1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* keygen.c (generate_keypair): Create an AUTHKEYTYPE entry for cards.

(do_generate_keypair): Abd generate the authkey.
(check_smartcard): Changed menu accordingly.
This commit is contained in:
Werner Koch 2003-07-23 07:11:06 +00:00
parent 4622a2180d
commit 44f4303bcf
10 changed files with 272 additions and 20 deletions

View file

@ -275,7 +275,43 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig,
sig->digest_algo = digest_algo;
sig->digest_start[0] = dp[0];
sig->digest_start[1] = dp[1];
if (sk->is_protected && sk->protect.s2k.mode == 1002)
#if 0
if (sk->is_protected && sk->protect.s2k.mode == 1002 && !sk->is_primary)
{ /* Temporary hack to test tey auth command. */
char *rbuf;
size_t rbuflen;
char *snbuf;
char *tmpbuf;
size_t tmp_n;
frame = encode_md_value( sk->pubkey_algo, md,
digest_algo, mpi_get_nbits(sk->skey[0]), 0 );
if (!frame)
return GPG_ERR_GENERAL;
if (gcry_mpi_aprint (GCRYMPI_FMT_USG, (void **)&tmpbuf, &tmp_n, frame ))
BUG ();
for (; tmp_n && *tmpbuf; tmp_n--, tmpbuf++)
;
assert (tmp_n);
tmp_n--;
tmpbuf++;
snbuf = serialno_and_fpr_from_sk (sk->protect.iv, sk->protect.ivlen, sk);
rc = agent_scd_pksign (snbuf, 0,
tmpbuf, tmp_n,
&rbuf, &rbuflen);
xfree (snbuf);
if (!rc)
{
unsigned int nbytes = rbuflen;
if (gcry_mpi_scan (&sig->data[0], GCRYMPI_FMT_USG, rbuf, &nbytes ))
BUG ();
}
}
else
#endif
if (sk->is_protected && sk->protect.s2k.mode == 1002)
{ /* FIXME: Note that we do only support RSA for now. */
char *rbuf;
size_t rbuflen;