diff options
author | Martin Willi <martin@strongswan.org> | 2009-09-14 20:04:48 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-09-15 08:23:48 +0200 |
commit | 79c6f16212ad69a0c74cd3be5a63dce5e449e2fd (patch) | |
tree | 5cf187e41e854e3cdc119e3f135da28009782b6c /src/libstrongswan/plugins/pem/pem_builder.c | |
parent | 4cb0e1bb76434ae448701c8d51aabbf47aaaeb0e (diff) | |
download | strongswan-79c6f16212ad69a0c74cd3be5a63dce5e449e2fd.tar.bz2 strongswan-79c6f16212ad69a0c74cd3be5a63dce5e449e2fd.tar.xz |
Implemented support for preinstalled PGP certificates in charon
Diffstat (limited to 'src/libstrongswan/plugins/pem/pem_builder.c')
-rw-r--r-- | src/libstrongswan/plugins/pem/pem_builder.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/pem/pem_builder.c b/src/libstrongswan/plugins/pem/pem_builder.c index c53e1e9cd..eb3d300a6 100644 --- a/src/libstrongswan/plugins/pem/pem_builder.c +++ b/src/libstrongswan/plugins/pem/pem_builder.c @@ -375,6 +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; + } } cred = lib->creds->create(lib->creds, type, subtype, pgp ? BUILD_BLOB_PGP : BUILD_BLOB_ASN1_DER, blob, |