Home GnuPG
Diffusion Scute f666690b817e

Second step for multiple device support. No monitoring cards.

Description

Second step for multiple device support. No monitoring cards.

* src/agent.h (struct agent_card_info_s, agent_card_info_t): Remove.
(scute_agent_check_status, scute_agent_learn): Remove.
(scute_agent_release_card_info): Remove.
(scute_agent_keyinfo_list, scute_agent_serialno): New.
* src/agent.c (scute_agent_serialno): New.
(unhexify_fpr, hexgrip_valid_p, store_serialno): Remove.
(scute_agent_release_card_info, learn_status_cb): Remove.
(scute_agent_learn, geteventcounter_status_cb): Remove.
(read_status_cb, scute_agent_check_status): Remove.
(scute_agent_get_cert): It's GRIP.
* src/cert-object.c (scute_attr_cert): CKA_LABEL is always "Scute".
(scute_attr_prv): Likewise.  CKA_ID is the GRIP.
* src/cert.h (struct key_info_s): Remove.
(struct cert): Remove certref field.
* src/gpgsm.c (scute_gpgsm_get_cert): Return GPG_ERR_NOT_FOUND, when
not found.
* src/p11-getsessioninfo.c (C_GetSessionInfo): Don't call
slots_update_slot.  Fix the name of call to slot_get_status to
slot_get_login_status.
* src/p11-getslotlist.c (C_GetSlotList): Instead of slots_update_all,
call scute_slots_finalize and then scute_slots_initialize.
* src/p11-initialize.c (C_Initialize): Don't call
scute_slots_initialize.
* src/slots.c (MAX_SLOTS): Remove.
(struct slot): Remove INFO field, add SERIALNO.
(add_object, slot_init): Add forward declarations.
(scute_slots_initialize): Call scute_agent_serialno to ask scdaemon
scanning the card list.
For each key, call scute_gpgsm_get_cert to get the certificate.
If a key has a certificate, allocate the slot.
(slot_reset): Don't call scute_agent_release_card_info.
(slot_init): Don't call scute_gpgsm_get_cert here.
(slots_update_slot, slots_detect_slot, slots_update_all): Remove.
It's scdaemon which monitors removal of card.
(slot_token_label): Return SERIALNO.
(slot_token_manufacturer): For now, it's "scdaemon".
(slot_token_application): For now, it's "gpg-agent".
(slot_token_serial): Return LSB of serialno.
(slot_token_version): For now, return zeros.
(slot_token_maxpinlen, slot_token_pincount, slot_token_has_rng): For
now return fixed values.
(slot_get_login_status): Rename from slot_get_status.
* src/slots.h (slots_update_all, slots_update_slot): Remove.
(slot_get_login_status): Rename from slot_get_status.
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Sep 28 2022, 6:56 AM
Parents
rSb4bc848320bb: Fix slot_get_status.
Branches
Unknown
Tags
Unknown