]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Debug message if requested AES key length is not supported
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 17 Nov 2017 18:57:56 +0000 (20:57 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 17 Nov 2017 18:59:25 +0000 (20:59 +0200)
This makes it clearer why some AES operations fail especially with
BoringSSL where the 192-bit case is not supported.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/crypto/crypto_openssl.c

index 661f749b1ed18ce0ae7d50e6494b0fb3bde08053..91201ca348bda564a2898a15a90a7c93ffc25c9a 100644 (file)
@@ -291,8 +291,11 @@ void * aes_encrypt_init(const u8 *key, size_t len)
                return NULL;
 
        type = aes_get_evp_cipher(len);
-       if (type == NULL)
+       if (!type) {
+               wpa_printf(MSG_INFO, "%s: Unsupported len=%u",
+                          __func__, (unsigned int) len);
                return NULL;
+       }
 
        ctx = EVP_CIPHER_CTX_new();
        if (ctx == NULL)
@@ -345,8 +348,11 @@ void * aes_decrypt_init(const u8 *key, size_t len)
                return NULL;
 
        type = aes_get_evp_cipher(len);
-       if (type == NULL)
+       if (!type) {
+               wpa_printf(MSG_INFO, "%s: Unsupported len=%u",
+                          __func__, (unsigned int) len);
                return NULL;
+       }
 
        ctx = EVP_CIPHER_CTX_new();
        if (ctx == NULL)