summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/bn
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2017-03-15 15:42:28 +0800
committerPeter Jones <pjones@redhat.com>2017-03-24 18:28:30 -0400
commitf48505bfb2b479694c01f7c56bd3548dfe243f46 (patch)
tree847f1a623556f73c602628a9e5e8d5d590e9fc99 /Cryptlib/OpenSSL/crypto/bn
parent832152986545e8fc66f1ed5cf9d8bf518c7df2b3 (diff)
downloadefi-boot-shim-f48505bfb2b479694c01f7c56bd3548dfe243f46.tar.gz
efi-boot-shim-f48505bfb2b479694c01f7c56bd3548dfe243f46.zip
Update to openssl 1.0.2k
Signed-off-by: Gary Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/bn')
-rw-r--r--Cryptlib/OpenSSL/crypto/bn/bn_exp.c5
-rw-r--r--Cryptlib/OpenSSL/crypto/bn/bn_mul.c5
-rw-r--r--Cryptlib/OpenSSL/crypto/bn/bn_prime.c3
-rw-r--r--Cryptlib/OpenSSL/crypto/bn/bn_sqr.c5
4 files changed, 11 insertions, 7 deletions
diff --git a/Cryptlib/OpenSSL/crypto/bn/bn_exp.c b/Cryptlib/OpenSSL/crypto/bn/bn_exp.c
index 1670f01d..195a7867 100644
--- a/Cryptlib/OpenSSL/crypto/bn/bn_exp.c
+++ b/Cryptlib/OpenSSL/crypto/bn/bn_exp.c
@@ -180,8 +180,9 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
goto err;
}
}
- if (r != rr)
- BN_copy(r, rr);
+ if (r != rr && BN_copy(r, rr) == NULL)
+ goto err;
+
ret = 1;
err:
BN_CTX_end(ctx);
diff --git a/Cryptlib/OpenSSL/crypto/bn/bn_mul.c b/Cryptlib/OpenSSL/crypto/bn/bn_mul.c
index b174850b..3c618dc3 100644
--- a/Cryptlib/OpenSSL/crypto/bn/bn_mul.c
+++ b/Cryptlib/OpenSSL/crypto/bn/bn_mul.c
@@ -1083,8 +1083,9 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
end:
#endif
bn_correct_top(rr);
- if (r != rr)
- BN_copy(r, rr);
+ if (r != rr && BN_copy(r, rr) == NULL)
+ goto err;
+
ret = 1;
err:
bn_check_top(r);
diff --git a/Cryptlib/OpenSSL/crypto/bn/bn_prime.c b/Cryptlib/OpenSSL/crypto/bn/bn_prime.c
index ad641c37..4dab3bba 100644
--- a/Cryptlib/OpenSSL/crypto/bn/bn_prime.c
+++ b/Cryptlib/OpenSSL/crypto/bn/bn_prime.c
@@ -288,7 +288,8 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
BIGNUM *t;
if ((t = BN_CTX_get(ctx)) == NULL)
goto err;
- BN_copy(t, a);
+ if (BN_copy(t, a) == NULL)
+ goto err;
t->neg = 0;
A = t;
} else
diff --git a/Cryptlib/OpenSSL/crypto/bn/bn_sqr.c b/Cryptlib/OpenSSL/crypto/bn/bn_sqr.c
index 3ca69879..256d26e8 100644
--- a/Cryptlib/OpenSSL/crypto/bn/bn_sqr.c
+++ b/Cryptlib/OpenSSL/crypto/bn/bn_sqr.c
@@ -143,8 +143,9 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
rr->top = max - 1;
else
rr->top = max;
- if (rr != r)
- BN_copy(r, rr);
+ if (r != rr && BN_copy(r, rr) == NULL)
+ goto err;
+
ret = 1;
err:
bn_check_top(rr);