diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_blind.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c index edc1a9d1ab..6ba9d99e62 100644 --- a/src/lib/libcrypto/bn/bn_blind.c +++ b/src/lib/libcrypto/bn/bn_blind.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_blind.c,v 1.34 2023/08/08 14:40:56 tb Exp $ */ | 1 | /* $OpenBSD: bn_blind.c,v 1.35 2023/08/08 15:10:34 tb Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -179,7 +179,7 @@ BN_BLINDING_free(BN_BLINDING *r) | |||
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | static int | 181 | static int |
| 182 | BN_BLINDING_setup(BN_BLINDING *ret, BN_CTX *ctx) | 182 | BN_BLINDING_setup(BN_BLINDING *b, BN_CTX *ctx) |
| 183 | { | 183 | { |
| 184 | int retry_counter = 32; | 184 | int retry_counter = 32; |
| 185 | 185 | ||
| @@ -188,9 +188,9 @@ BN_BLINDING_setup(BN_BLINDING *ret, BN_CTX *ctx) | |||
| 188 | * we have basically factored mod = (p-1)(q-1)... | 188 | * we have basically factored mod = (p-1)(q-1)... |
| 189 | */ | 189 | */ |
| 190 | do { | 190 | do { |
| 191 | if (!BN_rand_range(ret->A, ret->mod)) | 191 | if (!BN_rand_range(b->A, b->mod)) |
| 192 | return 0; | 192 | return 0; |
| 193 | if (BN_mod_inverse_ct(ret->Ai, ret->A, ret->mod, ctx) == NULL) { | 193 | if (BN_mod_inverse_ct(b->Ai, b->A, b->mod, ctx) == NULL) { |
| 194 | /* this should almost never happen for good RSA keys */ | 194 | /* this should almost never happen for good RSA keys */ |
| 195 | unsigned long error = ERR_peek_last_error(); | 195 | unsigned long error = ERR_peek_last_error(); |
| 196 | if (ERR_GET_REASON(error) == BN_R_NO_INVERSE) { | 196 | if (ERR_GET_REASON(error) == BN_R_NO_INVERSE) { |
| @@ -205,12 +205,12 @@ BN_BLINDING_setup(BN_BLINDING *ret, BN_CTX *ctx) | |||
| 205 | break; | 205 | break; |
| 206 | } while (1); | 206 | } while (1); |
| 207 | 207 | ||
| 208 | if (ret->bn_mod_exp != NULL && ret->m_ctx != NULL) { | 208 | if (b->bn_mod_exp != NULL && b->m_ctx != NULL) { |
| 209 | if (!ret->bn_mod_exp(ret->A, ret->A, ret->e, ret->mod, | 209 | if (!b->bn_mod_exp(b->A, b->A, b->e, b->mod, |
| 210 | ctx, ret->m_ctx)) | 210 | ctx, b->m_ctx)) |
| 211 | return 0; | 211 | return 0; |
| 212 | } else { | 212 | } else { |
| 213 | if (!BN_mod_exp_ct(ret->A, ret->A, ret->e, ret->mod, ctx)) | 213 | if (!BN_mod_exp_ct(b->A, b->A, b->e, b->mod, ctx)) |
| 214 | return 0; | 214 | return 0; |
| 215 | } | 215 | } |
| 216 | 216 | ||
