summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2003-10-14 14:29:16 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2003-10-14 14:29:16 +0000
commitba7ec25970a73fac88e8af6f1da6ed719e3fd12f (patch)
tree107600153d81a5344a22372d986d66df8d30d240
parent3f9f9669a0d7606e0a49e0c067baa9b93f3a2311 (diff)
constant_lookup() to constant_name() cleanup. markus@ ok.
-rw-r--r--sbin/isakmpd/exchange.c13
-rw-r--r--sbin/isakmpd/ike_auth.c8
-rw-r--r--sbin/isakmpd/ike_phase_1.c7
-rw-r--r--sbin/isakmpd/ipsec.c10
-rw-r--r--sbin/isakmpd/isakmp_doi.c8
5 files changed, 18 insertions, 28 deletions
diff --git a/sbin/isakmpd/exchange.c b/sbin/isakmpd/exchange.c
index e0a025e3435..52f652380bc 100644
--- a/sbin/isakmpd/exchange.c
+++ b/sbin/isakmpd/exchange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exchange.c,v 1.85 2003/09/25 14:15:15 cloder Exp $ */
+/* $OpenBSD: exchange.c,v 1.86 2003/10/14 14:29:15 ho Exp $ */
/* $EOM: exchange.c,v 1.143 2000/12/04 00:02:25 angelos Exp $ */
/*
@@ -1018,7 +1018,7 @@ exchange_setup_p1 (struct message *msg, u_int32_t doi)
struct conf_list *flags;
struct conf_list_node *flag;
#endif
- char *name = 0, *policy = 0, *str, *tag;
+ char *name = 0, *policy = 0, *str;
u_int32_t want_doi;
u_int8_t type;
@@ -1098,12 +1098,11 @@ exchange_setup_p1 (struct message *msg, u_int32_t doi)
}
if (type != GET_ISAKMP_HDR_EXCH_TYPE (msg->iov[0].iov_base))
{
- tag = constant_lookup (isakmp_exch_cst,
- GET_ISAKMP_HDR_EXCH_TYPE (msg->iov[0]
- .iov_base));
log_print ("exchange_setup_p1: expected exchange type %s got %s",
- str, tag ? tag : "<unknown>");
-
+ str,
+ constant_name (isakmp_exch_cst,
+ GET_ISAKMP_HDR_EXCH_TYPE (msg->iov[0]
+ .iov_base)));
return 0;
}
}
diff --git a/sbin/isakmpd/ike_auth.c b/sbin/isakmpd/ike_auth.c
index f2fc0271cc6..b6ae826062b 100644
--- a/sbin/isakmpd/ike_auth.c
+++ b/sbin/isakmpd/ike_auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ike_auth.c,v 1.79 2003/08/08 08:46:59 ho Exp $ */
+/* $OpenBSD: ike_auth.c,v 1.80 2003/10/14 14:29:15 ho Exp $ */
/* $EOM: ike_auth.c,v 1.59 2000/11/21 00:21:31 angelos Exp $ */
/*
@@ -582,7 +582,6 @@ rsa_sig_decode_hash (struct message *msg)
u_int32_t *id_cert_len;
size_t id_len;
int found = 0, n, i, id_found;
- char *tag;
#if defined (USE_DNSSEC)
u_int8_t *rawkey = 0;
u_int32_t rawkeylen;
@@ -681,11 +680,10 @@ rsa_sig_decode_hash (struct message *msg)
handler = cert_get (GET_ISAKMP_CERT_ENCODING (p->p));
if (!handler)
{
- tag = constant_lookup (isakmp_certenc_cst,
- GET_ISAKMP_CERT_ENCODING (p->p));
LOG_DBG ((LOG_MISC, 30,
"rsa_sig_decode_hash: no handler for %s CERT encoding",
- tag ? tag : "<unknown>"));
+ constant_name (isakmp_certenc_cst,
+ GET_ISAKMP_CERT_ENCODING (p->p))));
continue;
}
diff --git a/sbin/isakmpd/ike_phase_1.c b/sbin/isakmpd/ike_phase_1.c
index 1f5e4a23cda..c0dd8a3ca52 100644
--- a/sbin/isakmpd/ike_phase_1.c
+++ b/sbin/isakmpd/ike_phase_1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ike_phase_1.c,v 1.40 2003/10/04 17:29:58 cloder Exp $ */
+/* $OpenBSD: ike_phase_1.c,v 1.41 2003/10/14 14:29:15 ho Exp $ */
/* $EOM: ike_phase_1.c,v 1.31 2000/12/11 23:47:56 niklas Exp $ */
/*
@@ -1207,7 +1207,7 @@ attribute_unacceptable (u_int16_t type, u_int8_t *value, u_int16_t len,
struct conf_list *life_conf;
struct conf_list_node *xf = vs->xf, *life;
char *tag = constant_lookup (ike_attr_cst, type);
- char *tag2, *str;
+ char *str;
struct constant_map *map;
struct attr_node *node;
int rv;
@@ -1256,10 +1256,9 @@ attribute_unacceptable (u_int16_t type, u_int8_t *value, u_int16_t len,
LIST_INSERT_HEAD (&vs->attrs, node, link);
return 0;
}
- tag2 = constant_lookup (map, decode_16 (value));
LOG_DBG ((LOG_NEGOTIATION, 70,
"attribute_unacceptable: %s: got %s, expected %s", tag,
- tag2 ? tag2 : "<unknown>", str));
+ constant_name (map, decode_16 (value)), str));
return 1;
case IKE_ATTR_GROUP_PRIME:
diff --git a/sbin/isakmpd/ipsec.c b/sbin/isakmpd/ipsec.c
index 38b9ee8d8eb..91570499e46 100644
--- a/sbin/isakmpd/ipsec.c
+++ b/sbin/isakmpd/ipsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec.c,v 1.80 2003/09/02 18:15:55 ho Exp $ */
+/* $OpenBSD: ipsec.c,v 1.81 2003/10/14 14:29:15 ho Exp $ */
/* $EOM: ipsec.c,v 1.143 2000/12/11 23:57:42 niklas Exp $ */
/*
@@ -414,7 +414,6 @@ static int
ipsec_set_network (u_int8_t *src_id, u_int8_t *dst_id, struct ipsec_sa *isa)
{
int id;
- char *v;
/* Set source address/mask. */
id = GET_ISAKMP_ID_TYPE (src_id);
@@ -468,9 +467,8 @@ ipsec_set_network (u_int8_t *src_id, u_int8_t *dst_id, struct ipsec_sa *isa)
case IPSEC_ID_DER_ASN1_GN:
case IPSEC_ID_KEY_ID:
default:
- v = constant_lookup (ipsec_id_cst, id);
log_print ("ipsec_set_network: ID type %d (%s) not supported",
- id, v ? v : "<unknown>");
+ id, constant_name (ipsec_id_cst, id));
return -1;
}
@@ -1056,7 +1054,6 @@ ipsec_responder (struct message *msg)
struct exchange *exchange = msg->exchange;
int (**script) (struct message *) = 0;
struct payload *p;
- char *tag;
u_int16_t type;
/* Check that a new exchange is coherent with the IKE rules. */
@@ -1096,10 +1093,9 @@ ipsec_responder (struct message *msg)
p = TAILQ_NEXT (p, link))
{
type = GET_ISAKMP_NOTIFY_MSG_TYPE (p->p);
- tag = constant_lookup (isakmp_notify_cst, type);
LOG_DBG ((LOG_EXCHANGE, 10,
"ipsec_responder: got NOTIFY of type %s",
- tag ? tag : "<unknown>"));
+ constant_name (isakmp_notify_cst, type)));
if (type == ISAKMP_NOTIFY_INVALID_SPI)
ipsec_invalid_spi (msg, p);
diff --git a/sbin/isakmpd/isakmp_doi.c b/sbin/isakmpd/isakmp_doi.c
index abd012e6b6a..5d6de9a6f07 100644
--- a/sbin/isakmpd/isakmp_doi.c
+++ b/sbin/isakmpd/isakmp_doi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isakmp_doi.c,v 1.16 2003/08/08 08:46:59 ho Exp $ */
+/* $OpenBSD: isakmp_doi.c,v 1.17 2003/10/14 14:29:15 ho Exp $ */
/* $EOM: isakmp_doi.c,v 1.42 2000/09/12 16:29:41 ho Exp $ */
/*
@@ -228,7 +228,6 @@ static int
isakmp_responder (struct message *msg)
{
struct payload *p;
- char *tag;
switch (msg->exchange->type)
{
@@ -236,11 +235,10 @@ isakmp_responder (struct message *msg)
for (p = TAILQ_FIRST (&msg->payload[ISAKMP_PAYLOAD_NOTIFY]); p;
p = TAILQ_NEXT (p, link))
{
- tag = constant_lookup (isakmp_notify_cst,
- GET_ISAKMP_NOTIFY_MSG_TYPE (p->p));
LOG_DBG ((LOG_EXCHANGE, 10,
"isakmp_responder: got NOTIFY of type %s, ignoring",
- tag ? tag : "<unknown>"));
+ constant_name (isakmp_notify_cst,
+ GET_ISAKMP_NOTIFY_MSG_TYPE (p->p))));
p->flags |= PL_MARK;
}