PROJET AUTOBLOG


Shaarli - Les discussions de Shaarli

Archivé

Site original : Shaarli - Les discussions de Shaarli du 23/07/2013

⇐ retour index

YubiKey 4 and YubiKey 4 Nano | U2F, OTP, PIV | Yubico

samedi 28 novembre 2015 à 02:23
GuiGui's Show - Liens
Suite à une faille de sécu (http://shaarli.guiguishow.info/?nT1hgQ) dans l'applet OpenPGP de mes yubikeys (neo et neo-n), Yubico, la société qui commercialise les Yubikeys, a mis en place une procédure de remplacement. Comme j'utilise exclusivement cette fonctionnalité (OpenPGP) de mes yubikeys (voir http://shaarli.guiguishow.info/?VMg7XA), j'ai estimé que j'étais légitime et j'ai demandé l'échange contre les nouvelles Yubikeys 4.

Quoi de neuf avec ces Yubikeys version 4 ? Plus de NFC, support des clés OpenPGP RSA 4096 bits (< 3 ) et Docker. Forcément, votre clé ne sera pas reconnue par les tools Yubico (ykinfo, ykpersonalize) packagés dans Debian stable. ;)

Niveau OpenPGP, ça juste fonctionne en suivant mon tuto original (http://shaarli.guiguishow.info/?VMg7XA). Néanmoins, la clé est déjà en mode smartcard et il faut utiliser GnuPG v2 pour générer les paires de clés.

En effet, GnuPG v1 (j'ai testé avec la v1.4.18) voit la yubikey comme une smartcard qui supporte uniquement une taille de clés comprise entre 1024 et 3072 comme l'indique le message :
« $ gpg2 --card-edit
[...]
Key attributes ...: 2048R 2048R 2048R
[...]

gpg/card> admin
Admin commands are allowed

gpg/card> generate
Make off-card backup of encryption key? (Y/n) n
[...]

Quelle taille de clef désirez-vous pour la clef de signature ? (2048) 4096
les tailles de clefs RSA doivent être dans l'intervalle 1024-3072

[...]
Faut-il modifier le (N)om, le (C)ommentaire, l'(A)dresse électronique
ou (O)ui/(Q)uitter ? O
gpg: unknown parameter name in received key data
gpg: Note that the key does not use the suggested creation date
gpg: sending command `SCD PKSIGN' to agent failed: ec=6.18
gpg: échec de la signature : erreur générale
gpg: make_keysig_packet failed: erreur générale
Échec de génération de la clef : erreur générale »


En revanche, GnuPG v2 voit la smartcard avec une taille de clé de 2048 bits par défaut mais va reconfigurer la yubikey pour vous :
« $ gpg2 --card-edit
[...]
gpg/card> admin
Admin commands are allowed

gpg/card> generate
Make off-card backup of encryption key? (Y/n) n
[...]

scdaemon[4253]: DBG: asking for PIN '||Please enter the PIN'
What keysize do you want for the Signature key? (2048) 4096
The card will now be re-configured to generate a key of 4096 bits
NOTE: There is no guarantee that the card supports the requested size.
     If the key generation does not succeed, please check the
     documentation of your card to see what sizes are allowed.
scdaemon[4253]: 3 Admin PIN attempts remaining before card is permanently locked
scdaemon[4253]: DBG: asking for PIN '|A|Please enter the Admin PIN'
scdaemon[4253]: size of key 1 changed to 4096 bits
What keysize do you want for the Encryption key? (2048) 4096
The card will now be re-configured to generate a key of 4096 bits
scdaemon[4253]: 3 Admin PIN attempts remaining before card is permanently locked
scdaemon[4253]: DBG: asking for PIN '|A|Please enter the Admin PIN'
scdaemon[4253]: size of key 2 changed to 4096 bits
What keysize do you want for the Authentication key? (2048) 4096
The card will now be re-configured to generate a key of 4096 bits
scdaemon[4253]: 3 Admin PIN attempts remaining before card is permanently locked
scdaemon[4253]: DBG: asking for PIN '|A|Please enter the Admin PIN'
scdaemon[4253]: size of key 3 changed to 4096 bits
Please specify how long the key should be valid.
        0 = key does not expire
     <n>  = key expires in n days
     <n>w = key expires in n weeks
     <n>m = key expires in n months
     <n>y = key expires in n years
Key is valid for? (0) 1y
Key expires at Sat 26 Nov 2016 03:53:58 PM UTC
Is this correct? (y/N) y

GnuPG needs to construct a user ID to identify your key.
[...]

scdaemon[4253]: generating new key
scdaemon[4253]: 3 Admin PIN attempts remaining before card is permanently locked
scdaemon[4253]: DBG: asking for PIN '|A|Please enter the Admin PIN'
scdaemon[4253]: please wait while key is being generated ...
scdaemon[4253]: key generation completed (73 seconds)
scdaemon[4253]: signatures created so far: 0
scdaemon[4253]: DBG: asking for PIN '||Please enter the PIN%0A[sigs done: 0]'
scdaemon[4253]: generating new key
scdaemon[4253]: please wait while key is being generated ...
scdaemon[4253]: key generation completed (112 seconds)
scdaemon[4253]: signatures created so far: 1
scdaemon[4253]: signatures created so far: 2
scdaemon[4253]: generating new key
scdaemon[4253]: please wait while key is being generated ...
scdaemon[4253]: key generation completed (105 seconds)
scdaemon[4253]: signatures created so far: 3
scdaemon[4253]: signatures created so far: 4 »
(Permalink)