提交 3f3c7d26 编写于 作者: R Rob Percival 提交者: Rich Salz

Use s->session->peer instead of calling SSL_get_peer_certificate(s)

Avoids modifying certificate reference count, and thereby avoids locking.
Reviewed-by: NEmilia Käsper <emilia@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 4d482ee2
......@@ -3931,7 +3931,7 @@ err:
static int ct_extract_x509v3_extension_scts(SSL *s)
{
int scts_extracted = 0;
X509 *cert = SSL_get_peer_certificate(s);
X509 *cert = s->session != NULL ? s->session->peer : NULL;
if (cert != NULL) {
STACK_OF(SCT) *scts =
......@@ -3941,7 +3941,6 @@ static int ct_extract_x509v3_extension_scts(SSL *s)
ct_move_scts(&s->scts, scts, SCT_SOURCE_X509V3_EXTENSION);
SCT_LIST_free(scts);
X509_free(cert);
}
return scts_extracted;
......@@ -4032,7 +4031,7 @@ ct_validation_cb SSL_CTX_get_ct_validation_callback(const SSL_CTX *ctx)
int ssl_validate_ct(SSL *s)
{
int ret = 0;
X509 *cert = SSL_get_peer_certificate(s);
X509 *cert = s->session != NULL ? s->session->peer : NULL;
X509 *issuer = NULL;
CT_POLICY_EVAL_CTX *ctx = NULL;
const STACK_OF(SCT) *scts;
......@@ -4072,7 +4071,6 @@ int ssl_validate_ct(SSL *s)
end:
CT_POLICY_EVAL_CTX_free(ctx);
X509_free(cert);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册