From 4e1cade52fa34dd8207a566550252053dfd0f368 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 16 Sep 2009 11:24:35 +0200 Subject: [PATCH] Fixed loading of DER encoded certificate files --- src/libstrongswan/plugins/pem/pem_builder.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libstrongswan/plugins/pem/pem_builder.c b/src/libstrongswan/plugins/pem/pem_builder.c index eb3d300a6e..2f285e9bc4 100644 --- a/src/libstrongswan/plugins/pem/pem_builder.c +++ b/src/libstrongswan/plugins/pem/pem_builder.c @@ -375,11 +375,11 @@ static void *load_from_blob(chunk_t blob, credential_type_t type, int subtype, * RSA for PGP keys, which is actually wrong. */ subtype = KEY_ANY; } - /* if CERT_ANY is given, ASN1 encoded blob is handled as X509 */ - if (type == CRED_CERTIFICATE && subtype == CERT_ANY) - { - subtype = pgp ? CERT_GPG : CERT_X509; - } + } + /* if CERT_ANY is given, ASN1 encoded blob is handled as X509 */ + if (type == CRED_CERTIFICATE && subtype == CERT_ANY) + { + subtype = pgp ? CERT_GPG : CERT_X509; } cred = lib->creds->create(lib->creds, type, subtype, pgp ? BUILD_BLOB_PGP : BUILD_BLOB_ASN1_DER, blob, -- 2.47.2