mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 18:15:35 +00:00
- Fixed logic error on end of 'full' chain
This commit is contained in:
parent
6335fafd74
commit
e9581d66b0
|
@ -663,13 +663,13 @@ int x509parse_crt( x509_cert *chain, unsigned char *buf, int buflen )
|
||||||
if( crt == NULL || buf == NULL )
|
if( crt == NULL || buf == NULL )
|
||||||
return( 1 );
|
return( 1 );
|
||||||
|
|
||||||
while( crt->version != 0 || crt->next != NULL )
|
while( crt->version != 0 && crt->next != NULL )
|
||||||
crt = crt->next;
|
crt = crt->next;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add new certificate on the end of the chain if needed.
|
* Add new certificate on the end of the chain if needed.
|
||||||
*/
|
*/
|
||||||
if ( crt->next == NULL)
|
if ( crt->version != 0 && crt->next == NULL)
|
||||||
{
|
{
|
||||||
crt->next = (x509_cert *) malloc( sizeof( x509_cert ) );
|
crt->next = (x509_cert *) malloc( sizeof( x509_cert ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue