Do not encrypt certificate bag if the user has specified empty password
(--password ''). Encryption can be turned on by specifying
--empty-password.
Fixes #888
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
app_exit(1);
}
- result = gnutls_pkcs12_bag_encrypt(bag, pass, flags);
+ if (!(flags & GNUTLS_PKCS_PLAIN) || cinfo->empty_password)
+ result = gnutls_pkcs12_bag_encrypt(bag, pass, flags);
if (result < 0) {
fprintf(stderr, "bag_encrypt: %s\n",
gnutls_strerror(result));