summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 45e312a3a6..e01af702e7 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.27 2021/12/04 16:05:46 tb Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.28 2022/02/07 19:44:23 tb 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 *
@@ -369,6 +369,9 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
369 int ret = 0; 369 int ret = 0;
370 BIGNUM *Ri, *R; 370 BIGNUM *Ri, *R;
371 371
372 if (BN_is_zero(mod))
373 return 0;
374
372 BN_CTX_start(ctx); 375 BN_CTX_start(ctx);
373 if ((Ri = BN_CTX_get(ctx)) == NULL) 376 if ((Ri = BN_CTX_get(ctx)) == NULL)
374 goto err; 377 goto err;