aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/bn/bn_gf2m.c
diff options
context:
space:
mode:
authorMike DePaulo <mikedep333@gmail.com>2015-07-07 08:57:00 -0400
committerMike DePaulo <mikedep333@gmail.com>2015-07-07 09:01:38 -0400
commitf65ff03d106f4cfe162bfde4780426b7bbc2e4ee (patch)
tree571dd0bd95a0341fcb1817a3a17df69b1d43e3de /openssl/crypto/bn/bn_gf2m.c
parent4241d28e545a02eb753c8f713149e20747f044b6 (diff)
downloadvcxsrv-f65ff03d106f4cfe162bfde4780426b7bbc2e4ee.tar.gz
vcxsrv-f65ff03d106f4cfe162bfde4780426b7bbc2e4ee.tar.bz2
vcxsrv-f65ff03d106f4cfe162bfde4780426b7bbc2e4ee.zip
Update openssl: 1.0.1m -> 1.0.1o
Diffstat (limited to 'openssl/crypto/bn/bn_gf2m.c')
-rw-r--r--openssl/crypto/bn/bn_gf2m.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/openssl/crypto/bn/bn_gf2m.c b/openssl/crypto/bn/bn_gf2m.c
index aeee49a01..a0ba8de31 100644
--- a/openssl/crypto/bn/bn_gf2m.c
+++ b/openssl/crypto/bn/bn_gf2m.c
@@ -694,9 +694,10 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
}
# else
{
- int i, ubits = BN_num_bits(u), vbits = BN_num_bits(v), /* v is copy
- * of p */
- top = p->top;
+ int i;
+ int ubits = BN_num_bits(u);
+ int vbits = BN_num_bits(v); /* v is copy of p */
+ int top = p->top;
BN_ULONG *udp, *bdp, *vdp, *cdp;
bn_wexpand(u, top);
@@ -740,8 +741,12 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
ubits--;
}
- if (ubits <= BN_BITS2 && udp[0] == 1)
- break;
+ if (ubits <= BN_BITS2) {
+ if (udp[0] == 0) /* poly was reducible */
+ goto err;
+ if (udp[0] == 1)
+ break;
+ }
if (ubits < vbits) {
i = ubits;