Skip to content

Commit

Permalink
fixup! fixup! Fix PBMAC1 MAC verification in FIPS mode
Browse files Browse the repository at this point in the history
  • Loading branch information
beldmit committed Aug 9, 2024
1 parent dae6e74 commit 8d920c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/pkcs12.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,8 @@ int pkcs12_main(int argc, char **argv)
const ASN1_OBJECT *macobj;

PKCS12_get0_mac(NULL, &macalgid, NULL, NULL, p12);
/* current hash algorithms do not use parameters so extract just name,
in future alg_print() may be needed */
X509_ALGOR_get0(&macobj, NULL, NULL, macalgid);

if (OBJ_obj2nid(macobj) != NID_pbmac1) {
EVP_KDF *pkcs12kdf;

Expand All @@ -839,7 +838,7 @@ int pkcs12_main(int argc, char **argv)
goto end;
}
EVP_KDF_free(pkcs12kdf);
}
}

/* If we enter empty password try no password first */
if (!mpass[0] && PKCS12_verify_mac(p12, NULL, 0)) {
Expand Down

0 comments on commit 8d920c3

Please sign in to comment.