check return value

This commit is contained in:
Jacob Barthelmeh
2018-07-02 10:10:30 -06:00
parent e204b19923
commit a9ff79e321

View File

@ -17874,10 +17874,10 @@ WOLFSSL_STACK* wolfSSL_X509_STORE_CTX_get_chain(WOLFSSL_X509_STORE_CTX* ctx)
WOLFSSL_X509* x509 = wolfSSL_get_chain_X509(c, c->count - 1);
if (x509 != NULL) {
WOLFSSL_X509* issuer = NULL;
wolfSSL_X509_STORE_CTX_get1_issuer(&issuer, ctx, x509);
/* check that the certificate being looked up is not self signed
* and that a issuer was found */
if (wolfSSL_X509_STORE_CTX_get1_issuer(&issuer, ctx, x509)
== WOLFSSL_SUCCESS) {
/* check that the certificate being looked up is not self
* signed and that a issuer was found */
if (issuer != NULL && wolfSSL_X509_NAME_cmp(&x509->issuer,
&x509->subject) != 0) {
if (wolfSSL_sk_X509_push(sk, issuer) != SSL_SUCCESS) {
@ -17888,7 +17888,11 @@ WOLFSSL_STACK* wolfSSL_X509_STORE_CTX_get_chain(WOLFSSL_X509_STORE_CTX* ctx)
}
}
else {
WOLFSSL_MSG("could not find CA for cert or is self signed");
WOLFSSL_MSG("Certificate is self signed");
}
}
else {
WOLFSSL_MSG("Could not find CA for certificate");
}
}
}