]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfssl: Remove unnecessary WOLFSSL_X509_STORE manipulation
authorJuliusz Sosinowicz <juliusz@wolfssl.com>
Thu, 4 Apr 2024 18:16:20 +0000 (20:16 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 2 Feb 2025 17:04:26 +0000 (19:04 +0200)
Setting a new WOLFSSL_X509_STORE is not necessary when calling
wolfSSL_CTX_load_verify_locations().

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
src/crypto/tls_wolfssl.c

index fa99915d0683c2da201b3e668c9f0f9012d9c6eb..2dd28d618df0c5c6fc265ebc04ef093b4eb95a14 100644 (file)
@@ -1411,15 +1411,9 @@ static int tls_connection_ca_cert(void *tls_ctx, struct tls_connection *conn,
        }
 
        if (ca_cert || ca_path) {
-               WOLFSSL_X509_STORE *cm = wolfSSL_X509_STORE_new();
-
-               if (!cm) {
-                       wpa_printf(MSG_INFO,
-                                  "SSL: failed to create certificate store");
-                       return -1;
-               }
-               wolfSSL_CTX_set_cert_store(ctx, cm);
-
+               wpa_printf(MSG_DEBUG, "SSL: Loading CA's from '%s' and '%s'",
+                          ca_cert ? ca_cert : "N/A",
+                          ca_path ? ca_path : "N/A");
                if (wolfSSL_CTX_load_verify_locations(ctx, ca_cert, ca_path) !=
                    SSL_SUCCESS) {
                        wpa_printf(MSG_INFO,
@@ -1436,6 +1430,7 @@ static int tls_connection_ca_cert(void *tls_ctx, struct tls_connection *conn,
                                return -1;
                        }
                }
+               wpa_printf(MSG_DEBUG, "SSL: Loaded ca_cert or ca_path");
                return 0;
        }