WPA2 802.1X PEAPv0/EAP-MSCHAPv2

Ryan A. Krenzischek ryan at bbnx.net
Thu Apr 1 05:38:39 CEST 2010


Greetings!

I am at a road block here. I know setting up WPA2 Enterprise 
PEAPv0/EAP-MSCHAPv2 / 802.1X should be simple.  It just isn't working! 
Perhaps I am suffering from green screen syndrome :)

I have followed directions from: http://tldp.org/HOWTO/html_single/8021X-HOWTO/

Aside from mschap being in the <etcdir>/raddb/modules directory and 
needing to enable mppe, the instructions are fairly straight forward.

The certificates are generated from our certificate store.  I'm trying a 
less complicated set up before moving on to OpenLDAP/Kerberos.  During 
the build process, I made sure that OpenSSL was available.  LDD shows that 
it is linked:

# ldd /usr/local/sbin/radiusd
/usr/local/sbin/radiusd:
 	libfreeradius-radius-2.1.8.so => /usr/local/lib/freeradius-2.1.8/libfreeradius-radius-2.1.8.so (0x280b3000)
 	libcrypt.so.2 => /lib/libcrypt.so.2 (0x280d5000)
 	libltdl.so.7 => /usr/local/lib/libltdl.so.7 (0x280ed000)
 	libssl.so.5 => /usr/local/lib/libssl.so.5 (0x280f7000)
 	libcrypto.so.5 => /usr/local/lib/libcrypto.so.5 (0x2813e000)
 	libpthread.so.1 => /usr/lib/libpthread.so.1 (0x282af000)
 	libc.so.5 => /lib/libc.so.5 (0x282d3000)
 	libz.so.2 => /lib/libz.so.2 (0x283ad000)

The client computers are laptops running OpenSUSE 11.2 x86_64. 
Knetworkmanager is being used to configure the wireless security.  the 
settings are:
 	Security:		WPA/WPA2 Enterprise
 	Authentication:		Protected EAP (PEAP)
 	Anonymous Identity: 	<blank>
 	CA Certificate: 	/etc/ssl/certs/ca.pem
 	PEAP Version: 		Version 0
 	Inner Authentication: 	MSCHAPv2
 	Username: 		billgates
 	Password: 		98502

The "users" file contains:

billgates User-Password := "98502"

What I get on the test laptop in wpa_supplicant:

Associated with 00:00:00:c0:ff:ee
CTRL-EVENT-EAP-STARTED EAP Authentication started
OpenSSL: tls_connection_ca_cert - Failed to parse ca_cert_blob 
error:0D0680A8:ASN1 encoding routines: ASN1_CHECK_TLEN:wrong tag
openSSL: pending error: error:0D07803A:asn1 encoding 
routines:ASN1_ITEM_EX_D2I:nested asn1 error
TLS: Failed to set TLS connection parameters
EAP-PEAP: Failed to initialize SSL.
EAP: Failed to initialize EAP method: vendor 0 method 25 (PEAP)
CTRL-EVENT-DISCONNECTED - Disconnect Event - Remove keys
(this is repeated in the log several times)

Debug Output:

