mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-27 15:35:50 +00:00
Change the verify function naming
Change the naming to reflect that the function uses a new ca callback feature to distinguish different callbacks.
This commit is contained in:
parent
d6d100beb7
commit
31d9db6195
@ -523,7 +523,7 @@ int mbedtls_x509_crt_verify_restartable( mbedtls_x509_crt *crt,
|
|||||||
* \brief The type of trusted certificate callbacks.
|
* \brief The type of trusted certificate callbacks.
|
||||||
*
|
*
|
||||||
* Callbacks of this type are passed to and used by the CRT
|
* Callbacks of this type are passed to and used by the CRT
|
||||||
* verification routine mbedtls_x509_crt_verify_with_cb()
|
* verification routine mbedtls_x509_crt_verify_with_ca_cb()
|
||||||
* when looking for trusted signers of a given certificate.
|
* when looking for trusted signers of a given certificate.
|
||||||
*
|
*
|
||||||
* On success, the callback returns a list of trusted
|
* On success, the callback returns a list of trusted
|
||||||
@ -574,7 +574,7 @@ typedef int (*mbedtls_x509_crt_ca_cb_t)( void *p_ctx,
|
|||||||
*
|
*
|
||||||
* \return See \c mbedtls_crt_verify_with_profile().
|
* \return See \c mbedtls_crt_verify_with_profile().
|
||||||
*/
|
*/
|
||||||
int mbedtls_x509_crt_verify_with_cb( mbedtls_x509_crt *crt,
|
int mbedtls_x509_crt_verify_with_ca_cb( mbedtls_x509_crt *crt,
|
||||||
mbedtls_x509_crt_ca_cb_t f_ca_cb,
|
mbedtls_x509_crt_ca_cb_t f_ca_cb,
|
||||||
void *p_ca_cb,
|
void *p_ca_cb,
|
||||||
const mbedtls_x509_crt_profile *profile,
|
const mbedtls_x509_crt_profile *profile,
|
||||||
|
@ -2587,7 +2587,7 @@ static int x509_crt_merge_flags_with_cb(
|
|||||||
* of trusted signers, and `ca_crl` will be use as the static list
|
* of trusted signers, and `ca_crl` will be use as the static list
|
||||||
* of CRLs.
|
* of CRLs.
|
||||||
*/
|
*/
|
||||||
static int mbedtls_x509_crt_verify_restartable_cb( mbedtls_x509_crt *crt,
|
static int mbedtls_x509_crt_verify_restartable_ca_cb( mbedtls_x509_crt *crt,
|
||||||
mbedtls_x509_crt *trust_ca,
|
mbedtls_x509_crt *trust_ca,
|
||||||
mbedtls_x509_crl *ca_crl,
|
mbedtls_x509_crl *ca_crl,
|
||||||
mbedtls_x509_crt_ca_cb_t f_ca_cb,
|
mbedtls_x509_crt_ca_cb_t f_ca_cb,
|
||||||
@ -2682,7 +2682,7 @@ int mbedtls_x509_crt_verify( mbedtls_x509_crt *crt,
|
|||||||
int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
|
int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
|
||||||
void *p_vrfy )
|
void *p_vrfy )
|
||||||
{
|
{
|
||||||
return( mbedtls_x509_crt_verify_restartable_cb( crt, trust_ca, ca_crl,
|
return( mbedtls_x509_crt_verify_restartable_ca_cb( crt, trust_ca, ca_crl,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
&mbedtls_x509_crt_profile_default,
|
&mbedtls_x509_crt_profile_default,
|
||||||
cn, flags,
|
cn, flags,
|
||||||
@ -2700,7 +2700,7 @@ int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt,
|
|||||||
int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
|
int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
|
||||||
void *p_vrfy )
|
void *p_vrfy )
|
||||||
{
|
{
|
||||||
return( mbedtls_x509_crt_verify_restartable_cb( crt, trust_ca, ca_crl,
|
return( mbedtls_x509_crt_verify_restartable_ca_cb( crt, trust_ca, ca_crl,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
profile, cn, flags,
|
profile, cn, flags,
|
||||||
f_vrfy, p_vrfy, NULL ) );
|
f_vrfy, p_vrfy, NULL ) );
|
||||||
@ -2711,7 +2711,7 @@ int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt,
|
|||||||
* Verify the certificate validity (user-chosen profile, CA callback,
|
* Verify the certificate validity (user-chosen profile, CA callback,
|
||||||
* not restartable).
|
* not restartable).
|
||||||
*/
|
*/
|
||||||
int mbedtls_x509_crt_verify_with_cb( mbedtls_x509_crt *crt,
|
int mbedtls_x509_crt_verify_with_ca_cb( mbedtls_x509_crt *crt,
|
||||||
mbedtls_x509_crt_ca_cb_t f_ca_cb,
|
mbedtls_x509_crt_ca_cb_t f_ca_cb,
|
||||||
void *p_ca_cb,
|
void *p_ca_cb,
|
||||||
const mbedtls_x509_crt_profile *profile,
|
const mbedtls_x509_crt_profile *profile,
|
||||||
@ -2719,7 +2719,7 @@ int mbedtls_x509_crt_verify_with_cb( mbedtls_x509_crt *crt,
|
|||||||
int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
|
int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
|
||||||
void *p_vrfy )
|
void *p_vrfy )
|
||||||
{
|
{
|
||||||
return( mbedtls_x509_crt_verify_restartable_cb( crt, NULL, NULL,
|
return( mbedtls_x509_crt_verify_restartable_ca_cb( crt, NULL, NULL,
|
||||||
f_ca_cb, p_ca_cb,
|
f_ca_cb, p_ca_cb,
|
||||||
profile, cn, flags,
|
profile, cn, flags,
|
||||||
f_vrfy, p_vrfy, NULL ) );
|
f_vrfy, p_vrfy, NULL ) );
|
||||||
@ -2735,7 +2735,7 @@ int mbedtls_x509_crt_verify_restartable( mbedtls_x509_crt *crt,
|
|||||||
void *p_vrfy,
|
void *p_vrfy,
|
||||||
mbedtls_x509_crt_restart_ctx *rs_ctx )
|
mbedtls_x509_crt_restart_ctx *rs_ctx )
|
||||||
{
|
{
|
||||||
return( mbedtls_x509_crt_verify_restartable_cb( crt, trust_ca, ca_crl,
|
return( mbedtls_x509_crt_verify_restartable_ca_cb( crt, trust_ca, ca_crl,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
profile, cn, flags,
|
profile, cn, flags,
|
||||||
f_vrfy, p_vrfy, rs_ctx ) );
|
f_vrfy, p_vrfy, rs_ctx ) );
|
||||||
|
@ -446,7 +446,7 @@ void x509_verify( char *crt_file, char *ca_file, char *crl_file,
|
|||||||
{
|
{
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
|
||||||
res = mbedtls_x509_crt_verify_with_cb( &crt, ca_callback, &ca, profile, cn_name, &flags, f_vrfy, NULL );
|
res = mbedtls_x509_crt_verify_with_ca_cb( &crt, ca_callback, &ca, profile, cn_name, &flags, f_vrfy, NULL );
|
||||||
|
|
||||||
TEST_ASSERT( res == ( result ) );
|
TEST_ASSERT( res == ( result ) );
|
||||||
TEST_ASSERT( flags == (uint32_t)( flags_result ) );
|
TEST_ASSERT( flags == (uint32_t)( flags_result ) );
|
||||||
@ -477,7 +477,7 @@ void x509_verify_ca_cb_failure( char *crt_file, char *ca_file, char *name,
|
|||||||
if( strcmp( name, "NULL" ) == 0 )
|
if( strcmp( name, "NULL" ) == 0 )
|
||||||
name = NULL;
|
name = NULL;
|
||||||
|
|
||||||
ret = mbedtls_x509_crt_verify_with_cb( &crt, ca_callback_fail, &ca,
|
ret = mbedtls_x509_crt_verify_with_ca_cb( &crt, ca_callback_fail, &ca,
|
||||||
&compat_profile, name, &flags,
|
&compat_profile, name, &flags,
|
||||||
verify_all, NULL );
|
verify_all, NULL );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user