From caa00e7ab7daa6cd00d9669f9eb9a077363588cd Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 17 Aug 2009 13:48:50 +0200 Subject: pluto uses KEY_ANY builder to parse PGP public keys --- src/pluto/pgpcert.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'src/pluto/pgpcert.c') 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 */ -- cgit v1.2.3