-/* $OpenBSD: bn_blind.c,v 1.35 2023/08/08 15:10:34 tb Exp $ */
+/* $OpenBSD: bn_blind.c,v 1.36 2023/08/08 15:18:24 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
}
BN_BLINDING *
-BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
+BN_BLINDING_create_param(const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx)
{
BN_BLINDING *ret = NULL;
- if ((ret = b) == NULL)
- ret = BN_BLINDING_new(e, m);
- if (ret == NULL)
+ if ((ret = BN_BLINDING_new(e, m)) == NULL)
goto err;
if (bn_mod_exp != NULL)
return ret;
err:
- if (ret != b)
- BN_BLINDING_free(ret);
+ BN_BLINDING_free(ret);
return NULL;
}
-/* $OpenBSD: bn_local.h,v 1.33 2023/08/03 18:53:55 tb Exp $ */
+/* $OpenBSD: bn_local.h,v 1.34 2023/08/08 15:18:24 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int BN_BLINDING_invert(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *);
CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *);
-BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
- const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
+BN_BLINDING *BN_BLINDING_create_param(const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
BN_MONT_CTX *m_ctx);
-/* $OpenBSD: rsa_crpt.c,v 1.24 2023/08/08 13:49:45 tb Exp $ */
+/* $OpenBSD: rsa_crpt.c,v 1.25 2023/08/08 15:18:24 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BN_init(&n);
BN_with_flags(&n, rsa->n, BN_FLG_CONSTTIME);
- if ((ret = BN_BLINDING_create_param(NULL, e, &n, ctx,
- rsa->meth->bn_mod_exp, rsa->_method_mod_n)) == NULL) {
+ if ((ret = BN_BLINDING_create_param(e, &n, ctx, rsa->meth->bn_mod_exp,
+ rsa->_method_mod_n)) == NULL) {
RSAerror(ERR_R_BN_LIB);
goto err;
}
CRYPTO_THREADID_current(BN_BLINDING_thread_id(ret));
-err:
+
+ err:
BN_CTX_end(ctx);
if (ctx != in_ctx)
BN_CTX_free(ctx);