diff options
author | tb <> | 2023-08-08 15:18:24 +0000 |
---|---|---|
committer | tb <> | 2023-08-08 15:18:24 +0000 |
commit | cf64febdf3619178d65cd708a3beb81994fe5f2b (patch) | |
tree | 336c9666f273c25d0237e56f8a7e4724c8ce93aa /src/lib | |
parent | 2752fbc446fb0ada1c371f97d3ea6532ffd47d08 (diff) | |
download | openbsd-cf64febdf3619178d65cd708a3beb81994fe5f2b.tar.gz openbsd-cf64febdf3619178d65cd708a3beb81994fe5f2b.tar.bz2 openbsd-cf64febdf3619178d65cd708a3beb81994fe5f2b.zip |
Drop the unused BN_BLINDING argument of BN_BLINDING_create_param()
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/bn/bn_blind.c | 11 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn_local.h | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_crpt.c | 9 |
3 files changed, 11 insertions, 14 deletions
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c index 6ba9d99e62..f58a977bba 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.35 2023/08/08 15:10:34 tb Exp $ */ | 1 | /* $OpenBSD: bn_blind.c,v 1.36 2023/08/08 15:18:24 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 | * |
@@ -291,15 +291,13 @@ BN_BLINDING_thread_id(BN_BLINDING *b) | |||
291 | } | 291 | } |
292 | 292 | ||
293 | BN_BLINDING * | 293 | BN_BLINDING * |
294 | BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, | 294 | BN_BLINDING_create_param(const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, |
295 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 295 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
296 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx) | 296 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx) |
297 | { | 297 | { |
298 | BN_BLINDING *ret = NULL; | 298 | BN_BLINDING *ret = NULL; |
299 | 299 | ||
300 | if ((ret = b) == NULL) | 300 | if ((ret = BN_BLINDING_new(e, m)) == NULL) |
301 | ret = BN_BLINDING_new(e, m); | ||
302 | if (ret == NULL) | ||
303 | goto err; | 301 | goto err; |
304 | 302 | ||
305 | if (bn_mod_exp != NULL) | 303 | if (bn_mod_exp != NULL) |
@@ -313,8 +311,7 @@ BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m, BN_CTX *ctx | |||
313 | return ret; | 311 | return ret; |
314 | 312 | ||
315 | err: | 313 | err: |
316 | if (ret != b) | 314 | BN_BLINDING_free(ret); |
317 | BN_BLINDING_free(ret); | ||
318 | 315 | ||
319 | return NULL; | 316 | return NULL; |
320 | } | 317 | } |
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h index 5b7e852d70..454892871b 100644 --- a/src/lib/libcrypto/bn/bn_local.h +++ b/src/lib/libcrypto/bn/bn_local.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_local.h,v 1.33 2023/08/03 18:53:55 tb Exp $ */ | 1 | /* $OpenBSD: bn_local.h,v 1.34 2023/08/08 15:18:24 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 | * |
@@ -297,8 +297,7 @@ int BN_BLINDING_convert(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); | |||
297 | int BN_BLINDING_invert(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *); | 297 | int BN_BLINDING_invert(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *); |
298 | 298 | ||
299 | CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); | 299 | CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); |
300 | BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, | 300 | BN_BLINDING *BN_BLINDING_create_param(const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, |
301 | const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, | ||
302 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 301 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
303 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), | 302 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), |
304 | BN_MONT_CTX *m_ctx); | 303 | BN_MONT_CTX *m_ctx); |
diff --git a/src/lib/libcrypto/rsa/rsa_crpt.c b/src/lib/libcrypto/rsa/rsa_crpt.c index a53ec54b32..99086735ea 100644 --- a/src/lib/libcrypto/rsa/rsa_crpt.c +++ b/src/lib/libcrypto/rsa/rsa_crpt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_crpt.c,v 1.24 2023/08/08 13:49:45 tb Exp $ */ | 1 | /* $OpenBSD: rsa_crpt.c,v 1.25 2023/08/08 15:18:24 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 | * |
@@ -209,13 +209,14 @@ RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx) | |||
209 | BN_init(&n); | 209 | BN_init(&n); |
210 | BN_with_flags(&n, rsa->n, BN_FLG_CONSTTIME); | 210 | BN_with_flags(&n, rsa->n, BN_FLG_CONSTTIME); |
211 | 211 | ||
212 | if ((ret = BN_BLINDING_create_param(NULL, e, &n, ctx, | 212 | if ((ret = BN_BLINDING_create_param(e, &n, ctx, rsa->meth->bn_mod_exp, |
213 | rsa->meth->bn_mod_exp, rsa->_method_mod_n)) == NULL) { | 213 | rsa->_method_mod_n)) == NULL) { |
214 | RSAerror(ERR_R_BN_LIB); | 214 | RSAerror(ERR_R_BN_LIB); |
215 | goto err; | 215 | goto err; |
216 | } | 216 | } |
217 | CRYPTO_THREADID_current(BN_BLINDING_thread_id(ret)); | 217 | CRYPTO_THREADID_current(BN_BLINDING_thread_id(ret)); |
218 | err: | 218 | |
219 | err: | ||
219 | BN_CTX_end(ctx); | 220 | BN_CTX_end(ctx); |
220 | if (ctx != in_ctx) | 221 | if (ctx != in_ctx) |
221 | BN_CTX_free(ctx); | 222 | BN_CTX_free(ctx); |