- /* Make a shrouded key bag */
- p8 = EVP_PKEY2PKCS8 (key);
- EVP_PKEY_free(key);
- if(keytype) PKCS8_add_keyusage(p8, keytype);
- bag = PKCS12_MAKE_SHKEYBAG (NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
- cpass, -1, NULL, 0, iter, p8);
- PKCS8_PRIV_KEY_INFO_free(p8);
- if (name) PKCS12_add_friendlyname (bag, name, -1);
- if(pmatch) PKCS12_add_localkeyid (bag, keyid, keyidlen);
- bags = sk_new(NULL);
- sk_push (bags, (char *)bag);
- /* Turn it into unencrypted safe bag */
- authsafe = PKCS12_pack_p7data (bags);
- sk_pop_free(bags, PKCS12_SAFEBAG_free);
- sk_push (safes, (char *)authsafe);
+ if(!noprompt &&
+ EVP_read_pw_string(pass, sizeof pass, "Enter Export Password:", 1))
+ {
+ BIO_printf (bio_err, "Can't read Password\n");
+ goto export_end;
+ }
+ if (!twopass) BUF_strlcpy(macpass, pass, sizeof macpass);
+
+#ifdef CRYPTO_MDEBUG
+ CRYPTO_pop_info();
+ CRYPTO_push_info("creating PKCS#12 structure");
+#endif