FreeRADIUS Version 2.1.8
Copyright (C) 1999-2009 The FreeRADIUS server project and contributors.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License v2.
Starting - reading configuration files ...
including configuration file /usr/local/etc/raddb/radiusd.conf
including configuration file /usr/local/etc/raddb/clients.conf
including files in directory /usr/local/etc/raddb/modules/
including configuration file /usr/local/etc/raddb/modules/acct_unique
including configuration file /usr/local/etc/raddb/modules/always
including configuration file /usr/local/etc/raddb/modules/attr_filter
including configuration file /usr/local/etc/raddb/modules/attr_rewrite
including configuration file /usr/local/etc/raddb/modules/chap
including configuration file /usr/local/etc/raddb/modules/checkval
including configuration file /usr/local/etc/raddb/modules/counter
including configuration file /usr/local/etc/raddb/modules/cui
including configuration file /usr/local/etc/raddb/modules/detail
including configuration file 
/usr/local/etc/raddb/modules/detail.example.com
including configuration file /usr/local/etc/raddb/modules/detail.log
including configuration file /usr/local/etc/raddb/modules/digest
including configuration file /usr/local/etc/raddb/modules/echo
including configuration file /usr/local/etc/raddb/modules/etc_group
including configuration file /usr/local/etc/raddb/modules/exec
including configuration file /usr/local/etc/raddb/modules/expiration
including configuration file /usr/local/etc/raddb/modules/expr
including configuration file /usr/local/etc/raddb/modules/files
including configuration file /usr/local/etc/raddb/modules/inner-eap
including configuration file /usr/local/etc/raddb/modules/ippool
including configuration file /usr/local/etc/raddb/modules/krb5
including configuration file /usr/local/etc/raddb/modules/ldap
including configuration file /usr/local/etc/raddb/modules/linelog
including configuration file /usr/local/etc/raddb/modules/logintime
including configuration file /usr/local/etc/raddb/modules/mac2ip
including configuration file /usr/local/etc/raddb/modules/mac2vlan
including configuration file /usr/local/etc/raddb/modules/mschap
including configuration file /usr/local/etc/raddb/modules/ntlm_auth
including configuration file /usr/local/etc/raddb/modules/otp
including configuration file /usr/local/etc/raddb/modules/pam
including configuration file /usr/local/etc/raddb/modules/pap
including configuration file /usr/local/etc/raddb/modules/passwd
including configuration file /usr/local/etc/raddb/modules/perl
including configuration file /usr/local/etc/raddb/modules/policy
including configuration file /usr/local/etc/raddb/modules/preprocess
including configuration file /usr/local/etc/raddb/modules/radutmp
including configuration file /usr/local/etc/raddb/modules/realm
including configuration file /usr/local/etc/raddb/modules/smbpasswd
including configuration file /usr/local/etc/raddb/modules/smsotp
including configuration file /usr/local/etc/raddb/modules/sql_log
including configuration file 
/usr/local/etc/raddb/modules/sqlcounter_expire_on_login
including configuration file /usr/local/etc/raddb/modules/sradutmp
including configuration file /usr/local/etc/raddb/modules/unix
including configuration file /usr/local/etc/raddb/modules/wimax
including configuration file /usr/local/etc/raddb/eap.conf
including configuration file /usr/local/etc/raddb/policy.conf
including files in directory /usr/local/etc/raddb/sites-enabled/
including configuration file /usr/local/etc/raddb/sites-enabled/default
including configuration file 
/usr/local/etc/raddb/sites-enabled/inner-tunnel
including configuration file 
/usr/local/etc/raddb/sites-enabled/control-socket
main {
 	user = "freeradius"
 	group = "freeradius"
 	allow_core_dumps = no
}
including dictionary file /usr/local/etc/raddb/dictionary
main {
 	prefix = "/usr/local"
 	localstatedir = "/var"
 	logdir = "/var/log"
 	libdir = "/usr/local/lib/freeradius-2.1.8"
 	radacctdir = "/var/log/radacct"
 	hostname_lookups = no
 	max_request_time = 30
 	cleanup_delay = 5
 	max_requests = 1024
 	pidfile = "/var/run/radiusd/radiusd.pid"
 	checkrad = "/usr/local/sbin/checkrad"
 	debug_level = 0
 	proxy_requests = no
  log {
 	stripped_names = no
 	auth = no
 	auth_badpass = no
 	auth_goodpass = no
  }
  security {
 	max_attributes = 200
 	reject_delay = 1
 	status_server = yes
  }
}
radiusd: #### Loading Realms and Home Servers ####
radiusd: #### Loading Clients ####
radiusd: #### Instantiating modules ####
  instantiate {
  Module: Linked to module rlm_exec
  Module: Instantiating exec
   exec {
 	wait = no
 	input_pairs = "request"
 	shell_escape = yes
   }
  Module: Linked to module rlm_expr
  Module: Instantiating expr
  Module: Linked to module rlm_expiration
  Module: Instantiating expiration
   expiration {
 	reply-message = "Password Has Expired  "
   }
  Module: Linked to module rlm_logintime
  Module: Instantiating logintime
   logintime {
 	reply-message = "You are calling outside your allowed timespan  "
 	minimum-timeout = 60
   }
  }
