diff --git a/src/gpg_data.c b/src/gpg_data.c index cb20ea6..be17673 100644 --- a/src/gpg_data.c +++ b/src/gpg_data.c @@ -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; diff --git a/src/gpg_types.h b/src/gpg_types.h index f763b45..99b6146 100644 --- a/src/gpg_types.h +++ b/src/gpg_types.h @@ -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 */