mirror of
https://github.com/polhenarejos/pico-openpgp.git
synced 2026-07-14 09:35:38 +01:00
Add blink 3 times on PSO and internal authentication.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
+1
-1
Submodule pico-keys-sdk updated: 7c38eced51...50481a7671
@@ -78,5 +78,6 @@ int cmd_internal_aut(void) {
|
||||
}
|
||||
res_APDU_size = olen;
|
||||
}
|
||||
signal_private_key_use(uif_fid);
|
||||
return SW_OK();
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ int cmd_pso(void) {
|
||||
memcpy(res_APDU + 1, apdu.data, apdu.nc);
|
||||
res_APDU_size = apdu.nc + 1;
|
||||
}
|
||||
signal_private_key_use(uif_fid);
|
||||
return SW_OK();
|
||||
}
|
||||
if (algo[0] == ALGO_RSA) {
|
||||
@@ -236,5 +237,6 @@ int cmd_pso(void) {
|
||||
mbedtls_ecdh_free(&ctx);
|
||||
}
|
||||
}
|
||||
signal_private_key_use(uif_fid);
|
||||
return SW_OK();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "mbedtls/md.h"
|
||||
#include "usb.h"
|
||||
#include "ccid/ccid.h"
|
||||
#include "led/led.h"
|
||||
#include "otp.h"
|
||||
#include "do.h"
|
||||
#ifdef MBEDTLS_EDDSA_C
|
||||
@@ -275,6 +276,17 @@ bool wait_button_pressed_fid(uint16_t fid) {
|
||||
return val == EV_BUTTON_TIMEOUT;
|
||||
}
|
||||
|
||||
void signal_private_key_use(uint16_t uif_fid) {
|
||||
#ifndef ENABLE_EMULATION
|
||||
file_t *ef = file_search_by_fid(uif_fid, NULL, SPECIFY_ANY);
|
||||
if (ef == NULL || ef->data == NULL || file_get_data(ef)[0] == 0) {
|
||||
led_blink_n_times(3, LED_COLOR_GREEN, 100, 100);
|
||||
}
|
||||
#else
|
||||
(void)uif_fid;
|
||||
#endif
|
||||
}
|
||||
|
||||
void select_file(file_t *pe) {
|
||||
if (!pe) {
|
||||
currentDF = (file_t *) MF;
|
||||
|
||||
@@ -75,6 +75,7 @@ extern mbedtls_ecp_group_id get_ec_group_id_from_attr(const uint8_t *algo, size_
|
||||
extern int reset_sig_count(void);
|
||||
extern uint16_t algo_dec, algo_aut, pk_dec, pk_aut;
|
||||
extern bool wait_button_pressed_fid(uint16_t fid);
|
||||
extern void signal_private_key_use(uint16_t uif_fid);
|
||||
extern void scan_files_openpgp(void);
|
||||
extern int load_aes_key(uint8_t *aes_key, size_t *key_size, file_t *fkey);
|
||||
extern int load_key_data(file_t *fkey, uint8_t *out, size_t out_size, size_t *out_len, bool use_dek);
|
||||
|
||||
Reference in New Issue
Block a user