Fix #80: set 'URL of public key' on each slot

pull/100/head
Charles-Edouard de la Vergne 6 months ago
parent 7b7bd27fa3
commit 3e98639670
No known key found for this signature in database
GPG Key ID: F12296941B7BB9C6

@ -95,8 +95,8 @@ int gpg_apdu_get_data(unsigned int ref) {
break; break;
case 0x5F50: case 0x5F50:
/* Uniform resource locator */ /* Uniform resource locator */
gpg_io_insert((const unsigned char *) N_gpg_pstate->url.value, gpg_io_insert((const unsigned char *) N_gpg_pstate->keys[G_gpg_vstate.slot].url.value,
N_gpg_pstate->url.length); N_gpg_pstate->keys[G_gpg_vstate.slot].url.length);
break; break;
case 0x65: case 0x65:
/* Name, Language, salutation */ /* Name, Language, salutation */
@ -571,14 +571,14 @@ int gpg_apdu_put_data(unsigned int ref) {
break; break;
/* Uniform resource locator */ /* Uniform resource locator */
case 0x5F50: 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; sw = SW_WRONG_LENGTH;
break; 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.work.io_buffer,
G_gpg_vstate.io_length); 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, &G_gpg_vstate.io_length,
sizeof(unsigned int)); sizeof(unsigned int));
sw = SW_OK; sw = SW_OK;

@ -129,6 +129,8 @@ typedef struct gpg_key_slot_s {
unsigned int sig_count; unsigned int sig_count;
/* D5 */ /* D5 */
cx_aes_key_t AES_dec; cx_aes_key_t AES_dec;
/* 5F50 */
LV(url, GPG_EXT_PRIVATE_DO_LENGTH);
} gpg_key_slot_t; } gpg_key_slot_t;
@ -152,8 +154,6 @@ struct gpg_nv_state_s {
/* 5E */ /* 5E */
LV(login, GPG_EXT_PRIVATE_DO_LENGTH); LV(login, GPG_EXT_PRIVATE_DO_LENGTH);
/* 5F50 */
LV(url, GPG_EXT_PRIVATE_DO_LENGTH);
/* -- Cardholder Related Data -- */ /* -- Cardholder Related Data -- */
/* 5B */ /* 5B */

Loading…
Cancel
Save