mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-08 17:43:04 +01:00
ecc-sos: Fix SOS handling and revert change of cvt protocol.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
85acf0699e
commit
6d226ec8bd
@ -451,6 +451,7 @@ do_unprotect (const char *passphrase,
|
|||||||
nbytes = (nbits+7)/8;
|
nbytes = (nbits+7)/8;
|
||||||
|
|
||||||
nbits = nbytes * 8;
|
nbits = nbytes * 8;
|
||||||
|
if (*buffer)
|
||||||
if (nbits >= 8 && !(*buffer & 0x80))
|
if (nbits >= 8 && !(*buffer & 0x80))
|
||||||
if (--nbits >= 7 && !(*buffer & 0x40))
|
if (--nbits >= 7 && !(*buffer & 0x40))
|
||||||
if (--nbits >= 6 && !(*buffer & 0x20))
|
if (--nbits >= 6 && !(*buffer & 0x20))
|
||||||
@ -882,12 +883,21 @@ convert_from_openpgp_main (ctrl_t ctrl, gcry_sexp_t s_pgp, int dontcare_exist,
|
|||||||
value = gcry_sexp_nth_data (list, ++idx, &valuelen);
|
value = gcry_sexp_nth_data (list, ++idx, &valuelen);
|
||||||
if (!value || !valuelen)
|
if (!value || !valuelen)
|
||||||
goto bad_seckey;
|
goto bad_seckey;
|
||||||
|
if (is_enc || npkey == 1 /* This is ECC */)
|
||||||
|
{
|
||||||
skey[skeyidx] = gcry_mpi_set_opaque_copy (NULL, value, valuelen*8);
|
skey[skeyidx] = gcry_mpi_set_opaque_copy (NULL, value, valuelen*8);
|
||||||
if (!skey[skeyidx])
|
if (!skey[skeyidx])
|
||||||
goto outofmem;
|
goto outofmem;
|
||||||
if (is_enc)
|
if (is_enc)
|
||||||
/* Encrypted parameters need to have a USER1 flag. */
|
/* Encrypted parameters need to have a USER1 flag. */
|
||||||
gcry_mpi_set_flag (skey[skeyidx], GCRYMPI_FLAG_USER1);
|
gcry_mpi_set_flag (skey[skeyidx], GCRYMPI_FLAG_USER1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (gcry_mpi_scan (skey + skeyidx, GCRYMPI_FMT_STD,
|
||||||
|
value, valuelen, NULL))
|
||||||
|
goto bad_seckey;
|
||||||
|
}
|
||||||
skeyidx++;
|
skeyidx++;
|
||||||
}
|
}
|
||||||
skey[skeyidx++] = NULL;
|
skey[skeyidx++] = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user