Skip to content

Commit

Permalink
Merge pull request mycelium-com#189 from LedgerHQ/fix-101
Browse files Browse the repository at this point in the history
Fix firmware 1.0.1 detection
  • Loading branch information
DanielWeigl committed Aug 13, 2015
2 parents 0c07a4f + f164e7a commit 8aeaac1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public interface BTChipConstants {
public static final byte[] AZERTY_KEYMAP = Dump.hexToBin("08000000010000200100007820c8ffc3feffff07000000002c38202030341e21222d352e102e3637271e1f202122232425263736362e37101f1405060708090a0b0c0d0e0f331112130415161718191d1b1c1a2f64302f2d351405060708090a0b0c0d0e0f331112130415161718191d1b1c1a2f643035");

public static final int SW_OK = 0x9000;
public static final int SW_CONDITIONS_NOT_SATISFIED = 0x6985;
public static final int SW_INCORRECT_P1_P2 = 0x6A86;
public static final int SW_WRONG_P1_P2 = 0x6B00;
public static final int SW_INS_NOT_SUPPORTED = 0x6D00;
Expand Down
4 changes: 2 additions & 2 deletions public/btchip/src/main/java/com/btchip/BTChipDongle.java
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,11 @@ public BTChipOutput finalizeInput(byte[] outputScript, String outputAddress, Str
if (changePath != null) {
path = BIP32Utils.splitPath(changePath);
exchangeApdu(BTCHIP_CLA, BTCHIP_INS_HASH_INPUT_FINALIZE_FULL, (byte)0xFF, (byte)0x00, path, null);
oldAPI = ((lastSW == SW_INCORRECT_P1_P2) || (lastSW == SW_WRONG_P1_P2));
oldAPI = ((lastSW == SW_INCORRECT_P1_P2) || (lastSW == SW_WRONG_P1_P2) || (lastSW == SW_CONDITIONS_NOT_SATISFIED));
}
else {
exchangeApdu(BTCHIP_CLA, BTCHIP_INS_HASH_INPUT_FINALIZE_FULL, (byte)0xFF, (byte)0x00, new byte[1], null);
oldAPI = ((lastSW == SW_INCORRECT_P1_P2) || (lastSW == SW_WRONG_P1_P2));
oldAPI = ((lastSW == SW_INCORRECT_P1_P2) || (lastSW == SW_WRONG_P1_P2) || (lastSW == SW_CONDITIONS_NOT_SATISFIED));
}
if (oldAPI) {
return finalizeInput(outputAddress, amount, fees, changePath);
Expand Down

0 comments on commit 8aeaac1

Please sign in to comment.