2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Check BN_dup results in rsa_check

This commit is contained in:
Mark Andrews
2022-09-26 12:06:44 +10:00
parent 483c5a1978
commit a47235f4f5

View File

@@ -996,6 +996,9 @@ rsa_check(RSA *rsa, RSA *pub) {
}
} else {
n = BN_dup(n2);
if (n == NULL) {
return (ISC_R_NOMEMORY);
}
}
if (e1 != NULL) {
if (BN_cmp(e1, e2) != 0) {
@@ -1006,6 +1009,12 @@ rsa_check(RSA *rsa, RSA *pub) {
}
} else {
e = BN_dup(e2);
if (e == NULL) {
if (n != NULL) {
BN_free(n);
}
return (ISC_R_NOMEMORY);
}
}
if (RSA_set0_key(rsa, n, e, NULL) == 0) {
if (n != NULL) {