Skip to content

Commit

Permalink
DecryptError cause by low level error
Browse files Browse the repository at this point in the history
  • Loading branch information
qiek authored and aberaud committed Jul 23, 2024
1 parent 38454ea commit 44f6d21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ PrivateKey::PrivateKey(const uint8_t* src, size_t src_size, const char* password
throw CryptoException("Can't initialize private key !");

const gnutls_datum_t dt {(uint8_t*)src, static_cast<unsigned>(src_size)};
int flags = password_ptr ? GNUTLS_PKCS_PLAIN
int flags = (password_ptr == NULL || strlen(password_ptr)==0) ? GNUTLS_PKCS_PLAIN
: ( GNUTLS_PKCS_PBES2_AES_128 | GNUTLS_PKCS_PBES2_AES_192 | GNUTLS_PKCS_PBES2_AES_256
| GNUTLS_PKCS_PKCS12_3DES | GNUTLS_PKCS_PKCS12_ARCFOUR | GNUTLS_PKCS_PKCS12_RC2_40);

Expand Down

0 comments on commit 44f6d21

Please sign in to comment.