]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
BoringSSL: Comment out SSL_set_default_passwd_cb*() calls
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 17 Nov 2017 18:34:17 +0000 (20:34 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 17 Nov 2017 18:34:17 +0000 (20:34 +0200)
It looks like BoringSSL claims to have OPENSSL_VERSION_NUMBER for a
1.1.0 version, but it does not provide SSL_set_default_passwd_cb*(). For
now, comment out this regardless of the version BoringSSL claims to be.

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

index 3f024840c94ad2a734310ec205a1d610fd07d59f..ada88a9d340dbb505173c1804ed5c34b395ab140 100644 (file)
@@ -3016,12 +3016,16 @@ static int tls_connection_engine_private_key(struct tls_connection *conn)
 
 static void tls_clear_default_passwd_cb(SSL_CTX *ssl_ctx, SSL *ssl)
 {
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#ifndef LIBRESSL_VERSION_NUMBER
+#ifndef OPENSSL_IS_BORINGSSL
        if (ssl) {
                SSL_set_default_passwd_cb(ssl, NULL);
                SSL_set_default_passwd_cb_userdata(ssl, NULL);
        }
-#endif /* >= 1.1.0f && !LibreSSL */
+#endif /* !BoringSSL */
+#endif /* !LibreSSL */
+#endif /* >= 1.1.0f */
        SSL_CTX_set_default_passwd_cb(ssl_ctx, NULL);
        SSL_CTX_set_default_passwd_cb_userdata(ssl_ctx, NULL);
 }
@@ -3048,14 +3052,18 @@ static int tls_connection_private_key(struct tls_data *data,
        } else
                passwd = NULL;
 
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#ifndef LIBRESSL_VERSION_NUMBER
+#ifndef OPENSSL_IS_BORINGSSL
        /*
         * In OpenSSL >= 1.1.0f SSL_use_PrivateKey_file() uses the callback
         * from the SSL object. See OpenSSL commit d61461a75253.
         */
        SSL_set_default_passwd_cb(conn->ssl, tls_passwd_cb);
        SSL_set_default_passwd_cb_userdata(conn->ssl, passwd);
-#endif /* >= 1.1.0f && !LibreSSL */
+#endif /* !BoringSSL */
+#endif /* !LibreSSL */
+#endif /* >= 1.1.0f && */
        /* Keep these for OpenSSL < 1.1.0f */
        SSL_CTX_set_default_passwd_cb(ssl_ctx, tls_passwd_cb);
        SSL_CTX_set_default_passwd_cb_userdata(ssl_ctx, passwd);