diff options
author | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2005-06-06 07:15:47 +0000 |
---|---|---|
committer | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2005-06-06 07:15:47 +0000 |
commit | 99564025c0dce76804a8898cb5e5f29cfe94e550 (patch) | |
tree | 8af762253d0f0b55f02d62946176bbdf67c1bd6b | |
parent | 4a3798caff340bb2db78479786a9c5df0f942263 (diff) |
parse local/remote credential payload types.
-rw-r--r-- | sbin/ipsecctl/pfkdump.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sbin/ipsecctl/pfkdump.c b/sbin/ipsecctl/pfkdump.c index d40d567a080..dfdc34fa5ba 100644 --- a/sbin/ipsecctl/pfkdump.c +++ b/sbin/ipsecctl/pfkdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkdump.c,v 1.2 2005/05/27 05:48:10 hshoexer Exp $ */ +/* $OpenBSD: pfkdump.c,v 1.3 2005/06/06 07:15:46 hshoexer Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. @@ -46,6 +46,7 @@ static void print_key(struct sadb_ext *, struct sadb_msg *); static void print_life(struct sadb_ext *, struct sadb_msg *); static void print_ident(struct sadb_ext *, struct sadb_msg *); static void print_auth(struct sadb_ext *, struct sadb_msg *); +static void print_cred(struct sadb_ext *, struct sadb_msg *); static void print_udpenc(struct sadb_ext *, struct sadb_msg *); static struct idname *lookup(struct idname [], u_int8_t); @@ -73,6 +74,8 @@ struct idname ext_types[] = { { SADB_EXT_IDENTITY_SRC, "identity_src", print_ident }, { SADB_EXT_IDENTITY_DST, "identity_dst", print_ident }, { SADB_X_EXT_REMOTE_AUTH, "remote_auth", print_auth }, + { SADB_X_EXT_LOCAL_CREDENTIALS, "local_cred", print_cred }, + { SADB_X_EXT_REMOTE_CREDENTIALS,"remote_cred", print_cred }, { SADB_X_EXT_UDPENCAP, "udpencap", print_udpenc }, { SADB_X_EXT_LIFETIME_LASTUSE, "lifetime_lastuse", print_life }, { 0, NULL, NULL } @@ -106,6 +109,12 @@ struct idname auth_types[] = { { 0, NULL, NULL } }; +struct idname cred_types[] = { + { SADB_X_CREDTYPE_X509, "x509-asn1", NULL }, + { SADB_X_CREDTYPE_KEYNOTE, "keynote", NULL }, + { 0, NULL, NULL } +}; + struct idname enc_types[] = { { SADB_EALG_NONE, "none", NULL }, { SADB_EALG_3DESCBC, "3des-cbc", NULL }, @@ -289,6 +298,14 @@ print_auth(struct sadb_ext *ext, struct sadb_msg *msg) lookup_name(xauth_types, x_cred->sadb_x_cred_type)); } +void +print_cred(struct sadb_ext *ext, struct sadb_msg *msg) +{ + struct sadb_x_cred *x_cred = (struct sadb_x_cred *) ext; + printf("type %s\n", + lookup_name(cred_types, x_cred->sadb_x_cred_type)); +} + static void print_udpenc(struct sadb_ext *ext, struct sadb_msg *msg) { |