mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-15 00:02:49 +03:00
Add function to match certificate fingerprint
This commit is contained in:
@ -1887,6 +1887,15 @@ error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
EXP_FUNC int STDCALL ssl_match_fingerprint(const SSL *ssl, const uint8_t* fp)
|
||||
{
|
||||
uint8_t cert_fp[SHA1_SIZE];
|
||||
X509_CTX* x509 = ssl->x509_ctx;
|
||||
|
||||
bi_export(x509->rsa_ctx->bi_ctx, x509->fingerprint, cert_fp, SHA1_SIZE);
|
||||
return memcmp(cert_fp, fp, SHA1_SIZE);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SSL_CERT_VERIFICATION */
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user