From c53abc8ffe43a5fb7ae35cda6b1aed4987e0607d Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 19 Mar 2024 16:52:26 +0900 Subject: [PATCH] Fix cmd_sigkey and agent_hybrid_kem_decap. Signed-off-by: NIIBE Yutaka --- agent/command.c | 1 + agent/pkdecrypt.c | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/agent/command.c b/agent/command.c index 49779d71a..39b4b3fb2 100644 --- a/agent/command.c +++ b/agent/command.c @@ -776,6 +776,7 @@ cmd_sigkey (assuan_context_t ctx, char *line) int opt_another; opt_another = has_option (line, "--another"); + line = skip_options (line); rc = parse_keygrip (ctx, line, opt_another? ctrl->keygrip1 : ctrl->keygrip); if (rc) diff --git a/agent/pkdecrypt.c b/agent/pkdecrypt.c index 94607fbf4..e53d6a2b6 100644 --- a/agent/pkdecrypt.c +++ b/agent/pkdecrypt.c @@ -241,7 +241,7 @@ agent_hybrid_kem_decap (ctrl_t ctrl, const char *desc_text, int kemid, } err = agent_key_from_file (ctrl, NULL, desc_text, - NULL, &shadow_info, + ctrl->keygrip1, &shadow_info, CACHE_MODE_NORMAL, NULL, &s_skey1, NULL, NULL); if (gpg_err_code (err) == GPG_ERR_NO_SECKEY) no_shadow_info = 1; @@ -291,9 +291,6 @@ agent_hybrid_kem_decap (ctrl_t ctrl, const char *desc_text, int kemid, ecc_ct = gcry_mpi_get_opaque (ecc_ct_mpi, &nbits); ecc_ct_len = (nbits+7)/8; - /* Remove the 0x40 prefix*/ - ecc_ct++; - ecc_ct_len--; /*FIXME make sure the lengths are all correct. */ /*FIXME: check the internal of optional to determine the KEK-algo and KEKKEYLEN. */ err = gcry_kem_decap (GCRY_KEM_RAW_X25519,