aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorJuliusz Sosinowicz <juliusz@wolfssl.com>2021-02-08 08:34:07 (GMT)
committerJouni Malinen <j@w1.fi>2021-02-09 18:54:34 (GMT)
commit8d10831dcf9eebfefacbf47595beacafdcbe9e3c (patch)
treee937488d460a2f30cc494e8dbab32a683c05c929 /src/crypto
parent7e823d4df22c1714675d033b9c4f99b60069af64 (diff)
downloadhostap-8d10831dcf9eebfefacbf47595beacafdcbe9e3c.zip
hostap-8d10831dcf9eebfefacbf47595beacafdcbe9e3c.tar.gz
hostap-8d10831dcf9eebfefacbf47595beacafdcbe9e3c.tar.bz2
wolfSSL: wolfSSL_use_PrivateKey_* correct return codes
The wolfSSL_use_PrivateKey_* APIs return 1 on success. 0 is also an error. Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/tls_wolfssl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crypto/tls_wolfssl.c b/src/crypto/tls_wolfssl.c
index ea8f706..cf482bf 100644
--- a/src/crypto/tls_wolfssl.c
+++ b/src/crypto/tls_wolfssl.c
@@ -534,7 +534,7 @@ static int tls_connection_private_key(void *tls_ctx,
if (private_key_blob) {
if (wolfSSL_use_PrivateKey_buffer(conn->ssl,
private_key_blob, blob_len,
- SSL_FILETYPE_ASN1) < 0) {
+ SSL_FILETYPE_ASN1) <= 0) {
wpa_printf(MSG_INFO,
"SSL: use private DER blob failed");
} else {
@@ -545,11 +545,11 @@ static int tls_connection_private_key(void *tls_ctx,
if (!ok && private_key) {
if (wolfSSL_use_PrivateKey_file(conn->ssl, private_key,
- SSL_FILETYPE_PEM) < 0) {
+ SSL_FILETYPE_PEM) <= 0) {
wpa_printf(MSG_INFO,
"SSL: use private key PEM file failed");
if (wolfSSL_use_PrivateKey_file(conn->ssl, private_key,
- SSL_FILETYPE_ASN1) < 0)
+ SSL_FILETYPE_ASN1) <= 0)
{
wpa_printf(MSG_INFO,
"SSL: use private key DER file failed");