#include "schedule.h"
#include "debug.h"
-#ifdef ENABLE_HYBRID
-#include <resolv.h>
-#endif
-
#include "fsm.h"
#include "localconf.h"
#include "remoteconf.h"
#include "vpn_control.h"
#include "vpn_control_var.h"
-#include "ipsecSessionTracer.h"
-#include "ipsecMessageTracer.h"
#ifndef HAVE_OPENSSL
#include <Security/SecDH.h>
#endif
fsm_set_state(&iph1->status, IKEV1_STATE_AGG_I_MSG1SENT);
error = 0;
-
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_TX_SUCC,
- CONSTSTR("Initiator, Aggressive-Mode message 1"),
- CONSTSTR(NULL));
-
end:
- if (error) {
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_TX_FAIL,
- CONSTSTR("Initiator, Aggressive-Mode Message 1"),
- CONSTSTR("Failed to transmit Aggressive-Mode Message 1"));
- }
if (cr)
vfree(cr);
#ifdef ENABLE_FRAG
if (isakmp_p2ph (&natd->payload, pa->ptr) < 0) {
plog(ASL_LEVEL_ERR,
"failed to process NATD payload");
+ racoon_free(natd);
goto end;
}
struct natd_payload *natd = NULL;
int natd_verified;
- plog(ASL_LEVEL_INFO,
+ plog(ASL_LEVEL_NOTICE,
"Selected NAT-T version: %s\n",
vid_string_by_id(iph1->natt_options->version));
natd_verified = natt_compare_addr_hash (iph1,
natd->payload, natd->seq);
- plog (ASL_LEVEL_INFO, "NAT-D payload #%d %s\n",
+ plog (ASL_LEVEL_NOTICE, "NAT-D payload #%d %s\n",
natd->seq - 1,
natd_verified ? "verified" : "doesn't match");
racoon_free (natd);
}
- plog (ASL_LEVEL_INFO, "NAT %s %s%s\n",
+ plog (ASL_LEVEL_NOTICE, "NAT %s %s%s\n",
iph1->natt_flags & NAT_DETECTED ?
"detected:" : "not detected",
iph1->natt_flags & NAT_DETECTED_ME ? "ME " : "",
/* validate authentication value */
ptype = oakley_validate_auth(iph1);
if (ptype != 0) {
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKEV1_PH1_AUTH_FAIL,
- CONSTSTR("Initiator, Aggressive-Mode Message 2"),
- CONSTSTR("Failed to authenticate, Aggressive-Mode Message 2"));
if (ptype == -1) {
/* message printed inner oakley_validate_auth() */
goto end;
isakmp_info_send_n1(iph1, ptype, NULL);
goto end;
}
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKEV1_PH1_AUTH_SUCC,
- CONSTSTR("Initiator, Aggressive-Mode Message 2"),
- CONSTSTR(NULL));
-
+
if (oakley_checkcr(iph1) < 0) {
/* Ignore this error in order to be interoperability. */
;
#endif
error = 0;
-
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_RX_SUCC,
- CONSTSTR("Initiator, Aggressive-Mode message 2"),
- CONSTSTR(NULL));
-
end:
- if (error) {
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_RX_FAIL,
- CONSTSTR("Initiator, Aggressive-Mode Message 2"),
- CONSTSTR("Failure processing Aggressive-Mode Message 2"));
- }
-
if (pbuf)
vfree(pbuf);
if (satmp)
#ifdef ENABLE_NATT
/* generate NAT-D payloads */
if (NATT_AVAILABLE(iph1)) {
- plog (ASL_LEVEL_INFO, "Adding remote and local NAT-D payloads.\n");
+ plog (ASL_LEVEL_NOTICE, "Adding remote and local NAT-D payloads.\n");
if ((natd[0] = natt_hash_addr (iph1, iph1->remote)) == NULL) {
plog(ASL_LEVEL_ERR,
"NAT-D hashing failed for %s\n", saddr2str((struct sockaddr *)iph1->remote));
fsm_set_state(&iph1->status, IKEV1_STATE_PHASE1_ESTABLISHED);
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKEV1_PH1_INIT_SUCC,
- CONSTSTR("Initiator, Aggressive-Mode"),
- CONSTSTR(NULL));
-
error = 0;
-
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_TX_SUCC,
- CONSTSTR("Initiator, Aggressive-Mode message 3"),
- CONSTSTR(NULL));
-
end:
- if (error) {
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_TX_FAIL,
- CONSTSTR("Initiator, Aggressive-Mode Message 3"),
- CONSTSTR("Failed to transmit Aggressive-Mode Message 3"));
- }
#ifdef ENABLE_NATT
if (natd[0])
vfree(natd[0]);
#ifdef ENABLE_NATT
if (NATT_AVAILABLE(iph1)) {
- plog(ASL_LEVEL_INFO,
+ plog(ASL_LEVEL_NOTICE,
"Selected NAT-T version: %s\n",
vid_string_by_id(iph1->natt_options->version));
ike_session_update_natt_version(iph1);
fsm_set_state(&iph1->status, IKEV1_STATE_AGG_R_MSG1RCVD);
error = 0;
-
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_RX_SUCC,
- CONSTSTR("Responder, Aggressive-Mode message 1"),
- CONSTSTR(NULL));
-
end:
- if (error) {
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_RX_FAIL,
- CONSTSTR("Responder, Aggressive-Mode Message 1"),
- CONSTSTR("Failed to process Aggressive-Mode Message 1"));
- }
-
if (pbuf)
vfree(pbuf);
if (error) {
vid_natt = set_vendorid(iph1->natt_options->version);
/* generate NAT-D payloads */
- plog (ASL_LEVEL_INFO, "Adding remote and local NAT-D payloads.\n");
+ plog (ASL_LEVEL_NOTICE, "Adding remote and local NAT-D payloads.\n");
if ((natd[0] = natt_hash_addr (iph1, iph1->remote)) == NULL) {
plog(ASL_LEVEL_ERR,
"NAT-D hashing failed for %s\n", saddr2str((struct sockaddr *)iph1->remote));
#ifdef ENABLE_HYBRID
if (iph1->mode_cfg->flags & ISAKMP_CFG_VENDORID_XAUTH) {
- plog (ASL_LEVEL_INFO, "Adding xauth VID payload.\n");
+ plog (ASL_LEVEL_NOTICE, "Adding xauth VID payload.\n");
if ((xauth_vid = set_vendorid(VENDORID_XAUTH)) == NULL) {
plog(ASL_LEVEL_ERR,
"Cannot create Xauth vendor ID\n");
#endif
error = 0;
-
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_TX_SUCC,
- CONSTSTR("Responder, Aggressive-Mode message 2"),
- CONSTSTR(NULL));
-
end:
- if (error) {
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_TX_FAIL,
- CONSTSTR("Responder, Aggressive-Mode Message 2"),
- CONSTSTR("Failed to process Aggressive-Mode Message 2"));
- }
if (cr)
vfree(cr);
#ifdef ENABLE_HYBRID
natd_verified = natt_compare_addr_hash (iph1,
natd_received, natd_seq++);
- plog (ASL_LEVEL_INFO, "NAT-D payload #%d %s\n",
+ plog (ASL_LEVEL_NOTICE, "NAT-D payload #%d %s\n",
natd_seq - 1,
natd_verified ? "verified" : "doesn't match");
#ifdef ENABLE_NATT
if (NATT_AVAILABLE(iph1))
- plog (ASL_LEVEL_INFO, "NAT %s %s%s\n",
+ plog (ASL_LEVEL_NOTICE, "NAT %s %s%s\n",
iph1->natt_flags & NAT_DETECTED ?
"detected:" : "not detected",
iph1->natt_flags & NAT_DETECTED_ME ? "ME " : "",
/* validate authentication value */
ptype = oakley_validate_auth(iph1);
if (ptype != 0) {
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKEV1_PH1_AUTH_FAIL,
- CONSTSTR("Responder, Aggressive-Mode Message 3"),
- CONSTSTR("Failed to authenticate Aggressive-Mode Message 3"));
if (ptype == -1) {
/* message printed inner oakley_validate_auth() */
goto end;
isakmp_info_send_n1(iph1, ptype, NULL);
goto end;
}
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKEV1_PH1_AUTH_SUCC,
- CONSTSTR("Responder, Aggressive-Mode Message 3"),
- CONSTSTR(NULL));
-
fsm_set_state(&iph1->status, IKEV1_STATE_AGG_R_MSG3RCVD);
error = 0;
-
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_RX_SUCC,
- CONSTSTR("Responder, Aggressive-Mode message 3"),
- CONSTSTR(NULL));
-
end:
- if (error) {
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKE_PACKET_RX_FAIL,
- CONSTSTR("Responder, Aggressive-Mode Message 3"),
- CONSTSTR("Failed to process Aggressive-Mode Message 3"));
- }
if (pbuf)
vfree(pbuf);
if (msg)
iph1->flags |= ISAKMP_FLAG_E;
fsm_set_state(&iph1->status, IKEV1_STATE_PHASE1_ESTABLISHED);
-
- IPSECSESSIONTRACEREVENT(iph1->parent_session,
- IPSECSESSIONEVENTCODE_IKEV1_PH1_RESP_SUCC,
- CONSTSTR("Responder, Aggressive-Mode"),
- CONSTSTR(NULL));
-
error = 0;
end: