aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/ecgdsa
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/ecgdsa
parentdeef8ba63860efb14c45c5ee1cba2a3faaf8a719 (diff)
Fix leading zero bytes in DSA, ECDSA, ECGDSA and ECKCDSA signatures
Diffstat (limited to 'src/lib/pubkey/ecgdsa')
-rw-r--r--src/lib/pubkey/ecgdsa/ecgdsa.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lib/pubkey/ecgdsa/ecgdsa.cpp b/src/lib/pubkey/ecgdsa/ecgdsa.cpp
index 3e14aa8f4..30ea32817 100644
--- a/src/lib/pubkey/ecgdsa/ecgdsa.cpp
+++ b/src/lib/pubkey/ecgdsa/ecgdsa.cpp
@@ -73,10 +73,7 @@ ECGDSA_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_order.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_order.bytes());
}
/**