[PATCH 04/24] wolfssl: fix get_x509_cert

Juliusz Sosinowicz juliusz at wolfssl.com
Thu Apr 4 11:16:10 PDT 2024


The conditional was checking if data was not present. We should be allocating the buffer when data *is* present.

Signed-off-by: Juliusz Sosinowicz <juliusz at wolfssl.com>
---
 src/crypto/tls_wolfssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/crypto/tls_wolfssl.c b/src/crypto/tls_wolfssl.c
index 26832ed430..e851dd09d1 100644
--- a/src/crypto/tls_wolfssl.c
+++ b/src/crypto/tls_wolfssl.c
@@ -961,7 +961,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;
-- 
2.34.1




More information about the Hostap mailing list