Fixed loading of DER encoded certificate files

This commit is contained in:
Martin Willi
2009-09-16 11:24:35 +02:00
parent 934942dddb
commit 4e1cade52f
+1 -1
View File
@@ -375,12 +375,12 @@ static void *load_from_blob(chunk_t blob, credential_type_t type, int subtype,
* RSA for PGP keys, which is actually wrong. */ * RSA for PGP keys, which is actually wrong. */
subtype = KEY_ANY; subtype = KEY_ANY;
} }
}
/* if CERT_ANY is given, ASN1 encoded blob is handled as X509 */ /* if CERT_ANY is given, ASN1 encoded blob is handled as X509 */
if (type == CRED_CERTIFICATE && subtype == CERT_ANY) if (type == CRED_CERTIFICATE && subtype == CERT_ANY)
{ {
subtype = pgp ? CERT_GPG : CERT_X509; subtype = pgp ? CERT_GPG : CERT_X509;
} }
}
cred = lib->creds->create(lib->creds, type, subtype, cred = lib->creds->create(lib->creds, type, subtype,
pgp ? BUILD_BLOB_PGP : BUILD_BLOB_ASN1_DER, blob, pgp ? BUILD_BLOB_PGP : BUILD_BLOB_ASN1_DER, blob,
flags ? BUILD_X509_FLAG : BUILD_END, flags ? BUILD_X509_FLAG : BUILD_END,