aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/securitytoken
diff options
context:
space:
mode:
authorNikita Mikhailov <nikita.s.mikhailov@gmail.com>2016-04-12 00:06:21 +0600
committerNikita Mikhailov <nikita.s.mikhailov@gmail.com>2016-04-14 22:48:01 +0600
commit784bf2322cc37befb4857f0c440f889d43f89a48 (patch)
treeb74378ccfa5e13042ba9ff532c5968872dca8ee7 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/securitytoken
parentdf57ecde4755b6d2bf39c486cc7bb8d521d3268b (diff)
downloadopen-keychain-784bf2322cc37befb4857f0c440f889d43f89a48.tar.gz
open-keychain-784bf2322cc37befb4857f0c440f889d43f89a48.tar.bz2
open-keychain-784bf2322cc37befb4857f0c440f889d43f89a48.zip
OTG: Replace colons with dashes in usb error messages
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/securitytoken')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/securitytoken/UsbTransport.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/securitytoken/UsbTransport.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/securitytoken/UsbTransport.java
index 016117feb..10043e675 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/securitytoken/UsbTransport.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/securitytoken/UsbTransport.java
@@ -168,7 +168,7 @@ public class UsbTransport implements Transport {
mUsbInterface = getSmartCardInterface(mUsbDevice);
if (mUsbInterface == null) {
// Shouldn't happen as we whitelist only class 11 devices
- throw new UsbTransportException("USB error: device doesn't have class 11 interface");
+ throw new UsbTransportException("USB error - device doesn't have class 11 interface");
}
final Pair<UsbEndpoint, UsbEndpoint> ioEndpoints = getIoEndpoints(mUsbInterface);
@@ -176,16 +176,16 @@ public class UsbTransport implements Transport {
mBulkOut = ioEndpoints.second;
if (mBulkIn == null || mBulkOut == null) {
- throw new UsbTransportException("USB error: invalid class 11 interface");
+ throw new UsbTransportException("USB error - invalid class 11 interface");
}
mConnection = mUsbManager.openDevice(mUsbDevice);
if (mConnection == null) {
- throw new UsbTransportException("USB error: failed to connect to device");
+ throw new UsbTransportException("USB error - failed to connect to device");
}
if (!mConnection.claimInterface(mUsbInterface, true)) {
- throw new UsbTransportException("USB error: failed to claim interface");
+ throw new UsbTransportException("USB error - failed to claim interface");
}
iccPowerSet(true);
@@ -244,11 +244,11 @@ public class UsbTransport implements Transport {
do {
int res = mConnection.bulkTransfer(mBulkIn, buffer, buffer.length, TIMEOUT);
if (res < 0) {
- throw new UsbTransportException("USB error: failed to receive response " + res);
+ throw new UsbTransportException("USB error - failed to receive response " + res);
}
if (result == null) {
if (res < 10) {
- throw new UsbTransportException("USB-CCID error: failed to receive CCID header");
+ throw new UsbTransportException("USB-CCID error - failed to receive CCID header");
}
totalBytes = ByteBuffer.wrap(buffer, 1, 4).order(ByteOrder.LITTLE_ENDIAN).asIntBuffer().get() + 10;
result = new byte[totalBytes];
@@ -263,7 +263,7 @@ public class UsbTransport implements Transport {
private void sendRaw(final byte[] data) throws UsbTransportException {
final int tr1 = mConnection.bulkTransfer(mBulkOut, data, data.length, TIMEOUT);
if (tr1 != data.length) {
- throw new UsbTransportException("USB error: failed to transmit data " + tr1);
+ throw new UsbTransportException("USB error - failed to transmit data " + tr1);
}
}
@@ -274,7 +274,7 @@ public class UsbTransport implements Transport {
private void checkDataBlockResponse(byte[] bytes) throws UsbTransportException {
final byte status = getStatus(bytes);
if (status != 0) {
- throw new UsbTransportException("USB-CCID error: status " + status + " error code: " + Hex.toHexString(bytes, 8, 1));
+ throw new UsbTransportException("USB-CCID error - status " + status + " error code: " + Hex.toHexString(bytes, 8, 1));
}
}