Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4c77223

Browse files
author
Wolfgang Glas
committed
Brush up the new script API by undertaking more tests.
1 parent89f9488 commit4c77223

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

‎pkcs15/src/main/java/org/opensc/pkcs15/script/impl/CSFScriptParser.java‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ else if ("resp".equals(kv[0]))
307307
else
308308
cmd =newCommandAPDU(cla,ins,p1,p2);
309309

310-
SimpleCommandr =newSimpleCommand(cmd,resp,false);
310+
SimpleCommandr =newSimpleCommand(cmd,resp,true);
311311

312312
if (log.isDebugEnabled()) {
313313
log.debug("apdu = " +Util.asHex(r.getRequest().getBytes()));
@@ -358,10 +358,13 @@ else if ("[include]".equals(section))
358358

359359
if (ret ==null)
360360
ret =r;
361-
361+
362362
if (simpleCommand !=null)
363363
simpleCommand.setNext(r);
364364

365+
while (r.getNext() !=null)
366+
r = (SimpleCommand)r.getNext();
367+
365368
simpleCommand =r;
366369

367370
section =this.readLine(reader);

‎pkcs15/src/test/java/test/org/opensc/pkcs15/TestCSFScripts.java‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,34 @@ public class TestCSFScripts extends HardwareCardSupport {
4444

4545
privateStringgetResourceBase() {
4646

47+
Strings =System.getProperty("org.opensc.pkcs15.test.resourceBase");
48+
49+
if (s !=null)returns;
50+
4751
return"file:/home/ev-i/Siemens/SmartCard/Unterlagen/CardOS_V4.3B/Packages_and_Release_Notes/V43B_CSF_Files_2005_05/Run_CSF";
4852
}
4953

54+
privateStringgetScript() {
55+
56+
Strings =System.getProperty("org.opensc.pkcs15.test.script");
57+
58+
if (s !=null)returns;
59+
60+
return"Run_V43B_Erase_Profile_Default.csf";
61+
}
62+
5063
publicvoidtestInitScripts()throwsIOException,CardException {
5164

52-
StringresPath=this.getResourceBase() +"/Run_V43B_Erase_Profile_Default.csf";
65+
StringresPath=this.getResourceBase() +"/" +this.getScript();
5366

5467
ScriptResourceres =scriptResourceFactory.getScriptResource(resPath);
5568

5669
ScriptParsercsfParser =scriptParserFactory.getScriptParser("csf");
5770

5871
Commandcmd =csfParser.parseScript(res);
5972

60-
cmd.execute(this.card.getBasicChannel());
73+
while (cmd !=null)
74+
cmd =cmd.execute(this.card.getBasicChannel());
6175
}
6276

6377

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp