1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-22 22:03:43 +03:00

resolved: do not use BN_dup() unnecessarilly

Suggested in https://github.com/systemd/systemd/pull/21170#discussion_r738696794
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-11-02 10:45:20 +01:00
parent 7e8facb36b
commit 6e7323137a

View File

@ -110,8 +110,9 @@ static int dnssec_rsa_verify_raw(
if (!rpubkey)
return -ENOMEM;
if (RSA_set0_key(rpubkey, BN_dup(m), BN_dup(e), NULL) <= 0)
if (RSA_set0_key(rpubkey, m, e, NULL) <= 0)
return -EIO;
e = m = NULL;
assert((size_t) RSA_size(rpubkey) == signature_size);
@ -344,8 +345,9 @@ static int dnssec_ecdsa_verify_raw(
if (!sig)
return -ENOMEM;
if (ECDSA_SIG_set0(sig, BN_dup(r), BN_dup(s)) <= 0)
if (ECDSA_SIG_set0(sig, r, s) <= 0)
return -EIO;
r = s = NULL;
k = ECDSA_do_verify(data, data_size, sig, eckey);
if (k < 0)