mirror of
https://github.com/curl/curl.git
synced 2026-08-24 10:33:31 +03:00
Limit ASN.1 structure sizes to 256K. Prevent some allocation size overflows.
See CRL-01-006.
This commit is contained in:
parent
3e9c0230f4
commit
945f60e8a7
5 changed files with 47 additions and 25 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -875,9 +875,8 @@ static CURLcode gskit_connect_step3(struct connectdata *conn, int sockindex)
|
|||
curl_X509certificate x509;
|
||||
curl_asn1Element *p;
|
||||
|
||||
if(!cert)
|
||||
if(Curl_parseX509(&x509, cert, certend))
|
||||
return CURLE_SSL_PINNEDPUBKEYNOTMATCH;
|
||||
Curl_parseX509(&x509, cert, certend);
|
||||
p = &x509.subjectPublicKeyInfo;
|
||||
result = Curl_pin_peer_pubkey(data, ptr, p->header, p->end - p->header);
|
||||
if(result) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue