From 8ad98cce41aa8a6278f7ade6ad2f70b80b194b72 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Mon, 9 Dec 2024 19:05:33 +0100 Subject: To verify MAC, we need a MAC Fixes #26106 Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26140) --- apps/pkcs12.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apps') 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) { -- cgit v1.2.3