From 5373d3a869b8f80e578ee3b48a2b41226542c7e0 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Thu, 30 Jul 2009 10:20:04 +0200 Subject: [PATCH] Allow parsing of cert fail unless HX509_CERTS_UNPROTECT_ALL is set. --- lib/hx509/ks_file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/hx509/ks_file.c b/lib/hx509/ks_file.c index 74808f760..553191a77 100644 --- a/lib/hx509/ks_file.c +++ b/lib/hx509/ks_file.c @@ -340,7 +340,7 @@ pem_func(hx509_context context, const char *type, ret = (*formats[j].func)(context, NULL, pem_ctx->c, header, data, len, ai); - if (ret) { + if (ret && (pem_ctx->flags & HX509_CERTS_UNPROTECT_ALL)) { hx509_set_error_string(context, HX509_ERROR_APPEND, ret, "Failed parseing PEM format %s", type); return ret; @@ -354,8 +354,6 @@ pem_func(hx509_context context, const char *type, "Found no matching PEM format for %s", type); return ret; } - if (ret && (pem_ctx->flags & HX509_CERTS_UNPROTECT_ALL)) - return ret; return 0; }