Apply some CR suggestions

This commit is contained in:
Nikita Mikhailov
2016-08-15 00:27:07 +07:00
parent f79f1609c8
commit c12d62f309
3 changed files with 7 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ public class SecurityTokenHelper {
private static final int MAX_APDU_NE_EXT = 65536; private static final int MAX_APDU_NE_EXT = 65536;
private static final int APDU_SW_SUCCESS = 0x9000; private static final int APDU_SW_SUCCESS = 0x9000;
private static final int APDU_SW1_RESPONSE_AVAILABLE = 0x61;
private static final int MASK_CLA_CHAINING = 1 << 4; private static final int MASK_CLA_CHAINING = 1 << 4;
@@ -530,7 +531,7 @@ public class SecurityTokenHelper {
result.write(lastResponse.getData()); result.write(lastResponse.getData());
// Receive // Receive
while (lastResponse.getSW1() == 0x61) { while (lastResponse.getSW1() == APDU_SW1_RESPONSE_AVAILABLE) {
// GET RESPONSE ISO/IEC 7816-4 par.7.6.1 // GET RESPONSE ISO/IEC 7816-4 par.7.6.1
CommandAPDU getResponse = new CommandAPDU(0x00, 0xC0, 0x00, 0x00, lastResponse.getSW2()); CommandAPDU getResponse = new CommandAPDU(0x00, 0xC0, 0x00, 0x00, lastResponse.getSW2());
lastResponse = mTransport.transceive(getResponse); lastResponse = mTransport.transceive(getResponse);

View File

@@ -152,7 +152,7 @@ public class CcidTransceiver {
} }
} }
private byte getStatus(byte[] bytes) { private static byte getStatus(byte[] bytes) {
return (byte) ((bytes[7] >> 6) & 0x03); return (byte) ((bytes[7] >> 6) & 0x03);
} }
@@ -163,7 +163,7 @@ public class CcidTransceiver {
} }
} }
private boolean isDataBlockNotReady(byte[] bytes) { private static boolean isDataBlockNotReady(byte[] bytes) {
return getStatus(bytes) == 2; return getStatus(bytes) == 2;
} }
} }

View File

@@ -32,6 +32,9 @@
<usb-device class="11" vendor-id="8352" product-id="16648"/> <usb-device class="11" vendor-id="8352" product-id="16648"/>
<!-- Nitrokey Storage--> <!-- Nitrokey Storage-->
<usb-device class="11" vendor-id="8352" product-id="16649"/> <usb-device class="11" vendor-id="8352" product-id="16649"/>
<!--GNUK based device are not supported right now-->
<!-- Nitrokey Start--> <!-- Nitrokey Start-->
<!--<usb-device class="11" vendor-id="8352" product-id="16913"/>--> <!--<usb-device class="11" vendor-id="8352" product-id="16913"/>-->
<!-- Default GNUK vid/pid--> <!-- Default GNUK vid/pid-->