mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
agent, g10: Fix keygen.
* agent/command.c (cmd_readkey): Get length after card_readkey. * g10/keygen.c (gen_card_key): Fix off-by-one error. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
b680f79cc1
commit
9a34e2142b
@ -1020,10 +1020,10 @@ cmd_readkey (assuan_context_t ctx, char *line)
|
|||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
pkbuflen = gcry_sexp_canon_len (pkbuf, 0, NULL, NULL);
|
|
||||||
rc = agent_card_readkey (ctrl, keyid, &pkbuf);
|
rc = agent_card_readkey (ctrl, keyid, &pkbuf);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
pkbuflen = gcry_sexp_canon_len (pkbuf, 0, NULL, NULL);
|
||||||
rc = gcry_sexp_sscan (&s_pkey, NULL, (char*)pkbuf, pkbuflen);
|
rc = gcry_sexp_sscan (&s_pkey, NULL, (char*)pkbuf, pkbuflen);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
@ -4876,7 +4876,7 @@ gen_card_key (int algo, int keyno, int is_primary, kbnode_t pub_root,
|
|||||||
unsigned char *public;
|
unsigned char *public;
|
||||||
gcry_sexp_t s_key;
|
gcry_sexp_t s_key;
|
||||||
|
|
||||||
snprintf (keyid, DIM(keyid)-1, "OPENPGP.%d", keyno);
|
snprintf (keyid, DIM(keyid), "OPENPGP.%d", keyno);
|
||||||
keyid[DIM(keyid)-1] = 0;
|
keyid[DIM(keyid)-1] = 0;
|
||||||
|
|
||||||
if (algo != PUBKEY_ALGO_RSA)
|
if (algo != PUBKEY_ALGO_RSA)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user