ported EAP-AKA branch into trunk
This commit is contained in:
+10
-1
@@ -250,7 +250,16 @@ AC_ARG_ENABLE(
|
|||||||
eap_md5=true
|
eap_md5=true
|
||||||
fi]
|
fi]
|
||||||
)
|
)
|
||||||
AM_CONDITIONAL(BUILD_EAP_MD5, test x$eap_md5 = xtrue)
|
AM_CONDITIONAL(USE_EAP_MD5, test x$eap_md5 = xtrue)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(
|
||||||
|
[eap-aka],
|
||||||
|
AS_HELP_STRING([--enable-eap-aka],[build AKA authentication module for EAP (default is NO).]),
|
||||||
|
[if test x$enableval = xyes; then
|
||||||
|
eap_aka=true
|
||||||
|
fi]
|
||||||
|
)
|
||||||
|
AM_CONDITIONAL(USE_EAP_AKA, test x$eap_aka = xtrue)
|
||||||
|
|
||||||
AC_ARG_ENABLE(
|
AC_ARG_ENABLE(
|
||||||
[nat-transport],
|
[nat-transport],
|
||||||
|
|||||||
+3
-4
@@ -4,14 +4,13 @@ if USE_FILE_CONFIG
|
|||||||
SUBDIRS += libfreeswan starter ipsec _copyright
|
SUBDIRS += libfreeswan starter ipsec _copyright
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if USE_PLUTO
|
|
||||||
SUBDIRS += libcrypto pluto whack
|
|
||||||
endif
|
|
||||||
|
|
||||||
if USE_LIBSTRONGSWAN
|
if USE_LIBSTRONGSWAN
|
||||||
SUBDIRS += libstrongswan
|
SUBDIRS += libstrongswan
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if USE_PLUTO
|
||||||
|
SUBDIRS += libcrypto pluto whack
|
||||||
|
endif
|
||||||
if USE_CHARON
|
if USE_CHARON
|
||||||
SUBDIRS += charon
|
SUBDIRS += charon
|
||||||
endif
|
endif
|
||||||
|
|||||||
+10
-4
@@ -128,10 +128,16 @@ if USE_EAP_SIM
|
|||||||
libcharon_eapsim_la_LDFLAGS = -module
|
libcharon_eapsim_la_LDFLAGS = -module
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if BUILD_EAP_MD5
|
if USE_EAP_MD5
|
||||||
eap_LTLIBRARIES += libeapmd5.la
|
eap_LTLIBRARIES += libcharon-eapmd5.la
|
||||||
libeapmd5_la_SOURCES = sa/authenticators/eap/eap_md5.h sa/authenticators/eap/eap_md5.c
|
libcharon_eapmd5_la_SOURCES = sa/authenticators/eap/eap_md5.h sa/authenticators/eap/eap_md5.c
|
||||||
libeapmd5_la_LDFLAGS = -module
|
libcharon_eapmd5_la_LDFLAGS = -module
|
||||||
|
endif
|
||||||
|
|
||||||
|
if USE_EAP_AKA
|
||||||
|
eap_LTLIBRARIES += libcharon-eapaka.la
|
||||||
|
libcharon_eapaka_la_SOURCES = sa/authenticators/eap/eap_aka.h sa/authenticators/eap/eap_aka.c
|
||||||
|
libcharon_eapaka_la_LDFLAGS = -module
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# build backends
|
# build backends
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,141 @@
|
|||||||
|
/**
|
||||||
|
* @file eap_aka.h
|
||||||
|
*
|
||||||
|
* @brief Interface of eap_aka_t.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2006 Martin Willi
|
||||||
|
* Hochschule fuer Technik Rapperswil
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EAP_AKA_H_
|
||||||
|
#define EAP_AKA_H_
|
||||||
|
|
||||||
|
typedef struct eap_aka_t eap_aka_t;
|
||||||
|
typedef enum aka_subtype_t aka_subtype_t;
|
||||||
|
typedef enum aka_attribute_t aka_attribute_t;
|
||||||
|
|
||||||
|
#include <sa/authenticators/eap/eap_method.h>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subtypes of AKA messages
|
||||||
|
*/
|
||||||
|
enum aka_subtype_t {
|
||||||
|
AKA_CHALLENGE = 1,
|
||||||
|
AKA_AUTHENTICATION_REJECT = 2,
|
||||||
|
AKA_SYNCHRONIZATION_FAILURE = 4,
|
||||||
|
AKA_IDENTITY = 5,
|
||||||
|
AKA_NOTIFICATION = 12,
|
||||||
|
AKA_REAUTHENTICATION = 13,
|
||||||
|
AKA_CLIENT_ERROR = 14,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum names for aka_subtype_t
|
||||||
|
*/
|
||||||
|
extern enum_name_t *aka_subtype_names;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attribute types in AKA messages
|
||||||
|
*/
|
||||||
|
enum aka_attribute_t {
|
||||||
|
/** defines the end of attribute list */
|
||||||
|
AT_END = -1,
|
||||||
|
AT_RAND = 1,
|
||||||
|
AT_AUTN = 2,
|
||||||
|
AT_RES = 3,
|
||||||
|
AT_AUTS = 4,
|
||||||
|
AT_PADDING = 6,
|
||||||
|
AT_NONCE_MT = 7,
|
||||||
|
AT_PERMANENT_ID_REQ = 10,
|
||||||
|
AT_MAC = 11,
|
||||||
|
AT_NOTIFICATION = 12,
|
||||||
|
AT_ANY_ID_REQ = 13,
|
||||||
|
AT_IDENTITY = 14,
|
||||||
|
AT_VERSION_LIST = 15,
|
||||||
|
AT_SELECTED_VERSION = 16,
|
||||||
|
AT_FULLAUTH_ID_REQ = 17,
|
||||||
|
AT_COUNTER = 19,
|
||||||
|
AT_COUNTER_TOO_SMALL = 20,
|
||||||
|
AT_NONCE_S = 21,
|
||||||
|
AT_CLIENT_ERROR_CODE = 22,
|
||||||
|
AT_IV = 129,
|
||||||
|
AT_ENCR_DATA = 130,
|
||||||
|
AT_NEXT_PSEUDONYM = 132,
|
||||||
|
AT_NEXT_REAUTH_ID = 133,
|
||||||
|
AT_CHECKCODE = 134,
|
||||||
|
AT_RESULT_IND = 135,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum names for aka_attribute_t
|
||||||
|
*/
|
||||||
|
extern enum_name_t *aka_attribute_names;
|
||||||
|
|
||||||
|
/** check SEQ values as client for validity, disabled by default */
|
||||||
|
#ifndef SEQ_CHECK
|
||||||
|
# define SEQ_CHECK 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Implementation of the eap_method_t interface using EAP-AKA.
|
||||||
|
*
|
||||||
|
* EAP-AKA uses 3rd generation mobile phone standard authentication
|
||||||
|
* mechanism for authentication. It is a mutual authentication
|
||||||
|
* mechanism which establishs a shared key and therefore supports EAP_ONLY
|
||||||
|
* authentication. This implementation follows the standard of the
|
||||||
|
* 3GPP2 (S.S0055) and not the one of 3GGP.
|
||||||
|
* The shared key used for authentication is from ipsec.secrets. The
|
||||||
|
* peers ID is used to query it.
|
||||||
|
* The AKA mechanism uses sequence numbers to detect replay attacks. The
|
||||||
|
* peer stores the sequence number normally in a USIM and accepts
|
||||||
|
* incremental sequence numbers (incremental for lifetime of the USIM). To
|
||||||
|
* prevent a complex sequence number management, this implementation uses
|
||||||
|
* a sequence number derived from time. It is initialized to the startup
|
||||||
|
* time of the daemon. As long as the (UTC) time of the system is not
|
||||||
|
* turned back while the daemon is not running, this method is secure.
|
||||||
|
* To enable time based SEQs, #define SEQ_CHECK as 1. Default is to accept
|
||||||
|
* any SEQ numbers. This allows an attacker to do replay attacks. But since
|
||||||
|
* the server has proven his identity via IKE, such an attack is only
|
||||||
|
* possible between server and AAA (if any).
|
||||||
|
*
|
||||||
|
* @b Constructors:
|
||||||
|
* - eap_aka_create()
|
||||||
|
* - eap_client_create() using eap_method EAP_AKA
|
||||||
|
*
|
||||||
|
* @ingroup eap
|
||||||
|
*/
|
||||||
|
struct eap_aka_t {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented eap_method_t interface.
|
||||||
|
*/
|
||||||
|
eap_method_t eap_method_interface;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Creates the EAP method EAP-AKA.
|
||||||
|
*
|
||||||
|
* @param server ID of the EAP server
|
||||||
|
* @param peer ID of the EAP client
|
||||||
|
* @return eap_aka_t object
|
||||||
|
*
|
||||||
|
* @ingroup eap
|
||||||
|
*/
|
||||||
|
eap_aka_t *eap_create(eap_role_t role,
|
||||||
|
identification_t *server, identification_t *peer);
|
||||||
|
|
||||||
|
#endif /* EAP_AKA_H_ */
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
The roadwarrior <b>carol</b> sets up a connection to gateway <b>moon</b>.
|
||||||
|
<b>carol</b> uses the <i>Extensible Authentication Protocol</i>
|
||||||
|
in association with the <i>Authentication and Key Agreement</i> protocol
|
||||||
|
(<b>EAP-AKA</b>) to authenticate against the gateway. This protocol is used
|
||||||
|
in UMTS, but here a secret from ipsec.secrets is used instead of a USIM/(R)UIM.
|
||||||
|
Gateway <b>moon</b> additionaly uses an RSA signature to authenticate itself
|
||||||
|
against <b>carol</b>.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
carol::cat /var/log/daemon.log::authentication of '@moon.strongswan.org' with RSA signature successful::YES
|
||||||
|
carol::cat /var/log/daemon.log::authentication of '@moon.strongswan.org' with EAP successful::YES
|
||||||
|
moon::cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
||||||
|
moon::ipsec statusall::rw-eapaka.*ESTABLISHED::YES
|
||||||
|
carol::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
|
||||||
|
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=eap
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_CAROL
|
||||||
|
leftnexthop=%direct
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
rightsendcert=never
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
[email protected] : PSK "Ar3etTnp01qlpOgb"
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
strictcrlpolicy=no
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
|
||||||
|
conn rw-eapaka
|
||||||
|
authby=rsasig
|
||||||
|
eap=aka
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
[email protected]
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
leftfirewall=yes
|
||||||
|
rightid=*@strongswan.org
|
||||||
|
right=%any
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
: RSA moonKey.pem
|
||||||
|
|
||||||
|
[email protected] : PSK "Ar3etTnp01qlpOgb"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
carol::ipsec stop
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
moon::echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
carol::sleep 1
|
||||||
|
carol::ipsec up home
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# This configuration file provides information on the
|
||||||
|
# UML instances used for this test
|
||||||
|
|
||||||
|
# All UML instances that are required for this test
|
||||||
|
#
|
||||||
|
UMLHOSTS="alice carol moon"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-m-c.png"
|
||||||
|
|
||||||
|
# UML instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="moon"
|
||||||
|
|
||||||
|
# UML instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol"
|
||||||
Reference in New Issue
Block a user