Update AES use in SmartPGP (ENC/DEC/SM)

This commit is contained in:
Arnaud Fontaine
2017-07-06 18:05:59 +02:00
parent a2787abbcf
commit f8abbd8732
6 changed files with 86 additions and 54 deletions

View File

@@ -167,13 +167,9 @@ public final class PGPKey {
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
return;
}
if(is_secure_messaging_key) {
if((buf[0] != 0x12) ||
(((short)(Constants.aesKeyLength()* 8) > (short)128) &&
(params.nb_bits < 512))) {
ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);
return;
}
if((buf[0] != 0x12) && is_secure_messaging_key) {
ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);
return;
}
break;