summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2024-12-09 19:05:33 +0100
committerTomas Mraz <tomas@openssl.org>2024-12-11 18:27:54 +0100
commit8ad98cce41aa8a6278f7ade6ad2f70b80b194b72 (patch)
tree79bfdec7ec14060ac2546f068f60624bfa87ca75 /apps
parenttest: the timeSpecification X.509v3 extension (diff)
downloadopenssl-8ad98cce41aa8a6278f7ade6ad2f70b80b194b72.tar.xz
openssl-8ad98cce41aa8a6278f7ade6ad2f70b80b194b72.zip
To verify MAC, we need a MAC
Fixes #26106 Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/26140)
Diffstat (limited to 'apps')
-rw-r--r--apps/pkcs12.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index afdb719ccd..3b91f132f5 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -829,6 +829,12 @@ int pkcs12_main(int argc, char **argv)
const ASN1_OBJECT *macobj;
PKCS12_get0_mac(NULL, &macalgid, NULL, NULL, p12);
+
+ if (macalgid == NULL) {
+ BIO_printf(bio_err, "Warning: MAC is absent!\n");
+ goto dump;
+ }
+
X509_ALGOR_get0(&macobj, NULL, NULL, macalgid);
if (OBJ_obj2nid(macobj) != NID_pbmac1) {