mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-24 15:17:02 +01:00
ecc-sos: Fix exporting secret key for SOS.
* g10/export.c (transfer_format_to_openpgp): Use SOS. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
37aa23c55c
commit
705954149b
14
g10/export.c
14
g10/export.c
@ -978,15 +978,15 @@ transfer_format_to_openpgp (gcry_sexp_t s_pgp, PKT_public_key *pk)
|
||||
value = gcry_sexp_nth_data (list, ++idx, &valuelen);
|
||||
if (!value || !valuelen)
|
||||
goto bad_seckey;
|
||||
if (is_enc)
|
||||
if (is_enc
|
||||
|| pk->pubkey_algo == PUBKEY_ALGO_EDDSA
|
||||
|| pk->pubkey_algo == PUBKEY_ALGO_ECDH)
|
||||
{
|
||||
void *p = xtrymalloc (valuelen);
|
||||
if (!p)
|
||||
goto outofmem;
|
||||
memcpy (p, value, valuelen);
|
||||
skey[skeyidx] = gcry_mpi_set_opaque (NULL, p, valuelen*8);
|
||||
skey[skeyidx] = gcry_mpi_set_opaque_copy (NULL, value, valuelen*8);
|
||||
if (!skey[skeyidx])
|
||||
goto outofmem;
|
||||
if (is_enc)
|
||||
gcry_mpi_set_flag (skey[skeyidx], GCRYMPI_FLAG_USER1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1144,7 +1144,7 @@ transfer_format_to_openpgp (gcry_sexp_t s_pgp, PKT_public_key *pk)
|
||||
/* Check that the first secret key parameter in SKEY is encrypted
|
||||
and that there are no more secret key parameters. The latter is
|
||||
guaranteed by the v4 packet format. */
|
||||
if (!gcry_mpi_get_flag (skey[npkey], GCRYMPI_FLAG_OPAQUE))
|
||||
if (!gcry_mpi_get_flag (skey[npkey], GCRYMPI_FLAG_USER1))
|
||||
goto bad_seckey;
|
||||
if (npkey+1 < DIM (skey) && skey[npkey+1])
|
||||
goto bad_seckey;
|
||||
|
Loading…
x
Reference in New Issue
Block a user