mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
fetch_curl_verify_callback: Do depth update after check
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
f1e6690b25
commit
24dd16ddff
@ -662,11 +662,6 @@ fetch_curl_verify_callback(int verify_ok, X509_STORE_CTX *x509_ctx)
|
|||||||
depth = X509_STORE_CTX_get_error_depth(x509_ctx);
|
depth = X509_STORE_CTX_get_error_depth(x509_ctx);
|
||||||
fetch = X509_STORE_CTX_get_app_data(x509_ctx);
|
fetch = X509_STORE_CTX_get_app_data(x509_ctx);
|
||||||
|
|
||||||
/* record the max depth */
|
|
||||||
if (depth > fetch->cert_depth) {
|
|
||||||
fetch->cert_depth = depth;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* certificate chain is excessively deep so fail verification */
|
/* certificate chain is excessively deep so fail verification */
|
||||||
if (depth >= MAX_SSL_CERTS) {
|
if (depth >= MAX_SSL_CERTS) {
|
||||||
X509_STORE_CTX_set_error(x509_ctx,
|
X509_STORE_CTX_set_error(x509_ctx,
|
||||||
@ -674,6 +669,11 @@ fetch_curl_verify_callback(int verify_ok, X509_STORE_CTX *x509_ctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* record the max depth */
|
||||||
|
if (depth > fetch->cert_depth) {
|
||||||
|
fetch->cert_depth = depth;
|
||||||
|
}
|
||||||
|
|
||||||
/* save the certificate by incrementing the reference count and
|
/* save the certificate by incrementing the reference count and
|
||||||
* keeping a pointer.
|
* keeping a pointer.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user