Skip to content

Commit 47178a7

Browse files
Merge pull request #36 from ghm12/master-FixPkcs12Builder
Fix Pkcs12Builder missing call of load method before creating PKCS12 structs
2 parents 5cd2546 + cc5f1f7 commit 47178a7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Pkcs12Builder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Pkcs12* Pkcs12Builder::doFinal(string password) const throw(Pkcs12Exception)
4646
int mac_iter = 0;
4747
int keytype = 0;
4848

49+
//this method must be executed before PKCS12_create() or else it always returns null, temporary fix
50+
OpenSSL_add_all_algorithms();
51+
4952
//verifica se chave privada corresponde a chave publica
5053
if(!X509_check_private_key(this->keyCert->getX509(), this->key->getEvpPkey()))
5154
{

0 commit comments

Comments
 (0)