x509: Evaluate return codes of parsing functions

This commit is contained in:
Andreas Steffen
2017-05-08 16:44:25 +02:00
parent a4b3f1454b
commit b0dcf33f0f
4 changed files with 149 additions and 52 deletions
+7 -4
View File
@@ -1,9 +1,8 @@
/*
* Copyright (C) 2002 Ueli Galizzi, Ariane Seiler
* Copyright (C) 2003 Martin Berner, Lukas Suter
* Copyright (C) 2002-2014 Andreas Steffen
* Copyright (C) 2002-2017 Andreas Steffen
* Copyright (C) 2009 Martin Willi
*
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -177,7 +176,7 @@ static chunk_t ASN1_noRevAvail_ext = chunk_from_chars(
/**
* declaration of function implemented in x509_cert.c
*/
extern void x509_parse_generalNames(chunk_t blob, int level0, bool implicit,
extern bool x509_parse_generalNames(chunk_t blob, int level0, bool implicit,
linked_list_t *list);
/**
* parses a directoryName
@@ -191,7 +190,11 @@ static bool parse_directoryName(chunk_t blob, int level, bool implicit,
linked_list_t *list;
list = linked_list_create();
x509_parse_generalNames(blob, level, implicit, list);
if (!x509_parse_generalNames(blob, level, implicit, list))
{
list->destroy(list);
return FALSE;
}
enumerator = list->create_enumerator(list);
while (enumerator->enumerate(enumerator, &directoryName))