1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-07 23:27:48 +02:00

experiment: Fix exporting protecte secret key for new448.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2021-10-28 14:23:15 +09:00
parent 0683e88d30
commit b1a2e1904e

View File

@ -1477,6 +1477,27 @@ convert_to_openpgp (ctrl_t ctrl, gcry_sexp_t s_key, const char *passphrase,
if (err)
return err;
if (curve)
{
const char *curvename;
int pubkey_algo;
curvename = gcry_sexp_nth_string (curve, 1);
if (curvename && !strcmp (curvename, "Ed448"))
pubkey_algo = PUBKEY_ALGO_EDDSA;
else if (curvename && !strcmp (curvename, "X448"))
pubkey_algo = PUBKEY_ALGO_ECDH;
else
pubkey_algo = 0;
if (pubkey_algo)
{
err = openpgp_fixup_key_448 (pubkey_algo, &array[0]);
err = openpgp_fixup_key_448 (pubkey_algo, &array[1]);
}
}
gcry_create_nonce (protect_iv, sizeof protect_iv);
gcry_create_nonce (salt, sizeof salt);
/* We need to use the encoded S2k count. It is not possible to