aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-03-16 19:34:01 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-16 19:34:01 (GMT)
commit8b827c342f07b01622079734b24f8bf65497a1d6 (patch)
treed7b2f6aba361cb0ab0c57cbe7142504167d533fa /src/crypto
parent42a95533a8a33d2fa31f49ea4f1fc64b7bf002d7 (diff)
downloadhostap-8b827c342f07b01622079734b24f8bf65497a1d6.zip
hostap-8b827c342f07b01622079734b24f8bf65497a1d6.tar.gz
hostap-8b827c342f07b01622079734b24f8bf65497a1d6.tar.bz2
BoringSSL: Keep static analyzers happier with X509_get0_pubkey_bitstr()
While this function could return NULL if the parameter issued to it were NULL, that does not really happen here. Anyway, since this can result in a warning from a static analyzer that does can see the return NULL without fully understanding what it means here, check the return value explicitly against NULL to avoid false warnings. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/tls_openssl_ocsp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/crypto/tls_openssl_ocsp.c b/src/crypto/tls_openssl_ocsp.c
index 4e1c6b9..8b37b34 100644
--- a/src/crypto/tls_openssl_ocsp.c
+++ b/src/crypto/tls_openssl_ocsp.c
@@ -433,7 +433,8 @@ static int issuer_match(X509 *cert, X509 *issuer, CertID *certid)
}
ikey = X509_get0_pubkey_bitstr(issuer);
- if (!EVP_Digest(ikey->data, ikey->length, md, &len, dgst, NULL) ||
+ if (!ikey ||
+ !EVP_Digest(ikey->data, ikey->length, md, &len, dgst, NULL) ||
!ASN1_OCTET_STRING_set(hash, md, len)) {
ASN1_OCTET_STRING_free(hash);
return -1;