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

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.
This commit is contained in:
Werner Koch 2024-04-05 11:14:10 +02:00
parent 131dd2a351
commit ce8b25270b
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 11 additions and 6 deletions

View file

@ -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");