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

* options.h (DBG_CIPHER): Reintroduced it.

* seskey.c (encode_session_key): Debug output of the session key.

* pubkey-enc.c (get_it): Handle card case.
* call-agent.c (agent_scd_pkdecrypt): New.
* pkglue.c (pk_encrypt): Add RSA support.

* g10.c (main): Default to --use-agent.

* keygen.c (show_smartcard): Print info about the public key.
(check_smartcard): Check for existing key here.
(gen_card_key): And not anymore here.
(fpr_is_zero): New.
(generate_keypair): Generate both keys for a card.
(smartcard_change_url): Nw.
This commit is contained in:
Werner Koch 2003-07-03 18:08:16 +00:00
parent 39046ea7ec
commit 1753a2f3b0
13 changed files with 428 additions and 208 deletions

View file

@ -177,6 +177,12 @@ pk_encrypt (int algo, gcry_mpi_t * resarr, gcry_mpi_t data, gcry_mpi_t * pkey)
"(public-key(elg(p%m)(g%m)(y%m)))",
pkey[0], pkey[1], pkey[2]);
}
else if (algo == GCRY_PK_RSA)
{
rc = gcry_sexp_build (&s_pkey, NULL,
"(public-key(rsa(n%m)(e%m)))",
pkey[0], pkey[1]);
}
else
return GPG_ERR_PUBKEY_ALGO;
@ -202,11 +208,14 @@ pk_encrypt (int algo, gcry_mpi_t * resarr, gcry_mpi_t data, gcry_mpi_t * pkey)
assert (resarr[0]);
gcry_sexp_release (list);
list = gcry_sexp_find_token (s_ciph, "b", 0);
assert (list);
resarr[1] = gcry_sexp_nth_mpi (list, 1, 0);
assert (resarr[1]);
gcry_sexp_release (list);
if (algo != GCRY_PK_RSA)
{
list = gcry_sexp_find_token (s_ciph, "b", 0);
assert (list);
resarr[1] = gcry_sexp_nth_mpi (list, 1, 0);
assert (resarr[1]);
gcry_sexp_release (list);
}
}
gcry_sexp_release (s_ciph);
@ -276,3 +285,10 @@ pk_decrypt (int algo, gcry_mpi_t * result, gcry_mpi_t * data,
return 0;
}