Skip to content

Commit

Permalink
Support legacy option optionP2SHSkip2FA (set to true by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Jun 13, 2024
1 parent 40fded7 commit e2b33d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,7 @@ CFLAGS += -DCOIN_COINID_NAME=\"$(COIN_COINID_NAME)\"
CFLAGS += -DAPPDEVELOPPER=\"$(APPDEVELOPPER)\"
CFLAGS += -DAPPCOPYRIGHT=\"$(APPCOPYRIGHT)\"

# Enabling DEBUG flag will enable PRINTF and disable optimizations
#DEBUG=1

include $(BOLOS_SDK)/Makefile.standard_app
11 changes: 8 additions & 3 deletions transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,14 @@ void transaction_parse(unsigned char parseMode) {
// Handle non-segwit inputs (i.e. InputHashStart 1st APDU's P2==00 &&
// data[0]==0x00)
else if (!trustedInputFlag) {
PRINTF("Untrusted input not authorized\n");
goto fail;
PRINTF("Untrusted input authorized\n");
context.transactionBufferPointer++;
context.transactionDataRemaining--;
check_transaction_available(
36); // prevout : 32 hash + 4 index
transaction_offset_increase(36);
PRINTF("Marking relaxed input\n");
context.transactionContext.relaxed = 1;
}
// Handle non-segwit TrustedInput (i.e. InputHashStart 1st APDU's P2==00
// & data[0]==0x01)
Expand Down Expand Up @@ -554,7 +560,6 @@ void transaction_parse(unsigned char parseMode) {
// should be null
if (context.transactionContext.scriptRemaining != 0) {
PRINTF("Request to sign relaxed input\n");
goto fail;
}
}
// Move on
Expand Down

0 comments on commit e2b33d6

Please sign in to comment.