mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-07-04 03:58:19 +00:00
Code cosmetics
This commit is contained in:
parent
312010e6e9
commit
490047cc44
|
@ -1595,13 +1595,10 @@ static int x509_crt_verify_top(
|
||||||
else
|
else
|
||||||
md( md_info, child->tbs.p, child->tbs.len, hash );
|
md( md_info, child->tbs.p, child->tbs.len, hash );
|
||||||
|
|
||||||
while( trust_ca != NULL )
|
for( /* trust_ca */ ; trust_ca != NULL; trust_ca = trust_ca->next )
|
||||||
{
|
{
|
||||||
if( x509_crt_check_parent( child, trust_ca ) != 0 )
|
if( x509_crt_check_parent( child, trust_ca ) != 0 )
|
||||||
{
|
|
||||||
trust_ca = trust_ca->next;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reduce path_len to check against if top of the chain is
|
* Reduce path_len to check against if top of the chain is
|
||||||
|
@ -1617,7 +1614,6 @@ static int x509_crt_verify_top(
|
||||||
if( trust_ca->max_pathlen > 0 &&
|
if( trust_ca->max_pathlen > 0 &&
|
||||||
trust_ca->max_pathlen < check_path_cnt )
|
trust_ca->max_pathlen < check_path_cnt )
|
||||||
{
|
{
|
||||||
trust_ca = trust_ca->next;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1625,7 +1621,6 @@ static int x509_crt_verify_top(
|
||||||
pk_verify( &trust_ca->pk, child->sig_md, hash, md_info->size,
|
pk_verify( &trust_ca->pk, child->sig_md, hash, md_info->size,
|
||||||
child->sig.p, child->sig.len ) != 0 )
|
child->sig.p, child->sig.len ) != 0 )
|
||||||
{
|
{
|
||||||
trust_ca = trust_ca->next;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1733,16 +1728,15 @@ static int x509_crt_verify_child(
|
||||||
/* Is our parent part of the chain or at the top? */
|
/* Is our parent part of the chain or at the top? */
|
||||||
if( grandparent != NULL )
|
if( grandparent != NULL )
|
||||||
{
|
{
|
||||||
/*
|
ret = x509_crt_verify_child( parent, grandparent, trust_ca, ca_crl,
|
||||||
* Part of the chain
|
path_cnt + 1, &parent_flags, f_vrfy, p_vrfy );
|
||||||
*/
|
|
||||||
ret = x509_crt_verify_child( parent, grandparent, trust_ca, ca_crl, path_cnt + 1, &parent_flags, f_vrfy, p_vrfy );
|
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = x509_crt_verify_top( parent, trust_ca, ca_crl, path_cnt + 1, &parent_flags, f_vrfy, p_vrfy );
|
ret = x509_crt_verify_top( parent, trust_ca, ca_crl,
|
||||||
|
path_cnt + 1, &parent_flags, f_vrfy, p_vrfy );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
@ -1836,16 +1830,15 @@ int x509_crt_verify( x509_crt *crt,
|
||||||
/* Are we part of the chain or at the top? */
|
/* Are we part of the chain or at the top? */
|
||||||
if( parent != NULL )
|
if( parent != NULL )
|
||||||
{
|
{
|
||||||
/*
|
ret = x509_crt_verify_child( crt, parent, trust_ca, ca_crl,
|
||||||
* Part of the chain
|
pathlen, flags, f_vrfy, p_vrfy );
|
||||||
*/
|
|
||||||
ret = x509_crt_verify_child( crt, parent, trust_ca, ca_crl, pathlen, flags, f_vrfy, p_vrfy );
|
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = x509_crt_verify_top( crt, trust_ca, ca_crl, pathlen, flags, f_vrfy, p_vrfy );
|
ret = x509_crt_verify_top( crt, trust_ca, ca_crl,
|
||||||
|
pathlen, flags, f_vrfy, p_vrfy );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue