]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfssl: Fix get_x509_cert()
authorJuliusz Sosinowicz <juliusz@wolfssl.com>
Thu, 4 Apr 2024 18:16:10 +0000 (20:16 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 2 Feb 2025 16:08:26 +0000 (18:08 +0200)
The conditional was checking if data was not present. We should be
allocating the buffer when data *is* present.

Fixes: fec03f98383e ("Add support for wolfSSL cryptographic library")
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
src/crypto/tls_wolfssl.c

index 539bdd317de965a5bacab779998f9e755718e581..0f7ea44f10acfebc3efa6170febdcaf23d15ef78 100644 (file)
@@ -849,7 +849,7 @@ static struct wpabuf * get_x509_cert(WOLFSSL_X509 *cert)
        int cert_len;
 
        data = wolfSSL_X509_get_der(cert, &cert_len);
-       if (!data)
+       if (data)
                buf = wpabuf_alloc_copy(data, cert_len);
 
        return buf;