diff options
author | 2014-07-11 13:26:31 +0000 | |
---|---|---|
committer | 2014-07-11 13:26:31 +0000 | |
commit | 92c594c9b88b43546e7d10ffb4c9e33b465df16f (patch) | |
tree | 28b0aa6f1951930835fd6e43d7d7016b3e9a4d68 | |
parent | Accept CCS again after `finished' has been sent by the client; at this point (diff) | |
download | wireguard-openbsd-92c594c9b88b43546e7d10ffb4c9e33b465df16f.tar.xz wireguard-openbsd-92c594c9b88b43546e7d10ffb4c9e33b465df16f.zip |
Make sure BN_sqr never returns negative numbers.
OpenSSL PR #3400 via OpenSSL trunk.
-rw-r--r-- | lib/libcrypto/bn/bn_sqr.c | 3 | ||||
-rw-r--r-- | lib/libssl/src/crypto/bn/bn_sqr.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/libcrypto/bn/bn_sqr.c b/lib/libcrypto/bn/bn_sqr.c index d4a9f460403..5ea9fb083d6 100644 --- a/lib/libcrypto/bn/bn_sqr.c +++ b/lib/libcrypto/bn/bn_sqr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_sqr.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */ +/* $OpenBSD: bn_sqr.c,v 1.11 2014/07/11 13:26:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -78,6 +78,7 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) al = a->top; if (al <= 0) { r->top = 0; + r->neg = 0; return 1; } diff --git a/lib/libssl/src/crypto/bn/bn_sqr.c b/lib/libssl/src/crypto/bn/bn_sqr.c index d4a9f460403..5ea9fb083d6 100644 --- a/lib/libssl/src/crypto/bn/bn_sqr.c +++ b/lib/libssl/src/crypto/bn/bn_sqr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_sqr.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */ +/* $OpenBSD: bn_sqr.c,v 1.11 2014/07/11 13:26:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -78,6 +78,7 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) al = a->top; if (al <= 0) { r->top = 0; + r->neg = 0; return 1; } |