From a48bcc726186f844682c380815fdbed3af4d30b9 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 27 Apr 2019 10:45:55 +0200 Subject: [PATCH] Decrypt generic EVP private key Why PKCS#8? --- TunnelKit/Sources/Core/TLSBox.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TunnelKit/Sources/Core/TLSBox.m b/TunnelKit/Sources/Core/TLSBox.m index bac9c1a..cae3aa9 100644 --- a/TunnelKit/Sources/Core/TLSBox.m +++ b/TunnelKit/Sources/Core/TLSBox.m @@ -146,7 +146,7 @@ int TLSBoxVerifyPeer(int ok, X509_STORE_CTX *ctx) { + (NSString *)decryptedKeyFromPrivateKey:(EVP_PKEY *)evpKey error:(NSError * _Nullable __autoreleasing *)error { BIO *output = BIO_new(BIO_s_mem()); - if (!PEM_write_bio_PKCS8PrivateKey(output, evpKey, NULL, NULL, 0, NULL, NULL)) { + if (!PEM_write_bio_PrivateKey(output, evpKey, NULL, NULL, 0, NULL, NULL)) { BIO_free(output); return NULL; }