Fix incorrect offset use in setAttributes
This commit is contained in:
parent
04a66b376d
commit
e8ebf9e6d7
@ -122,15 +122,15 @@ public final class PGPKey {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(buf[0]) {
|
switch(buf[off]) {
|
||||||
case 0x01:
|
case 0x01:
|
||||||
if(len != 6) {
|
if(len != 6) {
|
||||||
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
|
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((Util.getShort(buf, (short)1) < 2048) ||
|
if((Util.getShort(buf, (short)(off + 1)) < 2048) ||
|
||||||
(Util.getShort(buf, (short)3) != 0x11) ||
|
(Util.getShort(buf, (short)(off + 3)) != 0x11) ||
|
||||||
(buf[5] < 0) || (buf[5] > 3)) {
|
(buf[(short)(off + 5)] < 0) || (buf[(short)(off + 5)] > 3)) {
|
||||||
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
|
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user