diff options
author | Patrick Monnerat <patrick@monnerat.net> | 2016-11-24 14:28:39 +0100 |
---|---|---|
committer | Patrick Monnerat <patrick@monnerat.net> | 2016-11-24 14:28:39 +0100 |
commit | 945f60e8a7f08aedb0eede5e3574f1972fc86ec8 (patch) | |
tree | 6a3479b7bdaf88a17f4f915846c1fddaff73873a /lib/vtls/cyassl.c | |
parent | 3e9c0230f45cafb9154bb4fcdc8ff2b51f00701a (diff) | |
download | curl-945f60e8a7f08aedb0eede5e3574f1972fc86ec8.tar.gz |
Limit ASN.1 structure sizes to 256K. Prevent some allocation size overflows.
See CRL-01-006.
Diffstat (limited to 'lib/vtls/cyassl.c')
-rw-r--r-- | lib/vtls/cyassl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c index 39248d2c7..f0c0f4a07 100644 --- a/lib/vtls/cyassl.c +++ b/lib/vtls/cyassl.c @@ -512,7 +512,8 @@ cyassl_connect_step2(struct connectdata *conn, } memset(&x509_parsed, 0, sizeof x509_parsed); - Curl_parseX509(&x509_parsed, x509_der, x509_der + x509_der_len); + if(Curl_parseX509(&x509_parsed, x509_der, x509_der + x509_der_len)) + return CURLE_SSL_PINNEDPUBKEYNOTMATCH; pubkey = &x509_parsed.subjectPublicKeyInfo; if(!pubkey->header || pubkey->end <= pubkey->header) { |