forked from wolfSSL/wolfssl
Don't propogate ASN_NO_PEM_HEADER from wolfSSL_load_client_CA_file
This commit is contained in:
13
src/ssl.c
13
src/ssl.c
@@ -14121,6 +14121,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
|
|||||||
WOLFSSL_BIO* bio;
|
WOLFSSL_BIO* bio;
|
||||||
WOLFSSL_X509 *cert = NULL;
|
WOLFSSL_X509 *cert = NULL;
|
||||||
WOLFSSL_X509_NAME *subjectName = NULL;
|
WOLFSSL_X509_NAME *subjectName = NULL;
|
||||||
|
unsigned long err;
|
||||||
|
|
||||||
WOLFSSL_ENTER("wolfSSL_load_client_CA_file");
|
WOLFSSL_ENTER("wolfSSL_load_client_CA_file");
|
||||||
|
|
||||||
@@ -14156,6 +14157,18 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
|
|||||||
cert = NULL;
|
cert = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = wolfSSL_ERR_peek_last_error();
|
||||||
|
|
||||||
|
if (ERR_GET_LIB(err) == ERR_LIB_PEM &&
|
||||||
|
ERR_GET_REASON(err) == PEM_R_NO_START_LINE) {
|
||||||
|
/*
|
||||||
|
* wolfSSL_PEM_read_bio_X509 pushes an ASN_NO_PEM_HEADER error
|
||||||
|
* to the error queue on file end. This should not be left
|
||||||
|
* for the caller to find so we clear the last error.
|
||||||
|
*/
|
||||||
|
wc_RemoveErrorNode(-1);
|
||||||
|
}
|
||||||
|
|
||||||
wolfSSL_X509_free(cert);
|
wolfSSL_X509_free(cert);
|
||||||
wolfSSL_BIO_free(bio);
|
wolfSSL_BIO_free(bio);
|
||||||
return list;
|
return list;
|
||||||
|
Reference in New Issue
Block a user