summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-08-02 08:31:12 +0000
committertb <>2023-08-02 08:31:12 +0000
commitea86a9248c5099628edccbed545fed2a94388737 (patch)
tree5fa6609f391aa19a15968959fd870ddf72c4099b
parent15cd42f12cb025c3771766b6d3b50005abf9f202 (diff)
downloadopenbsd-ea86a9248c5099628edccbed545fed2a94388737.tar.gz
openbsd-ea86a9248c5099628edccbed545fed2a94388737.tar.bz2
openbsd-ea86a9248c5099628edccbed545fed2a94388737.zip
Remove the unused flags member of BN_BLINDING
Nothing sets this, so remove it along with BN_BLINDING_NO_{UPDATE,RECREATE} and some checks that are always true. ok jsing
-rw-r--r--src/lib/libcrypto/bn/bn_blind.c8
-rw-r--r--src/lib/libcrypto/bn/bn_local.h6
2 files changed, 4 insertions, 10 deletions
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c
index 54b75c294b..6c434bef06 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.26 2023/08/02 08:26:55 tb Exp $ */ 1/* $OpenBSD: bn_blind.c,v 1.27 2023/08/02 08:31:12 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 *
@@ -126,7 +126,6 @@ struct bn_blinding_st {
126 BIGNUM *mod; 126 BIGNUM *mod;
127 CRYPTO_THREADID tid; 127 CRYPTO_THREADID tid;
128 int counter; 128 int counter;
129 unsigned long flags;
130 BN_MONT_CTX *m_ctx; 129 BN_MONT_CTX *m_ctx;
131 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 130 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
132 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); 131 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
@@ -196,12 +195,11 @@ BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx)
196 if (b->counter == -1) 195 if (b->counter == -1)
197 b->counter = 0; 196 b->counter = 0;
198 197
199 if (++b->counter == BN_BLINDING_COUNTER && b->e != NULL && 198 if (++b->counter == BN_BLINDING_COUNTER && b->e != NULL) {
200 !(b->flags & BN_BLINDING_NO_RECREATE)) {
201 /* re-create blinding parameters */ 199 /* re-create blinding parameters */
202 if (!BN_BLINDING_create_param(b, NULL, NULL, ctx, NULL, NULL)) 200 if (!BN_BLINDING_create_param(b, NULL, NULL, ctx, NULL, NULL))
203 goto err; 201 goto err;
204 } else if (!(b->flags & BN_BLINDING_NO_UPDATE)) { 202 } else {
205 if (!BN_mod_mul(b->A, b->A, b->A, b->mod, ctx)) 203 if (!BN_mod_mul(b->A, b->A, b->A, b->mod, ctx))
206 goto err; 204 goto err;
207 if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx)) 205 if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx))
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h
index c40002bed7..53d557dbe2 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.28 2023/08/02 08:26:55 tb Exp $ */ 1/* $OpenBSD: bn_local.h,v 1.29 2023/08/02 08:31:12 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 *
@@ -291,10 +291,6 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
291int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, 291int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
292 BN_RECP_CTX *recp, BN_CTX *ctx); 292 BN_RECP_CTX *recp, BN_CTX *ctx);
293 293
294/* BN_BLINDING flags */
295#define BN_BLINDING_NO_UPDATE 0x00000001
296#define BN_BLINDING_NO_RECREATE 0x00000002
297
298BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod); 294BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
299void BN_BLINDING_free(BN_BLINDING *b); 295void BN_BLINDING_free(BN_BLINDING *b);
300int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx); 296int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx);