[PATCH 3/3] openssl: Support unencrypted PKCS#8 private keys

Kevin Cernekee cernekee at gmail.com
Mon Mar 31 23:09:16 EDT 2014


This is verified working with the output from
"openssl pkcs12 -in foo.p12 -nodes" (v1.0.1).

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 openssl.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openssl.c b/openssl.c
index 67432d9..39db88e 100644
--- a/openssl.c
+++ b/openssl.c
@@ -761,7 +761,8 @@ static int load_certificate(struct openconnect_info *vpninfo)
 				break;
 			} else if (!strcmp(buf, "-----BEGIN RSA PRIVATE KEY-----\n") ||
 				   !strcmp(buf, "-----BEGIN DSA PRIVATE KEY-----\n") ||
-				   !strcmp(buf, "-----BEGIN ENCRYPTED PRIVATE KEY-----\n")) {
+				   !strcmp(buf, "-----BEGIN ENCRYPTED PRIVATE KEY-----\n") ||
+				   !strcmp(buf, "-----BEGIN PRIVATE KEY-----\n")) {
 				vpninfo->cert_type = CERT_TYPE_PEM;
 				break;
 			}
-- 
1.7.9.5




More information about the openconnect-devel mailing list