源码对照:5.2.2.2.1
禁止的 PPR / TC_eUICC_ForbiddenPPRs
左侧为人工切片入口(-man,来自 原料/切片 的最小可执行脚本),右侧为 Cas 盲生成入口(-cas,仅依据规范生成)。文件按原始编码(多为 GBK)解码为 UTF-8 显示,行号自 1 起;字节级原文与 sha256 见两侧脚本包。完整 unified diff 见本页底部折叠区,以及 报告原文 §4。
-man 入口
Import/TestCase_SGP_23.js
160 行 / 6863 字符 / gb18030
-cas 入口
TC_eUICC_ForbiddenPPRs/Import/TC_eUICC_ForbiddenPPRs.js
318 行 / 29664 字符 / gb18030
默认折行显示长行;取消勾选可横向滚动查看原始行宽
-man 人工切片Import/TestCase_SGP_23.js160 行 / 6863 字符 / gb18030入口函数 @L3
1// slice of Import\TestCase_SGP_23.js - cases: TC_eUICC_ForbiddenPPRs_01_Nominal_PPR1_management_and_handling_when_Operational_Profile_is_installed (extracted verbatim)
2
3function TC_eUICC_ForbiddenPPRs_01_Nominal_PPR1_management_and_handling_when_Operational_Profile_is_installed()
4{
5
6 tracenamestr = "卡内存在一个Operational的profile,不允许再下载一个PPR1的profile";
7 curDis.TraceStart(sno++,tracenamestr);
8
9 curLogicChannel = 0;
10 curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
11 Ini_powerOn_eUICC_LPAe_not_activate();
12
13 curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
14 TS_MANAGE_CHANNEL_OPEN();
15
16 curLogicChannel = 1;
17
18 curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
19 TS_SELECT("Select ISD",ISD_R_AID,"9000");
20
21 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,检查forbiddenProfilePolicyRules;");
22 var euiccInfo2 = new EUICCInfo2();
23 var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
24
25 euiccInfo2.checkCardResDataFormat(hexData);
26
27 try
28 {
29 curStrHandle.CheckData("不存在", euiccInfo2.forbiddenProfilePolicyRules, "forbiddenProfilePolicyRules");
30 }catch(e){
31 obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
32 }
33
34 curDis.TestStepStart2(stno++,"下载PROFILE_OPERATIONAL1;");
35
36
37 var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
38 Profile_load_procedure.ICCID = ICCID_OP_PROF1;
39 Profile_load_procedure.ES10b_GetEUICCInfo1();
40
41 Profile_load_procedure.ES10b_GetEUICCChallenge();
42
43 Profile_load_procedure.ES10b_AuthenticateServer();
44
45 Profile_load_procedure.ES10b_PrepareDownload();
46
47 Profile_load_procedure.ES10b_GetEID();
48
49
50 Profile_load_procedure.serviceProviderName = SP_NAME1; //SP Name 1
51 Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
52 Profile_load_procedure.iconType = "01";
53 Profile_load_procedure.icon = ICON_OP_PROF1;
54 Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
55 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
56 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
57 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;
58 Profile_load_procedure.profileOwner = OWNER_OP_PROF1;
59 Profile_load_procedure.profileClass = "02";
60 Profile_load_procedure.mccMnc = MCC_MNC1;
61
62 Profile_load_procedure.ES10b_LoadBoundProfilePackage();
63
64 var ISD_P_Test01 = curProfile_ISD_P_AID;
65
66 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,检查forbiddenProfilePolicyRules;");
67 var euiccInfo2 = new EUICCInfo2();
68 var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
69
70 euiccInfo2.checkCardResDataFormat(hexData);
71
72 try
73 {
74 var curforbiddenPPR = "0640";
75 curStrHandle.CheckData(curforbiddenPPR, euiccInfo2.forbiddenProfilePolicyRules, "forbiddenProfilePolicyRules");
76
77
78 }catch(e){
79 obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
80 }
81
82
83 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo1Request;");
84 var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL4_DATA);
85 Profile_load_procedure.ICCID = ICCID_OP_PROF4;
86 Profile_load_procedure.ES10b_GetEUICCInfo1();
87
88
89 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
90 Profile_load_procedure.ES10b_GetEUICCChallenge();
91
92 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行AuthenticateServerRequest;");
93 Profile_load_procedure.ES10b_AuthenticateServer();
94
95 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行PrepareDownloadRequest;");
96 Profile_load_procedure.ES10b_PrepareDownload();
97
98 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccDataRequest(GetEID);");
99 Profile_load_procedure.ES10b_GetEID();
100
101 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage;");
102 Profile_load_procedure.serviceProviderName = SP_NAME4;
103 Profile_load_procedure.profileName = NAME_OP_PROF4;
104 Profile_load_procedure.iconType = "01";
105 Profile_load_procedure.icon = ICON_OP_PROF4;
106 Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
107 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
108 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
109 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS4;
110 Profile_load_procedure.profilePolicyRules = "0640";
111 Profile_load_procedure.mccMnc = MCC_MNC4;
112 Profile_load_procedure.profileClass = "02";
113
114 Profile_load_procedure.isErrorTest = true;
115 Profile_load_procedure.bppCommandId = BppCommandId.storeMetadata;;
116 Profile_load_procedure.errorReason = ErrorReason.pprNotAllowed;
117 Profile_load_procedure.ES10b_LoadBoundProfilePackage();
118
119 curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
120 TS_SELECT("Select ISD",ISD_R_AID,"9000");
121
122 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ProfileInfoListRequest,获取profile状态;");
123 var proInfoListRequest = new ProfileInfoListRequest();
124 proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF1);
125 proInfoListRequest.tagList = "5A4F9F70";
126 proInfoListRequest.GenHexData();
127 var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
128
129 var proInfoListResponse = new ProfileInfoListResponse();
130 proInfoListResponse.checkCardResDataFormat(respData);
131
132 try
133 {
134 curStrHandle.CheckData(ICCID_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].iccid, "ICCID");
135 curStrHandle.CheckData(ISD_P_Test01, proInfoListResponse.profileInfoListOk.arrOfElement[0].isdpAid, "ISD-P AID");
136 curStrHandle.CheckData(Profile_DISABLED, proInfoListResponse.profileInfoListOk.arrOfElement[0].profileState, "profile State");
137 }catch(e){
138 obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
139 }
140
141 var proInfoListRequest = new ProfileInfoListRequest();
142 proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF4);
143 proInfoListRequest.tagList = "5A4F9F70";
144 proInfoListRequest.GenHexData();
145 var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
146
147 var proInfoListResponse = new ProfileInfoListResponse();
148 proInfoListResponse.checkCardResDataFormat(respData);
149
150 try
151 {
152 curStrHandle.CheckData("00", obj.ToHex(proInfoListResponse.profileInfoListOk.arrOfElement.length),"Profile Info number");
153 }catch(e){
154 obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
155 }
156
157
158 RecoverCard();
159}
160
-cas 盲生成TC_eUICC_ForbiddenPPRs/Import/TC_eUICC_ForbiddenPPRs.js318 行 / 29664 字符 / gb18030入口函数 @L15
1// Author: 卡思Cas智能体
2// Date: 20261004-022946
3// Function: (purpose 原文未由 SGP.23 该 TC 提供,corpus vacuum 登记)TC_eUICC_ForbiddenPPRs,Test Sequence #01 Nominal: PPR1 management and handling when Operational Profile is installed(本 TC 单条 Test Sequence),适用性 M。
4// Test points: ICH-IC1-K1-C1 ATR_present;ICH-IC1-K2-C2 FCP_Template;ICH-IC1-K2-C4 SW
5// ICH-IC1-K3-C4 SW;ICH-IC1-K4-C4 final SW;ICH-IC2-K1-C4 SW;ICH-IC2-K1-C3 CHANNEL_NUMBER extracted
6// ICH-IC2-K2-C4 SW;S1-C1 forbidden PP Rules do not contain ppr1;S1-C2 R_EUICC_INFO2 outer tag
7// S1-C2 R_EUICC_INFO2 required members present;S3-C1 forbidden PP Rules contain ppr1
8// S3-C2 R_EUICC_INFO2 outer tag;S3-C2 R_EUICC_INFO2 required members present;S9-C1 SW
9// S9-C2 response data absent;S10-C1 SW;S10-C2 response data absent;S11-C1 SW;S12-C1 SW
10// S12-C2 contains PROFILE_INFO1_DISABLED;S14-C1 forbidden PP Rules do not contain ppr1
11// S14-C2 R_EUICC_INFO2 outer tag;S14-C2 R_EUICC_INFO2 required members present
12// 本函数由 CaseIR 5.2.2.2.1 编译生成(experiments/5.2.2.2.1-TC_eUICC_ForbiddenPPRs-20261004_022946,SGP.23 v1.16 × SGP.22 v2.7):字节权威=CaseIR,非誊录黄金脚本。
13// Value-free template: every data byte is injected from CaseIR fields; no scaffold globals (see docs/speconly/compile-symbol-migration.md).
14// 适用性 M:编译期门,运行时由 harness 环境前置承担。
15function TC_eUICC_ForbiddenPPRs_01_merged() {
16 var bind = curBind;
17 // GEN-IC-1 卡态声明(E 段 General Initial Conditions,编排责任):There is no Profile installed in the eUICC: declared unexpanded (non-PROC row or K corpus vacuum; see CaseIR open_items).
18
19 // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 1):RESET(K 语料机械展开)
20 var s15 = bind.resetAndAtr();
21 bind.checkData("ICH-IC1-K1-C1 ATR_present", "1", s15.atr_hex !== "" ? "1" : "0");
22
23 // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 2):SELECT_MF(K 语料机械展开)
24 // FCP outer tag not materialized from clause: tag-face asserted only when corpus fixes the tag byte (e.g. TS 102 221 FCP '62').
25 var s16 = bind.sendApdu("00", "A4", "00", "04", "3F00", "00", "9000");
26 bind.checkData("ICH-IC1-K2-C2 FCP_Template", "1", s16.resp.length > 0 ? "1" : "0");
27 bind.checkData("ICH-IC1-K2-C4 SW", "9000", s16.sw);
28
29 // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 3):TERMINAL_CAPABILITY_LPAd(K 语料机械展开)
30 var s17 = bind.sendApdu("80", "AA", "00", "00", "A9058100830107", null, "9000");
31 bind.checkData("ICH-IC1-K3-C4 SW", "9000", s17.sw);
32
33 // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 4):TERMINAL_PROFILE(K 语料机械展开)
34 var steady18 = bind.runToSteadyState(function () {
35 return bind.sendTerminalProfile("FFFFFFFF7F9D00DFBF00001FE2000000C7EB0000000168005000000000000200", "9000");
36 });
37 bind.checkData("ICH-IC1-K4-C4 final SW", "9000", steady18.final.sw);
38
39 // IC head inline (initial_conditions → PROC_OPEN_LOGICAL_CHANNEL_AND_SELECT_ISDR, K row 1):MANAGE_CHANNEL_OPEN(K 语料机械展开)
40 // CHANNEL_NUMBER extraction and dynamic CLA rebinding are CasBind internal state (chaining rule; no generated-code re-implementation).
41 var s19 = bind.manageChannelOpen("9000");
42 bind.checkData("ICH-IC2-K1-C4 SW", "9000", s19.sw);
43 bind.checkData("ICH-IC2-K1-C3 CHANNEL_NUMBER extracted", "1", s19.chan !== null ? "1" : "0");
44
45 // IC head inline (initial_conditions → PROC_OPEN_LOGICAL_CHANNEL_AND_SELECT_ISDR, K row 2):MTD_SELECT(K 语料机械展开)
46 // CLA = bound channel (cla_rule) and <L> length binding are CasBind internal state (chaining rule; no generated-code re-implementation).
47 var s20 = bind.sendApdu(null, "A4", "04", "00", "A0000005591010FFFFFFFF8900000100", null, "9000");
48 // MTD_SELECT expected face is SW-only (K Annex C.2 open-channel procedure step 2: no FCI content assertion in corpus); no fabricated template parse.
49 bind.checkData("ICH-IC2-K2-C4 SW", "9000", s20.sw);
50
51 // 步骤 1:MTD_STORE_DATA(tc_step;REQ: RQ57_053, RQ57_054, RQ57_056, RQ57_057)
52 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
53 var sdCla1 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
54 var s1 = bind.sendApdu(sdCla1, "E2", "91", "00", "BF2200", "00", null);
55 // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
56 var gw1 = BindGecaProc.parseGecaResponse(s1.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
57 var fppr1 = null; for (var fpi1 = 0; fpi1 < gw1.children.length; fpi1++) { if (gw1.children[fpi1].tag === "99") { fppr1 = gw1.children[fpi1].value; } }
58 var fpprSet1 = (fppr1 !== null && fppr1.length >= 4 && (parseInt(fppr1.substring(2, 4), 16) & 64) !== 0);
59 bind.checkData("S1-C1 forbidden PP Rules do not contain ppr1", "1", !fpprSet1 ? "1" : "0");
60 bind.checkData("S1-C2 R_EUICC_INFO2 outer tag", "BF22", gw1.outer_tag === null ? "absent" : gw1.outer_tag);
61 bind.checkData("S1-C2 R_EUICC_INFO2 required members present", "1", gw1.ok ? "1" : "0");
62
63 // 步骤 2:Install PROFILE_OPERATIONAL1(tc_step;REQ: RQ57_057)
64 // card-state orchestration declaration (no APDU face): execution is
65 // the batch card_state prep framework's responsibility (4227 ruling B
66 // same-family scope; ensure_profile_state / prep_packager);
67 // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
68
69 // 步骤 3:MTD_STORE_DATA(tc_step;REQ: RQ57_053, RQ57_054, RQ57_056)
70 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
71 var sdCla3 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
72 var s3 = bind.sendApdu(sdCla3, "E2", "91", "00", "BF2200", "00", null);
73 // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
74 var gw3 = BindGecaProc.parseGecaResponse(s3.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
75 var fppr3 = null; for (var fpi3 = 0; fpi3 < gw3.children.length; fpi3++) { if (gw3.children[fpi3].tag === "99") { fppr3 = gw3.children[fpi3].value; } }
76 var fpprSet3 = (fppr3 !== null && fppr3.length >= 4 && (parseInt(fppr3.substring(2, 4), 16) & 64) !== 0);
77 bind.checkData("S3-C1 forbidden PP Rules contain ppr1", "1", fpprSet3 ? "1" : "0");
78 bind.checkData("S3-C2 R_EUICC_INFO2 outer tag", "BF22", gw3.outer_tag === null ? "absent" : gw3.outer_tag);
79 bind.checkData("S3-C2 R_EUICC_INFO2 required members present", "1", gw3.ok ? "1" : "0");
80
81 // 步骤 4:Seq#01 Step4] Execute the Common Mutual Authentication procedure between the eUICC and the S_SM-DP+ #GET_EUICC_INFO1, #GET_EUICC_CHALLENGE and #AUTHENTICATE_SMDP are sent to the eUICC the same GSMA CI is chosen for signing and for verification(tc_step)
82 // W3D CMA 过程声明行内联动态绑定(三命令链;声明面 = command.dynamic_template + 顶层 dynamic_templates.es10b_authenticate_server;物料 sha256 锚编译期已核;421324 IC6 dynamic-bound 先例机制面)
83 // CMA 链命令 1/3 GetEuiccInfo1(BF20 空结构,S22_info §5.7.8):
84 var cma4I1 = bind.sendApdu(null, "E2", "91", "00", "BF2000", null, "9000");
85 var cma4Gw1 = BindGecaProc.parseGecaResponse(cma4I1.resp, {outer: "BF20", required: ["82", "A9", "AA"], optional: []});
86 // CMA 链命令 2/3 GetEuiccChallenge(BF2E 空结构,S22_challenge §5.7.7;响应 euiccChallenge 成员运行时提取):
87 var cma4C2 = bind.sendApdu(null, "E2", "91", "00", "BF2E00", null, "9000");
88 var cma4Ch = BindGecaProc.parseGecaResponse(cma4C2.resp, {outer: "BF2E", required: ["80"], optional: []});
89 // CMA 链命令 3/3 AuthenticateServer(BF38 引擎组装;槽位值=声明面分级注入):
90 var cma4Tid = "";
91 var cma4Sc = "";
92 for (var cma4Ri = 0; cma4Ri < 16; cma4Ri++) {
93 cma4Tid += bind.engine.Hex(Math.round(255 * Math.random()), 2);
94 cma4Sc += bind.engine.Hex(Math.round(255 * Math.random()), 2);
95 }
96 var cma4PkList = BindEs10xSingleRequest.parseBerTlv(cma4Gw1.fields["AA"] || "");
97 var cma4CiIds = ["F54172BDF98A95D65CBEB88A38A1C11D800A85C3", "C0BC70BA36929D43B467FF57570530E57AB8FCD8"];
98 var cma4Sks = ["0A7CC1C244E60C52CD5B7807AB8C360C26524601507DCABC5DD598B5A616D5D5", "93FB33D0584F349B07F8B5D2AF93D7C3E354B349A3B913502E6ABC070E4D4929"];
99 var cma4Certs = ["308201DFA00302010202020100300A06082A8648CE3D04030230443110300E06035504030C07546573742043493111300F060355040B0C0854455354434552543110300E060355040A0C0752535054455354310B3009060355040613024954301E170D3230303430313038333133305A170D3330303333303038333133305A3025310D300B060355040A0C0441434D453114301206035504030C0B5445535420534D2D44502B3059301306072A8648CE3D020106082A8648CE3D030107034200044DFED4F4694791BF1695CEA0307A35B418019695387BB75B7D2447B6B5209F0445AE4E5E521CD13888D75FE07C8580222AE20DBAAC1D77CD76304993421BD739A381DF3081DC301F0603551D23041830168014F54172BDF98A95D65CBEB88A38A1C11D800A85C3301D0603551D0E04160414BD5A82CC1A96602118BA7560A1FF83A78B210BE5300E0603551D1104073005880388370A300E0603551D0F0101FF04040302078030170603551D200101FF040D300B300906076781120102010430610603551D1F045A3058302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D412E63726C302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D422E63726C300A06082A8648CE3D040302034700304402200823EE7DFA5E3DD07838E930F81BC34AE99F06CBA35927FE9E502C464DC1FEE302200D2D4087DB01A5382D21690AC0488B15067FB2460D336332446CA99F08A8A4EF", "308201E0A00302010202020100300A06082A8648CE3D04030230443110300E06035504030C07546573742043493111300F060355040B0C0854455354434552543110300E060355040A0C0752535054455354310B3009060355040613024954301E170D3230303430313038333133305A170D3330303333303038333133305A3025310D300B060355040A0C0441434D453114301206035504030C0B5445535420534D2D44502B305A301406072A8648CE3D020106092B240303020801010703420004255D7DAF00EF841D76FA7A63D63EB3FE6C9F70492D381923F8F8BD7B24F3C5AD168EBE3B09DD80F29E7FFD24A4D1BE747F8323E472928396DDE9E0151CEABA18A381DF3081DC301F0603551D23041830168014C0BC70BA36929D43B467FF57570530E57AB8FCD8301D0603551D0E0416041479A4BD4D78FF4734BC6045CF9196244A1FB84BEB300E0603551D1104073005880388370A300E0603551D0F0101FF04040302078030170603551D200101FF040D300B300906076781120102010430610603551D1F045A3058302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D412E63726C302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D422E63726C300A06082A8648CE3D0403020347003044022003078BD459045184BC50C1397141F8B90398E6B81737EC703403D5CB0DC0DFC302201A38E7FC84D3DB1179FBB17199231F2D635ED7A8AB4049774057B0ACDF726063"];
100 var cma4Dps = [["FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B", "046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5", "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"], ["A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", "048BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7"]];
101 var cma4Sel = -1;
102 for (var cma4Pi = 0; cma4Pi < cma4PkList.length && cma4Sel < 0; cma4Pi++) {
103 for (var cma4Mi = 0; cma4Mi < cma4CiIds.length; cma4Mi++) {
104 if (cma4PkList[cma4Pi].value === cma4CiIds[cma4Mi]) { cma4Sel = cma4Mi; break; }
105 }
106 }
107 var cma4Ech = "";
108 for (var cma4Ei = 0; cma4Ei < cma4Ch.children.length; cma4Ei++) {
109 if (cma4Ch.children[cma4Ei].tag === "80") { cma4Ech = cma4Ch.children[cma4Ei].value; }
110 }
111 if (cma4Sel < 0 || cma4Ech === "") {
112 // fail-closed 诚实面:CI PK ID 零命中物料套或 euiccChallenge 缺席 → BF38 不发送,后续过程面如实失败。
113 } else {
114 bind.engine.InitEccDomainParams(cma4Dps[cma4Sel][0], cma4Dps[cma4Sel][1], cma4Dps[cma4Sel][2], cma4Dps[cma4Sel][3], cma4Dps[cma4Sel][4], 1);
115 var cma4S1 = BindEs10xSingleRequest.buildTlv("30",
116 BindEs10xSingleRequest.buildTlv("80", cma4Tid)
117 + BindEs10xSingleRequest.buildTlv("81", cma4Ech)
118 + BindEs10xSingleRequest.buildTlv("83", "1674657374736D6470706C7573312E6578616D706C652E636F6D")
119 + BindEs10xSingleRequest.buildTlv("84", cma4Sc));
120 var cma4Sgn = "";
121 while (cma4Sgn.length != 2 * cma4Sks[cma4Sel].length) {
122 bind.engine.SleepTime(2000);
123 cma4Sgn = bind.engine.EccSignData(cma4Sks[cma4Sel], cma4S1, 33);
124 }
125 var cma4Asm = BindEs10bAuthServer.assembleAuthenticateServer(
126 {outer: "BF38",
127 signed1: {tag: "30", transactionId: "80", euiccChallenge: "81", serverAddress: "83", serverChallenge: "84"},
128 serverSignature1: "5F37", euiccCiPKIdToBeUsed: "04", serverCertificate: "30", ctxParams1: "A0"},
129 {transactionId: cma4Tid, euiccChallenge: cma4Ech,
130 serverAddress: "1674657374736D6470706C7573312E6578616D706C652E636F6D", serverChallenge: cma4Sc,
131 serverSignature1: cma4Sgn, euiccCiPKIdToBeUsed: cma4CiIds[cma4Sel],
132 serverCertificate: cma4Certs[cma4Sel], ctxParams1: "A10D800400000110A1058003000010"});
133 if (cma4Asm.error) {
134 } else {
135 var cma4Run = BindEs10xSingleRequest.runTransport(bind.sendApdu,
136 {cla: "", ins: "E2", p1: "91", p2: "00", data: cma4Asm.request_hex,
137 le: "00", blockSize: 255, blockSw: "9000", final_sw: "9000"});
138 var cma4Sw = (cma4Run.final && cma4Run.final.sw) ? cma4Run.final.sw : "transport_error";
139 var cma4Ex = BindEs10bAuthServer.extractAuthenticateServer(
140 {outer: "BF38",
141 ok: {tag: "A0", children: [
142 {name: "euiccSigned1", tag: "30", children: [
143 {name: "transactionId", tag: "80"},
144 {name: "serverAddress", tag: "83"},
145 {name: "serverChallenge", tag: "84"},
146 {name: "euiccInfo2", tag: "BF22"},
147 {name: "ctxParams1", tag: "A0"}]},
148 {name: "euiccSignature1", tag: "5F37"},
149 {name: "euiccCertificate", tag: "30"},
150 {name: "eumCertificate", tag: "30"}]},
151 error: {tag: "A1", children: [
152{name: "transactionId", tag: "80"},
153 {name: "authenticateErrorCode", tag: "81"}]}},
154 cma4Run.final ? cma4Run.final.resp : "");
155 var cma4OkBr = cma4Ex.branch === "ok" && cma4Ex.ok && cma4Ex.ok.missing.length === 0 && cma4Ex.ok.fields.euiccSigned1.children.missing.length === 0;
156 // euiccSignature1([5F37])运行时提取面登记:CMA 响应操作数供后续步(PREP_DOWNLOAD 签名明文)消费——5.2.2.2.1 后续 step5-8 属子过程声明/装配域,非本步发射面。
157 }
158 }
159
160 // 步骤 5:Seq#01 Step5] Execute the Sub-procedure Profile Download and Installation – End User Confirmation between the eUICC and the S_SM-DP+ #PREP_DOWNLOAD_NO_CC is sent to the eUICC(tc_step)
161 // PREP_DOWNLOAD 运行时绑定(PREP_DOWNLOAD_NO_CC;SGP.22 §5.7.5 PrepareDownloadRequest=BF21 成员序 smdpSigned2(30) → smdpSignature2(5F37) → smdpCertificate(30)):
162 // transactionId/euiccSignature1=前序 CMA 声明步 step4 运行时提取(§5.7.5 会话一致性同值要求,不新生成);smdpSignature2=EccSignData(DPpb SK, smdpSigned2 TLV‖5F37(euiccSignature1), 33)(S22_prep_dl+G Annex B+vendor GenRequest 三源对账);
163 // DPpb cert/SK=named_certs/named_sks 声明面(sha256 锚编译期已核;曲线套索引=CI 选择同号——同一 GSMA CI 链)。
164 var pd5Certs = ["308201DFA00302010202020101300A06082A8648CE3D04030230443110300E06035504030C07546573742043493111300F060355040B0C0854455354434552543110300E060355040A0C0752535054455354310B3009060355040613024954301E170D3230303430313038333434355A170D3330303333303038333434355A3025310D300B060355040A0C0441434D453114301206035504030C0B5445535420534D2D44502B3059301306072A8648CE3D020106082A8648CE3D03010703420004104C2AE3D02DEF9C979261A7C6710076B970721D0955A2644AE05FAE4BC2314E5DC09F6BF0118026165342E212318775E365F3B57325373066B9906E0BD1388DA381DF3081DC301F0603551D23041830168014F54172BDF98A95D65CBEB88A38A1C11D800A85C3301D0603551D0E04160414E6EAF71EE0FB9430ECCD1EBB421F881437C13263300E0603551D1104073005880388370A300E0603551D0F0101FF04040302078030170603551D200101FF040D300B300906076781120102010530610603551D1F045A3058302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D412E63726C302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D422E63726C300A06082A8648CE3D040302034800304502203EA51B0129FC11E843C38C8CB104244CCF92D8DDBCD4D5F9DAFD0AEF700A9B1C022100FEF382FF71FEFC58168A3607D5685DB7CB48F6B434261891496385BCD6B5857A", "308201E0A00302010202020101300A06082A8648CE3D04030230443110300E06035504030C07546573742043493111300F060355040B0C0854455354434552543110300E060355040A0C0752535054455354310B3009060355040613024954301E170D3230303430313038333434365A170D3330303333303038333434365A3025310D300B060355040A0C0441434D453114301206035504030C0B5445535420534D2D44502B305A301406072A8648CE3D020106092B240303020801010703420004893253ECC94C51DF4FEE6E0DB0951CFC65627481B5418E557069F487FAA15466A5CB8E10CC2B38099CF2A929F7F82DAC065126B71D0640961DB7F91A49E95612A381DF3081DC301F0603551D23041830168014C0BC70BA36929D43B467FF57570530E57AB8FCD8301D0603551D0E04160414A8C68DF449EB71EC723EAC132E40E4B6F54644FE300E0603551D1104073005880388370A300E0603551D0F0101FF04040302078030170603551D200101FF040D300B300906076781120102010530610603551D1F045A3058302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D412E63726C302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D422E63726C300A06082A8648CE3D04030203470030440220244ED22119D00D49D9EA4AC5D9A6D925FACFCD1998A96448A870CE47FE5E470E02206C4BC7223C925D548DDDD3D8DDD81118DA202973311F6012BB0A20E6DD2D7B7B"];
165 var pd5Sks = ["DCD694B778957E8E9ADDBDD94433E9EF8F73D11E491C48D425A38A9491BD3BED", "75FF322F416616DAE1A484EF71D4874FB0DF3295FD35C2CBA489FBB2BB9C7BF6"];
166 var pd5Tid = cma4Tid;
167 var pd5Sel = cma4Sel;
168 var pd5Sig1 = (typeof cma4Ex !== "undefined" && cma4Ex && cma4Ex.ok && cma4Ex.ok.fields.euiccSignature1) ? cma4Ex.ok.fields.euiccSignature1.value : "";
169 var pd5Dps = cma4Dps;
170 if (pd5Sel < 0 || pd5Sig1 === "") {
171 // fail-closed 诚实面:CMA 运行时操作数缺席(CMA 失败/未执行)→ BF21 不发送(前序 CMA 步断言面已计错,本步不伪造通过)。
172 } else {
173 bind.engine.InitEccDomainParams(pd5Dps[pd5Sel][0], pd5Dps[pd5Sel][1], pd5Dps[pd5Sel][2], pd5Dps[pd5Sel][3], pd5Dps[pd5Sel][4], 1);
174 var pd5S2 = BindEs10xSingleRequest.buildTlv("30",
175 BindEs10xSingleRequest.buildTlv("80", pd5Tid)
176 + BindEs10xSingleRequest.buildTlv("01", "00"));
177 var pd5Sgn = "";
178 while (pd5Sgn.length != 2 * pd5Sks[pd5Sel].length) {
179 bind.engine.SleepTime(2000);
180 pd5Sgn = bind.engine.EccSignData(pd5Sks[pd5Sel], pd5S2 + BindEs10xSingleRequest.buildTlv("5F37", pd5Sig1), 33);
181 }
182 var pd5Req = BindEs10xSingleRequest.buildTlv("BF21",
183 pd5S2
184 + BindEs10xSingleRequest.buildTlv("5F37", pd5Sgn)
185 + BindEs10xSingleRequest.buildTlv("30", pd5Certs[pd5Sel]));
186 var pd5Run = BindEs10xSingleRequest.runTransport(bind.sendApdu,
187 {cla: "", ins: "E2", p1: "91", p2: "00", data: pd5Req,
188 le: "00", blockSize: 255, blockSw: "9000", final_sw: "9000"});
189 var pd5Sw = (pd5Run.final && pd5Run.final.sw) ? pd5Run.final.sw : "transport_error";
190 // euiccOtpk(5F49)运行时提取面登记:响应 ok 分支 euiccSigned2 成员(BF21 A0 30 5F49 路径),供后续步(RETRY 形 bppEuiccOtpk/BPP 装配)消费。
191 var pd5Otpk = "";
192 if (pd5Run.final && pd5Run.final.resp) {
193 var pd5L1 = BindEs10xSingleRequest.parseBerTlv(pd5Run.final.resp);
194 for (var pd5I1 = 0; pd5I1 < pd5L1.length && pd5Otpk === ""; pd5I1++) {
195 if (pd5L1[pd5I1].tag !== "BF21") continue;
196 var pd5L2 = BindEs10xSingleRequest.parseBerTlv(pd5L1[pd5I1].value);
197 for (var pd5I2 = 0; pd5I2 < pd5L2.length && pd5Otpk === ""; pd5I2++) {
198 if (pd5L2[pd5I2].tag !== "A0") continue;
199 var pd5L3 = BindEs10xSingleRequest.parseBerTlv(pd5L2[pd5I2].value);
200 for (var pd5I3 = 0; pd5I3 < pd5L3.length && pd5Otpk === ""; pd5I3++) {
201 if (pd5L3[pd5I3].tag !== "30") continue;
202 var pd5L4 = BindEs10xSingleRequest.parseBerTlv(pd5L3[pd5I3].value);
203 for (var pd5I4 = 0; pd5I4 < pd5L4.length; pd5I4++) {
204 if (pd5L4[pd5I4].tag === "5F49") pd5Otpk = pd5L4[pd5I4].value;
205 }
206 }
207 }
208 }
209 }
210 }
211
212 // 步骤 6:Generate the <OTPK_S_SM_DP+_ECKA> and <OT_SK_S_SM_DP+_ECKA>(tc_step;non_wire)
213 // test-tool internal preparation (no APDU face): runtime-domain
214 // values per CaseIR unresolved (G Annex B generation rules);
215 // no fabricated bytes emitted here.
216
217 // 步骤 7:<BPP> = MTD_GENERATE_BPP(tc_step)
218 // BPP synthesized (5.2.2.2.1 seq#1, structural layer, SCP03t-unprotected): 1069 bytes; segments: INIT=191B, A0=7B, A1=74B, A3=797B.
219 // Segment bytes are runtime-domain (BPP load step data=null per CaseIR unresolved); not injected into this script. Provenance:
220 // [SPEC] TC — SGP.23 5.2.2.2.1 seq#1 接线(段选择/注入面)
221 // [SPEC] BF36 — SGP.22 §2.5.4 :1566 BoundProfilePackage [54]
222 // [SPEC] BF36/A0 — Table 4 :1588 firstSequenceOf87
223 // [SPEC] BF36/A1 — Table 4 :1590 sequenceOf88
224 // [SPEC] BF36/A3 — Table 4 :1595 sequenceOf86
225 // [HYPOTHESIS] 87/88/86 段值 — UNPROTECTED:明文承载,SCP03t 包壳属后续 lane
226 // [SPEC] BF23 — SGP.22 §5.5.1 :7241 InitialiseSecureChannelRequest [35]
227 // [SPEC] BF23/82 remoteOpId — SGP.22 :1400 RemoteOpId [2] INTEGER
228 // [HYPOTHESIS] BF23/80 transactionId — SM-DP+ 会话值,Annex E 缺席,调用方注入
229 // [SPEC] BF23/A6 controlRefTemplate — SGP.22 :7255-7263 CRT 子集
230 // [SPEC] BF23/A6/80 keyType — SGP.22 :7257 AES='88'
231 // [SPEC] BF23/A6/81 keyLen — SGP.22 :7259 SHALL be 0x10
232 // [HYPOTHESIS] BF23/A6/84 hostId — Host ID 值,Annex E 缺席
233 // [HYPOTHESIS] BF23/5F49 smdpOtpk — otPK.DP.ECKA,需真实密钥协商 lane
234 // [HYPOTHESIS] BF23/5F37 smdpSign — SK.DPbp.ECDSA 签名,需签名 lane
235 // [SPEC] BF24 — SGP.22 §5.5.2 :7319 ConfigureISDPRequest [36]
236 // [SPEC] BF25 — SGP.22 §5.5.3 :7365 StoreMetadataRequest [37]
237 // [SPEC] BF25/5A iccid — SGP.22 :1398 Iccid [APPLICATION 26] tag '5A';值域 HYPOTHESIS(Annex E 缺席,需与 UPP EF-ICCID 一致)
238 // [HYPOTHESIS] BF25/91 serviceProviderName — Annex E 缺席
239 // [HYPOTHESIS] BF25/92 profileName — Annex E 缺席
240 // [SPEC] BF25/95 profileClass — SGP.22 :13218 ProfileClass INTEGER;取 operational(2)
241 // [HYPOTHESIS] BF25/B7 profileOwner — OperatorId mccMnc 值(3GPP 24.008 编码面 SPEC,值 HYPOTHESIS)
242 // [SPEC] BF25/99 profilePolicyRules — SGP.22 :1438 PprIds BIT STRING 编码面
243 // [SPEC] UPP — PITS ProfileElement 序列 header+mf+usim+end(最小集)
244 // [SPEC] PE header — PITS asn:26 ProfileElement header CHOICE [0]
245 // [SPEC] PE header/version — PITS asn:67-68 2/3
246 // [SPEC] PE header/profileType — PITS asn:942 Test Profile 值
247 // [HYPOTHESIS] PE header/iccid — eUICC 忽略此值(SGP.22 :7511);随参数化 ICCID
248 // [SPEC] PE header/services+GFSTE — PITS asn:946-958 子集转录
249 // [SPEC] PE mf — PITS asn:222 PE-MF + mfVal :961-1039
250 // [HYPOTHESIS] PE mf/ef-iccid — ICCID 参数化(EF 编码形态);其余模板值 SPEC
251 // [SPEC] PE usim — PITS asn:284 PE-USIM + usimValue :1166-1218
252 // [HYPOTHESIS] PE usim/ef-imsi — IMSI 参数化(mccMnc+MSIN);TBCD 编码面 3GPP 24.008 SPEC
253 // [SPEC] PE end — PITS asn:906 PE-End + endVal :2106 id=99
254 // [SPEC] TC/flow — SGP.23 表1032 步 9-11:段流止于 storeMetadata(INIT→A0→A1,A1 段末触发 PIR #R_PIR_PPR_NOT_ALLOWED);A3 段已分段(E 步 8)但无发射步——拒装预期先于 loadBoundProfilePackageElements 发生
255 // [SPEC] TC/forbidden — SGP.23 §5.2.2.2.1:metadata 段带 PPR1 位(BF25/99 pprIds)——卡内 forbidden 集已含 ppr1 时该装载被拒(前提=步 2 Install PROFILE_OPERATIONAL1 已完成)
256
257 // 步骤 8:Split the <BPP> into several segments arrays named: <BPP_SEG_INIT> <BPP_SEG_A0> <BPP_SEG_A1> <BPP_SEG_A3>(tc_step)
258 // BPP segment declaration (no APDU face): <BPP_SEG_INIT>, <BPP_SEG_A0>, <BPP_SEG_A1>, <BPP_SEG_A3>.
259 // Segment partitioning lives in bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651 segment table; single source of segmentation knowledge — wire sends BPP_SEG_INIT first).
260 // Segment bytes are runtime-domain (BPP synthesized at the MTD_GENERATE_BPP step); not injected into this script; load steps follow the SCRIPT data=null contract.
261
262 // 步骤 9:MTD_STORE_DATA_SCRIPT(tc_step)
263 // BPP segment load (data=null contract): <BPP_SEG_INIT> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
264 // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
265 var sdCla9 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
266 var s9 = bind.sendApdu(sdCla9, "E2", "00", "00", null, "00", "9000");
267 bind.checkData("S9-C1 SW", "9000", s9.sw);
268 bind.checkData("S9-C2 response data absent", "1", s9.resp === "" ? "1" : "0");
269
270 // 步骤 10:MTD_STORE_DATA_SCRIPT(tc_step)
271 // BPP segment load (data=null contract): <BPP_SEG_A0> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
272 // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
273 var sdCla10 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
274 var s10 = bind.sendApdu(sdCla10, "E2", "00", "00", null, "00", "9000");
275 bind.checkData("S10-C1 SW", "9000", s10.sw);
276 bind.checkData("S10-C2 response data absent", "1", s10.resp === "" ? "1" : "0");
277
278 // 步骤 11:MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ25_025, RQ25_023, RQ57_056, RQ55_032, RQ57_057)
279 // BPP segment load (data=null contract): <BPP_SEG_A1> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
280 // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
281 var sdCla11 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
282 var s11 = bind.sendApdu(sdCla11, "E2", "00", "00", null, "00", "9000");
283 bind.checkData("S11-C1 SW", "9000", s11.sw);
284 // S11-C2: binding:bpp_seg_load_pir_runtime_structure(S22-2.5.6;PIR-runtime-domain) (check_attestation)
285 // S11-C3: binding:bpp_seg_load_pir_runtime_semantics(S22-2.5.6;PIR-runtime-domain) (check_attestation)
286
287 // 步骤 12:MTD_STORE_DATA(tc_step)
288 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
289 var sdCla12 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
290 var s12 = bind.sendApdu(sdCla12, "E2", "91", "00", "BF2D00", "00", "9000");
291 bind.checkData("S12-C1 SW", "9000", s12.sw);
292 var r2p12 = BindEs10xProcProfile.walkChoiceList(s12.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
293 var r2has12_0 = false;
294 for (var r2i12_0 = 0; r2i12_0 < r2p12.elements.length; r2i12_0++) {
295 var f = r2p12.elements[r2i12_0].fields;
296 if (f["5A"] === "989209012143658709F5" && f["9F70"] === "00") { r2has12_0 = true; break; }
297 }
298 bind.checkData("S12-C2 contains PROFILE_INFO1_DISABLED", "1", (r2p12.branch_tag === "A0" && r2has12_0) ? "1" : "0");
299
300 // 步骤 13:Delete PROFILE_OPERATIONAL1(tc_step)
301 // card-state orchestration declaration (no APDU face): execution is
302 // the batch card_state prep framework's responsibility (4227 ruling B
303 // same-family scope; ensure_profile_state / prep_packager);
304 // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
305
306 // 步骤 14:MTD_STORE_DATA(tc_step;REQ: RQ57_053, RQ57_054, RQ57_056)
307 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
308 var sdCla14 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
309 var s14 = bind.sendApdu(sdCla14, "E2", "91", "00", "BF2200", "00", null);
310 // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
311 var gw14 = BindGecaProc.parseGecaResponse(s14.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
312 var fppr14 = null; for (var fpi14 = 0; fpi14 < gw14.children.length; fpi14++) { if (gw14.children[fpi14].tag === "99") { fppr14 = gw14.children[fpi14].value; } }
313 var fpprSet14 = (fppr14 !== null && fppr14.length >= 4 && (parseInt(fppr14.substring(2, 4), 16) & 64) !== 0);
314 bind.checkData("S14-C1 forbidden PP Rules do not contain ppr1", "1", !fpprSet14 ? "1" : "0");
315 bind.checkData("S14-C2 R_EUICC_INFO2 outer tag", "BF22", gw14.outer_tag === null ? "absent" : gw14.outer_tag);
316 bind.checkData("S14-C2 R_EUICC_INFO2 required members present", "1", gw14.ok ? "1" : "0");
317}
318
完整 unified diff
行级差异:新增 316 行 / 删除 158 行(以 -man 为基准,unified 上下文 3 行)。
展开 diff(479 行)
--- -man
+++ -cas
@@ -1,160 +1,318 @@
-// slice of Import\TestCase_SGP_23.js - cases: TC_eUICC_ForbiddenPPRs_01_Nominal_PPR1_management_and_handling_when_Operational_Profile_is_installed (extracted verbatim)
-
-function TC_eUICC_ForbiddenPPRs_01_Nominal_PPR1_management_and_handling_when_Operational_Profile_is_installed()
-{
-
- tracenamestr = "卡内存在一个Operational的profile,不允许再下载一个PPR1的profile";
- curDis.TraceStart(sno++,tracenamestr);
-
- curLogicChannel = 0;
- curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
- Ini_powerOn_eUICC_LPAe_not_activate();
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
- TS_MANAGE_CHANNEL_OPEN();
-
- curLogicChannel = 1;
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
- TS_SELECT("Select ISD",ISD_R_AID,"9000");
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,检查forbiddenProfilePolicyRules;");
- var euiccInfo2 = new EUICCInfo2();
- var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
-
- euiccInfo2.checkCardResDataFormat(hexData);
-
- try
- {
- curStrHandle.CheckData("不存在", euiccInfo2.forbiddenProfilePolicyRules, "forbiddenProfilePolicyRules");
- }catch(e){
- obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
- }
-
- curDis.TestStepStart2(stno++,"下载PROFILE_OPERATIONAL1;");
-
-
- var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
- Profile_load_procedure.ICCID = ICCID_OP_PROF1;
- Profile_load_procedure.ES10b_GetEUICCInfo1();
-
- Profile_load_procedure.ES10b_GetEUICCChallenge();
-
- Profile_load_procedure.ES10b_AuthenticateServer();
-
- Profile_load_procedure.ES10b_PrepareDownload();
-
- Profile_load_procedure.ES10b_GetEID();
-
-
- Profile_load_procedure.serviceProviderName = SP_NAME1; //SP Name 1
- Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
- Profile_load_procedure.iconType = "01";
- Profile_load_procedure.icon = ICON_OP_PROF1;
- Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
- Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
- Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
- Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;
- Profile_load_procedure.profileOwner = OWNER_OP_PROF1;
- Profile_load_procedure.profileClass = "02";
- Profile_load_procedure.mccMnc = MCC_MNC1;
-
- Profile_load_procedure.ES10b_LoadBoundProfilePackage();
-
- var ISD_P_Test01 = curProfile_ISD_P_AID;
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,检查forbiddenProfilePolicyRules;");
- var euiccInfo2 = new EUICCInfo2();
- var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
-
- euiccInfo2.checkCardResDataFormat(hexData);
-
- try
- {
- var curforbiddenPPR = "0640";
- curStrHandle.CheckData(curforbiddenPPR, euiccInfo2.forbiddenProfilePolicyRules, "forbiddenProfilePolicyRules");
-
-
- }catch(e){
- obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
- }
-
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo1Request;");
- var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL4_DATA);
- Profile_load_procedure.ICCID = ICCID_OP_PROF4;
- Profile_load_procedure.ES10b_GetEUICCInfo1();
-
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
- Profile_load_procedure.ES10b_GetEUICCChallenge();
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行AuthenticateServerRequest;");
- Profile_load_procedure.ES10b_AuthenticateServer();
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行PrepareDownloadRequest;");
- Profile_load_procedure.ES10b_PrepareDownload();
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccDataRequest(GetEID);");
- Profile_load_procedure.ES10b_GetEID();
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage;");
- Profile_load_procedure.serviceProviderName = SP_NAME4;
- Profile_load_procedure.profileName = NAME_OP_PROF4;
- Profile_load_procedure.iconType = "01";
- Profile_load_procedure.icon = ICON_OP_PROF4;
- Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
- Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
- Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
- Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS4;
- Profile_load_procedure.profilePolicyRules = "0640";
- Profile_load_procedure.mccMnc = MCC_MNC4;
- Profile_load_procedure.profileClass = "02";
-
- Profile_load_procedure.isErrorTest = true;
- Profile_load_procedure.bppCommandId = BppCommandId.storeMetadata;;
- Profile_load_procedure.errorReason = ErrorReason.pprNotAllowed;
- Profile_load_procedure.ES10b_LoadBoundProfilePackage();
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
- TS_SELECT("Select ISD",ISD_R_AID,"9000");
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ProfileInfoListRequest,获取profile状态;");
- var proInfoListRequest = new ProfileInfoListRequest();
- proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF1);
- proInfoListRequest.tagList = "5A4F9F70";
- proInfoListRequest.GenHexData();
- var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
-
- var proInfoListResponse = new ProfileInfoListResponse();
- proInfoListResponse.checkCardResDataFormat(respData);
-
- try
- {
- curStrHandle.CheckData(ICCID_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].iccid, "ICCID");
- curStrHandle.CheckData(ISD_P_Test01, proInfoListResponse.profileInfoListOk.arrOfElement[0].isdpAid, "ISD-P AID");
- curStrHandle.CheckData(Profile_DISABLED, proInfoListResponse.profileInfoListOk.arrOfElement[0].profileState, "profile State");
- }catch(e){
- obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
- }
-
- var proInfoListRequest = new ProfileInfoListRequest();
- proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF4);
- proInfoListRequest.tagList = "5A4F9F70";
- proInfoListRequest.GenHexData();
- var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
-
- var proInfoListResponse = new ProfileInfoListResponse();
- proInfoListResponse.checkCardResDataFormat(respData);
-
- try
- {
- curStrHandle.CheckData("00", obj.ToHex(proInfoListResponse.profileInfoListOk.arrOfElement.length),"Profile Info number");
- }catch(e){
- obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
- }
-
-
- RecoverCard();
+// Author: 卡思Cas智能体
+// Date: 20261004-022946
+// Function: (purpose 原文未由 SGP.23 该 TC 提供,corpus vacuum 登记)TC_eUICC_ForbiddenPPRs,Test Sequence #01 Nominal: PPR1 management and handling when Operational Profile is installed(本 TC 单条 Test Sequence),适用性 M。
+// Test points: ICH-IC1-K1-C1 ATR_present;ICH-IC1-K2-C2 FCP_Template;ICH-IC1-K2-C4 SW
+// ICH-IC1-K3-C4 SW;ICH-IC1-K4-C4 final SW;ICH-IC2-K1-C4 SW;ICH-IC2-K1-C3 CHANNEL_NUMBER extracted
+// ICH-IC2-K2-C4 SW;S1-C1 forbidden PP Rules do not contain ppr1;S1-C2 R_EUICC_INFO2 outer tag
+// S1-C2 R_EUICC_INFO2 required members present;S3-C1 forbidden PP Rules contain ppr1
+// S3-C2 R_EUICC_INFO2 outer tag;S3-C2 R_EUICC_INFO2 required members present;S9-C1 SW
+// S9-C2 response data absent;S10-C1 SW;S10-C2 response data absent;S11-C1 SW;S12-C1 SW
+// S12-C2 contains PROFILE_INFO1_DISABLED;S14-C1 forbidden PP Rules do not contain ppr1
+// S14-C2 R_EUICC_INFO2 outer tag;S14-C2 R_EUICC_INFO2 required members present
+// 本函数由 CaseIR 5.2.2.2.1 编译生成(experiments/5.2.2.2.1-TC_eUICC_ForbiddenPPRs-20261004_022946,SGP.23 v1.16 × SGP.22 v2.7):字节权威=CaseIR,非誊录黄金脚本。
+// Value-free template: every data byte is injected from CaseIR fields; no scaffold globals (see docs/speconly/compile-symbol-migration.md).
+// 适用性 M:编译期门,运行时由 harness 环境前置承担。
+function TC_eUICC_ForbiddenPPRs_01_merged() {
+ var bind = curBind;
+ // GEN-IC-1 卡态声明(E 段 General Initial Conditions,编排责任):There is no Profile installed in the eUICC: declared unexpanded (non-PROC row or K corpus vacuum; see CaseIR open_items).
+
+ // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 1):RESET(K 语料机械展开)
+ var s15 = bind.resetAndAtr();
+ bind.checkData("ICH-IC1-K1-C1 ATR_present", "1", s15.atr_hex !== "" ? "1" : "0");
+
+ // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 2):SELECT_MF(K 语料机械展开)
+ // FCP outer tag not materialized from clause: tag-face asserted only when corpus fixes the tag byte (e.g. TS 102 221 FCP '62').
+ var s16 = bind.sendApdu("00", "A4", "00", "04", "3F00", "00", "9000");
+ bind.checkData("ICH-IC1-K2-C2 FCP_Template", "1", s16.resp.length > 0 ? "1" : "0");
+ bind.checkData("ICH-IC1-K2-C4 SW", "9000", s16.sw);
+
+ // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 3):TERMINAL_CAPABILITY_LPAd(K 语料机械展开)
+ var s17 = bind.sendApdu("80", "AA", "00", "00", "A9058100830107", null, "9000");
+ bind.checkData("ICH-IC1-K3-C4 SW", "9000", s17.sw);
+
+ // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 4):TERMINAL_PROFILE(K 语料机械展开)
+ var steady18 = bind.runToSteadyState(function () {
+ return bind.sendTerminalProfile("FFFFFFFF7F9D00DFBF00001FE2000000C7EB0000000168005000000000000200", "9000");
+ });
+ bind.checkData("ICH-IC1-K4-C4 final SW", "9000", steady18.final.sw);
+
+ // IC head inline (initial_conditions → PROC_OPEN_LOGICAL_CHANNEL_AND_SELECT_ISDR, K row 1):MANAGE_CHANNEL_OPEN(K 语料机械展开)
+ // CHANNEL_NUMBER extraction and dynamic CLA rebinding are CasBind internal state (chaining rule; no generated-code re-implementation).
+ var s19 = bind.manageChannelOpen("9000");
+ bind.checkData("ICH-IC2-K1-C4 SW", "9000", s19.sw);
+ bind.checkData("ICH-IC2-K1-C3 CHANNEL_NUMBER extracted", "1", s19.chan !== null ? "1" : "0");
+
+ // IC head inline (initial_conditions → PROC_OPEN_LOGICAL_CHANNEL_AND_SELECT_ISDR, K row 2):MTD_SELECT(K 语料机械展开)
+ // CLA = bound channel (cla_rule) and <L> length binding are CasBind internal state (chaining rule; no generated-code re-implementation).
+ var s20 = bind.sendApdu(null, "A4", "04", "00", "A0000005591010FFFFFFFF8900000100", null, "9000");
+ // MTD_SELECT expected face is SW-only (K Annex C.2 open-channel procedure step 2: no FCI content assertion in corpus); no fabricated template parse.
+ bind.checkData("ICH-IC2-K2-C4 SW", "9000", s20.sw);
+
+ // 步骤 1:MTD_STORE_DATA(tc_step;REQ: RQ57_053, RQ57_054, RQ57_056, RQ57_057)
+ // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+ var sdCla1 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
+ var s1 = bind.sendApdu(sdCla1, "E2", "91", "00", "BF2200", "00", null);
+ // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
+ var gw1 = BindGecaProc.parseGecaResponse(s1.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
+ var fppr1 = null; for (var fpi1 = 0; fpi1 < gw1.children.length; fpi1++) { if (gw1.children[fpi1].tag === "99") { fppr1 = gw1.children[fpi1].value; } }
+ var fpprSet1 = (fppr1 !== null && fppr1.length >= 4 && (parseInt(fppr1.substring(2, 4), 16) & 64) !== 0);
+ bind.checkData("S1-C1 forbidden PP Rules do not contain ppr1", "1", !fpprSet1 ? "1" : "0");
+ bind.checkData("S1-C2 R_EUICC_INFO2 outer tag", "BF22", gw1.outer_tag === null ? "absent" : gw1.outer_tag);
+ bind.checkData("S1-C2 R_EUICC_INFO2 required members present", "1", gw1.ok ? "1" : "0");
+
+ // 步骤 2:Install PROFILE_OPERATIONAL1(tc_step;REQ: RQ57_057)
+ // card-state orchestration declaration (no APDU face): execution is
+ // the batch card_state prep framework's responsibility (4227 ruling B
+ // same-family scope; ensure_profile_state / prep_packager);
+ // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
+
+ // 步骤 3:MTD_STORE_DATA(tc_step;REQ: RQ57_053, RQ57_054, RQ57_056)
+ // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+ var sdCla3 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
+ var s3 = bind.sendApdu(sdCla3, "E2", "91", "00", "BF2200", "00", null);
+ // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
+ var gw3 = BindGecaProc.parseGecaResponse(s3.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
+ var fppr3 = null; for (var fpi3 = 0; fpi3 < gw3.children.length; fpi3++) { if (gw3.children[fpi3].tag === "99") { fppr3 = gw3.children[fpi3].value; } }
+ var fpprSet3 = (fppr3 !== null && fppr3.length >= 4 && (parseInt(fppr3.substring(2, 4), 16) & 64) !== 0);
+ bind.checkData("S3-C1 forbidden PP Rules contain ppr1", "1", fpprSet3 ? "1" : "0");
+ bind.checkData("S3-C2 R_EUICC_INFO2 outer tag", "BF22", gw3.outer_tag === null ? "absent" : gw3.outer_tag);
+ bind.checkData("S3-C2 R_EUICC_INFO2 required members present", "1", gw3.ok ? "1" : "0");
+
+ // 步骤 4:Seq#01 Step4] Execute the Common Mutual Authentication procedure between the eUICC and the S_SM-DP+ #GET_EUICC_INFO1, #GET_EUICC_CHALLENGE and #AUTHENTICATE_SMDP are sent to the eUICC the same GSMA CI is chosen for signing and for verification(tc_step)
+ // W3D CMA 过程声明行内联动态绑定(三命令链;声明面 = command.dynamic_template + 顶层 dynamic_templates.es10b_authenticate_server;物料 sha256 锚编译期已核;421324 IC6 dynamic-bound 先例机制面)
+ // CMA 链命令 1/3 GetEuiccInfo1(BF20 空结构,S22_info §5.7.8):
+ var cma4I1 = bind.sendApdu(null, "E2", "91", "00", "BF2000", null, "9000");
+ var cma4Gw1 = BindGecaProc.parseGecaResponse(cma4I1.resp, {outer: "BF20", required: ["82", "A9", "AA"], optional: []});
+ // CMA 链命令 2/3 GetEuiccChallenge(BF2E 空结构,S22_challenge §5.7.7;响应 euiccChallenge 成员运行时提取):
+ var cma4C2 = bind.sendApdu(null, "E2", "91", "00", "BF2E00", null, "9000");
+ var cma4Ch = BindGecaProc.parseGecaResponse(cma4C2.resp, {outer: "BF2E", required: ["80"], optional: []});
+ // CMA 链命令 3/3 AuthenticateServer(BF38 引擎组装;槽位值=声明面分级注入):
+ var cma4Tid = "";
+ var cma4Sc = "";
+ for (var cma4Ri = 0; cma4Ri < 16; cma4Ri++) {
+ cma4Tid += bind.engine.Hex(Math.round(255 * Math.random()), 2);
+ cma4Sc += bind.engine.Hex(Math.round(255 * Math.random()), 2);
+ }
+ var cma4PkList = BindEs10xSingleRequest.parseBerTlv(cma4Gw1.fields["AA"] || "");
+ var cma4CiIds = ["F54172BDF98A95D65CBEB88A38A1C11D800A85C3", "C0BC70BA36929D43B467FF57570530E57AB8FCD8"];
+ var cma4Sks = ["0A7CC1C244E60C52CD5B7807AB8C360C26524601507DCABC5DD598B5A616D5D5", "93FB33D0584F349B07F8B5D2AF93D7C3E354B349A3B913502E6ABC070E4D4929"];
+ var cma4Certs = ["308201DFA00302010202020100300A06082A8648CE3D04030230443110300E06035504030C07546573742043493111300F060355040B0C0854455354434552543110300E060355040A0C0752535054455354310B3009060355040613024954301E170D3230303430313038333133305A170D3330303333303038333133305A3025310D300B060355040A0C0441434D453114301206035504030C0B5445535420534D2D44502B3059301306072A8648CE3D020106082A8648CE3D030107034200044DFED4F4694791BF1695CEA0307A35B418019695387BB75B7D2447B6B5209F0445AE4E5E521CD13888D75FE07C8580222AE20DBAAC1D77CD76304993421BD739A381DF3081DC301F0603551D23041830168014F54172BDF98A95D65CBEB88A38A1C11D800A85C3301D0603551D0E04160414BD5A82CC1A96602118BA7560A1FF83A78B210BE5300E0603551D1104073005880388370A300E0603551D0F0101FF04040302078030170603551D200101FF040D300B300906076781120102010430610603551D1F045A3058302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D412E63726C302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D422E63726C300A06082A8648CE3D040302034700304402200823EE7DFA5E3DD07838E930F81BC34AE99F06CBA35927FE9E502C464DC1FEE302200D2D4087DB01A5382D21690AC0488B15067FB2460D336332446CA99F08A8A4EF", "308201E0A00302010202020100300A06082A8648CE3D04030230443110300E06035504030C07546573742043493111300F060355040B0C0854455354434552543110300E060355040A0C0752535054455354310B3009060355040613024954301E170D3230303430313038333133305A170D3330303333303038333133305A3025310D300B060355040A0C0441434D453114301206035504030C0B5445535420534D2D44502B305A301406072A8648CE3D020106092B240303020801010703420004255D7DAF00EF841D76FA7A63D63EB3FE6C9F70492D381923F8F8BD7B24F3C5AD168EBE3B09DD80F29E7FFD24A4D1BE747F8323E472928396DDE9E0151CEABA18A381DF3081DC301F0603551D23041830168014C0BC70BA36929D43B467FF57570530E57AB8FCD8301D0603551D0E0416041479A4BD4D78FF4734BC6045CF9196244A1FB84BEB300E0603551D1104073005880388370A300E0603551D0F0101FF04040302078030170603551D200101FF040D300B300906076781120102010430610603551D1F045A3058302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D412E63726C302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D422E63726C300A06082A8648CE3D0403020347003044022003078BD459045184BC50C1397141F8B90398E6B81737EC703403D5CB0DC0DFC302201A38E7FC84D3DB1179FBB17199231F2D635ED7A8AB4049774057B0ACDF726063"];
+ var cma4Dps = [["FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B", "046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5", "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"], ["A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", "048BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7"]];
+ var cma4Sel = -1;
+ for (var cma4Pi = 0; cma4Pi < cma4PkList.length && cma4Sel < 0; cma4Pi++) {
+ for (var cma4Mi = 0; cma4Mi < cma4CiIds.length; cma4Mi++) {
+ if (cma4PkList[cma4Pi].value === cma4CiIds[cma4Mi]) { cma4Sel = cma4Mi; break; }
+ }
+ }
+ var cma4Ech = "";
+ for (var cma4Ei = 0; cma4Ei < cma4Ch.children.length; cma4Ei++) {
+ if (cma4Ch.children[cma4Ei].tag === "80") { cma4Ech = cma4Ch.children[cma4Ei].value; }
+ }
+ if (cma4Sel < 0 || cma4Ech === "") {
+ // fail-closed 诚实面:CI PK ID 零命中物料套或 euiccChallenge 缺席 → BF38 不发送,后续过程面如实失败。
+ } else {
+ bind.engine.InitEccDomainParams(cma4Dps[cma4Sel][0], cma4Dps[cma4Sel][1], cma4Dps[cma4Sel][2], cma4Dps[cma4Sel][3], cma4Dps[cma4Sel][4], 1);
+ var cma4S1 = BindEs10xSingleRequest.buildTlv("30",
+ BindEs10xSingleRequest.buildTlv("80", cma4Tid)
+ + BindEs10xSingleRequest.buildTlv("81", cma4Ech)
+ + BindEs10xSingleRequest.buildTlv("83", "1674657374736D6470706C7573312E6578616D706C652E636F6D")
+ + BindEs10xSingleRequest.buildTlv("84", cma4Sc));
+ var cma4Sgn = "";
+ while (cma4Sgn.length != 2 * cma4Sks[cma4Sel].length) {
+ bind.engine.SleepTime(2000);
+ cma4Sgn = bind.engine.EccSignData(cma4Sks[cma4Sel], cma4S1, 33);
+ }
+ var cma4Asm = BindEs10bAuthServer.assembleAuthenticateServer(
+ {outer: "BF38",
+ signed1: {tag: "30", transactionId: "80", euiccChallenge: "81", serverAddress: "83", serverChallenge: "84"},
+ serverSignature1: "5F37", euiccCiPKIdToBeUsed: "04", serverCertificate: "30", ctxParams1: "A0"},
+ {transactionId: cma4Tid, euiccChallenge: cma4Ech,
+ serverAddress: "1674657374736D6470706C7573312E6578616D706C652E636F6D", serverChallenge: cma4Sc,
+ serverSignature1: cma4Sgn, euiccCiPKIdToBeUsed: cma4CiIds[cma4Sel],
+ serverCertificate: cma4Certs[cma4Sel], ctxParams1: "A10D800400000110A1058003000010"});
+ if (cma4Asm.error) {
+ } else {
+ var cma4Run = BindEs10xSingleRequest.runTransport(bind.sendApdu,
+ {cla: "", ins: "E2", p1: "91", p2: "00", data: cma4Asm.request_hex,
+ le: "00", blockSize: 255, blockSw: "9000", final_sw: "9000"});
+ var cma4Sw = (cma4Run.final && cma4Run.final.sw) ? cma4Run.final.sw : "transport_error";
+ var cma4Ex = BindEs10bAuthServer.extractAuthenticateServer(
+ {outer: "BF38",
+ ok: {tag: "A0", children: [
+ {name: "euiccSigned1", tag: "30", children: [
+ {name: "transactionId", tag: "80"},
+ {name: "serverAddress", tag: "83"},
+ {name: "serverChallenge", tag: "84"},
+ {name: "euiccInfo2", tag: "BF22"},
+ {name: "ctxParams1", tag: "A0"}]},
+ {name: "euiccSignature1", tag: "5F37"},
+ {name: "euiccCertificate", tag: "30"},
+ {name: "eumCertificate", tag: "30"}]},
+ error: {tag: "A1", children: [
+{name: "transactionId", tag: "80"},
+ {name: "authenticateErrorCode", tag: "81"}]}},
+ cma4Run.final ? cma4Run.final.resp : "");
+ var cma4OkBr = cma4Ex.branch === "ok" && cma4Ex.ok && cma4Ex.ok.missing.length === 0 && cma4Ex.ok.fields.euiccSigned1.children.missing.length === 0;
+ // euiccSignature1([5F37])运行时提取面登记:CMA 响应操作数供后续步(PREP_DOWNLOAD 签名明文)消费——5.2.2.2.1 后续 step5-8 属子过程声明/装配域,非本步发射面。
+ }
+ }
+
+ // 步骤 5:Seq#01 Step5] Execute the Sub-procedure Profile Download and Installation – End User Confirmation between the eUICC and the S_SM-DP+ #PREP_DOWNLOAD_NO_CC is sent to the eUICC(tc_step)
+ // PREP_DOWNLOAD 运行时绑定(PREP_DOWNLOAD_NO_CC;SGP.22 §5.7.5 PrepareDownloadRequest=BF21 成员序 smdpSigned2(30) → smdpSignature2(5F37) → smdpCertificate(30)):
+ // transactionId/euiccSignature1=前序 CMA 声明步 step4 运行时提取(§5.7.5 会话一致性同值要求,不新生成);smdpSignature2=EccSignData(DPpb SK, smdpSigned2 TLV‖5F37(euiccSignature1), 33)(S22_prep_dl+G Annex B+vendor GenRequest 三源对账);
+ // DPpb cert/SK=named_certs/named_sks 声明面(sha256 锚编译期已核;曲线套索引=CI 选择同号——同一 GSMA CI 链)。
+ var pd5Certs = ["308201DFA00302010202020101300A06082A8648CE3D04030230443110300E06035504030C07546573742043493111300F060355040B0C0854455354434552543110300E060355040A0C0752535054455354310B3009060355040613024954301E170D3230303430313038333434355A170D3330303333303038333434355A3025310D300B060355040A0C0441434D453114301206035504030C0B5445535420534D2D44502B3059301306072A8648CE3D020106082A8648CE3D03010703420004104C2AE3D02DEF9C979261A7C6710076B970721D0955A2644AE05FAE4BC2314E5DC09F6BF0118026165342E212318775E365F3B57325373066B9906E0BD1388DA381DF3081DC301F0603551D23041830168014F54172BDF98A95D65CBEB88A38A1C11D800A85C3301D0603551D0E04160414E6EAF71EE0FB9430ECCD1EBB421F881437C13263300E0603551D1104073005880388370A300E0603551D0F0101FF04040302078030170603551D200101FF040D300B300906076781120102010530610603551D1F045A3058302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D412E63726C302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D422E63726C300A06082A8648CE3D040302034800304502203EA51B0129FC11E843C38C8CB104244CCF92D8DDBCD4D5F9DAFD0AEF700A9B1C022100FEF382FF71FEFC58168A3607D5685DB7CB48F6B434261891496385BCD6B5857A", "308201E0A00302010202020101300A06082A8648CE3D04030230443110300E06035504030C07546573742043493111300F060355040B0C0854455354434552543110300E060355040A0C0752535054455354310B3009060355040613024954301E170D3230303430313038333434365A170D3330303333303038333434365A3025310D300B060355040A0C0441434D453114301206035504030C0B5445535420534D2D44502B305A301406072A8648CE3D020106092B240303020801010703420004893253ECC94C51DF4FEE6E0DB0951CFC65627481B5418E557069F487FAA15466A5CB8E10CC2B38099CF2A929F7F82DAC065126B71D0640961DB7F91A49E95612A381DF3081DC301F0603551D23041830168014C0BC70BA36929D43B467FF57570530E57AB8FCD8301D0603551D0E04160414A8C68DF449EB71EC723EAC132E40E4B6F54644FE300E0603551D1104073005880388370A300E0603551D0F0101FF04040302078030170603551D200101FF040D300B300906076781120102010530610603551D1F045A3058302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D412E63726C302AA028A0268624687474703A2F2F63692E746573742E6578616D706C652E636F6D2F43524C2D422E63726C300A06082A8648CE3D04030203470030440220244ED22119D00D49D9EA4AC5D9A6D925FACFCD1998A96448A870CE47FE5E470E02206C4BC7223C925D548DDDD3D8DDD81118DA202973311F6012BB0A20E6DD2D7B7B"];
+ var pd5Sks = ["DCD694B778957E8E9ADDBDD94433E9EF8F73D11E491C48D425A38A9491BD3BED", "75FF322F416616DAE1A484EF71D4874FB0DF3295FD35C2CBA489FBB2BB9C7BF6"];
+ var pd5Tid = cma4Tid;
+ var pd5Sel = cma4Sel;
+ var pd5Sig1 = (typeof cma4Ex !== "undefined" && cma4Ex && cma4Ex.ok && cma4Ex.ok.fields.euiccSignature1) ? cma4Ex.ok.fields.euiccSignature1.value : "";
+ var pd5Dps = cma4Dps;
+ if (pd5Sel < 0 || pd5Sig1 === "") {
+ // fail-closed 诚实面:CMA 运行时操作数缺席(CMA 失败/未执行)→ BF21 不发送(前序 CMA 步断言面已计错,本步不伪造通过)。
+ } else {
+ bind.engine.InitEccDomainParams(pd5Dps[pd5Sel][0], pd5Dps[pd5Sel][1], pd5Dps[pd5Sel][2], pd5Dps[pd5Sel][3], pd5Dps[pd5Sel][4], 1);
+ var pd5S2 = BindEs10xSingleRequest.buildTlv("30",
+ BindEs10xSingleRequest.buildTlv("80", pd5Tid)
+ + BindEs10xSingleRequest.buildTlv("01", "00"));
+ var pd5Sgn = "";
+ while (pd5Sgn.length != 2 * pd5Sks[pd5Sel].length) {
+ bind.engine.SleepTime(2000);
+ pd5Sgn = bind.engine.EccSignData(pd5Sks[pd5Sel], pd5S2 + BindEs10xSingleRequest.buildTlv("5F37", pd5Sig1), 33);
+ }
+ var pd5Req = BindEs10xSingleRequest.buildTlv("BF21",
+ pd5S2
+ + BindEs10xSingleRequest.buildTlv("5F37", pd5Sgn)
+ + BindEs10xSingleRequest.buildTlv("30", pd5Certs[pd5Sel]));
+ var pd5Run = BindEs10xSingleRequest.runTransport(bind.sendApdu,
+ {cla: "", ins: "E2", p1: "91", p2: "00", data: pd5Req,
+ le: "00", blockSize: 255, blockSw: "9000", final_sw: "9000"});
+ var pd5Sw = (pd5Run.final && pd5Run.final.sw) ? pd5Run.final.sw : "transport_error";
+ // euiccOtpk(5F49)运行时提取面登记:响应 ok 分支 euiccSigned2 成员(BF21 A0 30 5F49 路径),供后续步(RETRY 形 bppEuiccOtpk/BPP 装配)消费。
+ var pd5Otpk = "";
+ if (pd5Run.final && pd5Run.final.resp) {
+ var pd5L1 = BindEs10xSingleRequest.parseBerTlv(pd5Run.final.resp);
+ for (var pd5I1 = 0; pd5I1 < pd5L1.length && pd5Otpk === ""; pd5I1++) {
+ if (pd5L1[pd5I1].tag !== "BF21") continue;
+ var pd5L2 = BindEs10xSingleRequest.parseBerTlv(pd5L1[pd5I1].value);
+ for (var pd5I2 = 0; pd5I2 < pd5L2.length && pd5Otpk === ""; pd5I2++) {
+ if (pd5L2[pd5I2].tag !== "A0") continue;
+ var pd5L3 = BindEs10xSingleRequest.parseBerTlv(pd5L2[pd5I2].value);
+ for (var pd5I3 = 0; pd5I3 < pd5L3.length && pd5Otpk === ""; pd5I3++) {
+ if (pd5L3[pd5I3].tag !== "30") continue;
+ var pd5L4 = BindEs10xSingleRequest.parseBerTlv(pd5L3[pd5I3].value);
+ for (var pd5I4 = 0; pd5I4 < pd5L4.length; pd5I4++) {
+ if (pd5L4[pd5I4].tag === "5F49") pd5Otpk = pd5L4[pd5I4].value;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // 步骤 6:Generate the <OTPK_S_SM_DP+_ECKA> and <OT_SK_S_SM_DP+_ECKA>(tc_step;non_wire)
+ // test-tool internal preparation (no APDU face): runtime-domain
+ // values per CaseIR unresolved (G Annex B generation rules);
+ // no fabricated bytes emitted here.
+
+ // 步骤 7:<BPP> = MTD_GENERATE_BPP(tc_step)
+ // BPP synthesized (5.2.2.2.1 seq#1, structural layer, SCP03t-unprotected): 1069 bytes; segments: INIT=191B, A0=7B, A1=74B, A3=797B.
+ // Segment bytes are runtime-domain (BPP load step data=null per CaseIR unresolved); not injected into this script. Provenance:
+ // [SPEC] TC — SGP.23 5.2.2.2.1 seq#1 接线(段选择/注入面)
+ // [SPEC] BF36 — SGP.22 §2.5.4 :1566 BoundProfilePackage [54]
+ // [SPEC] BF36/A0 — Table 4 :1588 firstSequenceOf87
+ // [SPEC] BF36/A1 — Table 4 :1590 sequenceOf88
+ // [SPEC] BF36/A3 — Table 4 :1595 sequenceOf86
+ // [HYPOTHESIS] 87/88/86 段值 — UNPROTECTED:明文承载,SCP03t 包壳属后续 lane
+ // [SPEC] BF23 — SGP.22 §5.5.1 :7241 InitialiseSecureChannelRequest [35]
+ // [SPEC] BF23/82 remoteOpId — SGP.22 :1400 RemoteOpId [2] INTEGER
+ // [HYPOTHESIS] BF23/80 transactionId — SM-DP+ 会话值,Annex E 缺席,调用方注入
+ // [SPEC] BF23/A6 controlRefTemplate — SGP.22 :7255-7263 CRT 子集
+ // [SPEC] BF23/A6/80 keyType — SGP.22 :7257 AES='88'
+ // [SPEC] BF23/A6/81 keyLen — SGP.22 :7259 SHALL be 0x10
+ // [HYPOTHESIS] BF23/A6/84 hostId — Host ID 值,Annex E 缺席
+ // [HYPOTHESIS] BF23/5F49 smdpOtpk — otPK.DP.ECKA,需真实密钥协商 lane
+ // [HYPOTHESIS] BF23/5F37 smdpSign — SK.DPbp.ECDSA 签名,需签名 lane
+ // [SPEC] BF24 — SGP.22 §5.5.2 :7319 ConfigureISDPRequest [36]
+ // [SPEC] BF25 — SGP.22 §5.5.3 :7365 StoreMetadataRequest [37]
+ // [SPEC] BF25/5A iccid — SGP.22 :1398 Iccid [APPLICATION 26] tag '5A';值域 HYPOTHESIS(Annex E 缺席,需与 UPP EF-ICCID 一致)
+ // [HYPOTHESIS] BF25/91 serviceProviderName — Annex E 缺席
+ // [HYPOTHESIS] BF25/92 profileName — Annex E 缺席
+ // [SPEC] BF25/95 profileClass — SGP.22 :13218 ProfileClass INTEGER;取 operational(2)
+ // [HYPOTHESIS] BF25/B7 profileOwner — OperatorId mccMnc 值(3GPP 24.008 编码面 SPEC,值 HYPOTHESIS)
+ // [SPEC] BF25/99 profilePolicyRules — SGP.22 :1438 PprIds BIT STRING 编码面
+ // [SPEC] UPP — PITS ProfileElement 序列 header+mf+usim+end(最小集)
+ // [SPEC] PE header — PITS asn:26 ProfileElement header CHOICE [0]
+ // [SPEC] PE header/version — PITS asn:67-68 2/3
+ // [SPEC] PE header/profileType — PITS asn:942 Test Profile 值
+ // [HYPOTHESIS] PE header/iccid — eUICC 忽略此值(SGP.22 :7511);随参数化 ICCID
+ // [SPEC] PE header/services+GFSTE — PITS asn:946-958 子集转录
+ // [SPEC] PE mf — PITS asn:222 PE-MF + mfVal :961-1039
+ // [HYPOTHESIS] PE mf/ef-iccid — ICCID 参数化(EF 编码形态);其余模板值 SPEC
+ // [SPEC] PE usim — PITS asn:284 PE-USIM + usimValue :1166-1218
+ // [HYPOTHESIS] PE usim/ef-imsi — IMSI 参数化(mccMnc+MSIN);TBCD 编码面 3GPP 24.008 SPEC
+ // [SPEC] PE end — PITS asn:906 PE-End + endVal :2106 id=99
+ // [SPEC] TC/flow — SGP.23 表1032 步 9-11:段流止于 storeMetadata(INIT→A0→A1,A1 段末触发 PIR #R_PIR_PPR_NOT_ALLOWED);A3 段已分段(E 步 8)但无发射步——拒装预期先于 loadBoundProfilePackageElements 发生
+ // [SPEC] TC/forbidden — SGP.23 §5.2.2.2.1:metadata 段带 PPR1 位(BF25/99 pprIds)——卡内 forbidden 集已含 ppr1 时该装载被拒(前提=步 2 Install PROFILE_OPERATIONAL1 已完成)
+
+ // 步骤 8:Split the <BPP> into several segments arrays named: <BPP_SEG_INIT> <BPP_SEG_A0> <BPP_SEG_A1> <BPP_SEG_A3>(tc_step)
+ // BPP segment declaration (no APDU face): <BPP_SEG_INIT>, <BPP_SEG_A0>, <BPP_SEG_A1>, <BPP_SEG_A3>.
+ // Segment partitioning lives in bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651 segment table; single source of segmentation knowledge — wire sends BPP_SEG_INIT first).
+ // Segment bytes are runtime-domain (BPP synthesized at the MTD_GENERATE_BPP step); not injected into this script; load steps follow the SCRIPT data=null contract.
+
+ // 步骤 9:MTD_STORE_DATA_SCRIPT(tc_step)
+ // BPP segment load (data=null contract): <BPP_SEG_INIT> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+ // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+ var sdCla9 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
+ var s9 = bind.sendApdu(sdCla9, "E2", "00", "00", null, "00", "9000");
+ bind.checkData("S9-C1 SW", "9000", s9.sw);
+ bind.checkData("S9-C2 response data absent", "1", s9.resp === "" ? "1" : "0");
+
+ // 步骤 10:MTD_STORE_DATA_SCRIPT(tc_step)
+ // BPP segment load (data=null contract): <BPP_SEG_A0> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+ // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+ var sdCla10 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
+ var s10 = bind.sendApdu(sdCla10, "E2", "00", "00", null, "00", "9000");
+ bind.checkData("S10-C1 SW", "9000", s10.sw);
+ bind.checkData("S10-C2 response data absent", "1", s10.resp === "" ? "1" : "0");
+
+ // 步骤 11:MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ25_025, RQ25_023, RQ57_056, RQ55_032, RQ57_057)
+ // BPP segment load (data=null contract): <BPP_SEG_A1> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+ // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+ var sdCla11 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
+ var s11 = bind.sendApdu(sdCla11, "E2", "00", "00", null, "00", "9000");
+ bind.checkData("S11-C1 SW", "9000", s11.sw);
+ // S11-C2: binding:bpp_seg_load_pir_runtime_structure(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+ // S11-C3: binding:bpp_seg_load_pir_runtime_semantics(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+
+ // 步骤 12:MTD_STORE_DATA(tc_step)
+ // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+ var sdCla12 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
+ var s12 = bind.sendApdu(sdCla12, "E2", "91", "00", "BF2D00", "00", "9000");
+ bind.checkData("S12-C1 SW", "9000", s12.sw);
+ var r2p12 = BindEs10xProcProfile.walkChoiceList(s12.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
+ var r2has12_0 = false;
+ for (var r2i12_0 = 0; r2i12_0 < r2p12.elements.length; r2i12_0++) {
+ var f = r2p12.elements[r2i12_0].fields;
+ if (f["5A"] === "989209012143658709F5" && f["9F70"] === "00") { r2has12_0 = true; break; }
+ }
+ bind.checkData("S12-C2 contains PROFILE_INFO1_DISABLED", "1", (r2p12.branch_tag === "A0" && r2has12_0) ? "1" : "0");
+
+ // 步骤 13:Delete PROFILE_OPERATIONAL1(tc_step)
+ // card-state orchestration declaration (no APDU face): execution is
+ // the batch card_state prep framework's responsibility (4227 ruling B
+ // same-family scope; ensure_profile_state / prep_packager);
+ // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
+
+ // 步骤 14:MTD_STORE_DATA(tc_step;REQ: RQ57_053, RQ57_054, RQ57_056)
+ // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+ var sdCla14 = s19.chan !== null ? (s19.chan <= 3 ? 128 + s19.chan : 188 + s19.chan).toString(16).toUpperCase() : null;
+ var s14 = bind.sendApdu(sdCla14, "E2", "91", "00", "BF2200", "00", null);
+ // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
+ var gw14 = BindGecaProc.parseGecaResponse(s14.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
+ var fppr14 = null; for (var fpi14 = 0; fpi14 < gw14.children.length; fpi14++) { if (gw14.children[fpi14].tag === "99") { fppr14 = gw14.children[fpi14].value; } }
+ var fpprSet14 = (fppr14 !== null && fppr14.length >= 4 && (parseInt(fppr14.substring(2, 4), 16) & 64) !== 0);
+ bind.checkData("S14-C1 forbidden PP Rules do not contain ppr1", "1", !fpprSet14 ? "1" : "0");
+ bind.checkData("S14-C2 R_EUICC_INFO2 outer tag", "BF22", gw14.outer_tag === null ? "absent" : gw14.outer_tag);
+ bind.checkData("S14-C2 R_EUICC_INFO2 required members present", "1", gw14.ok ? "1" : "0");
}