summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_lib.c
diff options
context:
space:
mode:
authorSamuel Weiser <samuel.weiser@iaik.tugraz.at>2017-09-16 16:52:44 +0200
committerMatt Caswell <matt@openssl.org>2017-09-27 10:03:37 +0100
commit9f9442918aeaed5dc2442d81ab8d29fe3e1fb906 (patch)
tree45bb6e52ae0435875d321f20269a13846b11598d /crypto/bn/bn_lib.c
parent3de81a5912041a70884cf4e52e7213f3b5dfa747 (diff)
BN_copy now propagates BN_FLG_CONSTTIME
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4377)
Diffstat (limited to 'crypto/bn/bn_lib.c')
-rw-r--r--crypto/bn/bn_lib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index 99179232f4..f0a3bf1e3d 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -332,6 +332,9 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
if (b->top > 0)
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
+ if (BN_get_flags(b, BN_FLG_CONSTTIME) != 0)
+ BN_set_flags(a, BN_FLG_CONSTTIME);
+
a->top = b->top;
a->neg = b->neg;
bn_check_top(a);