My lessons learned from #ethprague was these are the key algorithms:
I don’t see really any problem make them a bit more “stack compatible”. So maybe something to look at after I get my TPM2 public key patch set into the mainline.
So like when running bunch of servers, how to seal your keys properly, pretty basic stuff.
At least in Fedora, also shared a access configuration needs to be defined in ~/.gnupg/scdaemon.conf
:
# See for further information:
# https://github.com/OpenSC/OpenSC/wiki/GnuPG-and-OpenSC
card-timeout 5
disable-ccid
pcsc-shared
Otherwise, the earlier script needs to be run separately for each boot as a workaround. In OpenSUSE, I guess the defaults are different, given that everything just works without this extra configuration.
For gpg-agent I have the following entries in ~/.gnupg
:
gpg-agent.conf
gpg-agent.conf.darwin
gpg-agent.conf.linux-gnu
In a new installation the correct configuration can be deployed as follows:
cp ~/.gnupg/gpg-agent.conf.$OSTYPE ~/.gnupg/gpg-agent.conf
#teardown and #bootstrap gpg-agent, pcscd to have a working configuration:
#!/usr/bin/env sh
# Copyright (c) Jarkko Sakkinen 2024
# Bootstrap gpg-agent and pcscd for Yubikey use.
GPG_AGENT_SOCKETS=(gpg-agent-ssh.socket
gpg-agent-browser.socket
gpg-agent-extra.socket
gpg-agent-ssh.socket
gpg-agent.socket)
systemctl --user disable --now "${GPG_AGENT_SOCKETS[@]}"
gpgconf --kill gpg-agent
sudo systemctl disable --now pcscd.socket
systemctl --user enable --now gpg-agent.socket gpg-agent-ssh.socket
sudo systemctl enable --now pcscd.socket
Why Curve25519 uses EdDSA for signing, and SECP-P256-R1 and SECP-P256-K1 use ECDSA?
It’s the scale. Curve25519 field has the size that fits within 255 bits, and two previous have the size that fits within 256 bits.
So from that follows:
There is formal backing for this but pure common sense it is exactly like “if loose some, you must gain some” ;-)
I realized that I have something profound broken in my asymmetric TPM2 key series: TPM2 specific keys should only sign, not verify.
struct public_key
, which is the central structure used for built-in, vendor and machine owner keys, should be able to verify the signature, even when the TPM chip is removed.
As a consequence, I will delete all the verification code from the key type(s) and set the supported_ops
a KEYCTL_SUPPORTS_SIGN
, instead of previous KEYCTL_SUPPORTS_SIGN | KEYCTL_SUPPORTS_VERIFY
.
I’ll also rework tests to have two asymmetric keys: one for signing in the chip and other outside holding only the public key. That should also better verify that the feature is working correctly.
Right. I should take my TPM2 signing code and merge it to struct public_key
, use only TPM2_Sign and ditch TPM2_RSA_Decrypt.
Just hit me out of the void. Then e.g. builtin/secondary/machine keyrings, x.509 certiificates etc. is also in the finish line once this feature lands :-)
Three week clocked to the development so far so I think this is going in good phase.
I’ll start a new series (because it is not the exact same feature as before).