summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2023-04-06 04:32:52 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2023-04-06 04:32:52 +0200
commitcb055ecb9109385c65f715edfd9bf3ca2f1521d3 (patch)
tree6d93089a57d0f96c0d049d5f554f07bc109a530b
parentgpg: New option --assert-signer. (diff)
downloadgnupg2-cb055ecb9109385c65f715edfd9bf3ca2f1521d3.tar.xz
gnupg2-cb055ecb9109385c65f715edfd9bf3ca2f1521d3.zip
gpg: Fix handling of importing cv25519 secret key.
* g10/import.c (transfer_secret_keys): Only emit a warning when secret key is not encrypted. -- Fixing-commit: dbfb7f809b89cfe05bdacafdb91a2d485b9fe2e0 GnuPG-bug-id: 6322 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--g10/import.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/import.c b/g10/import.c
index 9fab46ca6..1ed40a63c 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -2656,6 +2656,7 @@ transfer_secret_keys (ctrl_t ctrl, struct import_stats_s *stats,
* in case of cv25519. We have only opaque MPIs here. */
if (pk->pubkey_algo == PUBKEY_ALGO_ECDH
&& !strcmp (curvestr, "1.3.6.1.4.1.3029.1.5.1")
+ && !gcry_mpi_get_flag (pk->pkey[i], GCRYMPI_FLAG_USER1)
&& gcry_mpi_get_flag (pk->pkey[i], GCRYMPI_FLAG_OPAQUE))
{
const unsigned char *pp;