aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHan Han <hhan@thousandeyes.com>2018-08-20 15:10:40 -0700
committerDaniel Stenberg <daniel@haxx.se>2018-09-06 08:27:15 +0200
commit0029aabc5620563a840ea13b313f29ea2a9b395e (patch)
treef10183320a32edacfa3ed92f600da1875f19b22f /lib
parent59dc83379a239d20ed04e66b650b232ed1f780aa (diff)
x509asn1: return CURLE_PEER_FAILED_VERIFICATION on failure to parse cert
CURLE_PEER_FAILED_VERIFICATION makes more sense because Curl_parseX509 does not allocate memory internally as its first argument is a pointer to the certificate structure. The same error code is also returned by Curl_verifyhost when its call to Curl_parseX509 fails so the change makes error handling more consistent.
Diffstat (limited to 'lib')
-rw-r--r--lib/x509asn1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/x509asn1.c b/lib/x509asn1.c
index 72a0b4a00..fc51e02f4 100644
--- a/lib/x509asn1.c
+++ b/lib/x509asn1.c
@@ -896,7 +896,7 @@ CURLcode Curl_extract_certinfo(struct connectdata *conn,
/* Extract the certificate ASN.1 elements. */
if(Curl_parseX509(&cert, beg, end))
- return CURLE_OUT_OF_MEMORY;
+ return CURLE_PEER_FAILED_VERIFICATION;
/* Subject. */
ccp = DNtostr(&cert.subject);