aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/eckcdsa
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-08-19 16:03:40 -0400
committerJack Lloyd <[email protected]>2016-08-19 16:03:40 -0400
commit165a21393f0061a6f3c68b9244a20b41c16c2a78 (patch)
treeff78cfd1907d0a208c0bb42b73622b0310172633 /src/lib/pubkey/eckcdsa
parentf26dfb3572aaab003e0c80002615d190488fb613 (diff)
parent6cbff45093199d821dee7ee74380474300f49948 (diff)
Merge GH #591
Change behavior of default key usage encoding, default now omits the key usage unless the user set a value. Fix allowed_usage which could produce incorrect results. More X.509 tests
Diffstat (limited to 'src/lib/pubkey/eckcdsa')
-rw-r--r--src/lib/pubkey/eckcdsa/eckcdsa.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/pubkey/eckcdsa/eckcdsa.cpp b/src/lib/pubkey/eckcdsa/eckcdsa.cpp
index 83439332e..5ca89675c 100644
--- a/src/lib/pubkey/eckcdsa/eckcdsa.cpp
+++ b/src/lib/pubkey/eckcdsa/eckcdsa.cpp
@@ -100,10 +100,9 @@ ECKCDSA_Signature_Operation::raw_sign(const byte msg[], size_t,
const BigInt s = m_mod_order.multiply(m_x, k - w);
BOTAN_ASSERT(s != 0, "invalid s");
- secure_vector<byte> signature(r.bytes() + s.bytes());
- r.binary_encode(signature.data());
- s.binary_encode(&signature[r.bytes()]);
- return signature;
+ secure_vector<byte> output = BigInt::encode_1363(r, c.size());
+ output += BigInt::encode_1363(s, m_mod_order.get_modulus().bytes());
+ return output;
}
/**