radiusd: #### Loading Virtual Servers ####
server inner-tunnel {
  modules {
  Module: Checking authenticate {...} for more modules to load
  Module: Linked to module rlm_pap
  Module: Instantiating pap
   pap {
 	encryption_scheme = "auto"
 	auto_header = no
   }
  Module: Linked to module rlm_chap
  Module: Instantiating chap
  Module: Linked to module rlm_mschap
  Module: Instantiating mschap
   mschap {
 	use_mppe = yes
 	require_encryption = yes
 	require_strong = yes
 	with_ntdomain_hack = no
   }
  Module: Linked to module rlm_unix
  Module: Instantiating unix
   unix {
 	radwtmp = "/var/log/radwtmp"
   }
  Module: Linked to module rlm_eap
  Module: Instantiating eap
   eap {
 	default_eap_type = "peap"
 	timer_expire = 60
 	ignore_unknown_eap_types = no
 	cisco_accounting_username_bug = no
 	max_sessions = 4096
   }
  Module: Linked to sub-module rlm_eap_md5
  Module: Instantiating eap-md5
  Module: Linked to sub-module rlm_eap_leap
  Module: Instantiating eap-leap
  Module: Linked to sub-module rlm_eap_gtc
  Module: Instantiating eap-gtc
    gtc {
 	challenge = "Password: "
 	auth_type = "PAP"
    }
  Module: Linked to sub-module rlm_eap_tls
  Module: Instantiating eap-tls
    tls {
 	rsa_key_exchange = no
 	dh_key_exchange = yes
 	rsa_key_length = 512
 	dh_key_length = 512
 	verify_depth = 0
 	pem_file_type = yes
 	private_key_file = 
"/usr/local/etc/CA/private/radius.pem"
 	certificate_file = 
"/usr/local/etc/CA/certs/radius.pem"
 	CA_file = "/usr/local/etc/CA/cacert.pem"
 	private_key_password = "1337"
 	dh_file = "/usr/local/etc/CA/certs/dh"
 	random_file = "/dev/urandom"
 	fragment_size = 1024
 	include_length = yes
 	check_crl = no
 	cipher_list = "DEFAULT"
 	make_cert_command = "/usr/local/etc/CA/certs/bootstrap"
     cache {
 	enable = no
 	lifetime = 24
 	max_entries = 255
     }
    }
  Module: Linked to sub-module rlm_eap_ttls
  Module: Instantiating eap-ttls
    ttls {
 	default_eap_type = "md5"
 	copy_request_to_tunnel = no
 	use_tunneled_reply = no
 	virtual_server = "inner-tunnel"
 	include_length = yes
    }
  Module: Linked to sub-module rlm_eap_peap
  Module: Instantiating eap-peap
    peap {
 	default_eap_type = "mschapv2"
 	copy_request_to_tunnel = no
 	use_tunneled_reply = no
 	proxy_tunneled_request_as_eap = yes
 	virtual_server = "inner-tunnel"
    }
  Module: Linked to sub-module rlm_eap_mschapv2
  Module: Instantiating eap-mschapv2
    mschapv2 {
 	with_ntdomain_hack = no
    }
  Module: Checking authorize {...} for more modules to load
  Module: Linked to module rlm_realm
  Module: Instantiating suffix
   realm suffix {
 	format = "suffix"
 	delimiter = "@"
 	ignore_default = no
 	ignore_null = no
   }
  Module: Linked to module rlm_files
  Module: Instantiating files
   files {
 	usersfile = "/usr/local/etc/raddb/users"
 	acctusersfile = "/usr/local/etc/raddb/acct_users"
 	preproxy_usersfile = "/usr/local/etc/raddb/preproxy_users"
 	compat = "no"
   }
  Module: Checking session {...} for more modules to load
  Module: Linked to module rlm_radutmp
  Module: Instantiating radutmp
   radutmp {
 	filename = "/var/log/radutmp"
 	username = "%{User-Name}"
 	case_sensitive = yes
 	check_with_nas = yes
 	perm = 384
 	callerid = yes
   }
  Module: Checking post-proxy {...} for more modules to load
  Module: Checking post-auth {...} for more modules to load
  Module: Linked to module rlm_attr_filter
  Module: Instantiating attr_filter.access_reject
   attr_filter attr_filter.access_reject {
 	attrsfile = "/usr/local/etc/raddb/attrs.access_reject"
 	key = "%{User-Name}"
   }
  } # modules
} # server
server {
  modules {
  Module: Checking authenticate {...} for more modules to load
  Module: Checking authorize {...} for more modules to load
  Module: Linked to module rlm_preprocess
  Module: Instantiating preprocess
   preprocess {
 	huntgroups = "/usr/local/etc/raddb/huntgroups"
 	hints = "/usr/local/etc/raddb/hints"
 	with_ascend_hack = no
 	ascend_channels_per_line = 23
 	with_ntdomain_hack = no
 	with_specialix_jetstream_hack = no
 	with_cisco_vsa_hack = no
 	with_alvarion_vsa_hack = no
   }
  Module: Checking preacct {...} for more modules to load
  Module: Linked to module rlm_acct_unique
  Module: Instantiating acct_unique
   acct_unique {
 	key = "User-Name, Acct-Session-Id, NAS-IP-Address, 
Client-IP-Address, NAS-Port"
   }
  Module: Checking accounting {...} for more modules to load
  Module: Linked to module rlm_detail
  Module: Instantiating detail
   detail {
 	detailfile = "/var/log/radacct/%{Client-IP-Address}/detail-%Y%m%d"
 	header = "%t"
 	detailperm = 384
 	dirperm = 493
 	locking = no
 	log_packet_header = no
   }
  Module: Instantiating attr_filter.accounting_response
   attr_filter attr_filter.accounting_response {
 	attrsfile = "/usr/local/etc/raddb/attrs.accounting_response"
 	key = "%{User-Name}"
   }
  Module: Checking session {...} for more modules to load
  Module: Checking post-proxy {...} for more modules to load
  Module: Checking post-auth {...} for more modules to load
  } # modules
} # server
radiusd: #### Opening IP addresses and Ports ####
listen {
 	type = "auth"
 	ipaddr = *
 	port = 0
 	clients = "per_socket_clients"
   client 1.2.3.4 {
 	require_message_authenticator = no
 	secret = "n0t4u2c"
 	shortname = "WLAN"
   }
}
listen {
 	type = "acct"
 	ipaddr = *
 	port = 0
}
listen {
 	type = "control"
  listen {
 	socket = "/var/run/radiusd/radiusd.sock"
  }
}
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on command file /var/run/radiusd/radiusd.sock
Ready to process requests.
rad_recv: Access-Request packet from host 1.2.3.4 port 1812, id=156, 
length=86
 	User-Name = "billgates"
 	NAS-IP-Address = 1.2.3.4
 	NAS-Port-Type = Wireless-802.11
 	Calling-Station-Id = "01-23-45-67-89-AB"
 	EAP-Message = 0x02770009017279616e
 	Message-Authenticator = 0x124bad1be78335e5345ac1235dd5a0f2
+- entering group authorize {...}
++[preprocess] returns ok
++[chap] returns noop
++[mschap] returns noop
[suffix] No '@' in User-Name = "billgates", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
[eap] EAP packet type response id 119 length 9
[eap] No EAP Start, assuming it's an on-going EAP conversation
++[eap] returns updated
++[unix] returns updated
[files] users: Matched entry billgates at line 206
++[files] returns ok
++[expiration] returns noop
++[logintime] returns noop
[pap] Found existing Auth-Type, not changing it.
++[pap] returns noop
Found Auth-Type = EAP
+- entering group authenticate {...}
[eap] EAP Identity
[eap] processing type tls
[tls] Initiate
[tls] Start returned 1
++[eap] returns handled
Sending Access-Challenge of id 156 to 1.2.3.4 port 1812
 	EAP-Message = 0x017800061920
 	Message-Authenticator = 0x00000000000000000000000000000000
 	State = 0x80109fb1806886dec5fe36c0b7659309
Finished request 2.
Going to the next request
Waking up in 4.9 seconds.
rad_recv: Access-Request packet from host 1.2.3.4 port 1812, id=157, 
length=101
 	User-Name = "billgates"
 	NAS-IP-Address = 1.2.3.4
 	NAS-Port-Type = Wireless-802.11
 	Calling-Station-Id = "01-23-45-67-89-AB"
 	State = 0x80109fb1806886dec5fe36c0b7659309
 	EAP-Message = 0x027800060300
 	Message-Authenticator = 0x5acdbbd8d404e0ff100969933c8254b3
+- entering group authorize {...}
++[preprocess] returns ok
++[chap] returns noop
++[mschap] returns noop
[suffix] No '@' in User-Name = "billgates", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
[eap] EAP packet type response id 120 length 6
[eap] No EAP Start, assuming it's an on-going EAP conversation
++[eap] returns updated
++[unix] returns updated
[files] users: Matched entry billgates at line 206
++[files] returns ok
++[expiration] returns noop
++[logintime] returns noop
[pap] Found existing Auth-Type, not changing it.
++[pap] returns noop
Found Auth-Type = EAP
+- entering group authenticate {...}
[eap] Request found, released from the list
[eap] EAP NAK
[eap] NAK asked for bad type 0
[eap] Failed in EAP select
++[eap] returns invalid
Failed to authenticate the user.
Using Post-Auth-Type Reject
+- entering group REJECT {...}
[attr_filter.access_reject] 	expand: %{User-Name} -> billgates
  attr_filter: Matched entry DEFAULT at line 11
++[attr_filter.access_reject] returns updated
Delaying reject of request 3 for 1 seconds
Going to the next request
Waking up in 0.9 seconds.
Sending delayed reject for request 3
Sending Access-Reject of id 157 to 1.2.3.4 port 1812
 	EAP-Message = 0x04780004
 	Message-Authenticator = 0x00000000000000000000000000000000
Waking up in 3.9 seconds.
Cleaning up request 2 ID 156 with timestamp +74
Waking up in 0.9 seconds.
Cleaning up request 3 ID 157 with timestamp +74
Ready to process requests.


TIA,

Ryan



More information about the Freeradius-Users mailing list