aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-04-05 09:14:10 +0000
committerWerner Koch <[email protected]>2024-04-05 09:22:38 +0000
commitce8b25270b2ac7ec1dc830e657d04edeff36be4b (patch)
treeeff02a47097b8aa970b2513566aea915b2117fbd /agent/command.c
parentagent: Add initial support for hybrid ECC+PQC decryption with KEM. (diff)
downloadgnupg-ce8b25270b2ac7ec1dc830e657d04edeff36be4b.tar.gz
gnupg-ce8b25270b2ac7ec1dc830e657d04edeff36be4b.zip
agent: Make "PKDECRYPT --kem" with optional value work.
* agent/command.c (cmd_pkdecrypt): Fix comparison. * agent/agent.h (enum kemids): Rename type and strip trailing comma. * agent/pkdecrypt.c (agent_hybrid_pgp_kem_decrypt): Allow building with Libgcrypt < 1.11 -- Eventually we should change the libgcrypt requirement in configure.
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/agent/command.c b/agent/command.c
index fd050ee6b..2fd9a85d4 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1075,13 +1075,14 @@ cmd_pkdecrypt (assuan_context_t ctx, char *line)
if (p)
{
kemid = KEM_PQC_PGP;
- if (*p++ == '=')
+ if (*p == '=')
{
- if (strcmp (p, "PQC-PGP"))
+ p++;
+ if (!strcmp (p, "PQC-PGP"))
kemid = KEM_PQC_PGP;
- else if (strcmp (p, "PGP"))
+ else if (!strcmp (p, "PGP"))
kemid = KEM_PGP;
- else if (strcmp (p, "CMS"))
+ else if (!strcmp (p, "CMS"))
kemid = KEM_CMS;
else
return set_error (GPG_ERR_ASS_PARAMETER, "invalid KEM algorithm");