mirror of
https://github.com/LedgerHQ/openpgp-card-app
synced 2024-11-09 07:10:30 +00:00
Minor Fixes
Fix Makefile for 'Multi/Single slot' compilation Fix unnecessary conditionnal code for 'Multi/Single slot' compilation Fix name display: remove '<' filler
This commit is contained in:
parent
2b4af766b3
commit
bcf9cd3c82
38
Makefile
38
Makefile
@ -24,19 +24,24 @@ include $(BOLOS_SDK)/Makefile.defines
|
||||
APP_LOAD_PARAMS=--appFlags 0x40 --path "2152157255'" --curve secp256k1 $(COMMON_LOAD_PARAMS)
|
||||
|
||||
ifeq ($(MULTISLOT),)
|
||||
MULTISLOT := 0
|
||||
endif
|
||||
|
||||
ifeq ($(MULTISLOT),0)
|
||||
GPG_MULTISLOT:=0
|
||||
APPNAME:=OpenPGP
|
||||
else
|
||||
GPG_MULTISLOT:=1
|
||||
APPNAME+=OpenPGP.XL
|
||||
APPNAME:=OpenPGP.XL
|
||||
endif
|
||||
|
||||
APP_LOAD_PARAMS=--appFlags 0x40 --path "2152157255'" --curve secp256k1 $(COMMON_LOAD_PARAMS)
|
||||
|
||||
SPECVERSION:="3.3.1"
|
||||
|
||||
APPVERSION_M:=1
|
||||
APPVERSION_N:=3
|
||||
APPVERSION_P:=0
|
||||
APPVERSION_P:=1
|
||||
APPVERSION:=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
|
||||
|
||||
ifeq ($(TARGET_NAME),TARGET_BLUE)
|
||||
@ -51,7 +56,22 @@ DEFINES += GPG_MULTISLOT=$(GPG_MULTISLOT) $(GPG_CONFIG) GPG_VERSION=$(APPVERSI
|
||||
# Default rule #
|
||||
################
|
||||
|
||||
.PHONY: allvariants listvariants
|
||||
|
||||
all: default
|
||||
mkdir -p release
|
||||
cp -a bin/app.elf release/$(APPNAME).elf
|
||||
cp -a bin/app.hex release/$(APPNAME).hex
|
||||
cp -a debug/app.asm release/$(APPNAME).asm
|
||||
cp -a debug/app.map release/$(APPNAME).map
|
||||
|
||||
|
||||
listvariants:
|
||||
@echo VARIANTS MULTISLOT 0 1
|
||||
|
||||
allvariants:
|
||||
make MULTISLOT=0 clean all
|
||||
make MULTISLOT=1 clean all
|
||||
|
||||
############
|
||||
# Platform #
|
||||
@ -102,6 +122,17 @@ SDK_SOURCE_PATH += lib_stusb
|
||||
|
||||
|
||||
load: all
|
||||
ifeq ($(MULTISLOT),0)
|
||||
cp -a release/openpgp.elf bin/app.elf
|
||||
cp -a release/openpgp.hex bin/app.hex
|
||||
cp -a release/openpgp.asm debug/app.asm
|
||||
cp -a release/openpgp.map debug/app.map
|
||||
else
|
||||
cp -a release/openpgp-XL.elf bin/app.elf
|
||||
cp -a release/openpgp-XL.hex bin/app.hex
|
||||
cp -a release/openpgp-XL.asm debug/app.asm
|
||||
cp -a release/openpgp-XL.map debug/app.map
|
||||
endif
|
||||
python -m ledgerblue.loadApp $(APP_LOAD_PARAMS)
|
||||
|
||||
run:
|
||||
@ -109,6 +140,7 @@ run:
|
||||
|
||||
exit:
|
||||
echo -e "0020008206313233343536\n0002000000" |scriptor -r "Ledger Nano S [Nano S] (0001) 01 00"
|
||||
|
||||
delete:
|
||||
python -m ledgerblue.deleteApp $(COMMON_DELETE_PARAMS)
|
||||
|
||||
@ -118,5 +150,3 @@ include Makefile.rules
|
||||
#add dependency on custom makefile filename
|
||||
dep/%.d: %.c Makefile
|
||||
|
||||
listvariants:
|
||||
@echo VARIANTS NONE openpgp
|
||||
|
@ -35,7 +35,7 @@
|
||||
#if GPG_MULTISLOT
|
||||
#define GPG_KEYS_SLOTS 3
|
||||
#else
|
||||
#define GPG_KEYS_SLOTS 3
|
||||
#define GPG_KEYS_SLOTS 1
|
||||
#endif
|
||||
|
||||
#define GPG_KEY_ATTRIBUTES_LENGTH 12
|
||||
|
@ -726,9 +726,6 @@ void ui_menu_tmpl_type_action(unsigned int value) {
|
||||
/* --------------------------------- SEED UX --------------------------------- */
|
||||
|
||||
const ux_menu_entry_t ui_menu_seed[] = {
|
||||
#if GPG_KEYS_SLOTS != 3
|
||||
#error menu definition not correct for current value of GPG_KEYS_SLOTS
|
||||
#endif
|
||||
{NULL, NULL, 0, NULL, "", NULL, 0, 0},
|
||||
{NULL, ui_menu_seed_action, 1, NULL, "Set on", NULL, 0, 0},
|
||||
{NULL, ui_menu_seed_action, 0, NULL, "Set off", NULL, 0, 0},
|
||||
@ -922,9 +919,6 @@ void ui_menu_uifmode_action(unsigned int value) {
|
||||
/* -------------------------------- RESET UX --------------------------------- */
|
||||
|
||||
const ux_menu_entry_t ui_menu_reset[] = {
|
||||
#if GPG_KEYS_SLOTS != 3
|
||||
#error menu definition not correct for current value of GPG_KEYS_SLOTS
|
||||
#endif
|
||||
{NULL, NULL, 0, NULL, "Really Reset ?", NULL, 0, 0},
|
||||
{NULL, ui_menu_main_display, 0, &C_badge_back, "No", NULL, 61, 40},
|
||||
{NULL, ui_menu_reset_action, 0, NULL, "Yes", NULL, 0, 0},
|
||||
@ -1015,10 +1009,6 @@ void ui_menu_slot_action(unsigned int value) {
|
||||
|
||||
/* --------------------------------- INFO UX --------------------------------- */
|
||||
|
||||
#if GPG_KEYS_SLOTS != 3
|
||||
#error menu definition not correct for current value of GPG_KEYS_SLOTS
|
||||
#endif
|
||||
|
||||
#define STR(x) #x
|
||||
#define XSTR(x) STR(x)
|
||||
|
||||
@ -1054,6 +1044,12 @@ const bagl_element_t* ui_menu_main_preprocessor(const ux_menu_entry_t* entry, ba
|
||||
os_memmove(G_gpg_vstate.menu, N_gpg_pstate->name.value, 12);
|
||||
if (G_gpg_vstate.menu[0] == 0) {
|
||||
os_memmove(G_gpg_vstate.menu, "<No Name>", 9);
|
||||
} else {
|
||||
for (int i = 0; i<12; i++) {
|
||||
if (G_gpg_vstate.menu[i] == 0x3c) {
|
||||
G_gpg_vstate.menu[i] = ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(element->component.userid==0x22) {
|
||||
|
Loading…
Reference in New Issue
Block a user