print out MAC algorithm
authorDr. Stephen Henson <steve@openssl.org>
Fri, 22 Jul 2016 14:33:15 +0000 (15:33 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 29 Jul 2016 22:25:47 +0000 (23:25 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
apps/pkcs12.c

index 25479058bd368f247e9588c8d03874afdda7d1ca..315b72d3a8138025949cddcbbe6b4634a780dfb3 100644 (file)
@@ -522,9 +522,13 @@ int pkcs12_main(int argc, char **argv)
 
     if ((options & INFO) && PKCS12_mac_present(p12)) {
         ASN1_INTEGER *tmaciter;
-
-        PKCS12_get0_mac(NULL, NULL, NULL, &tmaciter, p12);
-        BIO_printf(bio_err, "MAC Iteration %ld\n",
+        X509_ALGOR *macalgid;
+        ASN1_OBJECT *macobj;
+        PKCS12_get0_mac(NULL, &macalgid, NULL, &tmaciter, p12);
+        X509_ALGOR_get0(&macobj, NULL, NULL, macalgid);
+        BIO_puts(bio_err, "MAC:");
+        i2a_ASN1_OBJECT(bio_err, macobj);
+        BIO_printf(bio_err, " Iteration %ld\n",
                    tmaciter  != NULL ? ASN1_INTEGER_get(tmaciter) : 1L);
     }
     if (macver) {