| /////////////////////////////////////////////////////////////////////////////// |
| // |
| // Copyright (c) 2000-2018 Ericsson Telecom AB |
| // |
| // All rights reserved. This program and the accompanying materials |
| // are made available under the terms of the Eclipse Public License v2.0 |
| // which accompanies this distribution, and is available at |
| // https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html |
| ///////////////////////////////////////////////////////////////////////////////
|
| //
|
| // File: EAP_Types.ttcn
|
| // Rev: R6A |
| // Prodnr: CNL 113 722
|
| // Updated: 2014-01-24
|
| // Contact: http://ttcn.ericsson.se
|
| // Reference: RFC 3748(Extensible Authentication Protocol)
|
| // RFC 4187(EAP-AKA)
|
| // RFC 5448(EAP-AKA')
|
| // RFC 4186(EAP-SIM)
|
| // RFC 5281(EAP-TTLS)
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
| module EAP_Types
|
| {
|
|
|
| external function enc_PDU_EAP(in PDU_EAP pdu) return octetstring;
|
|
|
| external function dec_PDU_EAP(in octetstring stream) return PDU_EAP;
|
|
|
| external function enc_AKA_Attrib(in EAP_AKA_Attrib_List pdu) return octetstring;
|
|
|
| external function dec_AKA_Attrib(in octetstring stream) return EAP_AKA_Attrib_List;
|
|
|
|
|
| external function eap_sim_derive_mk(octetstring identity,octetstring nonce_mt,integer selected_version,octetstring ver_list,octetstring kc) return octetstring;
|
| external function fips186_2_prf(octetstring input) return octetstring;
|
|
|
| external function eap_aka_derive_mk(octetstring identity,octetstring ik,octetstring ck) return octetstring; |
| external function eap_aka_derive_reauth_msk_emsk(octetstring identity,octetstring counter,octetstring nonce_s,octetstring mk) return octetstring;
|
|
|
| //external function eap_aka_prime_derive_keys(octetstring identity,integer len,octetstring ik,octetstring ck,octetstring k_encr,octetstring k_aut, octetstring k_re, octetstring msk, octetstring emsk);
|
| external function eap_akaprime_derive_mk(octetstring identity,octetstring ik,octetstring ck) return octetstring;
|
| external function Calculate_AT_CheckCode(octetstring rcveap,octetstring sendeap) return octetstring;
|
| external function f_calc_Kaut(in octetstring input,inout octetstring kencr) return octetstring;
|
| external function f_calc_AKA_Keys(in octetstring pl_eap_identity, in octetstring pl_AKA_K,in octetstring pl_rand, inout octetstring pl_AK,inout octetstring pl_Kaut,inout octetstring pl_Kencr) return octetstring
|
|
|
|
|
| external function f_enc_eap_sim_attrib_list(in EAP_SIM_Attrib_List pdu) return octetstring
|
| with { extension "prototype(convert)" extension "encode(RAW)" }
|
|
|
| external function f_dec_eap_sim_attrib_list(in octetstring stream) return EAP_SIM_Attrib_List
|
| with { extension "prototype(convert)" extension "decode(RAW)" }
|
|
|
| external function f_enc_eap_aka_attrib_list(in EAP_AKA_Attrib_List pdu) return octetstring
|
| with { extension "prototype(convert)" extension "encode(RAW)" }
|
|
|
| external function f_dec_eap_aka_attrib_list(in octetstring stream) return EAP_AKA_Attrib_List
|
| with { extension "prototype(convert)" extension "decode(RAW)" }
|
|
|
| external function f_enc_tls_handshakeData(in TLS_HandshakeData_t pdu) return octetstring
|
| with { extension "prototype(convert)" extension "encode(RAW)" }
|
|
|
| external function f_dec_tls_handshakeData(in octetstring stream) return TLS_HandshakeData_t
|
| with { extension "prototype(convert)" extension "decode(RAW)" }
|
|
|
|
|
| external function f_get_ServersPublicKey(in octetstring certificate,out octetstring key, out octetstring exponent);
|
| external function f_prf(in octetstring p_key,in octetstring p_prefix, in octetstring p_data, in integer p_outLength) return octetstring;
|
|
|
| //
|
| // Basic type definitions
|
| //
|
|
|
| type integer U_INT8 (0..255) with {
|
| variant "FIELDLENGTH(8)"
|
| variant "BYTEORDER(last)"
|
| }
|
|
|
| type integer U_INT16 (0..65535) with {
|
| variant "FIELDLENGTH(16)"
|
| variant "BYTEORDER(last)"
|
| }
|
|
|
| type integer U_INT24 (0..16777215) with {
|
| variant "FIELDLENGTH(24)"
|
| variant "BYTEORDER(last)"
|
| }
|
|
|
| type integer U_INT32 (0..4294967296) with {
|
| variant "FIELDLENGTH(32)"
|
| variant "BYTEORDER(last)"
|
| }
|
|
|
| type integer U_INT64 with {
|
| variant "FIELDLENGTH(64)"
|
| variant "BYTEORDER(last)"
|
| }
|
|
|
| type integer S_INT32 with {
|
| variant "FIELDLENGTH(32)"
|
| variant "BYTEORDER(last)"
|
| variant "COMP(2scompl)"
|
| }
|
|
|
| type octetstring OCTET_1 length(1)
|
| type octetstring OCTET_2 length(2)
|
| type octetstring OCTET_3 length(3)
|
| type octetstring OCTET_4 length(4)
|
| type octetstring OCTET_6 length(6)
|
| type octetstring OCTET_8 length(8)
|
| type octetstring OCTET_12 length(12)
|
| type octetstring OCTET_14 length(14)
|
| type octetstring OCTET_16 length(16)
|
| type octetstring OCTET_20 length(20)
|
| type octetstring OCTET_28 length(28)
|
| type octetstring OCTET_32 length(32)
|
| type bitstring BIT1 length(1) with { variant "FIELDLENGTH(1)" };
|
| type bitstring BIT2 length(2) with { variant "FIELDLENGTH(2)" };
|
| type bitstring BIT3 length(3) with { variant "FIELDLENGTH(3)" };
|
| type bitstring BIT5 length(5) with { variant "FIELDLENGTH(5)" };
|
| type bitstring BIT7 length(7) with { variant "FIELDLENGTH(7)" };
|
|
|
| //================================================
|
| type enumerated EAP_Packet_Code
|
| {
|
| Request_Code (1),
|
| Response_Code (2),
|
| Success_Code (3),
|
| Failure_Code (4),
|
| Unknown_Code (5)
|
| }with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
| type enumerated EAP_Packet_Type
|
| {
|
| EAP_Identity (1),
|
| EAP_Notification (2),
|
| EAP_Nak (3),
|
| EAP_Md5_Challenge (4),
|
| EAP_One_Time_Password (5),
|
| EAP_Generic_Token_Card (6),
|
| EAP_Tls (13),
|
| EAP_Sim (18),
|
| EAP_Ttls (21),
|
| EAP_Aka (23),
|
| EAP_AkaPrime (50)
|
| }with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
| type record At_Void_t
|
| {
|
| U_INT16 reserved
|
| }
|
|
|
| type record At_Padding_t
|
| {
|
| octetstring reserved
|
| }
|
|
|
| type record At_Short_t
|
| {
|
| U_INT16 data_value
|
| }
|
|
|
| type record At_Long_t
|
| {
|
| U_INT16 reserved,
|
| OCTET_16 data_value
|
| }
|
|
|
| type record At_Checkcode_t
|
| {
|
| U_INT16 reserved,
|
| OCTET_32 data_value optional
|
| }
|
|
|
| type record of OCTET_16 octet16_list;
|
|
|
| type record At_Long_Rand_t
|
| {
|
| U_INT16 reserved,
|
| octet16_list data_value
|
| }
|
|
|
| type record At_Long_w_Length_t
|
| {
|
| U_INT16 actual_length,
|
| octetstring data_value
|
| }with {
|
| variant(actual_length) "LENGTHTO(data_value)"
|
| }
|
|
|
| type record At_Long_w_Length_Res_t
|
| {
|
| U_INT16 actual_length,
|
| octetstring data_value
|
| }with {
|
| variant(actual_length) "LENGTHTO(data_value)"
|
| variant(actual_length) "UNIT(bits)"
|
| }
|
|
|
| type record of U_INT16 integer16_list;
|
|
|
| type record At_List_t
|
| {
|
| U_INT16 actual_length,
|
| integer16_list data_value
|
| }with {
|
| variant(actual_length) "LENGTHTO(data_value)"
|
| }
|
|
|
| type record At_AKA_Auts_t
|
| {
|
| OCTET_14 data_value
|
| }
|
|
|
| type record At_Encr_Data_t
|
| {
|
| U_INT16 reserved,
|
| octetstring data_value
|
| }
|
|
|
|
|
| // AKA Attributes
|
|
|
| type At_Long_t At_Data_AKA_Rand;
|
| type At_Checkcode_t At_Data_AKA_Checkcode;
|
| type At_Long_t At_Data_AKA_Autn;
|
| type At_Padding_t At_Data_AKA_Padding;
|
| type At_Long_t At_Data_AKA_Mac;
|
| type At_Long_t At_Data_AKA_Iv;
|
| type At_Long_w_Length_t At_Data_AKA_Identity;
|
| type At_Long_w_Length_Res_t At_Data_AKA_Res;
|
| type At_Void_t At_Data_AKA_Result_Ind;
|
| type At_Short_t At_Data_AKA_Notification;
|
| type At_Short_t At_Data_AKA_Client_Error_Code;
|
| type At_AKA_Auts_t At_Data_AKA_Auts;
|
| type At_Encr_Data_t At_Data_AKA_Encr_Data;
|
| type At_Void_t At_Data_AKA_PermanentIdReq;
|
| type At_Void_t At_Data_AKA_AnyIdReq;
|
| type At_Void_t At_Data_AKA_FullauthIdReq;
|
| type At_Long_w_Length_t At_Data_AKA_NextPseudonym;
|
| type At_Long_w_Length_t At_Data_AKA_NextReauthId;
|
| type At_Short_t At_Data_AKA_Counter;
|
| type At_Void_t At_Data_AKA_Counter_Too_Small;
|
| type At_Long_t At_Data_AKA_NonceS;
|
|
|
|
|
| type union EAP_AKA_Attribute_Data {
|
| At_Data_AKA_PermanentIdReq at_data_AKA_PermanentIdReq,
|
| At_Data_AKA_Rand at_data_AKA_Rand,
|
| At_Data_AKA_Checkcode at_data_AKA_Checkcode,
|
| At_Data_AKA_Autn at_data_AKA_Autn,
|
| At_Data_AKA_Padding at_data_AKA_Padding,
|
| At_Data_AKA_Mac at_data_AKA_Mac,
|
| At_Data_AKA_Iv at_data_AKA_Iv,
|
| At_Data_AKA_Identity at_data_AKA_Identity,
|
| At_Data_AKA_Res at_data_AKA_Res,
|
| At_Data_AKA_Result_Ind at_data_AKA_Result_Ind,
|
| At_Data_AKA_Notification at_data_AKA_Notification,
|
| At_Data_AKA_Client_Error_Code at_data_AKA_Client_Error_Code,
|
| At_Data_AKA_Auts at_data_AKA_Auts,
|
| At_Data_AKA_NextPseudonym at_data_AKA_NextPseudonym,
|
| At_Data_AKA_NextReauthId at_data_AKA_NextReauthId,
|
| At_Data_AKA_Encr_Data at_data_AKA_Encr_Data,
|
| At_Data_AKA_Counter at_data_AKA_Counter,
|
| At_Data_AKA_Counter_Too_Small at_data_AKA_Counter_Too_Small,
|
| At_Data_AKA_NonceS at_data_AKA_NonceS
|
| }
|
|
|
| type record EAP_AKA_Attrib_t
|
| {
|
| EAP_AKA_Attribute_Type attrib_type,
|
| U_INT8 attrib_length,
|
| EAP_AKA_Attribute_Data attrib_value optional
|
| } with {
|
| variant (attrib_value) "CROSSTAG(
|
| at_data_AKA_PermanentIdReq, attrib_type=At_AKA_Permanent_Id_Req;
|
| at_data_AKA_Rand, attrib_type=At_AKA_Rand;
|
| at_data_AKA_Checkcode, attrib_type=At_AKA_Checkcode;
|
| at_data_AKA_Autn, attrib_type=At_AKA_Autn;
|
| at_data_AKA_Padding, attrib_type=At_AKA_Padding;
|
| at_data_AKA_Mac, attrib_type=At_AKA_Mac;
|
| at_data_AKA_Iv, attrib_type=At_AKA_Iv;
|
| at_data_AKA_Identity, attrib_type=At_AKA_Identity;
|
| at_data_AKA_Res, attrib_type=At_AKA_Res;
|
| at_data_AKA_Result_Ind, attrib_type=At_AKA_Result_Ind;
|
| at_data_AKA_Notification, attrib_type=At_AKA_Notification;
|
| at_data_AKA_Client_Error_Code, attrib_type=At_AKA_Client_Error_Code;
|
| at_data_AKA_Auts, attrib_type=At_AKA_Auts;
|
| at_data_AKA_NextPseudonym, attrib_type=At_AKA_Next_Pseudonym;
|
| at_data_AKA_NextReauthId, attrib_type=At_AKA_Next_Reauth_Id;
|
| at_data_AKA_Encr_Data, attrib_type=At_AKA_Encr_Data;
|
| at_data_AKA_Counter, attrib_type=At_AKA_Counter;
|
| at_data_AKA_Counter_Too_Small, attrib_type=At_AKA_Counter_Too_Small;
|
| at_data_AKA_NonceS, attrib_type=At_AKA_Nonce_S)"
|
| variant(attrib_length) "LENGTHTO(attrib_type,attrib_length,attrib_value)"
|
| variant(attrib_length) "UNIT(dword32)"
|
| variant "PADDING(dword32)"
|
| }
|
|
|
|
|
| // AKA' Attributes
|
|
|
| type At_Long_w_Length_t At_Data_AKAPrime_KDF_INPUT;
|
| type At_Short_t At_Data_AKAPrime_KDF;
|
|
|
| type union EAP_AKAPrime_Attribute_Data {
|
| At_Data_AKA_PermanentIdReq at_data_AKA_PermanentIdReq,
|
| At_Data_AKA_Rand at_data_AKA_Rand,
|
| At_Data_AKA_Checkcode at_data_AKA_Checkcode,
|
| At_Data_AKA_Autn at_data_AKA_Autn,
|
| At_Data_AKA_Padding at_data_AKA_Padding,
|
| At_Data_AKA_Mac at_data_AKA_Mac,
|
| At_Data_AKA_Iv at_data_AKA_Iv,
|
| At_Data_AKA_Identity at_data_AKA_Identity,
|
| At_Data_AKA_Res at_data_AKA_Res,
|
| At_Data_AKA_Result_Ind at_data_AKA_Result_Ind,
|
| At_Data_AKA_Notification at_data_AKA_Notification,
|
| At_Data_AKA_Client_Error_Code at_data_AKA_Client_Error_Code,
|
| At_Data_AKA_Auts at_data_AKA_Auts,
|
| At_Data_AKA_Encr_Data at_data_AKA_Encr_Data,
|
| At_Data_AKA_Counter at_data_AKA_Counter,
|
| At_Data_AKA_Counter_Too_Small at_data_AKA_Counter_Too_Small,
|
| At_Data_AKAPrime_KDF_INPUT at_data_AKAPrime_KDF_INPUT,
|
| At_Data_AKAPrime_KDF at_data_AKAPrime_KDF
|
| }
|
|
|
|
|
| type record EAP_AKAPrime_Attrib_t
|
| {
|
| EAP_AKAPrime_Attribute_Type attrib_type,
|
| U_INT8 attrib_length,
|
| EAP_AKAPrime_Attribute_Data attrib_value optional
|
| }with {
|
| variant (attrib_value) "CROSSTAG(
|
| at_data_AKA_PermanentIdReq, attrib_type=At_AKA_Permanent_Id_Req;
|
| at_data_AKA_Rand, attrib_type=At_AKA_Rand;
|
| at_data_AKA_Checkcode, attrib_type=At_AKA_Checkcode;
|
| at_data_AKA_Autn, attrib_type=At_AKA_Autn;
|
| at_data_AKA_Padding, attrib_type=At_AKA_Padding;
|
| at_data_AKA_Mac, attrib_type=At_AKA_Mac;
|
| at_data_AKA_Iv, attrib_type=At_AKA_Iv;
|
| at_data_AKA_Identity, attrib_type=At_AKA_Identity;
|
| at_data_AKA_Res, attrib_type=At_AKA_Res;
|
| at_data_AKA_Result_Ind, attrib_type=At_AKA_Result_Ind;
|
| at_data_AKA_Notification, attrib_type=At_AKA_Notification;
|
| at_data_AKA_Client_Error_Code, attrib_type=At_AKA_Client_Error_Code;
|
| at_data_AKA_Auts, attrib_type=At_AKA_Auts;
|
| at_data_AKA_Encr_Data, attrib_type=At_AKA_Encr_Data;
|
| at_data_AKA_Counter, attrib_type=At_AKA_Counter;
|
| at_data_AKA_Counter_Too_Small, attrib_type=At_AKA_Counter_Too_Small;
|
| at_data_AKAPrime_KDF_INPUT, attrib_type=At_AKA_KDF_INPUT;
|
| at_data_AKAPrime_KDF, attrib_type=At_AKA_KDF)"
|
| variant(attrib_length) "LENGTHTO(attrib_type,attrib_length,attrib_value)"
|
| variant(attrib_length) "UNIT(dword32)"
|
| variant "PADDING(dword32)"
|
| }
|
|
|
| type enumerated EAP_AKA_SubType
|
| {
|
| EAP_AKA_Challenge (1),
|
| EAP_AKA_Authentication_Reject (2),
|
| EAP_AKA_Synchronization_Failure (4),
|
| EAP_AKA_Identity (5),
|
| EAP_AKA_Notification (12),
|
| EAP_AKA_Reauthentication (13),
|
| EAP_AKA_Client_Error (14),
|
| EAP_AKA_Wrong_Subtype (88)
|
| }with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
| type enumerated EAP_AKA_Attribute_Type
|
| {
|
| At_AKA_Rand (1),
|
| At_AKA_Autn (2),
|
| At_AKA_Res (3),
|
| At_AKA_Auts (4),
|
| At_AKA_Padding (6),
|
| At_AKA_Permanent_Id_Req (10),
|
| At_AKA_Mac (11),
|
| At_AKA_Notification (12),
|
| At_AKA_Any_Id_Req (13),
|
| At_AKA_Identity (14),
|
| At_AKA_Fullauth_Id_Req (17),
|
| At_AKA_Counter (19),
|
| At_AKA_Counter_Too_Small (20),
|
| At_AKA_Nonce_S (21),
|
| At_AKA_Client_Error_Code (22),
|
| At_AKA_Iv (129),
|
| At_AKA_Encr_Data (130),
|
| At_AKA_Next_Pseudonym (132),
|
| At_AKA_Next_Reauth_Id (133),
|
| At_AKA_Checkcode (134),
|
| At_AKA_Result_Ind (135)
|
| }with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
| type enumerated EAP_AKAPrime_Attribute_Type
|
| {
|
| At_AKA_Rand (1),
|
| At_AKA_Autn (2),
|
| At_AKA_Res (3),
|
| At_AKA_Auts (4),
|
| At_AKA_Padding (6),
|
| At_AKA_Permanent_Id_Req (10),
|
| At_AKA_Mac (11),
|
| At_AKA_Notification (12),
|
| At_AKA_Any_Id_Req (13),
|
| At_AKA_Identity (14),
|
| At_AKA_Fullauth_Id_Req (17),
|
| At_AKA_Counter (19),
|
| At_AKA_Counter_Too_Small (20),
|
| At_AKA_Nonce_S (21),
|
| At_AKA_Client_Error_Code (22),
|
| At_AKA_KDF_INPUT (23),
|
| At_AKA_KDF (24),
|
| At_AKA_Iv (129),
|
| At_AKA_Encr_Data (130),
|
| At_AKA_Next_Pseudonym (132),
|
| At_AKA_Next_Reauth_Id (133),
|
| At_AKA_Checkcode (134),
|
| At_AKA_Result_Ind (135)
|
| }with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
|
|
| type At_Void_t At_Data_SIM_PermanentIdReq;
|
| type At_Void_t At_Data_SIM_FullAuthIdReq;
|
| type At_Void_t At_Data_SIM_AnyIdReq;
|
| type At_List_t At_Data_SIM_Version_List;
|
| type At_Long_t At_Data_SIM_NonceMT;
|
| type At_Long_w_Length_t At_Data_SIM_Identity;
|
| type At_Short_t At_Data_SIM_SelectedVersion;
|
| type At_Long_Rand_t At_Data_SIM_Rand;
|
| type At_Long_t At_Data_SIM_Iv;
|
| type At_Encr_Data_t At_Data_SIM_Encr_Data;
|
| type At_Long_t At_Data_SIM_Mac;
|
| type At_Long_w_Length_t At_Data_SIM_Next_Pseudonym;
|
| type At_Long_t At_Data_SIM_NonceS;
|
| type At_Long_w_Length_Res_t At_Data_SIM_Next_ReauthId;
|
| type At_Padding_t At_Data_SIM_Padding;
|
| type At_Short_t At_Data_SIM_Counter;
|
| type At_Void_t At_Data_SIM_CounterTooSmall;
|
| type At_Short_t At_Data_SIM_Notification;
|
| type At_Void_t At_Data_SIM_Result_Ind;
|
| type At_Short_t At_Data_SIM_Client_Error_Code;
|
|
|
| type union EAP_SIM_Attribute_Data {
|
| At_Data_SIM_PermanentIdReq at_data_SIM_PermanentIdReq,
|
| At_Data_SIM_FullAuthIdReq at_data_SIM_FullAuthIdReq,
|
| At_Data_SIM_AnyIdReq at_data_SIM_AnyIdReq,
|
| At_Data_SIM_Version_List at_data_SIM_Version_List,
|
| At_Data_SIM_NonceMT at_data_SIM_NonceMT,
|
| At_Data_SIM_Identity at_data_SIM_Identity,
|
| At_Data_SIM_SelectedVersion at_data_SIM_SelectedVersion,
|
| At_Data_SIM_Rand at_data_SIM_Rand,
|
| At_Data_SIM_Iv at_data_SIM_Iv,
|
| At_Data_SIM_Encr_Data at_data_SIM_Encr_Data,
|
| At_Data_SIM_Mac at_data_SIM_Mac,
|
| At_Data_SIM_Next_Pseudonym at_data_SIM_Next_Pseudonym,
|
| At_Data_SIM_NonceS at_data_SIM_NonceS,
|
| At_Data_SIM_Next_ReauthId at_data_SIM_Next_ReauthId,
|
| At_Data_SIM_Padding at_data_SIM_Padding,
|
| At_Data_SIM_Counter at_data_SIM_Counter,
|
| At_Data_SIM_CounterTooSmall at_data_SIM_CounterTooSmall,
|
| At_Data_SIM_Notification at_data_SIM_Notification,
|
| At_Data_SIM_Result_Ind at_data_SIM_Result_Ind,
|
| At_Data_SIM_Client_Error_Code at_data_SIM_Client_Error_Code
|
| }
|
|
|
| type record EAP_SIM_Attrib_t
|
| {
|
| EAP_SIM_Attribute_Type attrib_type,
|
| U_INT8 attrib_length,
|
| EAP_SIM_Attribute_Data attrib_value optional
|
| } with {
|
| variant (attrib_value) "CROSSTAG(
|
| at_data_SIM_PermanentIdReq, attrib_type=At_SIM_Permanent_Id_Req;
|
| at_data_SIM_FullAuthIdReq, attrib_type=At_SIM_FullAuth_Id_Req;
|
| at_data_SIM_AnyIdReq, attrib_type=At_SIM_Any_Id_Req;
|
| at_data_SIM_Version_List, attrib_type=At_SIM_Version_List;
|
| at_data_SIM_NonceMT, attrib_type=At_SIM_NonceMT;
|
| at_data_SIM_Identity, attrib_type=At_SIM_Identity;
|
| at_data_SIM_SelectedVersion, attrib_type=At_SIM_SelectedVersion;
|
| at_data_SIM_Rand, attrib_type=At_SIM_Rand;
|
| at_data_SIM_Iv, attrib_type=At_SIM_Iv;
|
| at_data_SIM_Encr_Data, attrib_type=At_SIM_Encr_Data;
|
| at_data_SIM_Mac, attrib_type=At_SIM_Mac;
|
| at_data_SIM_Next_Pseudonym, attrib_type=At_SIM_Next_Pseudonym;
|
| at_data_SIM_NonceS, attrib_type=At_SIM_NonceS;
|
| at_data_SIM_Next_ReauthId, attrib_type=At_SIM_Next_ReauthId;
|
| at_data_SIM_Padding, attrib_type=At_SIM_Padding;
|
| at_data_SIM_Counter, attrib_type=At_SIM_Counter;
|
| at_data_SIM_CounterTooSmall, attrib_type=At_SIM_CounterTooSmall;
|
| at_data_SIM_Notification, attrib_type=At_SIM_Notification;
|
| at_data_SIM_Result_Ind, attrib_type=At_SIM_Result_Ind;
|
| at_data_SIM_Client_Error_Code, attrib_type=At_SIM_Client_Error_Code)"
|
| variant(attrib_length) "LENGTHTO(attrib_type,attrib_length,attrib_value)"
|
| variant(attrib_length) "UNIT(dword32)"
|
| variant "PADDING(dword32)"
|
| }
|
|
|
| type enumerated EAP_SIM_Attribute_Type
|
| {
|
| At_SIM_Rand (1),
|
| At_SIM_Padding (6),
|
| At_SIM_NonceMT (7),
|
| At_SIM_Permanent_Id_Req (10),
|
| At_SIM_Mac (11),
|
| At_SIM_Notification (12),
|
| At_SIM_Any_Id_Req (13),
|
| At_SIM_Identity (14),
|
| At_SIM_Version_List (15),
|
| At_SIM_SelectedVersion (16),
|
| At_SIM_FullAuth_Id_Req (17),
|
| At_SIM_Counter (19),
|
| At_SIM_CounterTooSmall (20),
|
| At_SIM_NonceS (21),
|
| At_SIM_Client_Error_Code (22),
|
| At_SIM_Iv (129),
|
| At_SIM_Encr_Data (130),
|
| At_SIM_Next_Pseudonym (132),
|
| At_SIM_Next_ReauthId (133),
|
| At_SIM_Result_Ind (135)
|
| } with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
| type enumerated EAP_SIM_SubType
|
| {
|
| EAP_SIM_Start (10),
|
| EAP_SIM_Challenge (11),
|
| EAP_SIM_Notification (12),
|
| EAP_SIM_Re_Authentication (13),
|
| EAP_SIM_Client_Error (14)
|
| } with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
| type set of EAP_AKA_Attrib_t EAP_AKA_Attrib_List;
|
|
|
| type set of EAP_AKAPrime_Attrib_t EAP_AKAPrime_Attrib_List;
|
|
|
| type set of EAP_SIM_Attrib_t EAP_SIM_Attrib_List;
|
|
|
| type record EAP_AKA_Data_t
|
| {
|
| EAP_AKA_SubType subtype,
|
| U_INT16 reserved,
|
| EAP_AKA_Attrib_List attrib_list
|
| }
|
|
|
| //Added for EPC
|
| type record EAP_AKAPRIME_Data_t
|
| {
|
| EAP_AKA_SubType subtype,
|
| U_INT16 reserved,
|
| EAP_AKAPrime_Attrib_List attrib_list
|
| }
|
|
|
|
|
| type record EAP_MD5_CHALLENGE_Data_t
|
| {
|
| U_INT8 valueSize,
|
| octetstring dataValue
|
| } with {
|
| variant (valueSize) "LENGTHTO(dataValue)"
|
| }
|
|
|
| type record EAP_IDENTITY_Data_t {
|
| octetstring dataValue
|
| }
|
|
|
| type record EAP_NOTIFICATION_Data_t {
|
| octetstring dataValue
|
| }
|
|
|
| type record EAP_NAK_Data_t {
|
| octetstring dataValue
|
| }
|
|
|
| type record EAP_OTP_Data_t {
|
| octetstring dataValue
|
| }
|
|
|
| type record EAP_GTC_Data_t {
|
| octetstring dataValue
|
| }
|
|
|
| type record EAP_SIM_Data_t
|
| {
|
| EAP_SIM_SubType subtype,
|
| U_INT16 reserved,
|
| EAP_SIM_Attrib_List attrib_list
|
| }
|
|
|
| type record HelloRequest_t{}
|
|
|
| type record of OCTET_2 octet2_list;
|
| type record of OCTET_1 octet1_list;
|
|
|
| type record ClientHello_t
|
| {
|
| OCTET_2 version,
|
| U_INT32 time,
|
| OCTET_28 random,
|
| U_INT8 sessionIdLength,
|
| octetstring sessionId,
|
| U_INT16 cipherSuitesLength,
|
| octet2_list cipherSuites,
|
| U_INT8 compressionMethodsLength,
|
| octet1_list compressionMethods
|
| } with {
|
| variant (sessionIdLength) "LENGTHTO(sessionId)"
|
| variant (cipherSuitesLength) "LENGTHTO(cipherSuites)"
|
| variant (compressionMethodsLength) "LENGTHTO(compressionMethods)"
|
| }
|
|
|
| type record ServerHello_t
|
| {
|
| OCTET_2 version,
|
| U_INT32 time,
|
| OCTET_28 random,
|
| U_INT8 sessionIdLength,
|
| octetstring sessionId,
|
| OCTET_2 cipherSuite,
|
| OCTET_1 compressionMethod
|
| } with {
|
| variant (sessionIdLength) "LENGTHTO(sessionId)"
|
| }
|
|
|
| type record Certificate
|
| {
|
| U_INT24 certificateLength,
|
| octetstring certificate
|
| } with {
|
| variant (certificateLength) "LENGTHTO(certificate)"
|
| }
|
|
|
| type record of Certificate CertificateList;
|
|
|
| type record Certificate_t
|
| {
|
| U_INT24 certificatesLength,
|
| CertificateList certificates
|
| } with {
|
| variant (certificatesLength) "LENGTHTO(certificates)"
|
| }
|
|
|
| type record ServerKeyExchange_t
|
| {
|
|
|
| }
|
|
|
| type record of DistinguishedNames DistinguishedNamesList;
|
|
|
| type record DistinguishedNames
|
| {
|
| U_INT16 distinguishedNameLength,
|
| // DistinguishedName distinguishedName
|
| octetstring distinguishedName
|
| } with {
|
| variant (distinguishedNameLength) "LENGTHTO(distinguishedName)"
|
| }
|
|
|
|
|
| type record CertificateRequest_t
|
| {
|
| U_INT8 certificateTypesCount,
|
| octet2_list certificateTypes,
|
| U_INT16 distinguishedNamesLength,
|
| DistinguishedNamesList distinguishedNames
|
| } with {
|
| variant (certificateTypesCount) "LENGTHTO(certificateTypes)"
|
| variant (distinguishedNamesLength) "LENGTHTO(distinguishedNames)"
|
| }
|
|
|
| type record ServerHelloDone_t{}
|
|
|
| type record CertificateVerify_t
|
| {
|
|
|
| }
|
|
|
| type record ClientKeyExchange_t
|
| {
|
| octetstring clientKey
|
|
|
| }
|
|
|
| type record Finished_t
|
| {
|
| octetstring finishedData
|
| }
|
|
|
|
|
| type enumerated TLS_HandshakeType
|
| {
|
| HelloRequest (0),
|
| ClientHello (1),
|
| ServerHello (2),
|
| Certificate (11),
|
| ServerKeyExchange (12),
|
| CertificateRequest (13),
|
| ServerHelloDone (14),
|
| CertificateVerify (15),
|
| ClientKeyExchange (16),
|
| Finished (20)
|
| } with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
|
|
| type union TLS_HandshakeDataType_t
|
| {
|
| HelloRequest_t helloRequest,
|
| ClientHello_t clientHello,
|
| ServerHello_t serverHello,
|
| Certificate_t certificate,
|
| ServerKeyExchange_t serverKeyExchange,
|
| CertificateRequest_t certificateRequest,
|
| ServerHelloDone_t serverHelloDone,
|
| CertificateVerify_t certificateVerify,
|
| ClientKeyExchange_t clientKeyExchange,
|
| Finished_t finished
|
| }
|
|
|
| type union TLS_HandshakeDataElement_t
|
| {
|
| TLS_HandshakeData_t nonEncriptedHandshake,
|
| octetstring encriptedHandshake
|
| }
|
|
|
| type record of TLS_HandshakeDataElement_t TLS_HandshakeDataList
|
|
|
| type record TLS_HandshakeData_t
|
| {
|
| TLS_HandshakeType handshakeType,
|
| U_INT24 messageLength,
|
| // OCT2 version, //'0301'O TLS 1.0
|
| TLS_HandshakeDataType_t handshake
|
| } with {
|
| variant (handshake) "CROSSTAG(
|
| helloRequest, handshakeType=HelloRequest;
|
| clientHello, handshakeType=ClientHello;
|
| serverHello, handshakeType=ServerHello;
|
| certificate, handshakeType=Certificate;
|
| serverKeyExchange, handshakeType=ServerKeyExchange;
|
| certificateRequest, handshakeType=CertificateRequest;
|
| serverHelloDone, handshakeType=ServerHelloDone;
|
| certificateVerify, handshakeType=CertificateVerify;
|
| clientKeyExchange, handshakeType=ClientKeyExchange;
|
| finished, handshakeType=Finished)"
|
| variant(messageLength) "LENGTHTO(handshake)"
|
| }
|
|
|
| type enumerated TLS_ContentType
|
| {
|
| ChangeCipherSpec (20),
|
| Alert (21),
|
| Handshake (22),
|
| ApplicationData (23)
|
| } with {
|
| variant "FIELDLENGTH(8)"
|
| }
|
|
|
| type record TLS_Handshake
|
| {
|
| TLS_ContentType contentType, // Handshake
|
| OCTET_2 version, //'0301'O TLS 1.0
|
| U_INT16 messageLength,
|
| // octetstring handshake
|
| TLS_HandshakeDataList handshake
|
| } with {
|
| variant (messageLength) "LENGTHTO(handshake)"
|
| variant "PRESENCE (contentType = Handshake; )"
|
| }
|
|
|
| type record of TLS_Handshake Handshake_t;
|
|
|
| type record ChangeCipherSpec_t
|
| {
|
| TLS_ContentType contentType, // ChangeCipherSpec
|
| OCTET_2 version, //'0301'O TLS 1.0
|
| U_INT16 messageLength,
|
| // octetstring handshake
|
| OCTET_1 changeCipherValue
|
| } with {
|
| variant (messageLength) "LENGTHTO(changeCipherValue)"
|
| variant "PRESENCE (contentType = ChangeCipherSpec; )"
|
| }
|
|
|
| type record Alert_t
|
| {
|
| TLS_ContentType contentType, // Alert
|
| OCTET_2 version, //'0301'O TLS 1.0
|
| U_INT16 messageLength,
|
| // octetstring handshake
|
| OCTET_1 alertLevel,
|
| OCTET_1 alertDescription
|
| } with {
|
| variant (messageLength) "LENGTHTO(alertLevel,alertDescription)"
|
| variant "PRESENCE (contentType = Alert; )"
|
| }
|
|
|
| type record ApplicationData_t
|
| {
|
| TLS_ContentType contentType, // ApplicationData
|
| OCTET_2 version, //'0301'O TLS 1.0
|
| U_INT16 messageLength,
|
| octetstring applicationData
|
| } with {
|
| variant (messageLength) "LENGTHTO(applicationData)"
|
| variant "PRESENCE (contentType = ApplicationData; )"
|
| }
|
|
|
| type union TLS_Fragment
|
| {
|
| ChangeCipherSpec_t changeCipherSpec,
|
| Alert_t alert,
|
| Handshake_t handshake,
|
| ApplicationData_t applicationData
|
| }
|
|
|
| type record of TLS_Fragment TLS_Fragments;
|
|
|
| type record EAP_TLS_Data_t
|
| {
|
| BIT5 reserved,
|
| BIT1 startBit,
|
| BIT1 moreFragments,
|
| BIT1 lengthIncluded,
|
| U_INT32 messageLength optional,
|
| octetstring dataValue
|
| //TLS_HandshakeList dataValue optional
|
| } with {
|
| variant (messageLength) "PRESENCE (lengthIncluded = '1'B) "
|
| variant (messageLength) "LENGTHTO(dataValue)"
|
| }
|
|
|
| type record EAP_TTLS_Data_t
|
| {
|
| BIT3 version, //'000'B for EAP-TTLSv0
|
| BIT2 reserved,
|
| BIT1 startBit,
|
| BIT1 moreFragments,
|
| BIT1 lengthIncluded,
|
| U_INT32 messageLength optional,
|
| TLS_Fragments dataValue
|
| // octetstring dataValue
|
| } with {
|
| variant (messageLength) "PRESENCE (lengthIncluded = '1'B) "
|
| // variant (messageLength) "LENGTHTO(dataValue)"
|
| }
|
|
|
| type union EAP_Packet_Type_Data
|
| {
|
| EAP_IDENTITY_Data_t f_eap_identity,
|
| EAP_NOTIFICATION_Data_t f_eap_notification,
|
| EAP_NAK_Data_t f_eap_nak,
|
| EAP_MD5_CHALLENGE_Data_t f_eap_md5_challenge,
|
| EAP_OTP_Data_t f_eap_one_time_password,
|
| EAP_GTC_Data_t f_eap_generic_token_card,
|
| EAP_AKA_Data_t f_eap_aka,
|
| EAP_AKAPRIME_Data_t f_eap_akaprime,
|
| EAP_SIM_Data_t f_eap_sim,
|
| EAP_TLS_Data_t f_eap_tls,
|
| EAP_TTLS_Data_t f_eap_ttls
|
| }
|
|
|
| type record EAP_Packet_Data
|
| {
|
| EAP_Packet_Type eap_packet_type,
|
| EAP_Packet_Type_Data eap_packet_type_data
|
| }with {
|
| variant (eap_packet_type_data) "CROSSTAG(
|
| f_eap_identity, eap_packet_type=EAP_Identity;
|
| f_eap_notification, eap_packet_type=EAP_Notification;
|
| f_eap_nak, eap_packet_type=EAP_Nak;
|
| f_eap_md5_challenge, eap_packet_type=EAP_Md5_Challenge;
|
| f_eap_one_time_password, eap_packet_type=EAP_One_Time_Password;
|
| f_eap_generic_token_card, eap_packet_type=EAP_Generic_Token_Card;
|
| f_eap_akaprime, eap_packet_type=EAP_AkaPrime;
|
| f_eap_aka, eap_packet_type=EAP_Aka;
|
| f_eap_sim, eap_packet_type=EAP_Sim;
|
| f_eap_tls, eap_packet_type=EAP_Tls;
|
| f_eap_ttls, eap_packet_type=EAP_Ttls)"
|
| }
|
|
|
| type record PDU_EAP //EAP (RFC 3748)
|
| {
|
| EAP_Packet_Code code,
|
| U_INT8 identifier,
|
| U_INT16 packet_length,
|
| EAP_Packet_Data packet_data optional
|
| } with {
|
| variant (packet_length) "LENGTHTO(code, identifier, packet_length, packet_data)"
|
| }
|
|
|
| }with { encode "RAW" } // End module
|
|
|