mirror of https://github.com/openssl/openssl.git
OSSL_PARAM_BLD_push_BN_pad(): Allow NULL BIGNUM
This was supported previously and regressed
with commit 17898ec601
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21945)
This commit is contained in:
parent
374945a9aa
commit
2ce79d97e3
|
@ -233,8 +233,8 @@ static int push_BN(OSSL_PARAM_BLD *bld, const char *key,
|
|||
int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key,
|
||||
const BIGNUM *bn)
|
||||
{
|
||||
if (BN_is_negative(bn))
|
||||
return push_BN(bld, key, bn, bn == NULL ? 0 : BN_num_bytes(bn) + 1,
|
||||
if (bn != NULL && BN_is_negative(bn))
|
||||
return push_BN(bld, key, bn, BN_num_bytes(bn) + 1,
|
||||
OSSL_PARAM_INTEGER);
|
||||
return push_BN(bld, key, bn, bn == NULL ? 0 : BN_num_bytes(bn),
|
||||
OSSL_PARAM_UNSIGNED_INTEGER);
|
||||
|
@ -243,8 +243,8 @@ int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key,
|
|||
int OSSL_PARAM_BLD_push_BN_pad(OSSL_PARAM_BLD *bld, const char *key,
|
||||
const BIGNUM *bn, size_t sz)
|
||||
{
|
||||
if (BN_is_negative(bn))
|
||||
return push_BN(bld, key, bn, bn == NULL ? 0 : BN_num_bytes(bn),
|
||||
if (bn != NULL && BN_is_negative(bn))
|
||||
return push_BN(bld, key, bn, BN_num_bytes(bn),
|
||||
OSSL_PARAM_INTEGER);
|
||||
return push_BN(bld, key, bn, sz, OSSL_PARAM_UNSIGNED_INTEGER);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue