Skip to content

Commit

Permalink
removed extra Cryptonomic APDU -- now out of scope for 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Hartzell committed Oct 29, 2018
1 parent 13f2d73 commit 0a7f725
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 24 deletions.
4 changes: 1 addition & 3 deletions src/apdu_pubkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,18 @@ unsigned int handle_apdu_get_public_key(uint8_t instruction) {
// instruction == INS_PROMPT_PUBLIC_KEY || instruction == INS_AUTHORIZE_BAKING
callback_t cb;
bool bake;
bool prompt_your_address = false;
#ifdef BAKING_APP
if (instruction == INS_AUTHORIZE_BAKING) {
cb = baking_ok;
bake = true;
} else {
#endif
// INS_PROMPT_PUBLIC_KEY
prompt_your_address = instruction == INS_PROMPT_YOUR_ADDRESS;
cb = pubkey_ok;
bake = false;
#ifdef BAKING_APP
}
#endif
prompt_address(bake, prompt_your_address, curve, &public_key, cb, delay_reject);
prompt_address(bake, curve, &public_key, cb, delay_reject);
}
}
1 change: 0 additions & 1 deletion src/apdu_pubkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
#define INS_AUTHORIZE_BAKING 0x01
#define INS_GET_PUBLIC_KEY 0x02
#define INS_PROMPT_PUBLIC_KEY 0x03
#define INS_PROMPT_YOUR_ADDRESS 0x0A

unsigned int handle_apdu_get_public_key(uint8_t instruction);
19 changes: 1 addition & 18 deletions src/baking_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ static const char *const pubkey_values[] = {
NULL,
};

static const char *const your_address_labels[] = {
"Your",
"Public Key Hash",
NULL,
};

static const char *const your_address_values[] = {
"Address",
address_display_data,
NULL,
};

#ifdef BAKING_APP
static const char *const baking_labels[] = {
"Authorize Baking",
Expand Down Expand Up @@ -141,7 +129,6 @@ void prompt_address(
__attribute__((unused))
#endif
bool baking,
bool prompt_your_address,
cx_curve_t curve, const cx_ecfp_public_key_t *key, callback_t ok_cb,
callback_t cxl_cb) {
if (!pubkey_to_pkh_string(address_display_data, sizeof(address_display_data), curve, key)) {
Expand All @@ -153,11 +140,7 @@ void prompt_address(
ui_prompt(baking_labels, baking_values, ok_cb, cxl_cb);
} else {
#endif
if (prompt_your_address) {
ui_prompt(your_address_labels, your_address_values, ok_cb, cxl_cb);
} else {
ui_prompt(pubkey_labels, pubkey_values, ok_cb, cxl_cb);
}
ui_prompt(pubkey_labels, pubkey_values, ok_cb, cxl_cb);
#ifdef BAKING_APP
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/baking_auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bool is_valid_level(level_t level);
void update_auth_text(void);

void prompt_contract_for_baking(struct parsed_contract *contract, callback_t ok_cb, callback_t cxl_cb);
void prompt_address(bool bake, bool prompt_your_address, cx_curve_t curve,
void prompt_address(bool bake, cx_curve_t curve,
const cx_ecfp_public_key_t *key,
callback_t ok_cb, callback_t cxl_cb) __attribute__((noreturn));

Expand Down
1 change: 0 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ void app_main(void) {
#ifndef BAKING_APP
handlers[INS_SIGN_UNSAFE] = handle_apdu_sign;
#endif
handlers[INS_PROMPT_YOUR_ADDRESS] = handle_apdu_get_public_key;
handlers[INS_GIT] = handle_apdu_git;
main_loop(handlers);
}

0 comments on commit 0a7f725

Please sign in to comment.