aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2020-06-16 14:48:47 (GMT)
committerJouni Malinen <j@w1.fi>2020-06-16 15:24:23 (GMT)
commit812d52ae271a2a806881287115b2473165d7ab37 (patch)
tree9d30abe18592299a90e11038f9b6f90d69150562 /src/crypto
parent4b834df5e08a41c5b018881ad888f637ba66b1ee (diff)
downloadhostap-812d52ae271a2a806881287115b2473165d7ab37.zip
hostap-812d52ae271a2a806881287115b2473165d7ab37.tar.gz
hostap-812d52ae271a2a806881287115b2473165d7ab37.tar.bz2
OpenSSL: Support EC key from private_key blob
Try to parse the private_key blob as an ECPrivateKey in addition to the previously supported RSA and DSA. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/tls_openssl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index 160578e..29c7688 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -3772,6 +3772,17 @@ static int tls_connection_private_key(struct tls_data *data,
break;
}
+#ifndef OPENSSL_NO_EC
+ if (SSL_use_PrivateKey_ASN1(EVP_PKEY_EC, conn->ssl,
+ (u8 *) private_key_blob,
+ private_key_blob_len) == 1) {
+ wpa_printf(MSG_DEBUG,
+ "OpenSSL: SSL_use_PrivateKey_ASN1(EVP_PKEY_EC) --> OK");
+ ok = 1;
+ break;
+ }
+#endif /* OPENSSL_NO_EC */
+
if (SSL_use_RSAPrivateKey_ASN1(conn->ssl,
(u8 *) private_key_blob,
private_key_blob_len) == 1) {