Skip to content

Commit

Permalink
Merge pull request bitcoin#169
Browse files Browse the repository at this point in the history
603c33b Make signing fail if a too small buffer is passed. (Pieter Wuille)
  • Loading branch information
sipa committed Dec 18, 2014
2 parents 6d16606 + 603c33b commit cf0c48b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/secp256k1.c
Expand Up @@ -88,7 +88,7 @@ int secp256k1_ecdsa_sign(const unsigned char *msg32, unsigned char *signature, i
ret = secp256k1_ecdsa_sig_sign(&sig, &sec, &msg, &non, NULL);
}
if (ret) {
secp256k1_ecdsa_sig_serialize(signature, signaturelen, &sig);
ret = secp256k1_ecdsa_sig_serialize(signature, signaturelen, &sig);
}
secp256k1_scalar_clear(&msg);
secp256k1_scalar_clear(&non);
Expand Down
2 changes: 2 additions & 0 deletions src/tests.c
Expand Up @@ -1298,6 +1298,8 @@ void test_ecdsa_edge_cases(void) {
msg[31] = 0xaa;
siglen = 72;
CHECK(secp256k1_ecdsa_sign(msg, sig, &siglen, key, nonce) == 1);
siglen = 10;
CHECK(secp256k1_ecdsa_sign(msg, sig, &siglen, key, nonce) != 1);
}

/* Privkey export where pubkey is the point at infinity. */
Expand Down

0 comments on commit cf0c48b

Please sign in to comment.