Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
feat: KEYP-96 fix postponed data length in CloseSessionRespPars
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanpierrefortune committed Jul 8, 2020
1 parent 5244499 commit bddd8ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Expand Up @@ -40,17 +40,14 @@ public SvCheckCmdBuild(SamRevision revision, byte[] svPoSignature) {
if (revision != null) {
this.defaultRevision = revision;
}
byte cla = this.defaultRevision.getClassByte();

byte p1, p2;
byte[] data;

p1 = (byte) 0x00;
p2 = (byte) 0x00;
byte cla = this.defaultRevision.getClassByte();
byte p1 = (byte) 0x00;
byte p2 = (byte) 0x00;

if (svPoSignature != null) {
// the operation is not "abort"
data = new byte[svPoSignature.length];
byte[] data = new byte[svPoSignature.length];
System.arraycopy(svPoSignature, 0, data, 0, svPoSignature.length);
request = setApduRequest(cla, command, p1, p2, data, null);
} else {
Expand Down
Expand Up @@ -108,6 +108,6 @@ public void lc4WithPostponedData() {
CloseSessionRespPars parser = new CloseSessionRespPars(
new ApduResponse(ByteArrayUtil.fromHex("04 345678 FEDCBA98 9000h"), null), null);
Assert.assertEquals("FEDCBA98", ByteArrayUtil.toHex(parser.getSignatureLo()));
Assert.assertEquals("04345678", ByteArrayUtil.toHex(parser.getPostponedData()));
Assert.assertEquals("345678", ByteArrayUtil.toHex(parser.getPostponedData()));
}
}

0 comments on commit bddd8ff

Please sign in to comment.