Hey all,

I’m trying to run a road warrior setup on OpenBSD 5.6-current with an IOS8 
device, but I’m running into problems. For simplicity I’ve created the vpn 
server on my local network without a firewall. But somehow the sa_state doesn’t 
get passed to 0x1f. So basically it’s missing ‘cert’ in the authentication 
procedure, so what’s ‘cert' about? As far as I can tell the client does 
authenticate itself with it’s certificate and seems to be valid. And the local 
cert with ca is loaded at start.

I’ve setup the certificates this way:
ikectl ca vpn create 
ikectl ca vpn install
ikectl ca vpn certificate 10.0.0.132 create
ikectl ca vpn certificate 10.0.0.132 install
ikectl ca vpn certificate roadwarrior create
ikectl ca vpn certificate roadwarrior export

Installed roadwarrior.pfx and ca.crt and configured with the correct sa 
settings on the iphone.
 
Here is my iked.conf:
ikev2 roadwarrior passive esp \
        from 0.0.0.0/0 to 172.16.99.2 local 10.0.0.132 peer 0.0.0.0/0 \
        ikesa auth hmac-sha2-256 enc aes-128 prf hmac-sha2-256 group modp1024 \
        childsa auth hmac-sha2-256 enc aes-128 prf hmac-sha2-256 group modp1024 
\
        srcid 10.0.0.132 \
        config address 172.16.99.2

Log from iked:
#  /sbin/iked -dvv   
ca_privkey_serialize: type RSA_KEY length 1191
ca_pubkey_serialize: type RSA_KEY length 270
/etc/iked.conf: loaded 1 configuration rules
ca_reload: loaded ca file ca.crt
ca_reload: loaded crl file ca.crl
config_getpolicy: received policy
ca_reload: /C=NL/ST=xxx/L=xxx/O=xxxxxx/OU=IPSec/CN=VPN 
CA/[email protected]
ikev2ca_reload: loaded 1 ca certificate
 "roadwarrior"ca_reload: loaded cert file 10.0.0.132.crt
 passiveca_validate_cert: 
/C=NL/ST=xxx/L=xxx/O=xxxxxx/OU=IPSec/CN=10.0.0.132/[email protected] 
ok
 espca_reload: local cert type X509_CERT
 inetconfig_getocsp: ocsp_url none
 from 0.0.0.0/0 to 172.16.99.2 local 10.0.0.132 peer 0.0.0.0/0 ikesa enc 
