diff options
author | miod <> | 2014-07-11 13:26:31 +0000 |
---|---|---|
committer | miod <> | 2014-07-11 13:26:31 +0000 |
commit | e5bd68fbf698eda6db31914219e0ff7e755a1a02 (patch) | |
tree | 6f9830d44ed6aa5bf5ec7ba9d97dd9661106e773 /src/lib | |
parent | c2265cc8b8f01c8a364e89b8653c576067f4b402 (diff) | |
download | openbsd-e5bd68fbf698eda6db31914219e0ff7e755a1a02.tar.gz openbsd-e5bd68fbf698eda6db31914219e0ff7e755a1a02.tar.bz2 openbsd-e5bd68fbf698eda6db31914219e0ff7e755a1a02.zip |
Make sure BN_sqr never returns negative numbers.
OpenSSL PR #3400 via OpenSSL trunk.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/bn/bn_sqr.c | 3 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/bn/bn_sqr.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c index d4a9f46040..5ea9fb083d 100644 --- a/src/lib/libcrypto/bn/bn_sqr.c +++ b/src/lib/libcrypto/bn/bn_sqr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_sqr.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */ | 1 | /* $OpenBSD: bn_sqr.c,v 1.11 2014/07/11 13:26:31 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -78,6 +78,7 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) | |||
78 | al = a->top; | 78 | al = a->top; |
79 | if (al <= 0) { | 79 | if (al <= 0) { |
80 | r->top = 0; | 80 | r->top = 0; |
81 | r->neg = 0; | ||
81 | return 1; | 82 | return 1; |
82 | } | 83 | } |
83 | 84 | ||
diff --git a/src/lib/libssl/src/crypto/bn/bn_sqr.c b/src/lib/libssl/src/crypto/bn/bn_sqr.c index d4a9f46040..5ea9fb083d 100644 --- a/src/lib/libssl/src/crypto/bn/bn_sqr.c +++ b/src/lib/libssl/src/crypto/bn/bn_sqr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_sqr.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */ | 1 | /* $OpenBSD: bn_sqr.c,v 1.11 2014/07/11 13:26:31 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -78,6 +78,7 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) | |||
78 | al = a->top; | 78 | al = a->top; |
79 | if (al <= 0) { | 79 | if (al <= 0) { |
80 | r->top = 0; | 80 | r->top = 0; |
81 | r->neg = 0; | ||
81 | return 1; | 82 | return 1; |
82 | } | 83 | } |
83 | 84 | ||