mirror of
https://github.com/LedgerHQ/openpgp-card-app
synced 2024-11-09 07:10:30 +00:00
Fix #80: set 'URL of public key' on each slot
This commit is contained in:
parent
7b7bd27fa3
commit
3e98639670
@ -95,8 +95,8 @@ int gpg_apdu_get_data(unsigned int ref) {
|
||||
break;
|
||||
case 0x5F50:
|
||||
/* Uniform resource locator */
|
||||
gpg_io_insert((const unsigned char *) N_gpg_pstate->url.value,
|
||||
N_gpg_pstate->url.length);
|
||||
gpg_io_insert((const unsigned char *) N_gpg_pstate->keys[G_gpg_vstate.slot].url.value,
|
||||
N_gpg_pstate->keys[G_gpg_vstate.slot].url.length);
|
||||
break;
|
||||
case 0x65:
|
||||
/* Name, Language, salutation */
|
||||
@ -571,14 +571,14 @@ int gpg_apdu_put_data(unsigned int ref) {
|
||||
break;
|
||||
/* Uniform resource locator */
|
||||
case 0x5F50:
|
||||
if (G_gpg_vstate.io_length > sizeof(N_gpg_pstate->url.value)) {
|
||||
if (G_gpg_vstate.io_length > sizeof(N_gpg_pstate->keys[G_gpg_vstate.slot].url.value)) {
|
||||
sw = SW_WRONG_LENGTH;
|
||||
break;
|
||||
}
|
||||
nvm_write((void *) N_gpg_pstate->url.value,
|
||||
nvm_write((void *) N_gpg_pstate->keys[G_gpg_vstate.slot].url.value,
|
||||
G_gpg_vstate.work.io_buffer,
|
||||
G_gpg_vstate.io_length);
|
||||
nvm_write((void *) &N_gpg_pstate->url.length,
|
||||
nvm_write((void *) &N_gpg_pstate->keys[G_gpg_vstate.slot].url.length,
|
||||
&G_gpg_vstate.io_length,
|
||||
sizeof(unsigned int));
|
||||
sw = SW_OK;
|
||||
|
@ -129,6 +129,8 @@ typedef struct gpg_key_slot_s {
|
||||
unsigned int sig_count;
|
||||
/* D5 */
|
||||
cx_aes_key_t AES_dec;
|
||||
/* 5F50 */
|
||||
LV(url, GPG_EXT_PRIVATE_DO_LENGTH);
|
||||
|
||||
} gpg_key_slot_t;
|
||||
|
||||
@ -152,8 +154,6 @@ struct gpg_nv_state_s {
|
||||
|
||||
/* 5E */
|
||||
LV(login, GPG_EXT_PRIVATE_DO_LENGTH);
|
||||
/* 5F50 */
|
||||
LV(url, GPG_EXT_PRIVATE_DO_LENGTH);
|
||||
|
||||
/* -- Cardholder Related Data -- */
|
||||
/* 5B */
|
||||
|
Loading…
Reference in New Issue
Block a user