aes-128 prf hmac-sha2-256 auth hmac-sha2-256 group modp1024 childsa enc aes-128 
auth hmac-sha2-256 group modp1024 srcid 10.0.0.132 lifetime 10800 bytes 
536870912 rsa config address 172.16.99.2
config_getpfkey: received pfkey fd 3
config_getcompile: compilation done
config_getsocket: received socket fd 4
config_getsocket: received socket fd 5
ikev2_dispatch_cert: updated local CERTREQ type X509_CERT length 20
ikev2_dispatch_cert: updated local CERTREQ type X509_CERT length 20
config_getsocket: received socket fd 7
config_getsocket: received socket fd 8
ikev2_recv: IKE_SA_INIT request from initiator 10.0.0.102:500 to 10.0.0.132:500 
policy 'roadwarrior' id 0, 288 bytes
ikev2_recv: ispi 0x1f4a1989390c27a7 rspi 0x0000000000000000
ikev2_policy2id: srcid IPV4/10.0.0.132 length 8
ikev2_pld_parse: header ispi 0x1f4a1989390c27a7 rspi 0x0000000000000000 
nextpayload SA version 0x20 exchange IKE_SA_INIT flags 0x08 msgid 0 length 288 
response 0
ikev2_pld_payloads: payload SA nextpayload KE critical 0x00 length 48
ikev2_pld_sa: more 0 reserved 0 length 44 proposal #1 protoid IKE spisize 0 
xforms 4 spi 0
ikev2_pld_xform: more 3 reserved 0 length 12 type ENCR id AES_CBC
ikev2_pld_attr: attribute type KEY_LENGTH length 128 total 4
ikev2_pld_xform: more 3 reserved 0 length 8 type PRF id HMAC_SHA2_256
ikev2_pld_xform: more 3 reserved 0 length 8 type INTEGR id HMAC_SHA2_256_128
ikev2_pld_xform: more 0 reserved 0 length 8 type DH id MODP_1024
ikev2_pld_payloads: payload KE nextpayload NONCE critical 0x00 length 136
ikev2_pld_ke: dh group MODP_1024 reserved 0
ikev2_pld_payloads: payload NONCE nextpayload NOTIFY critical 0x00 length 20
ikev2_pld_payloads: payload NOTIFY nextpayload NOTIFY critical 0x00 length 28
ikev2_pld_notify: protoid NONE spisize 0 type NAT_DETECTION_SOURCE_IP
ikev2_nat_detection: peer source 0x1f4a1989390c27a7 0x0000000000000000 
10.0.0.102:500
ikev2_pld_payloads: payload NOTIFY nextpayload NONE critical 0x00 length 28
ikev2_pld_notify: protoid NONE spisize 0 type NAT_DETECTION_DESTINATION_IP
ikev2_nat_detection: peer destination 0x1f4a1989390c27a7 0x0000000000000000 
10.0.0.132:500
sa_state: INIT -> SA_INIT
ikev2_sa_negotiate: score 4
sa_stateok: SA_INIT flags 0x00, require 0x00 
sa_stateflags: 0x00 -> 0x10 sa (required 0x00 )
ikev2_sa_keys: SKEYSEED with 32 bytes
ikev2_sa_keys: S with 64 bytes
ikev2_prfplus: T1 with 32 bytes
ikev2_prfplus: T2 with 32 bytes
ikev2_prfplus: T3 with 32 bytes
ikev2_prfplus: T4 with 32 bytes
ikev2_prfplus: T5 with 32 bytes
ikev2_prfplus: T6 with 32 bytes
ikev2_prfplus: Tn with 192 bytes
ikev2_sa_keys: SK_d with 32 bytes
ikev2_sa_keys: SK_ai with 32 bytes
ikev2_sa_keys: SK_ar with 32 bytes
ikev2_sa_keys: SK_ei with 16 bytes
ikev2_sa_keys: SK_er with 16 bytes
ikev2_sa_keys: SK_pi with 32 bytes
ikev2_sa_keys: SK_pr with 32 bytes
ikev2_add_proposals: length 44
ikev2_next_payload: length 48 nextpayload KE
ikev2_next_payload: length 136 nextpayload NONCE
ikev2_next_payload: length 36 nextpayload NOTIFY
ikev2_nat_detection: local source 0x1f4a1989390c27a7 0xfd14d116d2dbdddf 
10.0.0.132:500
ikev2_next_payload: length 28 nextpayload NOTIFY
ikev2_nat_detection: local destination 0x1f4a1989390c27a7 0xfd14d116d2dbdddf 
10.0.0.102:500
ikev2_next_payload: length 28 nextpayload CERTREQ
ikev2_add_certreq: type X509_CERT length 21
ikev2_next_payload: length 25 nextpayload NONE
ikev2_pld_parse: header ispi 0x1f4a1989390c27a7 rspi 0xfd14d116d2dbdddf 
nextpayload SA version 0x20 exchange IKE_SA_INIT flags 0x20 msgid 0 length 329 
response 1
ikev2_pld_payloads: payload SA nextpayload KE critical 0x00 length 48
ikev2_pld_sa: more 0 reserved 0 length 44 proposal #1 protoid IKE spisize 0 
xforms 4 spi 0
ikev2_pld_xform: more 3 reserved 0 length 12 type ENCR id AES_CBC
ikev2_pld_attr: attribute type KEY_LENGTH length 128 total 4
ikev2_pld_xform: more 3 reserved 0 length 8 type PRF id HMAC_SHA2_256
ikev2_pld_xform: more 3 reserved 0 length 8 type INTEGR id HMAC_SHA2_256_128
ikev2_pld_xform: more 0 reserved 0 length 8 type DH id MODP_1024
ikev2_pld_payloads: payload KE nextpayload NONCE critical 0x00 length 136
ikev2_pld_ke: dh group MODP_1024 reserved 0
ikev2_pld_payloads: payload NONCE nextpayload NOTIFY critical 0x00 length 36
ikev2_pld_payloads: payload NOTIFY nextpayload NOTIFY critical 0x00 length 28
ikev2_pld_notify: protoid NONE spisize 0 type NAT_DETECTION_SOURCE_IP
ikev2_pld_payloads: payload NOTIFY nextpayload CERTREQ critical 0x00 length 28
ikev2_pld_notify: protoid NONE spisize 0 type NAT_DETECTION_DESTINATION_IP
ikev2_pld_payloads: payload CERTREQ nextpayload NONE critical 0x00 length 25
ikev2_pld_certreq: type X509_CERT length 20
ikev2_msg_send: IKE_SA_INIT response from 10.0.0.132:500 to 10.0.0.102:500 
msgid 0, 329 bytes
config_free_proposals: free 0x2c8ac5700
ikev2_recv: IKE_AUTH request from initiator 10.0.0.102:500 to 10.0.0.132:500 
policy 'roadwarrior' id 1, 1632 bytes
ikev2_recv: ispi 0x1f4a1989390c27a7 rspi 0xfd14d116d2dbdddf
ikev2_recv: updated SA to peer 10.0.0.102:500 local 10.0.0.132:500
ikev2_pld_parse: header ispi 0x1f4a1989390c27a7 rspi 0xfd14d116d2dbdddf 
nextpayload SK version 0x20 exchange IKE_AUTH flags 0x08 msgid 1 length 1632 
response 0
ikev2_pld_payloads: payload SK nextpayload IDi critical 0x00 length 1604
ikev2_msg_decrypt: IV length 16
ikev2_msg_decrypt: encrypted payload length 1568
ikev2_msg_decrypt: integrity checksum length 16
ikev2_msg_decrypt: integrity check succeeded
ikev2_msg_decrypt: decrypted payload length 1568/1568 padding 16
ikev2_pld_payloads: decrypted payload IDi nextpayload NOTIFY critical 0x00 
length 19
ikev2_pld_id: id FQDN/roadwarrior length 15
ikev2_pld_payloads: decrypted payload NOTIFY nextpayload IDr critical 0x00 
length 8
ikev2_pld_notify: protoid NONE spisize 0 type INITIAL_CONTACT
ikev2_pld_payloads: decrypted payload IDr nextpayload AUTH critical 0x00 length 
12
ikev2_pld_id: id IPV4/10.0.0.132 length 8
ikev2_pld_id: unexpected id payload
ikev2_pld_payloads: decrypted payload AUTH nextpayload CERT critical 0x00 
length 264
ikev2_pld_auth: method RSA_SIG length 256
sa_state: SA_INIT -> AUTH_REQUEST
ikev2_pld_payloads: decrypted payload CERT nextpayload CP critical 0x00 length 
1024
ikev2_pld_cert: type X509_CERT length 1019
ikev2_pld_payloads: decrypted payload CP nextpayload NOTIFY critical 0x00 
length 36
ikev2_pld_cp: type REQUEST length 28
ikev2_pld_cp: INTERNAL_IP4_ADDRESS 0x0001 length 0
ikev2_pld_cp: INTERNAL_IP4_DHCP 0x0006 length 0
ikev2_pld_cp: INTERNAL_IP4_DNS 0x0003 length 0
ikev2_pld_cp: INTERNAL_IP4_NETMASK 0x0002 length 0
ikev2_pld_cp: INTERNAL_IP6_ADDRESS 0x0008 length 0
ikev2_pld_cp: INTERNAL_IP6_DHCP 0x000c length 0
ikev2_pld_cp: INTERNAL_IP6_DNS 0x000a length 0
ikev2_pld_payloads: decrypted payload NOTIFY nextpayload NOTIFY critical 0x00 
length 8
ikev2_pld_notify: protoid NONE spisize 0 type ESP_TFC_PADDING_NOT_SUPPORTED
ikev2_pld_payloads: decrypted payload NOTIFY nextpayload SA critical 0x00 
length 8
ikev2_pld_notify: protoid NONE spisize 0 type NON_FIRST_FRAGMENTS_ALSO
ikev2_pld_payloads: decrypted payload SA nextpayload TSi critical 0x00 length 44
ikev2_pld_sa: more 0 reserved 0 length 40 proposal #1 protoid ESP spisize 4 
xforms 3 spi 0x095a5a5c
ikev2_pld_xform: more 3 reserved 0 length 12 type ENCR id AES_CBC
ikev2_pld_attr: attribute type KEY_LENGTH length 128 total 4
ikev2_pld_xform: more 3 reserved 0 length 8 type INTEGR id HMAC_SHA2_256_128
ikev2_pld_xform: more 0 reserved 0 length 8 type ESN id NONE
ikev2_pld_payloads: decrypted payload TSi nextpayload TSr critical 0x00 length 
64
ikev2_pld_ts: count 2 length 56
ikev2_pld_ts: type IPV4_ADDR_RANGE protoid 0 length 16 startport 0 endport 65535
ikev2_pld_ts: start 0.0.0.0 end 255.255.255.255
ikev2_pld_ts: type IPV6_ADDR_RANGE protoid 0 length 40 startport 0 endport 65535
ikev2_pld_ts: start :: end ff:ff:ff:ff:ff:ff:ff:ff
ikev2_pld_payloads: decrypted payload TSr nextpayload NONE critical 0x00 length 
64
ikev2_pld_ts: count 2 length 56
ikev2_pld_ts: type IPV4_ADDR_RANGE protoid 0 length 16 startport 0 endport 65535
ikev2_pld_ts: start 0.0.0.0 end 255.255.255.255
ikev2_pld_ts: type IPV6_ADDR_RANGE protoid 0 length 40 startport 0 endport 65535
ikev2_pld_ts: start :: end ff:ff:ff:ff:ff:ff:ff:ff
sa_stateok: SA_INIT flags 0x00, require 0x00 
policy_lookup: peerid 'roadwarrior'
ikev2_msg_auth: responder auth data length 377
ca_setauth: auth length 377
ikev2_msg_auth: initiator auth data length 352
ikev2_msg_authverify: method RSA_SIG keylen 1019 type X509_CERT
ikev2_msg_authverify: authentication successful
sa_state: AUTH_REQUEST -> AUTH_SUCCESS
sa_stateflags: 0x10 -> 0x18 authvalid,sa (required 0x1f 
cert,certvalid,auth,authvalid,sa)
ikev2_sa_negotiate: score 4
sa_stateflags: 0x18 -> 0x18 authvalid,sa (required 0x1f 
cert,certvalid,auth,authvalid,sa)
sa_stateok: VALID flags 0x18, require 0x1f cert,certvalid,auth,authvalid,sa
sa_state: cannot switch: AUTH_SUCCESS -> VALID
config_free_proposals: free 0x253412600
ca_setauth: auth length 256
ca_x509_subjectaltname: FQDN/roadwarrior
ca_validate_cert: 
/C=NL/ST=xxx/L=xxx/O=xxxxxx/OU=IPSec/CN=roadwarrior/[email protected] 
ok
ikev2_getimsgdata: imsg 23 rspi 0xfd14d116d2dbdddf ispi 0x1f4a1989390c27a7 
initiator 0 sa valid type 1 data length 256
ikev2_dispatch_cert: AUTH type 1 len 256
sa_stateflags: 0x18 -> 0x1c auth,authvalid,sa (required 0x1f 
cert,certvalid,auth,authvalid,sa)
sa_stateok: VALID flags 0x1c, require 0x1f cert,certvalid,auth,authvalid,sa
sa_state: cannot switch: AUTH_SUCCESS -> VALID
ikev2_dispatch_cert: peer certificate is valid
sa_stateflags: 0x1c -> 0x1e certvalid,auth,authvalid,sa (required 0x1f 
cert,certvalid,auth,authvalid,sa)
sa_stateok: VALID flags 0x1e, require 0x1f cert,certvalid,auth,authvalid,sa
sa_state: cannot switch: AUTH_SUCCESS -> VALID
ikev2_recv: IKE_AUTH request from initiator 10.0.0.102:500 to 10.0.0.132:500 
policy 'roadwarrior' id 1, 1632 bytes
ikev2_recv: ispi 0x1f4a1989390c27a7 rspi 0xfd14d116d2dbdddf
ikev2_recv: IKE_AUTH request from initiator 10.0.0.102:500 to 10.0.0.132:500 
policy 'roadwarrior' id 1, 1632 bytes
ikev2_recv: ispi 0x1f4a1989390c27a7 rspi 0xfd14d116d2dbdddf
ikev2_recv: IKE_AUTH request from initiator 10.0.0.102:500 to 10.0.0.132:500 
policy 'roadwarrior' id 1, 1632 bytes
ikev2_recv: ispi 0x1f4a1989390c27a7 rspi 0xfd14d116d2dbdddf

I’ve tried the same setup on 5.5, but with same results. I hope somebody can 
help me out and tell me what ike actually expects with ‘cert’? Thanks!

Regards,

René

Reply via email to