Omnikey 6121: não é possível gravar no cartão inteligente OpenPGP

Omnikey 6121: não é possível gravar no cartão inteligente OpenPGP

Estou tentando usar um leitor de cartão inteligente Omnikey 6121 com um cartão inteligente OpenPGPv2. O leitor é reconhecido, pelo que vejo gpg --card-statuse consegui editar alguns detalhes do cartão como URL, nome etc.

No entanto, quando tento emitir um comando "keytocard", recebo o seguinte:

gpg: writing new key
gpg: 3 Admin PIN attempts remaining before card is permanently locked

Please enter the Admin PIN
gpg: ccid_transceive failed: (0x10002)
gpg: apdu_send_simple(0) failed: invalid value
gpg: failed to store the key: invalid argument
gpg: error writing key to card: invalid argument

Mesmo erro com --debug-ccid-driver.

E da mesma forma, se eu apenas emitir um "generar":

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

Please enter the PIN
What keysize do you want for the Signature key? (2048) 
What keysize do you want for the Encryption key? (2048) 
What keysize do you want for the Authentication key? (2048) 
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) 
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and E-mail Address in this form:
    "Heinrich Heine (Der Dichter) <[email protected]>"

Real name: Deim0s Anomaly
E-mail address: [email protected]
Comment: 
You selected this USER-ID:
    "Deim0s Anomaly <[email protected]>"

Change (N)ame, (C)omment, (E)-mail or (O)kay/(Q)uit? O
gpg: generating new key
gpg: 3 Admin PIN attempts remaining before card is permanently locked

Please enter the Admin PIN
gpg: please wait while key is being generated ...
gpg: generating key failed
gpg: key generation failed: general error
Key generation failed: general error

gpg/card> 

o que está acontecendo? Alguém pode ajudar?

Responder1

Estranho, mas finalmente consegui fazer essa configuração funcionar (Omnichave 6121+Placa OpenGPG v2). É assim que ummero mortalpode conseguir o mesmo:

  1. Desative 90gpg-agent-minee 90ssh-agent-mineem /etc/X11/Xsession.d/ para que eles não tentem iniciar gpg-agent ou ssh-agent
  2. Crie um novo gpg-agent-wrapper conforme explicado emhttps://blog.flameeyes.eu/2010/08/smart-cards-and-secret-agents

Em (1), o motivo para não iniciar o gpg-agent a partir daí é que ele não ativará --enable-ssh-support, que é algo que eu queria.

Ao emitir um gpg --card-status, você notará um pequeno atraso e então:

gpg: detected reader `OMNIKEY CardMan (076B:6622) 6121 00 00'
Application ID ...: ......

Isso significa que o cartão agora também funcionará para operações de escrita! Yay! E o meu keytocardfoi um sucesso :)

informação relacionada