diff options
author | Martin Willi <martin@strongswan.org> | 2009-08-17 13:48:50 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-08-26 11:23:50 +0200 |
commit | caa00e7ab7daa6cd00d9669f9eb9a077363588cd (patch) | |
tree | ab285fddb16565e0a1ee1081460c8633c380e472 /src | |
parent | 9493dd2ce0b0330cf8874cc5b474822f33eff6b7 (diff) | |
download | strongswan-caa00e7ab7daa6cd00d9669f9eb9a077363588cd.tar.bz2 strongswan-caa00e7ab7daa6cd00d9669f9eb9a077363588cd.tar.xz |
pluto uses KEY_ANY builder to parse PGP public keys
Diffstat (limited to 'src')
-rw-r--r-- | src/pluto/pgpcert.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/pluto/pgpcert.c b/src/pluto/pgpcert.c index a349a02c2..1f3db59e4 100644 --- a/src/pluto/pgpcert.c +++ b/src/pluto/pgpcert.c @@ -172,36 +172,17 @@ static bool parse_pgp_pubkey_version_validity(chunk_t *packet, pgpcert_t *cert) static bool parse_pgp_pubkey_packet(chunk_t *packet, pgpcert_t *cert) { chunk_t pubkey_packet = *packet; - pgp_pubkey_alg_t pubkey_alg; if (!parse_pgp_pubkey_version_validity(packet, cert)) { return FALSE; } - /* public key algorithm - 1 byte */ - pubkey_alg = pgp_length(packet, 1); - DBG(DBG_PARSING, - DBG_log("L3 - public key algorithm:"); - DBG_log(" %N", pgp_pubkey_alg_names, pubkey_alg) - ) - - switch (pubkey_alg) + cert->public_key = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY, + BUILD_BLOB_PGP, *packet, BUILD_END); + if (cert->public_key == NULL) { - case PGP_PUBKEY_ALG_RSA: - case PGP_PUBKEY_ALG_RSA_SIGN_ONLY: - cert->public_key = lib->creds->create(lib->creds, - CRED_PUBLIC_KEY, KEY_RSA, - BUILD_BLOB_PGP, *packet, - BUILD_END); - if (cert->public_key == NULL) - { - return FALSE; - } - break; - default: - plog(" non RSA public keys not supported"); - return FALSE; + return FALSE; } /* compute V4 or V3 fingerprint according to section 12.2 of RFC 4880 */ |