mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-10-02 23:07:22 +00:00
Merge pull request #10276 from bjwtaylor/switch-to-mbedtls_pk_verify_new
Switch to mbedtls_pk_verify_new
This commit is contained in:
@@ -2082,8 +2082,7 @@ start_processing:
|
|||||||
|
|
||||||
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
|
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
|
||||||
if (pk_alg == MBEDTLS_PK_RSASSA_PSS) {
|
if (pk_alg == MBEDTLS_PK_RSASSA_PSS) {
|
||||||
ret = mbedtls_pk_verify_ext(pk_alg, NULL,
|
ret = mbedtls_pk_verify_new(pk_alg, peer_pk,
|
||||||
peer_pk,
|
|
||||||
md_alg, hash, hashlen,
|
md_alg, hash, hashlen,
|
||||||
p, sig_len);
|
p, sig_len);
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -300,13 +300,13 @@ static int ssl_tls13_parse_certificate_verify(mbedtls_ssl_context *ssl,
|
|||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_BUF(3, "verify hash", verify_hash, verify_hash_len);
|
MBEDTLS_SSL_DEBUG_BUF(3, "verify hash", verify_hash, verify_hash_len);
|
||||||
|
|
||||||
if ((ret = mbedtls_pk_verify_ext(sig_alg, NULL,
|
if ((ret = mbedtls_pk_verify_new(sig_alg,
|
||||||
&ssl->session_negotiate->peer_cert->pk,
|
&ssl->session_negotiate->peer_cert->pk,
|
||||||
md_alg, verify_hash, verify_hash_len,
|
md_alg, verify_hash, verify_hash_len,
|
||||||
p, signature_len)) == 0) {
|
p, signature_len)) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
MBEDTLS_SSL_DEBUG_RET(1, "mbedtls_pk_verify_ext", ret);
|
MBEDTLS_SSL_DEBUG_RET(1, "mbedtls_pk_verify_new", ret);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
/* RFC 8446 section 4.4.3
|
/* RFC 8446 section 4.4.3
|
||||||
|
|||||||
+2
-2
@@ -2060,7 +2060,7 @@ static int x509_crt_verifycrl(mbedtls_x509_crt *crt, mbedtls_x509_crt *ca,
|
|||||||
flags |= MBEDTLS_X509_BADCERT_BAD_KEY;
|
flags |= MBEDTLS_X509_BADCERT_BAD_KEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mbedtls_pk_verify_ext(crl_list->sig_pk, NULL, &ca->pk,
|
if (mbedtls_pk_verify_new(crl_list->sig_pk, &ca->pk,
|
||||||
crl_list->sig_md, hash, hash_length,
|
crl_list->sig_md, hash, hash_length,
|
||||||
crl_list->sig.p, crl_list->sig.len) != 0) {
|
crl_list->sig.p, crl_list->sig.len) != 0) {
|
||||||
flags |= MBEDTLS_X509_BADCRL_NOT_TRUSTED;
|
flags |= MBEDTLS_X509_BADCRL_NOT_TRUSTED;
|
||||||
@@ -2134,7 +2134,7 @@ static int x509_crt_check_signature(const mbedtls_x509_crt *child,
|
|||||||
(void) rs_ctx;
|
(void) rs_ctx;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return mbedtls_pk_verify_ext(child->sig_pk, NULL, &parent->pk,
|
return mbedtls_pk_verify_new(child->sig_pk, &parent->pk,
|
||||||
child->sig_md, hash, hash_len,
|
child->sig_md, hash, hash_len,
|
||||||
child->sig.p, child->sig.len);
|
child->sig.p, child->sig.len);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ static int x509_crt_verifycsr(const unsigned char *buf, size_t buflen)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mbedtls_pk_verify_ext(csr.sig_pk, NULL, &csr.pk,
|
if (mbedtls_pk_verify_new(csr.sig_pk, &csr.pk,
|
||||||
csr.sig_md, hash, mbedtls_md_get_size_from_type(csr.sig_md),
|
csr.sig_md, hash, mbedtls_md_get_size_from_type(csr.sig_md),
|
||||||
csr.sig.p, csr.sig.len) != 0) {
|
csr.sig.p, csr.sig.len) != 0) {
|
||||||
ret = MBEDTLS_ERR_X509_CERT_VERIFY_FAILED;
|
ret = MBEDTLS_ERR_X509_CERT_VERIFY_FAILED;
|
||||||
|
|||||||
Reference in New Issue
Block a user