From 7c6d4a4e6bf35b523cf379259194a4be809830ea Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Sat, 28 Mar 2009 20:35:47 +0000
Subject: [PATCH] - Fixed new logic on certificate chains in
x509parse_verify()
---
library/x509parse.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/library/x509parse.c b/library/x509parse.c
index 919be65d1..7d88a0cc3 100644
--- a/library/x509parse.c
+++ b/library/x509parse.c
@@ -1584,7 +1584,7 @@ int x509parse_verify( x509_cert *crt,
pathlen = 1;
- while( cur->version != 0 )
+ while( cur != NULL && cur->version != 0 )
{
if( cur->ca_istrue == 0 ||
crt->issuer_raw.len != cur->subject_raw.len ||
@@ -1612,7 +1612,7 @@ int x509parse_verify( x509_cert *crt,
/*
* Atempt to validate topmost cert with our CA chain.
*/
- while( trust_ca->version != 0 )
+ while( trust_ca != NULL && trust_ca->version != 0 )
{
if( crt->issuer_raw.len != trust_ca->subject_raw.len ||
memcmp( crt->issuer_raw.p, trust_ca->subject_raw.p,