Expand description
Your security key where it meets the world: its certificate looked up when
you ask, and GnuPG asked to let the key go when you press “Let GnuPG
release it”. What is checked and kept is the core’s
(sioul_core::securitykey).
- The certificate. A security key holds no certificate, only its keys’ fingerprints and public parts. Sioul looks for it only when you ask (at setup, and “Look for a newer version”), since each lookup tells a server that someone wants your key: the address written on the key (HTTPS only), then the Web Key Directory of your addresses’ domains, then keys.openpgp.org by fingerprint. Each certificate found is checked against the key, and one that is not the key’s is never kept.
- GnuPG’s hold. GnuPG’s smart card daemon keeps the key for itself
after any use (scdaemon connects exclusively unless
pcsc-sharedis set inscdaemon.conf). “Let GnuPG release it” runsgpgconf --kill scdaemon, on that click only: gpg starts it again when it needs the key, and asks its PIN again then. Sioul never changes GnuPG’s settings. - GnuPG’s own steps, on a press (
Gnupg): “Import from GnuPG” runsgpg --export --armorfor the key’s fingerprint; “Renew for two years” runsgpg --quick-set-expirefor the key, then its subkeys, GnuPG’s own pinentry asking the card’s PIN. The person’s GnuPG, its home as GnuPG finds it; never a setting changed, never a key made or deleted. - keys.openpgp.org (
send_to_keys_openpgp): the public certificate sent on “Send it to keys.openpgp.org”, over HTTPS, then a confirmation asked for each address it names that is not published yet: the server mails each a link, and publishes the address once the link is opened. - The key itself, on a computer: the system’s smart card service,
PC/SC (
smartcard). On a phone, not yet. - Logs:
cap_logging, as each program starts.
Modules§
- smartcard
- Security keys through the system’s smart card service, PC/SC: pcscd
(pcsc-lite) on Linux, the Smart Card service on Windows, CryptoTokenKit on
macOS. The OpenPGP card protocol is
openpgp-card0.7’s, its transportcard-backend-pcsc0.5’s (both Heiko Schaefer’s, MIT OR Apache-2.0).
Structs§
- Gnupg
- GnuPG, as Sioul runs it on your press: the
gpgprogram, and the home it reads (none: GnuPG’s own,GNUPGHOMEor~/.gnupg; a throwaway one in tests). - OnCard
- Held while Sioul’s own GnuPG works with the security key.
- Published
- What keys.openpgp.org said of a certificate sent to it.
Enums§
- Gnupg
Problem - Why GnuPG did not do what was asked.
- Gnupg
Step - Where a GnuPG step on the security key is, for what the window says.
- Looked
- What looking for a security key’s certificate found.
- Released
- What “Let GnuPG release it” did.
- Status
- A line of GnuPG’s status (
--status-fd), as far as Sioul needs it.
Constants§
- GNUPG_
WAITS 🔒 - How long GnuPG may take when it asks for a PIN and a touch: then it is said as not answering, and its process is ended.
- GPG_
ERR_ 🔒TIMEOUT - libgpg-error’s GPG_ERR_TIMEOUT: a security key that waited for a touch in vain.
- KEYS_
OPENPGP - keys.openpgp.org, where “Send it to keys.openpgp.org” sends.
Statics§
- GNUPG_
ON_ 🔒CARD - While Sioul’s own GnuPG works with the security key, Sioul’s own looks at
the keys wait (
Gnupg::renew): a key opened by Sioul between two of GnuPG’s commands, and reset when closed, would undo the PIN GnuPG gave it.
Functions§
- cap_
logging - Caps what any crate may log at “info”, whatever level it asks, as a
program starts (
sioul-app,sioul).openpgp-cardwrites whole APDUs at “trace”, a VERIFY’s PIN included, and a card’s answers, session keys among them. Sioul installs no logger, so nothing is written anywhere; this keeps “debug” and “trace” away even if one came, and never raises the level (it starts at “off”). - export_
command - The command that writes the key’s certificate into a file by hand.
- find_at 🔒
- find_
certificate - Looks for the certificate of the security key
card, only when you ask: over HTTPS, in the order ofplaces, keeping the first that is the key’s. - gpgconf_
places 🔒 - Where
gpgconfmay be: on the PATH, then where GnuPG’s installers put it, since a window started from the desktop may not have them on its PATH. - may_
look - Whether Sioul may look at the security keys now: not while its own GnuPG works with one.
- places
- The places to look, in order: the address written on the key (HTTPS only),
the Web Key Directory of each of
addresses, then keys.openpgp.org by the fingerprint of the key’s signing key (else of its decryption key). - readers
- Where security keys are found: the system’s smart card service on a computer; on a phone, nowhere yet (NFC and USB come later).
- release_
at 🔒 gpgconf --kill scdaemon, for the GnuPG homehomewhen given (--homedir).- release_
gnupg - Asks GnuPG to let the security key go:
gpgconf --kill scdaemon. Run only when you press “Let GnuPG release it”, never by itself. - release_
with 🔒 - renew_
commands - The commands that renew the key
fingerprintfor two years by hand: the key, then itssubkeys, each named (GnuPG’s “*” leaves the expired ones). - running 🔒
- Whether the process
pidstill runs (its pinentry): on Linux, as /proc says; elsewhere not known, taken as running until GnuPG answers. - send_at 🔒
- send_
to_ keys_ openpgp - Sends the public certificate
armoredto keys.openpgp.org, only when you press its button: over HTTPS, then a link asked for each address it names that is not published yet, the mail in your language (locale, “fr”). Anyone can then find the key there by its fingerprint; by an address, only once that address’s link is opened. - status_
of - A status line read, if it is one Sioul needs.