aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2024-03-19 07:52:26 +0000
committerNIIBE Yutaka <[email protected]>2024-03-19 07:52:26 +0000
commitc53abc8ffe43a5fb7ae35cda6b1aed4987e0607d (patch)
treeff3f9af2fe50366a53ab49e60fedcd71ae8f05e4
parentFix since AES KeyWrap is always with AES256 for hybrid KEM. (diff)
downloadgnupg-c53abc8ffe43a5fb7ae35cda6b1aed4987e0607d.tar.gz
gnupg-c53abc8ffe43a5fb7ae35cda6b1aed4987e0607d.zip
Fix cmd_sigkey and agent_hybrid_kem_decap.
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--agent/command.c1
-rw-r--r--agent/pkdecrypt.c5
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,