源码对照:4.2.11.2.4
ES10b 加载绑定 Profile 包异常用例 / TC_eUICC_ES10b.LoadBoundProfilePackage_ErrorCases
左侧为人工切片入口(-man,来自 原料/切片 的最小可执行脚本),右侧为 Cas 盲生成入口(-cas,仅依据规范生成)。文件按原始编码(多为 GBK)解码为 UTF-8 显示,行号自 1 起;字节级原文与 sha256 见两侧脚本包。完整 unified diff 见本页底部折叠区,以及 报告原文 §4。
-man 入口
Import/TestCase_SGP_23.js
293 行 / 15047 字符 / gb18030
-cas 入口
TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases/Import/TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases.js
120 行 / 10614 字符 / gb18030
默认折行显示长行;取消勾选可横向滚动查看原始行宽
-man 人工切片Import/TestCase_SGP_23.js293 行 / 15047 字符 / gb18030入口函数 @L84
1// slice of Import\TestCase_SGP_23.js - cases: TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_01_Error_Unrecognized_leading_tag_in_BPP + TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_02_Error_GetEUICCChallenge_during_BPP_loading (extracted verbatim)
2
3function TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_01_Error_Unrecognized_leading_tag_in_BPP()
4{
5 tracenamestr = "测试目的:确保eUICC在Profile下载期间,拒绝任何带有无法识别的leading tag的BPP部分。在这种情况下,eUICC应返回SW为0x6A88,不应丢弃下载会话状态";
6 curDis.TraceStart(sno++,tracenamestr);
7
8 curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
9 Ini_powerOn_eUICC_LPAe_not_activate();
10
11 curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
12 TS_MANAGE_CHANNEL_OPEN();
13
14 curLogicChannel = 1;
15
16 curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
17 TS_SELECT("Select ISD",ISD_R_AID,"9000");
18
19 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo1Request;");
20
21
22 var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
23 Profile_load_procedure.ICCID = ICCID_OP_PROF1;
24 Profile_load_procedure.ES10b_GetEUICCInfo1();
25
26 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
27 Profile_load_procedure.ES10b_GetEUICCChallenge();
28
29
30 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行AuthenticateServerRequest;");
31 Profile_load_procedure.ES10b_AuthenticateServer();
32
33 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行PrepareDownloadRequest;");
34 Profile_load_procedure.ES10b_PrepareDownload();
35
36 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccDataRequest(GetEID);");
37 Profile_load_procedure.ES10b_GetEID();
38
39 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage,中间插入不识别的tag;");
40 Profile_load_procedure.serviceProviderName = SP_NAME1;
41 Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
42 Profile_load_procedure.profileClass = "02";
43 Profile_load_procedure.iconType = "01";
44 Profile_load_procedure.icon = ICON_OP_PROF1;
45 Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
46 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
47 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
48 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;
49 Profile_load_procedure.profilePolicyRules = "0560";
50 Profile_load_procedure.mccMnc = MCC_MNC1;
51 Profile_load_procedure.LoadRemainder = 2;
52 Profile_load_procedure.Unrecognized_leading_tag_in_BPP = "C9050102030405";
53
54 Profile_load_procedure.ES10b_LoadBoundProfilePackage();
55
56 curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
57 TS_SELECT("Select ISD",ISD_R_AID,"9000");
58
59 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ProfileInfoListRequest,获取profile信息;");
60 var proInfoListRequest = new ProfileInfoListRequest();
61 proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF1);
62 proInfoListRequest.GenHexData();
63 var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
64
65 var proInfoListResponse = new ProfileInfoListResponse();
66 proInfoListResponse.checkCardResDataFormat(respData);
67
68 try
69 {
70 curStrHandle.CheckData(ICCID_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].iccid, "ICCID");
71 curStrHandle.CheckData(SP_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].serviceProviderName, "serviceProviderName");
72 curStrHandle.CheckData(PROFILE_OPERATIONAL1_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].profileName, "profileName");
73 curStrHandle.CheckData("01", proInfoListResponse.profileInfoListOk.arrOfElement[0].iconType, "iconType");
74 curStrHandle.CheckData(ICON_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].icon, "icon");
75 curStrHandle.CheckData("02", proInfoListResponse.profileInfoListOk.arrOfElement[0].profileClass, "profileClass");
76 }catch(e){
77 obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
78 }
79
80 RecoverCard();
81
82}
83
84function TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_02_Error_GetEUICCChallenge_during_BPP_loading()
85{
86 tracenamestr = "测试目的:确保eUICC在BPP下载时,eUICC接受ES10b.GetEUICCChallenge请求,开始新的RSP会话";
87 curDis.TraceStart(sno++,tracenamestr);
88
89 curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
90 Ini_powerOn_eUICC_LPAe_not_activate();
91
92 curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
93 TS_MANAGE_CHANNEL_OPEN();
94
95 curLogicChannel = 1;
96
97 curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
98 TS_SELECT("Select ISD",ISD_R_AID,"9000");
99
100 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo1Request;");
101
102
103 var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
104 Profile_load_procedure.ICCID = ICCID_OP_PROF1;
105 Profile_load_procedure.ES10b_GetEUICCInfo1();
106
107 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
108 Profile_load_procedure.ES10b_GetEUICCChallenge();
109
110
111 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行AuthenticateServerRequest;");
112 Profile_load_procedure.ES10b_AuthenticateServer();
113
114 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行PrepareDownloadRequest;");
115 Profile_load_procedure.ES10b_PrepareDownload();
116
117 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccDataRequest(GetEID);");
118 Profile_load_procedure.ES10b_GetEID();
119
120 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage,中间插入ES10b.GetEUICCChallenge;");
121 Profile_load_procedure.serviceProviderName = SP_NAME1;
122 Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
123 Profile_load_procedure.profileClass = "02";
124 Profile_load_procedure.iconType = "01";
125 Profile_load_procedure.icon = ICON_OP_PROF1;
126 Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
127 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
128 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
129 Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;
130 Profile_load_procedure.profilePolicyRules = "0560";
131 Profile_load_procedure.mccMnc = MCC_MNC1;
132
133 LogicChannelInfo[curLogicChannel] = new SecureChannelInfo(auth03.scp + auth03.iscp, auth03.level);
134
135 Profile_load_procedure.iniSecureChannelRequest = new InitialiseSecureChannelRequest();
136 Profile_load_procedure.iniSecureChannelRequest.remoteOpId = Profile_load_procedure.remoteOpId;
137 Profile_load_procedure.iniSecureChannelRequest.transactionId = Profile_load_procedure.authServerRequest.serverSigned1.transactionId;
138 Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate = new ControlRefTemplate();
139
140 Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.keyType = "88";
141 Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.keyLen = "10";
142 Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.hostId = Profile_load_procedure.hostId;
143 var ss = Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.GenHexData();
144
145 Profile_load_procedure.SmdpOtEcc = Euicc_RSP_GenKey(Profile_load_procedure.DPbpInforObj.Para);
146
147 Profile_load_procedure.iniSecureChannelRequest.smdpOtpk = Profile_load_procedure.SmdpOtEcc.P_key;
148
149 var signa1= "";
150
151 signa1 += GenASN1HexData(Profile_load_procedure.iniSecureChannelRequest.tagOfremoteOpId, Profile_load_procedure.iniSecureChannelRequest.remoteOpId); //remoteOpId
152 signa1 += GenASN1HexData(Profile_load_procedure.iniSecureChannelRequest.tagOftransactionId, Profile_load_procedure.iniSecureChannelRequest.transactionId); //transactionId
153 signa1 += GenASN1HexData(Profile_load_procedure.iniSecureChannelRequest.tagOfcontrolRefTemplate, Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate); //controlRefTemplate
154 signa1 += GenASN1HexData(Profile_load_procedure.iniSecureChannelRequest.tagOfsmdpOtpk,Profile_load_procedure.iniSecureChannelRequest.smdpOtpk);//euiccOtpk
155 signa1 += GenASN1HexData(Profile_load_procedure.preDownloadResponse.downloadResponseOk.euiccSigned2.tagOfeuiccOtpk,Profile_load_procedure.euiccOtpk);//euiccOtpk
156
157 Profile_load_procedure.iniSecureChannelRequest.smdpSign = Euicc_RSP_Sign(Profile_load_procedure.DPbpInforObj.D_key, Profile_load_procedure.DPbpInforObj.P_key, signa1, SM_IDa, Profile_load_procedure.DPbpInforObj.Para);
158
159 var iniSecureChannelRequestHexStr = Profile_load_procedure.iniSecureChannelRequest.GenHexData();
160 iniSecureChannelRequestHexStr = GenBER_TLV("BF23", iniSecureChannelRequestHexStr);
161
162 var shareinfo = Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.keyType + Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.keyLen;
163 shareinfo += GenerLV(Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.hostId) + GenerLV(Profile_load_procedure.eidValue);
164
165 var keydata = Euicc_RSP_KeyExchange(Profile_load_procedure.euiccOtpk, Profile_load_procedure.SmdpOtEcc.D_key, Profile_load_procedure.DPbpInforObj.Para, shareinfo,48,
166 Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.hostId,Profile_load_procedure.DPbpInforObj.P_key,Profile_load_procedure.DPbpInforObj.D_key,Profile_load_procedure.SmdpOtEcc.Px_key,
167 Profile_load_procedure.eidValue,pk_EUICC,1);
168
169 LogicChannelInfo[curLogicChannel].dataMac = keydata.substr(0,32);
170 LogicChannelInfo[curLogicChannel].sessionENC = keydata.substr(32,32);
171 LogicChannelInfo[curLogicChannel].sessionMAC = keydata.substr(64,32);
172 LogicChannelInfo[curLogicChannel].encCounter = 1;
173
174 Profile_load_procedure.confISDPRequest = new ConfigureISDPRequest();
175 Profile_load_procedure.confISDPRequest.dpProprietaryData = new DpProprietaryData();
176 Profile_load_procedure.confISDPRequest.dpProprietaryData.dpOid = Profile_load_procedure.DPbpInforObj.registeredID;
177 var confISDPRequestHexStr = Profile_load_procedure.confISDPRequest.GenHexData();
178
179
180 LogicChannelInfo[curLogicChannel].Security_level = "03";
181 confISDPRequestHexStr = curGPEnc.SendGPcmdSCP03t(confISDPRequestHexStr,"87");
182 confISDPRequestHexStr = GenBER_TLV("A0", confISDPRequestHexStr);
183
184 Profile_load_procedure.stMetadataRequest = new StoreMetadataRequest();
185 Profile_load_procedure.stMetadataRequest.iccid = Profile_load_procedure.ICCID;
186 Profile_load_procedure.stMetadataRequest.serviceProviderName = Profile_load_procedure.serviceProviderName;
187 Profile_load_procedure.stMetadataRequest.profileName = Profile_load_procedure.profileName;
188 Profile_load_procedure.stMetadataRequest.profilePolicyRules = Profile_load_procedure.profilePolicyRules;
189 Profile_load_procedure.stMetadataRequest.profileClass = Profile_load_procedure.profileClass;
190 if ((typeof(Profile_load_procedure.profilePolicyRules) == "string") && (Profile_load_procedure.SetProfileOwner))
191 {
192
193 Profile_load_procedure.stMetadataRequest.profileOwner = new OperatorID();
194 Profile_load_procedure.stMetadataRequest.profileOwner.mccMnc = Profile_load_procedure.mccMnc;
195 if (Profile_load_procedure.UseGid)
196 {
197 Profile_load_procedure.stMetadataRequest.profileOwner.gid1 = Profile_load_procedure.gid1;
198 Profile_load_procedure.stMetadataRequest.profileOwner.gid2 = Profile_load_procedure.gid2;
199 }
200
201
202 }
203 Profile_load_procedure.stMetadataRequest.notificationConfigurationInfo = Profile_load_procedure.notificationConfigurationInfo;
204 Profile_load_procedure.stMetadataRequest.iconType = Profile_load_procedure.iconType;
205 Profile_load_procedure.stMetadataRequest.icon = Profile_load_procedure.icon;
206
207
208 var stMetadataRequestHexStr = Profile_load_procedure.stMetadataRequest.GenHexData();
209 LogicChannelInfo[curLogicChannel].Security_level = "01";
210 stMetadataRequestHexStr = curGPEnc.SendGPcmdSCP03t(stMetadataRequestHexStr,"88");
211 sequenceOf88HexStr = "A1" + GenBER_Len(stMetadataRequestHexStr.length/2);
212
213 var reSessionKeysRequestHexStr = "";
214
215 var ProfileArr = new Array();
216 var t = 0;
217 var off = 0;
218 var len = Profile_load_procedure.profileData.length/2;
219 LogicChannelInfo[curLogicChannel].Security_level = "03";
220 var datalen = Profile_load_procedure.PPPdatablock_Max_Size;
221 var sProfileLen = 0;
222
223 while (off < len)
224 {
225 if ((len - off) < Profile_load_procedure.PPPdatablock_Max_Size)
226 datalen = len - off;
227
228 ProfileArr[t] = curGPEnc.SendGPcmdSCP03t(Profile_load_procedure.profileData.substr(2*off, 2*datalen),"86");
229
230 sProfileLen += ProfileArr[t].length/2;
231 off += datalen;
232
233 t ++;
234 }
235
236 sequenceOf86HexStr = "A3" + GenBER_Len(sProfileLen);
237 var totalLen = iniSecureChannelRequestHexStr.length/2 + confISDPRequestHexStr.length/2 + sequenceOf88HexStr.length/2 +
238 stMetadataRequestHexStr.length/2 + reSessionKeysRequestHexStr.length/2 + sequenceOf86HexStr.length/2 + sProfileLen;
239
240 iniSecureChannelRequestHexStr = "BF36" + "82" + obj.Hex(totalLen,4) + iniSecureChannelRequestHexStr;
241
242
243 var bpp_data_Arr = new Array();
244 bpp_data_Arr.push(iniSecureChannelRequestHexStr);
245 bpp_data_Arr.push(confISDPRequestHexStr);
246
247 bpp_data_Arr.push(sequenceOf88HexStr);
248 bpp_data_Arr.push(stMetadataRequestHexStr);
249 bpp_data_Arr.push(reSessionKeysRequestHexStr);
250
251 var arr1 = new Array();
252 arr1.push(sequenceOf86HexStr);
253
254 for (var i = 0; i < ProfileArr.length; i++)
255 {
256 arr1.push(ProfileArr[i]);
257 }
258
259 var resdata = LPAd_BPP_data_to_eUICC(bpp_data_Arr,Profile_load_procedure.LoadRemainder);
260
261 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
262 Profile_load_procedure.ES10b_GetEUICCChallenge();
263
264
265 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage,剩余的BBP;");
266 LPAd_Transport_data_to_eUICC(arr1[0],"91","00","6985/6A88","");
267
268 curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
269 TS_SELECT("Select ISD",ISD_R_AID,"9000");
270
271 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ProfileInfoListRequest,获取profile状态;");
272 var proInfoListRequest = new ProfileInfoListRequest();
273 proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF1);
274 proInfoListRequest.tagList = "5A4F9F70";
275 proInfoListRequest.GenHexData();
276 var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
277 var proInfoListResponse = new ProfileInfoListResponse();
278 proInfoListResponse.checkCardResDataFormat(respData);
279
280 try
281 {
282 curStrHandle.CheckData("00", obj.ToHex(proInfoListResponse.profileInfoListOk.arrOfElement.length),"Profile Info number");
283 }catch(e){
284 obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
285 }
286
287 curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ListNotification;");
288 var resdata = LPAd_Transport_data_to_eUICC("BF2800");
289 curStrHandle.CheckData("BF2802A000", resdata, "Notification");
290
291 RecoverCard();
292}
293
-cas 盲生成TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases/Import/TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases.js120 行 / 10614 字符 / gb18030入口函数 @L21
1// Author: 卡思Cas智能体
2// Date: 20261005-152741
3// Function: (purpose 原文未由 SGP.23 该 TC 提供,corpus vacuum 登记)TC_eUICC_ES10b.LoadBoundProfilePackage_ErrorCases,Test Sequence #01 Error: Unrecognized leading tag in BPP; #02 Error: GetEUICCChallenge during BPP loading,适用性 M。
4// Test points: S1-C1 SW;S2-C1 SW;S2-C2 response data absent;S3-C1 SW;S3-C2 SW;S4-C1 SW
5// S4-C2 contains iccid 989209012143658709F5;S4-C3 contains iccid 989209012143658709F5
6// S4-C4 isdpAid;S4-C5 profileState;S5-C1 SW;S5-C2 R_CHALLENGE outer tag
7// S5-C2 R_CHALLENGE required members present;S5-C2 tagOfeuiccChallenge
8// S5-C2 lengthOfeuiccChallenge;S5-C3 R_CHALLENGE outer tag;S5-C3 tagOfeuiccChallenge
9// S5-C3 lengthOfeuiccChallenge;S6-C1 SW in 6A88/6985;S7-C1 SW;S7-C2 profileInfoListOk empty
10// S8-C1 SW;S8-C2 notificationMetadataList empty
11// 本函数由 CaseIR 4.2.11.2.4 编译生成(fullwave-blindgen-live-70-W1-A3,SGP.23 v1.16 × SGP.22 v2.7):字节权威=CaseIR,非誊录黄金脚本。
12// Value-free template: every data byte is injected from CaseIR fields; no scaffold globals (see docs/speconly/compile-symbol-migration.md).
13// 适用性 M:编译期门,运行时由 harness 环境前置承担。
14// PRECONDITION (declared, NOT compiled): initial_conditions 缺语料过程体(Annex C.2 absent from input package, corpus vacuum): IC 序列属测试工具/卡态编排责任,本脚本不虚构初始化步骤;语义影响见 CaseIR open_items。
15// GIC1 The PROFILE_OPERATIONAL1 is not loaded on the eUICC.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
16// GIC2 Communication S_Device/eUICC initialized, S_LPAd has selected the ISD-R; Common Mutual Authentication successfully executed (#GET_EUICC_INFO1, #GET_EUICC_CHALLENGE, #AUTHENTICATE_SMDP sent); the same GSMA CI chosen for signing and verification; End User Confirmation sub-procedure executed (#PREP_DOWNLOAD_NO_CC sent).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
17// Seq01-IC1/IC2/IC3 Generate <OTPK_S_SM_DP+_ECKA>/<OT_SK_S_SM_DP+_ECKA>; <BPP> = MTD_GENERATE_BPP(#S_INIT_SC_PROF1, #CONF_ISDP_PROF1, #METADATA_OP_PROF1, NO_PARAM, #UPP_OP_PROF1); split into <BPP_SEG_INIT>/<BPP_SEG_A0>/<BPP_SEG_A1>/<BPP_SEG_A3>.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
18// Seq01-IC4 S_LPAd → eUICC: MTD_STORE_DATA_SCRIPT(<BPP_SEG_INIT>) — SW=0x9000 without response data for all STORE DATA commands.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
19// Seq01-IC5 S_LPAd → eUICC: MTD_STORE_DATA_SCRIPT(<BPP_SEG_A0>) — SW=0x9000 without response data for all STORE DATA commands (REQ RQ31_186_1).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
20// Seq02-IC No Notification is stored in the eUICC's Pending Notifications List; IC1-IC6: generate one-time keys, generate <BPP> (same as Seq01-IC2), split segments, then load <BPP_SEG_INIT>, <BPP_SEG_A0>, <BPP_SEG_A1> — each SW=0x9000 without response data.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
21function TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_01_02_merged() {
22 var bind = curBind;
23
24 // 步骤 1:Seq#01 Step1] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ31_186_1, RQ57_013, RQ57_016)
25 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
26 var s1 = bind.sendApdu(null, "E2", "91", "00", "C9050102030405", "00", "6A88");
27 bind.checkData("S1-C1 SW", "6A88", s1.sw);
28 // S1-C2: kind 'requirement' pattern '' has no static generation face (corpus vacuum; see CaseIR unresolved).
29 // S1-C3: kind 'requirement' pattern '' has no static generation face (corpus vacuum; see CaseIR unresolved).
30 // S1-C2: binding:requirement_satisfied_by_same_step_error_sw_assertion (check_attestation)
31 // S1-C3: binding:requirement_satisfied_by_same_step_error_sw_assertion (check_attestation)
32
33 // 步骤 2:Seq#01 Step2] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ31_186_1)
34 // BPP segment load (data=null contract): <BPP_SEG_A1> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
35 // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
36 var s2 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
37 bind.checkData("S2-C1 SW", "9000", s2.sw);
38 bind.checkData("S2-C2 response data absent", "1", s2.resp === "" ? "1" : "0");
39
40 // 步骤 3:Seq#01 Step3] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ31_186_1)
41 // BPP segment load (data=null contract): <BPP_SEG_A3> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
42 // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
43 var s3 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
44 bind.checkData("S3-C1 SW", "9000", s3.sw);
45 bind.checkData("S3-C2 SW", "9000", s3.sw);
46 // S3-C3: binding:bpp_seg_load_pir_runtime_structure(S22-2.5.6;PIR-runtime-domain) (check_attestation)
47
48 // 步骤 4:Seq#01 Step4] MTD_STORE_DATA(tc_step)
49 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
50 var s4 = bind.sendApdu(null, "E2", "91", "00", "BF2D0EA00C5A0A989209012143658709F5", "00", "9000");
51 bind.checkData("S4-C1 SW", "9000", s4.sw);
52 var r2p4 = BindEs10xProcProfile.walkChoiceList(s4.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
53 var r2has4_0 = false;
54 for (var r2i4_0 = 0; r2i4_0 < r2p4.elements.length; r2i4_0++) {
55 var f = r2p4.elements[r2i4_0].fields;
56 if (f["5A"] === "989209012143658709F5" && f["9F70"] === "00") { r2has4_0 = true; break; }
57 }
58 bind.checkData("S4-C2 contains iccid 989209012143658709F5", "1", (r2p4.branch_tag === "A0" && r2has4_0) ? "1" : "0");
59 var r2has4_0 = false;
60 for (var r2i4_0 = 0; r2i4_0 < r2p4.elements.length; r2i4_0++) {
61 var f = r2p4.elements[r2i4_0].fields;
62 if (f["5A"] === "989209012143658709F5") { r2has4_0 = true; break; }
63 }
64 bind.checkData("S4-C3 contains iccid 989209012143658709F5", "1", (r2p4.branch_tag === "A0" && r2has4_0) ? "1" : "0");
65 var r2fa4S4_C4 = false;
66 for (var r2fi4S4_C4 = 0; r2fi4S4_C4 < r2p4.elements.length; r2fi4S4_C4++) {
67 var f = r2p4.elements[r2fi4S4_C4].fields;
68 if (f["4F"] !== undefined) { r2fa4S4_C4 = true; break; }
69 }
70 bind.checkData("S4-C4 isdpAid", "1", (r2p4.branch_tag === "A0" && r2fa4S4_C4) ? "1" : "0");
71 var r2fa4S4_C5 = false;
72 for (var r2fi4S4_C5 = 0; r2fi4S4_C5 < r2p4.elements.length; r2fi4S4_C5++) {
73 var f = r2p4.elements[r2fi4S4_C5].fields;
74 if (f["9F70"] === "00") { r2fa4S4_C5 = true; break; }
75 }
76 bind.checkData("S4-C5 profileState", "1", (r2p4.branch_tag === "A0" && r2fa4S4_C5) ? "1" : "0");
77
78 // 步骤 5:Seq#02 Step1] MTD_STORE_DATA(tc_step;REQ: RQ31_188_1)
79 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
80 var s5 = bind.sendApdu(null, "E2", "91", "00", "BF2E00", "00", "9000");
81 bind.checkData("S5-C1 SW", "9000", s5.sw);
82 // geca-proc ES10b Info 响应面(R_CHALLENGE,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
83 var gw5 = BindGecaProc.parseGecaResponse(s5.resp, {outer: "BF2E", required: ["80"], optional: []});
84 bind.checkData("S5-C2 R_CHALLENGE outer tag", "BF2E", gw5.outer_tag === null ? "absent" : gw5.outer_tag);
85 bind.checkData("S5-C2 R_CHALLENGE required members present", "1", gw5.ok ? "1" : "0");
86 var r2w5 = BindGecaProc.parseGecaResponse(s5.resp, {outer: "BF2E", required: ["80"]});
87 bind.checkData("S5-C2 R_CHALLENGE outer tag", "BF2E", r2w5.outer_tag === null ? "absent" : r2w5.outer_tag);
88 var r2ch5 = null; for (var r2ci5 = 0; r2ci5 < r2w5.children.length; r2ci5++) { if (r2w5.children[r2ci5].tag === "80") { r2ch5 = r2w5.children[r2ci5]; } }
89 var r2chal5 = r2ch5 === null ? "" : r2ch5.value;
90 bind.checkData("S5-C2 tagOfeuiccChallenge", "80", r2ch5 === null ? "absent" : r2ch5.tag);
91 bind.checkData("S5-C2 lengthOfeuiccChallenge", "10", r2ch5 === null ? "absent" : (r2ch5.len < 16 ? ("0" + r2ch5.len.toString(16).toUpperCase()) : r2ch5.len.toString(16).toUpperCase()));
92 bind.checkData("S5-C3 R_CHALLENGE outer tag", "BF2E", r2w5.outer_tag === null ? "absent" : r2w5.outer_tag);
93 bind.checkData("S5-C3 tagOfeuiccChallenge", "80", r2ch5 === null ? "absent" : r2ch5.tag);
94 bind.checkData("S5-C3 lengthOfeuiccChallenge", "10", r2ch5 === null ? "absent" : (r2ch5.len < 16 ? ("0" + r2ch5.len.toString(16).toUpperCase()) : r2ch5.len.toString(16).toUpperCase()));
95
96 // 步骤 6:Seq#02 Step2] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ31_185, RQ57_013, RQ57_016)
97 // BPP segment load (data=null contract): <BPP_SEG_A3> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
98 // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
99 var s6 = bind.sendApdu(null, "E2", "00", "00", null, "00", "6A88/6985");
100 bind.checkData("S6-C1 SW in 6A88/6985", "1", (s6.sw === "6A88" || s6.sw === "6985") ? "1" : "0");
101 // S6-C2: binding:bpp_seg_load_pir_runtime_semantics(S22-2.5.6;PIR-runtime-domain) (check_attestation)
102
103 // 步骤 7:Seq#02 Step3] MTD_STORE_DATA(tc_step;REQ: RQ31_185)
104 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
105 var s7 = bind.sendApdu(null, "E2", "91", "00", "BF2D0EA00C5A0A989209012143658709F5", "00", "9000");
106 bind.checkData("S7-C1 SW", "9000", s7.sw);
107 var r2p7 = BindEs10xProcProfile.walkChoiceList(s7.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
108 bind.checkData("S7-C2 profileInfoListOk empty", "1", (r2p7.branch_tag === "A0" && r2p7.elements.length === 0) ? "1" : "0");
109
110 // 步骤 8:Seq#02 Step4] MTD_STORE_DATA(tc_step;REQ: RQ31_185)
111 // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
112 var s8 = bind.sendApdu(null, "E2", "91", "00", "BF2804810204F0", "00", "9000");
113 bind.checkData("S8-C1 SW", "9000", s8.sw);
114 var ln8S8_C2T = BindEs10xSingleRequest.parseBerTlv(s8.resp);
115 var ln8S8_C2Ok = ln8S8_C2T.length === 1 && ln8S8_C2T[0].tag === "BF28";
116 var ln8S8_C2Br = ln8S8_C2Ok ? BindEs10xSingleRequest.parseBerTlv(ln8S8_C2T[0].value) : [];
117 var ln8S8_C2Empty = ln8S8_C2Br.length === 1 && ln8S8_C2Br[0].tag === "A0" && BindEs10xSingleRequest.parseBerTlv(ln8S8_C2Br[0].value).length === 0;
118 bind.checkData("S8-C2 notificationMetadataList empty", "1", ln8S8_C2Empty ? "1" : "0");
119}
120
完整 unified diff
行级差异:新增 110 行 / 删除 283 行(以 -man 为基准,unified 上下文 3 行)。
展开 diff(406 行)
--- -man
+++ -cas
@@ -1,293 +1,120 @@
-// slice of Import\TestCase_SGP_23.js - cases: TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_01_Error_Unrecognized_leading_tag_in_BPP + TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_02_Error_GetEUICCChallenge_during_BPP_loading (extracted verbatim)
+// Author: 卡思Cas智能体
+// Date: 20261005-152741
+// Function: (purpose 原文未由 SGP.23 该 TC 提供,corpus vacuum 登记)TC_eUICC_ES10b.LoadBoundProfilePackage_ErrorCases,Test Sequence #01 Error: Unrecognized leading tag in BPP; #02 Error: GetEUICCChallenge during BPP loading,适用性 M。
+// Test points: S1-C1 SW;S2-C1 SW;S2-C2 response data absent;S3-C1 SW;S3-C2 SW;S4-C1 SW
+// S4-C2 contains iccid 989209012143658709F5;S4-C3 contains iccid 989209012143658709F5
+// S4-C4 isdpAid;S4-C5 profileState;S5-C1 SW;S5-C2 R_CHALLENGE outer tag
+// S5-C2 R_CHALLENGE required members present;S5-C2 tagOfeuiccChallenge
+// S5-C2 lengthOfeuiccChallenge;S5-C3 R_CHALLENGE outer tag;S5-C3 tagOfeuiccChallenge
+// S5-C3 lengthOfeuiccChallenge;S6-C1 SW in 6A88/6985;S7-C1 SW;S7-C2 profileInfoListOk empty
+// S8-C1 SW;S8-C2 notificationMetadataList empty
+// 本函数由 CaseIR 4.2.11.2.4 编译生成(fullwave-blindgen-live-70-W1-A3,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 环境前置承担。
+// PRECONDITION (declared, NOT compiled): initial_conditions 缺语料过程体(Annex C.2 absent from input package, corpus vacuum): IC 序列属测试工具/卡态编排责任,本脚本不虚构初始化步骤;语义影响见 CaseIR open_items。
+// GIC1 The PROFILE_OPERATIONAL1 is not loaded on the eUICC.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// GIC2 Communication S_Device/eUICC initialized, S_LPAd has selected the ISD-R; Common Mutual Authentication successfully executed (#GET_EUICC_INFO1, #GET_EUICC_CHALLENGE, #AUTHENTICATE_SMDP sent); the same GSMA CI chosen for signing and verification; End User Confirmation sub-procedure executed (#PREP_DOWNLOAD_NO_CC sent).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// Seq01-IC1/IC2/IC3 Generate <OTPK_S_SM_DP+_ECKA>/<OT_SK_S_SM_DP+_ECKA>; <BPP> = MTD_GENERATE_BPP(#S_INIT_SC_PROF1, #CONF_ISDP_PROF1, #METADATA_OP_PROF1, NO_PARAM, #UPP_OP_PROF1); split into <BPP_SEG_INIT>/<BPP_SEG_A0>/<BPP_SEG_A1>/<BPP_SEG_A3>.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// Seq01-IC4 S_LPAd → eUICC: MTD_STORE_DATA_SCRIPT(<BPP_SEG_INIT>) — SW=0x9000 without response data for all STORE DATA commands.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// Seq01-IC5 S_LPAd → eUICC: MTD_STORE_DATA_SCRIPT(<BPP_SEG_A0>) — SW=0x9000 without response data for all STORE DATA commands (REQ RQ31_186_1).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// Seq02-IC No Notification is stored in the eUICC's Pending Notifications List; IC1-IC6: generate one-time keys, generate <BPP> (same as Seq01-IC2), split segments, then load <BPP_SEG_INIT>, <BPP_SEG_A0>, <BPP_SEG_A1> — each SW=0x9000 without response data.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+function TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_01_02_merged() {
+ var bind = curBind;
-function TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_01_Error_Unrecognized_leading_tag_in_BPP()
-{
- tracenamestr = "测试目的:确保eUICC在Profile下载期间,拒绝任何带有无法识别的leading tag的BPP部分。在这种情况下,eUICC应返回SW为0x6A88,不应丢弃下载会话状态";
- curDis.TraceStart(sno++,tracenamestr);
+ // 步骤 1:Seq#01 Step1] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ31_186_1, RQ57_013, RQ57_016)
+ // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+ var s1 = bind.sendApdu(null, "E2", "91", "00", "C9050102030405", "00", "6A88");
+ bind.checkData("S1-C1 SW", "6A88", s1.sw);
+ // S1-C2: kind 'requirement' pattern '' has no static generation face (corpus vacuum; see CaseIR unresolved).
+ // S1-C3: kind 'requirement' pattern '' has no static generation face (corpus vacuum; see CaseIR unresolved).
+ // S1-C2: binding:requirement_satisfied_by_same_step_error_sw_assertion (check_attestation)
+ // S1-C3: binding:requirement_satisfied_by_same_step_error_sw_assertion (check_attestation)
- 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命令,执行GetEuiccInfo1Request;");
+ // 步骤 2:Seq#01 Step2] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ31_186_1)
+ // 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 s2 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+ bind.checkData("S2-C1 SW", "9000", s2.sw);
+ bind.checkData("S2-C2 response data absent", "1", s2.resp === "" ? "1" : "0");
-
- 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();
+ // 步骤 3:Seq#01 Step3] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ31_186_1)
+ // BPP segment load (data=null contract): <BPP_SEG_A3> 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 s3 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+ bind.checkData("S3-C1 SW", "9000", s3.sw);
+ bind.checkData("S3-C2 SW", "9000", s3.sw);
+ // S3-C3: binding:bpp_seg_load_pir_runtime_structure(S22-2.5.6;PIR-runtime-domain) (check_attestation)
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
- Profile_load_procedure.ES10b_GetEUICCChallenge();
+ // 步骤 4:Seq#01 Step4] 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 s4 = bind.sendApdu(null, "E2", "91", "00", "BF2D0EA00C5A0A989209012143658709F5", "00", "9000");
+ bind.checkData("S4-C1 SW", "9000", s4.sw);
+ var r2p4 = BindEs10xProcProfile.walkChoiceList(s4.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
+ var r2has4_0 = false;
+ for (var r2i4_0 = 0; r2i4_0 < r2p4.elements.length; r2i4_0++) {
+ var f = r2p4.elements[r2i4_0].fields;
+ if (f["5A"] === "989209012143658709F5" && f["9F70"] === "00") { r2has4_0 = true; break; }
+ }
+ bind.checkData("S4-C2 contains iccid 989209012143658709F5", "1", (r2p4.branch_tag === "A0" && r2has4_0) ? "1" : "0");
+ var r2has4_0 = false;
+ for (var r2i4_0 = 0; r2i4_0 < r2p4.elements.length; r2i4_0++) {
+ var f = r2p4.elements[r2i4_0].fields;
+ if (f["5A"] === "989209012143658709F5") { r2has4_0 = true; break; }
+ }
+ bind.checkData("S4-C3 contains iccid 989209012143658709F5", "1", (r2p4.branch_tag === "A0" && r2has4_0) ? "1" : "0");
+ var r2fa4S4_C4 = false;
+ for (var r2fi4S4_C4 = 0; r2fi4S4_C4 < r2p4.elements.length; r2fi4S4_C4++) {
+ var f = r2p4.elements[r2fi4S4_C4].fields;
+ if (f["4F"] !== undefined) { r2fa4S4_C4 = true; break; }
+ }
+ bind.checkData("S4-C4 isdpAid", "1", (r2p4.branch_tag === "A0" && r2fa4S4_C4) ? "1" : "0");
+ var r2fa4S4_C5 = false;
+ for (var r2fi4S4_C5 = 0; r2fi4S4_C5 < r2p4.elements.length; r2fi4S4_C5++) {
+ var f = r2p4.elements[r2fi4S4_C5].fields;
+ if (f["9F70"] === "00") { r2fa4S4_C5 = true; break; }
+ }
+ bind.checkData("S4-C5 profileState", "1", (r2p4.branch_tag === "A0" && r2fa4S4_C5) ? "1" : "0");
-
- 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,中间插入不识别的tag;");
- Profile_load_procedure.serviceProviderName = SP_NAME1;
- Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
- Profile_load_procedure.profileClass = "02";
- 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.profilePolicyRules = "0560";
- Profile_load_procedure.mccMnc = MCC_MNC1;
- Profile_load_procedure.LoadRemainder = 2;
- Profile_load_procedure.Unrecognized_leading_tag_in_BPP = "C9050102030405";
-
- 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.GenHexData();
- var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
+ // 步骤 5:Seq#02 Step1] MTD_STORE_DATA(tc_step;REQ: RQ31_188_1)
+ // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+ var s5 = bind.sendApdu(null, "E2", "91", "00", "BF2E00", "00", "9000");
+ bind.checkData("S5-C1 SW", "9000", s5.sw);
+ // geca-proc ES10b Info 响应面(R_CHALLENGE,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
+ var gw5 = BindGecaProc.parseGecaResponse(s5.resp, {outer: "BF2E", required: ["80"], optional: []});
+ bind.checkData("S5-C2 R_CHALLENGE outer tag", "BF2E", gw5.outer_tag === null ? "absent" : gw5.outer_tag);
+ bind.checkData("S5-C2 R_CHALLENGE required members present", "1", gw5.ok ? "1" : "0");
+ var r2w5 = BindGecaProc.parseGecaResponse(s5.resp, {outer: "BF2E", required: ["80"]});
+ bind.checkData("S5-C2 R_CHALLENGE outer tag", "BF2E", r2w5.outer_tag === null ? "absent" : r2w5.outer_tag);
+ var r2ch5 = null; for (var r2ci5 = 0; r2ci5 < r2w5.children.length; r2ci5++) { if (r2w5.children[r2ci5].tag === "80") { r2ch5 = r2w5.children[r2ci5]; } }
+ var r2chal5 = r2ch5 === null ? "" : r2ch5.value;
+ bind.checkData("S5-C2 tagOfeuiccChallenge", "80", r2ch5 === null ? "absent" : r2ch5.tag);
+ bind.checkData("S5-C2 lengthOfeuiccChallenge", "10", r2ch5 === null ? "absent" : (r2ch5.len < 16 ? ("0" + r2ch5.len.toString(16).toUpperCase()) : r2ch5.len.toString(16).toUpperCase()));
+ bind.checkData("S5-C3 R_CHALLENGE outer tag", "BF2E", r2w5.outer_tag === null ? "absent" : r2w5.outer_tag);
+ bind.checkData("S5-C3 tagOfeuiccChallenge", "80", r2ch5 === null ? "absent" : r2ch5.tag);
+ bind.checkData("S5-C3 lengthOfeuiccChallenge", "10", r2ch5 === null ? "absent" : (r2ch5.len < 16 ? ("0" + r2ch5.len.toString(16).toUpperCase()) : r2ch5.len.toString(16).toUpperCase()));
- var proInfoListResponse = new ProfileInfoListResponse();
- proInfoListResponse.checkCardResDataFormat(respData);
-
- try
- {
- curStrHandle.CheckData(ICCID_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].iccid, "ICCID");
- curStrHandle.CheckData(SP_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].serviceProviderName, "serviceProviderName");
- curStrHandle.CheckData(PROFILE_OPERATIONAL1_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].profileName, "profileName");
- curStrHandle.CheckData("01", proInfoListResponse.profileInfoListOk.arrOfElement[0].iconType, "iconType");
- curStrHandle.CheckData(ICON_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].icon, "icon");
- curStrHandle.CheckData("02", proInfoListResponse.profileInfoListOk.arrOfElement[0].profileClass, "profileClass");
- }catch(e){
- obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
- }
-
- RecoverCard();
-
-}
+ // 步骤 6:Seq#02 Step2] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ31_185, RQ57_013, RQ57_016)
+ // BPP segment load (data=null contract): <BPP_SEG_A3> 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 s6 = bind.sendApdu(null, "E2", "00", "00", null, "00", "6A88/6985");
+ bind.checkData("S6-C1 SW in 6A88/6985", "1", (s6.sw === "6A88" || s6.sw === "6985") ? "1" : "0");
+ // S6-C2: binding:bpp_seg_load_pir_runtime_semantics(S22-2.5.6;PIR-runtime-domain) (check_attestation)
-function TC_eUICC_ES10b_LoadBoundProfilePackage_ErrorCases_02_Error_GetEUICCChallenge_during_BPP_loading()
-{
- tracenamestr = "测试目的:确保eUICC在BPP下载时,eUICC接受ES10b.GetEUICCChallenge请求,开始新的RSP会话";
- curDis.TraceStart(sno++,tracenamestr);
+ // 步骤 7:Seq#02 Step3] MTD_STORE_DATA(tc_step;REQ: RQ31_185)
+ // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+ var s7 = bind.sendApdu(null, "E2", "91", "00", "BF2D0EA00C5A0A989209012143658709F5", "00", "9000");
+ bind.checkData("S7-C1 SW", "9000", s7.sw);
+ var r2p7 = BindEs10xProcProfile.walkChoiceList(s7.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
+ bind.checkData("S7-C2 profileInfoListOk empty", "1", (r2p7.branch_tag === "A0" && r2p7.elements.length === 0) ? "1" : "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命令,执行GetEuiccInfo1Request;");
-
-
- 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();
-
- 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,中间插入ES10b.GetEUICCChallenge;");
- Profile_load_procedure.serviceProviderName = SP_NAME1;
- Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
- Profile_load_procedure.profileClass = "02";
- 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.profilePolicyRules = "0560";
- Profile_load_procedure.mccMnc = MCC_MNC1;
-
- LogicChannelInfo[curLogicChannel] = new SecureChannelInfo(auth03.scp + auth03.iscp, auth03.level);
-
- Profile_load_procedure.iniSecureChannelRequest = new InitialiseSecureChannelRequest();
- Profile_load_procedure.iniSecureChannelRequest.remoteOpId = Profile_load_procedure.remoteOpId;
- Profile_load_procedure.iniSecureChannelRequest.transactionId = Profile_load_procedure.authServerRequest.serverSigned1.transactionId;
- Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate = new ControlRefTemplate();
-
- Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.keyType = "88";
- Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.keyLen = "10";
- Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.hostId = Profile_load_procedure.hostId;
- var ss = Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.GenHexData();
-
- Profile_load_procedure.SmdpOtEcc = Euicc_RSP_GenKey(Profile_load_procedure.DPbpInforObj.Para);
-
- Profile_load_procedure.iniSecureChannelRequest.smdpOtpk = Profile_load_procedure.SmdpOtEcc.P_key;
-
- var signa1= "";
-
- signa1 += GenASN1HexData(Profile_load_procedure.iniSecureChannelRequest.tagOfremoteOpId, Profile_load_procedure.iniSecureChannelRequest.remoteOpId); //remoteOpId
- signa1 += GenASN1HexData(Profile_load_procedure.iniSecureChannelRequest.tagOftransactionId, Profile_load_procedure.iniSecureChannelRequest.transactionId); //transactionId
- signa1 += GenASN1HexData(Profile_load_procedure.iniSecureChannelRequest.tagOfcontrolRefTemplate, Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate); //controlRefTemplate
- signa1 += GenASN1HexData(Profile_load_procedure.iniSecureChannelRequest.tagOfsmdpOtpk,Profile_load_procedure.iniSecureChannelRequest.smdpOtpk);//euiccOtpk
- signa1 += GenASN1HexData(Profile_load_procedure.preDownloadResponse.downloadResponseOk.euiccSigned2.tagOfeuiccOtpk,Profile_load_procedure.euiccOtpk);//euiccOtpk
-
- Profile_load_procedure.iniSecureChannelRequest.smdpSign = Euicc_RSP_Sign(Profile_load_procedure.DPbpInforObj.D_key, Profile_load_procedure.DPbpInforObj.P_key, signa1, SM_IDa, Profile_load_procedure.DPbpInforObj.Para);
-
- var iniSecureChannelRequestHexStr = Profile_load_procedure.iniSecureChannelRequest.GenHexData();
- iniSecureChannelRequestHexStr = GenBER_TLV("BF23", iniSecureChannelRequestHexStr);
-
- var shareinfo = Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.keyType + Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.keyLen;
- shareinfo += GenerLV(Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.hostId) + GenerLV(Profile_load_procedure.eidValue);
-
- var keydata = Euicc_RSP_KeyExchange(Profile_load_procedure.euiccOtpk, Profile_load_procedure.SmdpOtEcc.D_key, Profile_load_procedure.DPbpInforObj.Para, shareinfo,48,
- Profile_load_procedure.iniSecureChannelRequest.controlRefTemplate.hostId,Profile_load_procedure.DPbpInforObj.P_key,Profile_load_procedure.DPbpInforObj.D_key,Profile_load_procedure.SmdpOtEcc.Px_key,
- Profile_load_procedure.eidValue,pk_EUICC,1);
-
- LogicChannelInfo[curLogicChannel].dataMac = keydata.substr(0,32);
- LogicChannelInfo[curLogicChannel].sessionENC = keydata.substr(32,32);
- LogicChannelInfo[curLogicChannel].sessionMAC = keydata.substr(64,32);
- LogicChannelInfo[curLogicChannel].encCounter = 1;
-
- Profile_load_procedure.confISDPRequest = new ConfigureISDPRequest();
- Profile_load_procedure.confISDPRequest.dpProprietaryData = new DpProprietaryData();
- Profile_load_procedure.confISDPRequest.dpProprietaryData.dpOid = Profile_load_procedure.DPbpInforObj.registeredID;
- var confISDPRequestHexStr = Profile_load_procedure.confISDPRequest.GenHexData();
-
-
- LogicChannelInfo[curLogicChannel].Security_level = "03";
- confISDPRequestHexStr = curGPEnc.SendGPcmdSCP03t(confISDPRequestHexStr,"87");
- confISDPRequestHexStr = GenBER_TLV("A0", confISDPRequestHexStr);
-
- Profile_load_procedure.stMetadataRequest = new StoreMetadataRequest();
- Profile_load_procedure.stMetadataRequest.iccid = Profile_load_procedure.ICCID;
- Profile_load_procedure.stMetadataRequest.serviceProviderName = Profile_load_procedure.serviceProviderName;
- Profile_load_procedure.stMetadataRequest.profileName = Profile_load_procedure.profileName;
- Profile_load_procedure.stMetadataRequest.profilePolicyRules = Profile_load_procedure.profilePolicyRules;
- Profile_load_procedure.stMetadataRequest.profileClass = Profile_load_procedure.profileClass;
- if ((typeof(Profile_load_procedure.profilePolicyRules) == "string") && (Profile_load_procedure.SetProfileOwner))
- {
-
- Profile_load_procedure.stMetadataRequest.profileOwner = new OperatorID();
- Profile_load_procedure.stMetadataRequest.profileOwner.mccMnc = Profile_load_procedure.mccMnc;
- if (Profile_load_procedure.UseGid)
- {
- Profile_load_procedure.stMetadataRequest.profileOwner.gid1 = Profile_load_procedure.gid1;
- Profile_load_procedure.stMetadataRequest.profileOwner.gid2 = Profile_load_procedure.gid2;
- }
-
-
- }
- Profile_load_procedure.stMetadataRequest.notificationConfigurationInfo = Profile_load_procedure.notificationConfigurationInfo;
- Profile_load_procedure.stMetadataRequest.iconType = Profile_load_procedure.iconType;
- Profile_load_procedure.stMetadataRequest.icon = Profile_load_procedure.icon;
-
-
- var stMetadataRequestHexStr = Profile_load_procedure.stMetadataRequest.GenHexData();
- LogicChannelInfo[curLogicChannel].Security_level = "01";
- stMetadataRequestHexStr = curGPEnc.SendGPcmdSCP03t(stMetadataRequestHexStr,"88");
- sequenceOf88HexStr = "A1" + GenBER_Len(stMetadataRequestHexStr.length/2);
-
- var reSessionKeysRequestHexStr = "";
-
- var ProfileArr = new Array();
- var t = 0;
- var off = 0;
- var len = Profile_load_procedure.profileData.length/2;
- LogicChannelInfo[curLogicChannel].Security_level = "03";
- var datalen = Profile_load_procedure.PPPdatablock_Max_Size;
- var sProfileLen = 0;
-
- while (off < len)
- {
- if ((len - off) < Profile_load_procedure.PPPdatablock_Max_Size)
- datalen = len - off;
-
- ProfileArr[t] = curGPEnc.SendGPcmdSCP03t(Profile_load_procedure.profileData.substr(2*off, 2*datalen),"86");
-
- sProfileLen += ProfileArr[t].length/2;
- off += datalen;
-
- t ++;
- }
-
- sequenceOf86HexStr = "A3" + GenBER_Len(sProfileLen);
- var totalLen = iniSecureChannelRequestHexStr.length/2 + confISDPRequestHexStr.length/2 + sequenceOf88HexStr.length/2 +
- stMetadataRequestHexStr.length/2 + reSessionKeysRequestHexStr.length/2 + sequenceOf86HexStr.length/2 + sProfileLen;
-
- iniSecureChannelRequestHexStr = "BF36" + "82" + obj.Hex(totalLen,4) + iniSecureChannelRequestHexStr;
-
-
- var bpp_data_Arr = new Array();
- bpp_data_Arr.push(iniSecureChannelRequestHexStr);
- bpp_data_Arr.push(confISDPRequestHexStr);
-
- bpp_data_Arr.push(sequenceOf88HexStr);
- bpp_data_Arr.push(stMetadataRequestHexStr);
- bpp_data_Arr.push(reSessionKeysRequestHexStr);
-
- var arr1 = new Array();
- arr1.push(sequenceOf86HexStr);
-
- for (var i = 0; i < ProfileArr.length; i++)
- {
- arr1.push(ProfileArr[i]);
- }
-
- var resdata = LPAd_BPP_data_to_eUICC(bpp_data_Arr,Profile_load_procedure.LoadRemainder);
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
- Profile_load_procedure.ES10b_GetEUICCChallenge();
-
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage,剩余的BBP;");
- LPAd_Transport_data_to_eUICC(arr1[0],"91","00","6985/6A88","");
-
- 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("00", obj.ToHex(proInfoListResponse.profileInfoListOk.arrOfElement.length),"Profile Info number");
- }catch(e){
- obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
- }
-
- curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ListNotification;");
- var resdata = LPAd_Transport_data_to_eUICC("BF2800");
- curStrHandle.CheckData("BF2802A000", resdata, "Notification");
-
- RecoverCard();
+ // 步骤 8:Seq#02 Step4] MTD_STORE_DATA(tc_step;REQ: RQ31_185)
+ // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+ var s8 = bind.sendApdu(null, "E2", "91", "00", "BF2804810204F0", "00", "9000");
+ bind.checkData("S8-C1 SW", "9000", s8.sw);
+ var ln8S8_C2T = BindEs10xSingleRequest.parseBerTlv(s8.resp);
+ var ln8S8_C2Ok = ln8S8_C2T.length === 1 && ln8S8_C2T[0].tag === "BF28";
+ var ln8S8_C2Br = ln8S8_C2Ok ? BindEs10xSingleRequest.parseBerTlv(ln8S8_C2T[0].value) : [];
+ var ln8S8_C2Empty = ln8S8_C2Br.length === 1 && ln8S8_C2Br[0].tag === "A0" && BindEs10xSingleRequest.parseBerTlv(ln8S8_C2Br[0].value).length === 0;
+ bind.checkData("S8-C2 notificationMetadataList empty", "1", ln8S8_C2Empty ? "1" : "0");
}