1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.internal.net.eap.test.message; 18 19 import static com.android.internal.net.TestUtils.hexStringToByteArray; 20 import static com.android.internal.net.eap.test.message.simaka.attributes.EapTestAttributeDefinitions.AT_VERSION_LIST_DATA; 21 import static com.android.internal.net.eap.test.message.simaka.attributes.EapTestAttributeDefinitions.IDENTITY_STRING; 22 import static com.android.internal.net.eap.test.message.simaka.attributes.EapTestAttributeDefinitions.NONCE_MT_STRING; 23 import static com.android.internal.net.eap.test.message.simaka.attributes.EapTestAttributeDefinitions.RAND_1; 24 import static com.android.internal.net.eap.test.message.simaka.attributes.EapTestAttributeDefinitions.RAND_2; 25 import static com.android.internal.net.eap.test.message.simaka.attributes.EapTestAttributeDefinitions.RES; 26 27 /** 28 * EapTestMessageDefinitions provides byte[] encodings of commonly used EAP Messages. 29 * 30 * @see <a href="https://tools.ietf.org/html/rfc3748#section-4">RFC 3748, Extensible Authentication 31 * Protocol (EAP)</a> 32 */ 33 public class EapTestMessageDefinitions { 34 public static final String ID = "10"; 35 public static final int ID_INT = Integer.parseInt(ID, 16 /* radix */); 36 37 // EAP-AKA Identity request 38 public static final String EAP_REQUEST_TYPE_DATA = "0500000D010000"; 39 public static final byte[] EAP_AKA_IDENTITY_REQUEST = 40 hexStringToByteArray(EAP_REQUEST_TYPE_DATA); 41 42 // EAP-AKA/Identity request with no attributes 43 public static final byte[] EAP_REQUEST_AKA = hexStringToByteArray("01" + ID + "000817050000"); 44 public static final byte[] EAP_REQUEST_AKA_IDENTITY_PACKET = 45 hexStringToByteArray("01" + ID + "000A17" + EAP_REQUEST_TYPE_DATA); 46 public static final byte[] EAP_REQUEST_IDENTITY_PACKET = 47 hexStringToByteArray("01" + ID + "000501"); 48 public static final byte[] EAP_REQUEST_IDENTITY_PACKET_TOO_LONG = 49 hexStringToByteArray("01" + ID + "00050100"); 50 51 // EAP-Identity: hex for ASCII in "test@android.net" 52 public static final String EAP_IDENTITY_STRING = "7465737440616E64726F69642E6E6574"; 53 public static final byte[] EAP_IDENTITY = hexStringToByteArray(EAP_IDENTITY_STRING); 54 public static final byte[] EAP_RESPONSE_IDENTITY_PACKET = 55 hexStringToByteArray("02" + ID + "001501" + EAP_IDENTITY_STRING); 56 public static final byte[] EAP_RESPONSE_IDENTITY_DEFAULT_PACKET = 57 hexStringToByteArray("02" + ID + "000501"); 58 public static final byte[] EAP_REQUEST_NOTIFICATION_PACKET = 59 hexStringToByteArray("01" + ID + "000802AABBCC"); 60 public static final byte[] EAP_SUCCESS_PACKET = hexStringToByteArray("03" + ID + "0004"); 61 public static final byte[] EAP_FAILURE_PACKET = hexStringToByteArray("04" + ID + "0004"); 62 public static final byte[] EAP_SIM_CLIENT_ERROR_RESPONSE = 63 hexStringToByteArray("02" + ID + "000C120E000016010001"); 64 public static final byte[] EAP_SIM_CLIENT_ERROR_INSUFFICIENT_CHALLENGES = 65 hexStringToByteArray("02" + ID + "000C120E000016010002"); 66 public static final byte[] EAP_SIM_CLIENT_ERROR_UNABLE_TO_PROCESS = 67 hexStringToByteArray("02" + ID + "000C120E000016010000"); 68 public static final byte[] EAP_AKA_CLIENT_ERROR_UNABLE_TO_PROCESS = 69 hexStringToByteArray("02" + ID + "000C170E000016010000"); 70 71 // EAP-SIM response containing SELECTED_VERSION (1) and IDENTITY attributes 72 public static final byte[] EAP_SIM_RESPONSE_PACKET = hexStringToByteArray( 73 "02" + ID + "0024120A0000100100010E060011" + IDENTITY_STRING + "000000"); 74 public static final byte[] EAP_SIM_RESPONSE_WITHOUT_IDENTITY = 75 hexStringToByteArray("02" + ID + "0020120A000007050000" + NONCE_MT_STRING + "10010001"); 76 public static final byte[] EAP_SIM_NOTIFICATION_RESPONSE = hexStringToByteArray( 77 "02" + ID + "0008120C0000"); 78 public static final byte[] EAP_AKA_NOTIFICATION_RESPONSE = 79 hexStringToByteArray("02" + ID + "0008170C0000"); 80 81 // Body of EapData is the list of supported methods 82 public static final byte[] EAP_RESPONSE_NAK_PACKET = 83 hexStringToByteArray("02" + ID + "00060312"); 84 public static final byte[] EAP_RESPONSE_NOTIFICATION_PACKET = 85 hexStringToByteArray("02" + ID + "000502"); 86 public static final byte[] EAP_REQUEST_MD5_CHALLENGE = 87 hexStringToByteArray("01" + ID + "000504"); 88 public static final byte[] EAP_REQUEST_NAK_PACKET = 89 hexStringToByteArray("01" + ID + "000503"); 90 public static final String EAP_REQUEST_SIM_TYPE_DATA = "0A00000F02000200010000"; 91 public static final byte[] EAP_REQUEST_SIM_START_PACKET = 92 hexStringToByteArray("01" + ID + "001012" + EAP_REQUEST_SIM_TYPE_DATA); 93 94 public static final byte[] REQUEST_UNSUPPORTED_TYPE_PACKET = 95 hexStringToByteArray("01" + ID + "0005FF"); 96 public static final byte[] REQUEST_MISSING_TYPE_PACKET = 97 hexStringToByteArray("01" + ID + "0004"); 98 public static final byte[] LONG_SUCCESS_PACKET = hexStringToByteArray("03" + ID + "000500"); 99 public static final byte[] SHORT_PACKET = hexStringToByteArray("01" + ID + "0005"); 100 public static final byte[] INCOMPLETE_HEADER_PACKET = hexStringToByteArray("03" + ID); 101 public static final byte[] INVALID_CODE_PACKET = hexStringToByteArray("F0" + ID + "0004"); 102 103 // Attributes 104 public static final String SKIPPABLE_DATA = "112233445566"; 105 public static final byte[] SKIPPABLE_DATA_BYTES = hexStringToByteArray(SKIPPABLE_DATA); 106 public static final byte[] SKIPPABLE_INVALID_ATTRIBUTE = 107 hexStringToByteArray("FF02" + SKIPPABLE_DATA); 108 public static final byte[] NON_SKIPPABLE_INVALID_ATTRIBUTE = 109 hexStringToByteArray("7F010000"); 110 111 // Type-Data 112 public static final byte[] EAP_SIM_START_SUBTYPE = 113 hexStringToByteArray("0A00000F02" + AT_VERSION_LIST_DATA + "0A010000"); 114 public static final byte[] INVALID_SUBTYPE = hexStringToByteArray("FF"); 115 public static final byte[] TYPE_DATA_INVALID_AT_RAND = 116 hexStringToByteArray("0A000001050000" + RAND_1); 117 public static final byte[] SHORT_TYPE_DATA = hexStringToByteArray("0A"); 118 public static final byte[] TYPE_DATA_INVALID_ATTRIBUTE = 119 hexStringToByteArray("0A00007F01"); 120 public static final byte[] EAP_SIM_START_DUPLICATE_ATTRIBUTES = 121 hexStringToByteArray("0A00000F02" + "0A010000" + "0A010000"); 122 123 // RAND Challenge Results 124 public static final String SRES_1 = "11223344"; 125 public static final byte[] SRES_1_BYTES = hexStringToByteArray(SRES_1); 126 public static final String SRES_2 = "44332211"; 127 public static final byte[] SRES_2_BYTES = hexStringToByteArray(SRES_2); 128 public static final byte[] SRES_BYTES = hexStringToByteArray(SRES_1 + SRES_2); 129 public static final String KC_1 = "0102030405060708"; 130 public static final byte[] KC_1_BYTES = hexStringToByteArray(KC_1); 131 public static final String KC_2 = "0807060504030201"; 132 public static final byte[] KC_2_BYTES = hexStringToByteArray(KC_2); 133 public static final byte[] VALID_CHALLENGE_RESPONSE = 134 hexStringToByteArray("04" + SRES_1 + "08" + KC_1); 135 public static final byte[] CHALLENGE_RESPONSE_INVALID_SRES = hexStringToByteArray("03"); 136 public static final byte[] CHALLENGE_RESPONSE_INVALID_KC = 137 hexStringToByteArray("04" + SRES_1 + "04"); 138 139 public static final String IMSI = "123456789012345"; 140 public static final String EAP_SIM_IDENTITY = "1" + IMSI; 141 public static final byte[] EAP_SIM_IDENTITY_BYTES = hexStringToByteArray(EAP_SIM_IDENTITY); 142 143 // ASCII hex for "0" + IMSI (EAP-AKA identity format) 144 public static final String EAP_AKA_IDENTITY_BYTES = "30313233343536373839303132333435"; 145 146 // Master Key generation 147 public static final String MK_STRING = "0123456789ABCDEF0123456789ABCDEF01234567"; 148 public static final byte[] MK = hexStringToByteArray(MK_STRING); 149 public static final String K_ENCR_STRING = "000102030405060708090A0B0C0D0E0F"; 150 public static final byte[] K_ENCR = hexStringToByteArray(K_ENCR_STRING); 151 public static final String K_AUT_STRING = "0F0E0D0C0B0A09080706050403020100"; 152 public static final byte[] K_AUT = hexStringToByteArray(K_AUT_STRING); 153 public static final String MSK_STRING = 154 "00112233445566778899AABBCCDDEEFF" 155 + "00112233445566778899AABBCCDDEEFF" 156 + "00112233445566778899AABBCCDDEEFF" 157 + "00112233445566778899AABBCCDDEEFF"; 158 public static final byte[] MSK = hexStringToByteArray(MSK_STRING); 159 public static final String EMSK_STRING = 160 "FFEEDDCCBBAA99887766554433221100" 161 + "FFEEDDCCBBAA99887766554433221100" 162 + "FFEEDDCCBBAA99887766554433221100" 163 + "FFEEDDCCBBAA99887766554433221100"; 164 public static final byte[] EMSK = hexStringToByteArray(EMSK_STRING); 165 166 // MAC computation 167 public static final String ORIGINAL_MAC_STRING = "112233445566778899AABBCCDDEEFF11"; 168 public static final byte[] ORIGINAL_MAC = hexStringToByteArray(ORIGINAL_MAC_STRING); 169 public static final String COMPUTED_MAC_STRING = "FFEEDDCCBBAA998877665544332211FF"; 170 public static final byte[] COMPUTED_MAC = hexStringToByteArray(COMPUTED_MAC_STRING); 171 public static final String EAP_SIM_CHALLENGE_REQUEST_STRING = 172 "01" + ID + "0040" // EAP-Request | ID | length in bytes 173 + "120b0000" // EAP-SIM | Challenge | 2B padding 174 + "01090000" + RAND_1 + RAND_2 // EAP-SIM AT_RAND attribute 175 + "0B05000000000000000000000000000000000000"; // AT_MAC attribute with no MAC 176 public static final byte[] MAC_INPUT = 177 hexStringToByteArray(EAP_SIM_CHALLENGE_REQUEST_STRING + NONCE_MT_STRING); 178 179 // Response Message with MAC 180 public static final String EAP_SIM_CHALLENGE_RESPONSE_EMPTY_MAC = 181 "02" + ID + "001C" // EAP-Response | ID | length in bytes 182 + "120b0000" // EAP-SIM | Challenge | 2B padding 183 + "0B05000000000000000000000000000000000000"; // AT_MAC attribute with no MAC 184 public static final byte[] EAP_SIM_CHALLENGE_RESPONSE_MAC_INPUT = 185 hexStringToByteArray(EAP_SIM_CHALLENGE_RESPONSE_EMPTY_MAC + SRES_1 + SRES_2); 186 public static final byte[] EAP_SIM_CHALLENGE_RESPONSE_WITH_MAC = hexStringToByteArray( 187 "02" + ID + "001C" // EAP-Response | ID | length in bytes 188 + "120b0000" // EAP-SIM | Challenge | 2B padding 189 + "0B050000" + COMPUTED_MAC_STRING); // AT_MAC attribute 190 public static final byte[] EAP_SIM_NOTIFICATION_REQUEST_WITH_EMPTY_MAC = hexStringToByteArray( 191 "01" + ID + "0020" // EAP-Request | ID | length in bytes 192 + "120C0000" // EAP-SIM | Notification | 2B padding 193 + "0C010000" // AT_NOTIFICATION attribute 194 + "0B05000000000000000000000000000000000000"); // empty AT_MAC attribute 195 public static final byte[] EAP_SIM_NOTIFICATION_RESPONSE_WITH_EMPTY_MAC = hexStringToByteArray( 196 "02" + ID + "001C" // EAP-Response | ID | length in bytes 197 + "120C0000" // EAP-SIM | Notification | 2B padding 198 + "0B05000000000000000000000000000000000000"); // empty AT_MAC attribute 199 public static final byte[] EAP_SIM_NOTIFICATION_RESPONSE_WITH_MAC = hexStringToByteArray( 200 "02" + ID + "001C" // EAP-Response | ID | length in bytes 201 + "120C0000" // EAP-SIM | Notification | 2B padding 202 + "0B050000" + COMPUTED_MAC_STRING); // AT_MAC attribute 203 204 public static final byte[] EAP_AKA_IDENTITY_RESPONSE = 205 hexStringToByteArray("02" + ID + "001C" // EAP-Response | ID | length in bytes 206 + "17050000" // EAP-AKA | Identity | 2B padding 207 + "0E050010" + EAP_AKA_IDENTITY_BYTES); // AT_IDENTITY ("0" + IMSI) 208 209 // Base64 of: FF0111 210 public static final String EAP_AKA_UICC_RESP_INVALID_TAG = "/wER"; 211 212 // Base64 of: DC0E112233445566778899AABBCCDDEE 213 public static final String EAP_AKA_UICC_RESP_SYNCHRONIZE_BASE_64 = "3A4RIjNEVWZ3iJmqu8zd7g=="; 214 215 public static final byte[] EAP_AKA_SYNCHRONIZATION_FAILURE = 216 hexStringToByteArray("02" + ID + "0018" // EAP-Response | ID | length in bytes 217 + "17040000" // EAP-SIM | Synchronization-Failure | 2B padding 218 + "0404112233445566778899AABBCCDDEE"); // AT_AUTS attribute 219 220 public static final String CK = "00112233445566778899AABBCCDDEEFF"; 221 public static final byte[] CK_BYTES = hexStringToByteArray(CK); 222 public static final String IK = "FFEEDDCCBBAA99887766554433221100"; 223 public static final byte[] IK_BYTES = hexStringToByteArray(IK); 224 225 // Base-64 of: 'DB05' + RES_BYTES + '10' + CK + '10' + IK 226 // 'DB0511223344551000112233445566778899AABBCCDDEEFF10FFEEDDCCBBAA99887766554433221100' 227 public static final String EAP_AKA_UICC_RESP_SUCCESS_BASE_64 = 228 "2wURIjNEVRAAESIzRFVmd4iZqrvM3e7/EP/u3cy7qpmId2ZVRDMiEQA="; 229 230 public static final byte[] EAP_AKA_AUTHENTICATION_REJECT = 231 hexStringToByteArray("02" + ID + "000817020000"); 232 public static final String EAP_AKA_CHALLENGE_RESPONSE_MAC = "7086E8341306F99CDB949DBE9CAC4EB2"; 233 public static final byte[] EAP_AKA_CHALLENGE_RESPONSE_MAC_BYTES = 234 hexStringToByteArray(EAP_AKA_CHALLENGE_RESPONSE_MAC); 235 public static final byte[] EAP_AKA_CHALLENGE_RESPONSE_TYPE_DATA = 236 hexStringToByteArray( 237 "01000003030028" + RES + "0000000B050000" + EAP_AKA_CHALLENGE_RESPONSE_MAC); 238 public static final byte[] EAP_AKA_CHALLENGE_RESPONSE = 239 hexStringToByteArray( 240 "02100028" // EAP-Response | ID | length in bytes 241 + "17010000" // EAP-AKA | Challenge | 2B padding 242 + "03030028" + RES + "000000" // AT_RES attribute 243 + "0B050000" + EAP_AKA_CHALLENGE_RESPONSE_MAC); // AT_MAC attribute 244 245 public static final byte[] EAP_SUCCESS = hexStringToByteArray("03860004"); 246 247 public static final byte[] EAP_REQUEST_MSCHAP_V2 = 248 hexStringToByteArray("01" + ID + "00061A01"); 249 250 // MSCHAPv2 Test vectors taken from RFC 2759#9.2 and RFC 3079#3.5.3 251 public static final String MSCHAP_V2_USERNAME = "User"; 252 public static final String MSCHAP_V2_USERNAME_HEX = "55736572"; 253 public static final byte[] MSCHAP_V2_USERNAME_ASCII_BYTES = 254 hexStringToByteArray(MSCHAP_V2_USERNAME_HEX); 255 public static final String MSCHAP_V2_PASSWORD = "clientPass"; 256 public static final byte[] MSCHAP_V2_PASSWORD_UTF_BYTES = 257 hexStringToByteArray("63006C00690065006E0074005000610073007300"); 258 public static final String MSCHAP_V2_AUTHENTICATOR_CHALLENGE_STRING = 259 "5B5D7C7D7B3F2F3E3C2C602132262628"; 260 public static final byte[] MSCHAP_V2_AUTHENTICATOR_CHALLENGE = 261 hexStringToByteArray(MSCHAP_V2_AUTHENTICATOR_CHALLENGE_STRING); 262 public static final String MSCHAP_V2_PEER_CHALLENGE_STRING = "21402324255E262A28295F2B3A337C7E"; 263 public static final byte[] MSCHAP_V2_PEER_CHALLENGE = 264 hexStringToByteArray(MSCHAP_V2_PEER_CHALLENGE_STRING); 265 public static final byte[] MSCHAP_V2_CHALLENGE = hexStringToByteArray("D02E4386BCE91226"); 266 public static final byte[] MSCHAP_V2_PASSWORD_HASH = 267 hexStringToByteArray("44EBBA8D5312B8D611474411F56989AE"); 268 public static final byte[] MSCHAP_V2_PASSWORD_HASH_HASH = 269 hexStringToByteArray("41C00C584BD2D91C4017A2A12FA59F3F"); 270 public static final String MSCHAP_V2_NT_RESPONSE_STRING = 271 "82309ECD8D708B5EA08FAA3981CD83544233114A3D85D6DF"; 272 public static final byte[] MSCHAP_V2_NT_RESPONSE = 273 hexStringToByteArray(MSCHAP_V2_NT_RESPONSE_STRING); 274 public static final byte[] MSCHAP_V2_AUTHENTICATOR_RESPONSE = 275 hexStringToByteArray("407A5589115FD0D6209F510FE9C04566932CDA56"); 276 public static final byte[] MSCHAP_V2_MASTER_KEY = 277 hexStringToByteArray("FDECE3717A8C838CB388E527AE3CDD31"); 278 279 // generated based on RFC 3079#3.5.3 params 280 public static final String SEND_KEY = "D5F0E9521E3EA9589645E86051C82226"; 281 public static final byte[] MSCHAP_V2_SEND_START_KEY = hexStringToByteArray(SEND_KEY); 282 283 // This value is labeled 'send key' in RFC 3079#3.5.3. However, it's used as 'receive key' here, 284 // because send and receive keys are swapped for peers relative to authenticators. 285 public static final String RECEIVE_KEY = "8B7CDC149B993A1BA118CB153F56DCCB"; 286 public static final byte[] MSCHAP_V2_RECEIVE_START_KEY = hexStringToByteArray(RECEIVE_KEY); 287 288 // MSK: MSCHAP_V2_SEND_START_KEY + MSCHAP_V2_RECEIVE_START_KEY, padded to 64B 289 public static final byte[] MSCHAP_V2_MSK = 290 hexStringToByteArray( 291 SEND_KEY 292 + RECEIVE_KEY 293 + "0000000000000000000000000000000000000000000000000000000000000000"); 294 public static final int MSCHAP_V2_EMSK_LEN = 64; 295 public static final byte[] MSCHAP_V2_EMSK = new byte[MSCHAP_V2_EMSK_LEN]; 296 297 public static final String MSCHAP_V2_ID = "42"; 298 public static final int MSCHAP_V2_ID_INT = Integer.parseInt(MSCHAP_V2_ID, 16 /* radix */); 299 public static final byte[] EAP_MSCHAP_V2_CHALLENGE_RESPONSE = 300 hexStringToByteArray("02" + ID + "003F" // EAP-Response | ID | length in bytes 301 + "1A02" + MSCHAP_V2_ID // EAP-MSCHAPv2 | Response | MSCHAPv2 ID 302 + "003A31" // MS length | Value Size (0x31) 303 + MSCHAP_V2_PEER_CHALLENGE_STRING 304 + "0000000000000000" // 8B (reserved) 305 + MSCHAP_V2_NT_RESPONSE_STRING 306 + "00" // Flags (always 0) 307 + MSCHAP_V2_USERNAME_HEX); 308 309 public static final byte[] EAP_MSCHAP_V2_SUCCESS_RESPONSE = 310 hexStringToByteArray("02" + ID + "0006" // EAP-Response | ID | length in bytes 311 + "1A03"); // EAP-MSCHAPv2 | Success 312 313 public static final byte[] INVALID_AUTHENTICATOR_RESPONSE = new byte[20]; 314 315 public static final byte[] EAP_MSCHAP_V2_FAILURE_RESPONSE = 316 hexStringToByteArray("02" + ID + "0006" // EAP-Response | ID | length in bytes 317 + "1A04"); // EAP-MSCHAPv2 | Failure 318 319 public static final byte[] EAP_AKA_PRIME_REQUEST = 320 hexStringToByteArray("01" + ID + "000832050000"); 321 public static final byte[] EAP_AKA_PRIME_CLIENT_ERROR_UNABLE_TO_PROCESS = 322 hexStringToByteArray("02" + ID + "000C320E000016010000"); 323 public static final String EAP_AKA_PRIME_IDENTITY = "36313233343536373839303132333435"; 324 public static final byte[] EAP_AKA_PRIME_IDENTITY_BYTES = 325 hexStringToByteArray(EAP_AKA_PRIME_IDENTITY); 326 public static final byte[] EAP_AKA_PRIME_IDENTITY_RESPONSE = 327 hexStringToByteArray( 328 "02" + ID + "001C" // EAP-Response | ID | length in bytes 329 + "32050000" // EAP-AKA' | Identity | 2B padding 330 + "0E050010" + EAP_AKA_PRIME_IDENTITY); // AT_IDENTITY ("6" + IMSI) 331 public static final byte[] EAP_AKA_PRIME_AUTHENTICATION_REJECT = 332 hexStringToByteArray( 333 "02" + ID + "0008" // EAP-Response | ID | length in bytes 334 + "32020000"); // EAP-AKA' | Authentication Reject | 2B padding 335 336 // EAP-TTLS test vectors 337 public static final String EAP_DUMMY_REQUEST = "011000051A"; 338 public static final String EAP_DUMMY_RESPONSE = "021000051A"; 339 public static final String EAP_TTLS_DUMMY_DATA = 340 "17010160301000E050010a516030100a010000a151603010036313233343" 341 + "5363738393031323334003A31316030100a55a51603320500000100a516030100a50"; 342 public static final String EAP_TTLS_DUMMY_DATA_INITIAL_FRAGMENT = 343 "36313233343536373839303132333435030100a010000a151603010036313" 344 + "2333435363738393031323334003A31316030100a55a51603320500000100a51603"; 345 public static final String EAP_TTLS_DUMMY_DATA_FINAL_FRAGMENT = 346 "010000a10E050010320200000000000000000000"; 347 public static final String EAP_TTLS_DUMMY_DATA_ASSEMBLED_FRAGMENT = 348 EAP_TTLS_DUMMY_DATA_INITIAL_FRAGMENT + EAP_TTLS_DUMMY_DATA_FINAL_FRAGMENT; 349 350 public static final byte[] EAP_DUMMY_REQUEST_BYTES = hexStringToByteArray(EAP_DUMMY_REQUEST); 351 public static final byte[] EAP_DUMMY_RESPONSE_BYTES = hexStringToByteArray(EAP_DUMMY_RESPONSE); 352 public static final byte[] EAP_TTLS_DUMMY_DATA_BYTES = 353 hexStringToByteArray(EAP_TTLS_DUMMY_DATA); 354 public static final byte[] EAP_TTLS_DUMMY_DATA_ASSEMBLED_FRAGMENT_BYTES = 355 hexStringToByteArray(EAP_TTLS_DUMMY_DATA_ASSEMBLED_FRAGMENT); 356 public static final byte[] EAP_TTLS_DUMMY_DATA_INITIAL_FRAGMENT_BYTES = 357 hexStringToByteArray(EAP_TTLS_DUMMY_DATA_INITIAL_FRAGMENT); 358 public static final byte[] EAP_TTLS_DUMMY_DATA_FINAL_FRAGMENT_BYTES = 359 hexStringToByteArray(EAP_TTLS_DUMMY_DATA_FINAL_FRAGMENT); 360 361 public static final byte[] EAP_REQUEST_TTLS_START = 362 hexStringToByteArray( 363 "01" + ID + "0006" // EAP-REQUEST | ID | length in bytes 364 + "1520"); // EAP-TTLS | flags 365 public static final byte[] EAP_RESPONSE_TTLS_WITH_LENGTH = 366 hexStringToByteArray( 367 "02" + ID + "004A" // EAP-RESPONSE | ID | length in bytes 368 + "158000000040" // EAP-TTLS | flags | message length in bytes 369 + EAP_TTLS_DUMMY_DATA); 370 public static final byte[] EAP_RESPONSE_TTLS_WITHOUT_LENGTH = 371 hexStringToByteArray( 372 "02" + ID + "0046" // EAP-RESPONSE | ID | length in bytes 373 + "1500" // EAP-TTLS | flags 374 + EAP_TTLS_DUMMY_DATA); 375 public static final byte[] EAP_RESPONSE_TTLS_INITIAL_FRAGMENT = 376 hexStringToByteArray( 377 "02" + ID + "004A" // EAP-RESPONSE | ID | length in bytes 378 + "15C000000054" // EAP-TTLS | flags | message length in bytes 379 + EAP_TTLS_DUMMY_DATA_INITIAL_FRAGMENT); 380 public static final byte[] EAP_RESPONSE_TTLS_FINAL_FRAGMENT = 381 hexStringToByteArray( 382 "02" + ID + "001A" // EAP-RESPONSE | ID | length in bytes 383 + "1500" // EAP-TTLS | flags 384 + EAP_TTLS_DUMMY_DATA_FINAL_FRAGMENT); 385 public static final byte[] EAP_RESPONSE_TTLS_ACK = 386 hexStringToByteArray( 387 "02" + ID + "0006" // EAP-RESPONSE | ID | length in bytes 388 + "1500"); // EAP-TTLS | flags 389 public static final byte[] EAP_MESSAGE_AVP_EAP_REQUEST = 390 hexStringToByteArray( 391 "0000004F" 392 + "40" 393 + "00000D" // AVP Code | AVP Flags | Avp Length 394 + EAP_DUMMY_REQUEST // EAP-REQUEST 395 + "000000"); // Padding 396 public static final byte[] EAP_MESSAGE_AVP_EAP_RESPONSE = 397 hexStringToByteArray( 398 "0000004F" 399 + "40" 400 + "00000D" // AVP Code | AVP Flags | Avp Length 401 + EAP_DUMMY_RESPONSE // EAP-RESPONSE 402 + "000000"); // Padding 403 } 404