summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorTJ Saunders <tj@castaglia.org>2016-06-10 00:36:45 -0700
committerRich Salz <rsalz@openssl.org>2016-06-13 15:44:49 -0400
commitbbaa9dd850152bc85cad094e0aa0c685553d149c (patch)
tree9089f4a5ace81d14136c4d2d222ca404ed0844dc /crypto/ec
parent1d454d58a80971eac941911965e894fdf1621cd8 (diff)
Ensure that NULL r and s parameters cannot be set on DSA_SIG/ECDSA_SIGs.
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1193)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec_asn1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
index 9bc4ca7b27..9f7e837308 100644
--- a/crypto/ec/ec_asn1.c
+++ b/crypto/ec/ec_asn1.c
@@ -1182,6 +1182,8 @@ void ECDSA_SIG_get0(BIGNUM **pr, BIGNUM **ps, const ECDSA_SIG *sig)
int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
{
+ if (r == NULL || s == NULL)
+ return 0;
BN_clear_free(sig->r);
BN_clear_free(sig->s);
sig->r = r;