aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bakker <p.j.bakker@polarssl.org>2009-03-28 20:29:25 +0000
committerPaul Bakker <p.j.bakker@polarssl.org>2009-03-28 20:29:25 +0000
commite9581d66b0baafbd2699fea658e7466dd201d8b7 (patch)
tree45578d1e2e7d31ac3054d64780b9d71486abfb4f
parent6335fafd74405b9961f743b7852e8b156a3ee8d3 (diff)
downloadmbedtls-e9581d66b0baafbd2699fea658e7466dd201d8b7.zip
mbedtls-e9581d66b0baafbd2699fea658e7466dd201d8b7.tar.gz
mbedtls-e9581d66b0baafbd2699fea658e7466dd201d8b7.tar.bz2
- Fixed logic error on end of 'full' chain
-rw-r--r--library/x509parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/x509parse.c b/library/x509parse.c
index 2596559..919be65 100644
--- a/library/x509parse.c
+++ b/library/x509parse.c
@@ -663,13 +663,13 @@ int x509parse_crt( x509_cert *chain, unsigned char *buf, int buflen )
if( crt == NULL || buf == NULL )
return( 1 );
- while( crt->version != 0 || crt->next != NULL )
+ while( crt->version != 0 && crt->next != NULL )
crt = crt->next;
/*
* 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 ) );