aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/dsa
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2016-08-09 18:06:39 +0200
committerRenĂ© Korthaus <[email protected]>2016-08-17 20:26:14 +0200
commit40a935209876b7c5360dadae85b0b26c2e13e0f5 (patch)
tree0adc0a99ce785ebe090d28e68e72fffd60238e85 /src/lib/pubkey/dsa
parentdeef8ba63860efb14c45c5ee1cba2a3faaf8a719 (diff)
Fix leading zero bytes in DSA, ECDSA, ECGDSA and ECKCDSA signatures
Diffstat (limited to 'src/lib/pubkey/dsa')
-rw-r--r--src/lib/pubkey/dsa/dsa.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lib/pubkey/dsa/dsa.cpp b/src/lib/pubkey/dsa/dsa.cpp
index 6effb81dd..399756b1a 100644
--- a/src/lib/pubkey/dsa/dsa.cpp
+++ b/src/lib/pubkey/dsa/dsa.cpp
@@ -133,10 +133,7 @@ DSA_Signature_Operation::raw_sign(const byte msg[], size_t msg_len,
BOTAN_ASSERT(s != 0, "invalid s");
BOTAN_ASSERT(r != 0, "invalid r");
- secure_vector<byte> output(2*m_q.bytes());
- r.binary_encode(&output[output.size() / 2 - r.bytes()]);
- s.binary_encode(&output[output.size() - s.bytes()]);
- return output;
+ return BigInt::encode_fixed_length_int_pair(r, s, m_q.bytes());
}
/**