From: Jouni Malinen Date: Sun, 27 Nov 2011 11:21:36 +0000 (+0200) Subject: TLS: Add a debug information on unsupported private key format X-Git-Tag: aosp-jb-start~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e770c497eb7dbbc24533f116707e483866429ebd;p=thirdparty%2Fhostap.git TLS: Add a debug information on unsupported private key format Provide easier to understand reason for failure to use the old OpenSSL encrypted private key format. Signed-hostap: Jouni Malinen --- diff --git a/src/tls/tlsv1_cred.c b/src/tls/tlsv1_cred.c index 3e07245ec..d84648097 100644 --- a/src/tls/tlsv1_cred.c +++ b/src/tls/tlsv1_cred.c @@ -244,10 +244,17 @@ static struct crypto_private_key * tlsv1_set_key_pem(const u8 *key, size_t len) if (!end) return NULL; } else { + const u8 *pos2; pos += os_strlen(pem_key_begin); end = search_tag(pem_key_end, pos, key + len - pos); if (!end) return NULL; + pos2 = search_tag("Proc-Type: 4,ENCRYPTED", pos, end - pos); + if (pos2) { + wpa_printf(MSG_DEBUG, "TLSv1: Unsupported private key " + "format (Proc-Type/DEK-Info)"); + return NULL; + } } der = base64_decode(pos, end - pos, &der_len);