diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-04-30 11:46:25 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-04-30 11:46:25 +0000 |
commit | 91de10943b78aa3b04e46a841d73c61f8e8ab261 (patch) | |
tree | d05617d626986b3f39bbe43e1c609679deac09ab /sbin/isakmpd | |
parent | 66d41d7f3446487d4647a055bf15e2a693f3075e (diff) |
ike_phase_1.c: Merge with EOM 1.3
ike_quick_mode.c: Merge with EOM 1.84
message.h: Merge with EOM 1.46
author: niklas
New message_drop API. Generate real INVALID_COOKIE notification.
Generate informational exchanges in phase 1 too. Really get these
messages to the wire
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r-- | sbin/isakmpd/ike_phase_1.c | 11 | ||||
-rw-r--r-- | sbin/isakmpd/ike_quick_mode.c | 16 | ||||
-rw-r--r-- | sbin/isakmpd/message.h | 6 |
3 files changed, 17 insertions, 16 deletions
diff --git a/sbin/isakmpd/ike_phase_1.c b/sbin/isakmpd/ike_phase_1.c index 87a1c8cf242..67bec8f1338 100644 --- a/sbin/isakmpd/ike_phase_1.c +++ b/sbin/isakmpd/ike_phase_1.c @@ -1,4 +1,5 @@ -/* $Id: ike_phase_1.c,v 1.1 1999/04/19 21:05:22 niklas Exp $ */ +/* $OpenBSD: ike_phase_1.c,v 1.2 1999/04/30 11:46:23 niklas Exp $ */ +/* $EOM: ike_phase_1.c,v 1.3 1999/04/29 10:51:36 niklas Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -370,7 +371,7 @@ ike_phase_1_initiator_recv_SA (struct message *msg) log_print ("ike_phase_1_initiator_recv_SA: " "multiple SA, proposal or transform payloads in phase 1"); /* XXX Is there a better notification type? */ - message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 1, 0); return -1; } @@ -442,7 +443,7 @@ ike_phase_1_responder_recv_SA (struct message *msg) log_print ("ike_phase_1_responder_recv_SA: " "multiple SA or proposal payloads in phase 1"); /* XXX Is there a better notification type? */ - message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 1, 0); return -1; } @@ -463,7 +464,7 @@ ike_phase_1_responder_recv_SA (struct message *msg) */ if (!exchange->crypto || !ie->hash || !ie->ike_auth || !ie->group) { - message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 1, 0); return -1; } @@ -892,7 +893,7 @@ ike_phase_1_recv_AUTH (struct message *msg) /* The decoded hash will be in ie->hash_r or ie->hash_i */ if (ie->ike_auth->decode_hash (msg)) { - message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 1, 0); return -1; } diff --git a/sbin/isakmpd/ike_quick_mode.c b/sbin/isakmpd/ike_quick_mode.c index ec3f2865204..b1efc0cd27e 100644 --- a/sbin/isakmpd/ike_quick_mode.c +++ b/sbin/isakmpd/ike_quick_mode.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ike_quick_mode.c,v 1.14 1999/04/27 21:04:07 niklas Exp $ */ -/* $EOM: ike_quick_mode.c,v 1.83 1999/04/25 22:08:08 niklas Exp $ */ +/* $OpenBSD: ike_quick_mode.c,v 1.15 1999/04/30 11:46:24 niklas Exp $ */ +/* $EOM: ike_quick_mode.c,v 1.84 1999/04/29 10:51:34 niklas Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -648,7 +648,7 @@ initiator_recv_HASH_SA_NONCE (struct message *msg) log_print ("initiator_recv_HASH_SA_NONCE: " "multiple SA payloads in quick mode"); /* XXX Is there a better notification type? */ - message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 1, 0); return -1; } @@ -973,7 +973,7 @@ responder_recv_HASH_SA_NONCE (struct message *msg) if (hash != pkt + ISAKMP_HDR_SZ) { /* XXX Is there a better notification type? */ - message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 1, 0); goto cleanup; } hash_len = GET_ISAKMP_GEN_LENGTH (hash); @@ -1012,7 +1012,7 @@ responder_recv_HASH_SA_NONCE (struct message *msg) if (memcmp (hash + ISAKMP_GEN_SZ, my_hash, hash_len - ISAKMP_GEN_SZ) != 0) { /* XXX Is there a better notification type? */ - message_drop (msg, ISAKMP_NOTIFY_INVALID_HASH_INFORMATION, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_INVALID_HASH_INFORMATION, 0, 1, 0); goto cleanup; } free (my_hash); @@ -1039,7 +1039,7 @@ responder_recv_HASH_SA_NONCE (struct message *msg) { if (!isa->group_desc) { - message_drop (msg, ISAKMP_NOTIFY_NO_PROPOSAL_CHOSEN, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_NO_PROPOSAL_CHOSEN, 0, 1, 0); continue; } @@ -1048,7 +1048,7 @@ responder_recv_HASH_SA_NONCE (struct message *msg) group_desc = isa->group_desc; else if (group_desc != isa->group_desc) { - message_drop (msg, ISAKMP_NOTIFY_NO_PROPOSAL_CHOSEN, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_NO_PROPOSAL_CHOSEN, 0, 1, 0); continue; } } @@ -1343,7 +1343,7 @@ responder_recv_HASH (struct message *msg) if (memcmp (hash + ISAKMP_GEN_SZ, my_hash, hash_len - ISAKMP_GEN_SZ) != 0) { /* XXX Is there a better notification type? */ - message_drop (msg, ISAKMP_NOTIFY_INVALID_HASH_INFORMATION, 0, 0, 0); + message_drop (msg, ISAKMP_NOTIFY_INVALID_HASH_INFORMATION, 0, 1, 0); goto cleanup; } free (my_hash); diff --git a/sbin/isakmpd/message.h b/sbin/isakmpd/message.h index ee719444297..abb45f007cf 100644 --- a/sbin/isakmpd/message.h +++ b/sbin/isakmpd/message.h @@ -1,5 +1,5 @@ -/* $OpenBSD: message.h,v 1.8 1999/04/27 20:58:30 niklas Exp $ */ -/* $EOM: message.h,v 1.45 1999/04/25 13:38:33 niklas Exp $ */ +/* $OpenBSD: message.h,v 1.9 1999/04/30 11:46:24 niklas Exp $ */ +/* $EOM: message.h,v 1.46 1999/04/29 10:51:30 niklas Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -175,7 +175,7 @@ extern int message_register_post_send (struct message *, void (*) (struct message *)); extern void message_post_send (struct message *); extern void message_send (struct message *); -extern void message_send_info (struct message *); +extern int message_send_info (struct message *); extern void message_send_notification (struct message *, struct sa *, u_int16_t, struct proto *, int); extern void message_setup_header (struct message *, u_int8_t, u_int8_t, |