Fix useless/misplaced short conversions
This commit is contained in:
parent
4796f6ea78
commit
79d9342827
@ -28,7 +28,7 @@ import javacardx.crypto.*;
|
||||
public final class Constants {
|
||||
|
||||
protected static final short INTERNAL_BUFFER_MAX_LENGTH =
|
||||
(short)((short)0x500);
|
||||
(short)0x500;
|
||||
|
||||
protected static final short APDU_MAX_LENGTH = (short)256;
|
||||
|
||||
|
@ -320,7 +320,7 @@ public final class PGPKey {
|
||||
off = Common.skipLength(buf, off, (short)(len - (short)(off - boff)));
|
||||
template_off = off;
|
||||
|
||||
if(template_len > (short)(len - ((short)off - boff))) {
|
||||
if(template_len > (short)(len - (short)(off - boff))) {
|
||||
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
|
||||
return;
|
||||
}
|
||||
@ -353,7 +353,7 @@ public final class PGPKey {
|
||||
off = Common.skipLength(buf, off, (short)(len - (short)(off - boff)));
|
||||
data_off = off;
|
||||
|
||||
if(data_len > (short)(len - ((short)off - boff))) {
|
||||
if(data_len > (short)(len - (short)(off - boff))) {
|
||||
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
|
||||
return;
|
||||
}
|
||||
@ -476,9 +476,9 @@ public final class PGPKey {
|
||||
cipher_rsa_pkcs1.init(priv, Cipher.MODE_ENCRYPT);
|
||||
|
||||
off = cipher_rsa_pkcs1.doFinal(buf, (short)0, lc,
|
||||
buf, (short)lc);
|
||||
buf, lc);
|
||||
|
||||
return Util.arrayCopyNonAtomic(buf, (short)lc,
|
||||
return Util.arrayCopyNonAtomic(buf, lc,
|
||||
buf, (short)0,
|
||||
off);
|
||||
|
||||
@ -516,7 +516,7 @@ public final class PGPKey {
|
||||
cipher_rsa_pkcs1.init(priv, Cipher.MODE_DECRYPT);
|
||||
|
||||
final short len = cipher_rsa_pkcs1.doFinal(buf, (short)1, (short)(lc - 1),
|
||||
buf, (short)lc);
|
||||
buf, lc);
|
||||
|
||||
off = Util.arrayCopyNonAtomic(buf, lc,
|
||||
buf, (short)0,
|
||||
|
@ -291,7 +291,7 @@ public final class SmartPGPApplet extends Applet {
|
||||
|
||||
case Constants.TAG_HISTORICAL_BYTES_CARD_SERVICE_CARD_CAPABILITIES:
|
||||
off = Util.arrayCopyNonAtomic(Constants.HISTORICAL_BYTES, (short)0,
|
||||
buf, (short)off,
|
||||
buf, off,
|
||||
(byte)Constants.HISTORICAL_BYTES.length);
|
||||
break;
|
||||
|
||||
@ -1090,17 +1090,17 @@ public final class SmartPGPApplet extends Applet {
|
||||
|
||||
case Constants.TAG_GENERATION_DATE_SIG:
|
||||
assertAdmin();
|
||||
data.pgp_keys[Persistent.PGP_KEYS_OFFSET_SIG].setGenerationDate(buf, (short)0, (short)lc);
|
||||
data.pgp_keys[Persistent.PGP_KEYS_OFFSET_SIG].setGenerationDate(buf, (short)0, lc);
|
||||
break;
|
||||
|
||||
case Constants.TAG_GENERATION_DATE_DEC:
|
||||
assertAdmin();
|
||||
data.pgp_keys[Persistent.PGP_KEYS_OFFSET_DEC].setGenerationDate(buf, (short)0, (short)lc);
|
||||
data.pgp_keys[Persistent.PGP_KEYS_OFFSET_DEC].setGenerationDate(buf, (short)0, lc);
|
||||
break;
|
||||
|
||||
case Constants.TAG_GENERATION_DATE_AUT:
|
||||
assertAdmin();
|
||||
data.pgp_keys[Persistent.PGP_KEYS_OFFSET_AUT].setGenerationDate(buf, (short)0, (short)lc);
|
||||
data.pgp_keys[Persistent.PGP_KEYS_OFFSET_AUT].setGenerationDate(buf, (short)0, lc);
|
||||
break;
|
||||
|
||||
case Constants.TAG_RESETTING_CODE:
|
||||
|
Loading…
Reference in New Issue
Block a user