Add Secalot hardware token support.
This commit is contained in:
parent
cab4789091
commit
29b59b7404
|
@ -98,11 +98,11 @@ public abstract class OpenPgpCapabilities {
|
|||
}
|
||||
|
||||
public int getPw1MaxLength() {
|
||||
return getPwStatusBytes()[MAX_PW1_LENGTH_INDEX];
|
||||
return getPwStatusBytes()[MAX_PW1_LENGTH_INDEX] & 0xFF;
|
||||
}
|
||||
|
||||
public int getPw3MaxLength() {
|
||||
return getPwStatusBytes()[MAX_PW3_LENGTH_INDEX];
|
||||
return getPwStatusBytes()[MAX_PW3_LENGTH_INDEX] & 0xFF;
|
||||
}
|
||||
|
||||
public int getPw1TriesLeft() {
|
||||
|
|
|
@ -117,7 +117,7 @@ public abstract class SecurityTokenInfo implements Parcelable {
|
|||
|
||||
public enum TokenType {
|
||||
YUBIKEY_NEO, YUBIKEY_4, FIDESMO, NITROKEY_PRO, NITROKEY_STORAGE, NITROKEY_START_OLD,
|
||||
NITROKEY_START_1_25_AND_NEWER, GNUK_OLD, GNUK_1_25_AND_NEWER, LEDGER_NANO_S, UNKNOWN
|
||||
NITROKEY_START_1_25_AND_NEWER, GNUK_OLD, GNUK_1_25_AND_NEWER, LEDGER_NANO_S, SECALOT, UNKNOWN
|
||||
}
|
||||
|
||||
public static final Set<TokenType> SUPPORTED_USB_TOKENS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
|
||||
|
@ -129,7 +129,8 @@ public abstract class SecurityTokenInfo implements Parcelable {
|
|||
TokenType.NITROKEY_START_1_25_AND_NEWER,
|
||||
TokenType.GNUK_OLD,
|
||||
TokenType.GNUK_1_25_AND_NEWER,
|
||||
TokenType.LEDGER_NANO_S
|
||||
TokenType.LEDGER_NANO_S,
|
||||
TokenType.SECALOT
|
||||
)));
|
||||
|
||||
private static final Set<TokenType> SUPPORTED_USB_SETUP = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
|
||||
|
@ -138,7 +139,8 @@ public abstract class SecurityTokenInfo implements Parcelable {
|
|||
TokenType.NITROKEY_PRO,
|
||||
TokenType.NITROKEY_STORAGE,
|
||||
TokenType.NITROKEY_START_1_25_AND_NEWER,
|
||||
TokenType.GNUK_1_25_AND_NEWER
|
||||
TokenType.GNUK_1_25_AND_NEWER,
|
||||
TokenType.SECALOT
|
||||
)));
|
||||
|
||||
public boolean isPutKeySupported() {
|
||||
|
|
|
@ -70,6 +70,9 @@ public class UsbTransport implements Transport {
|
|||
private static final int VENDOR_FSIJ = 9035;
|
||||
private static final int VENDOR_LEDGER = 11415;
|
||||
|
||||
private static final int VENDOR_SECALOT = 4617;
|
||||
private static final int PRODUCT_SECALOT = 28672;
|
||||
|
||||
private final UsbDevice usbDevice;
|
||||
private final UsbManager usbManager;
|
||||
|
||||
|
@ -254,6 +257,13 @@ public class UsbTransport implements Transport {
|
|||
case VENDOR_LEDGER: {
|
||||
return TokenType.LEDGER_NANO_S;
|
||||
}
|
||||
case VENDOR_SECALOT: {
|
||||
switch (productId) {
|
||||
case PRODUCT_SECALOT:
|
||||
return TokenType.SECALOT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Timber.d("Unknown USB token. Vendor ID: %s, Product ID: %s", vendorId, productId);
|
||||
|
|
Loading…
Reference in a new issue