mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
ecc-sos,gpg: Use sexp_extract_param_sos to get MPI.
* g10/export.c (sexp_extract_param_sos): Expose. * g10/keygen.c (ecckey_from_sexp): Use it. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
f71dff40ea
commit
fb9e39dcc9
@ -627,7 +627,7 @@ canon_pk_algo (enum gcry_pk_algos algo)
|
||||
}
|
||||
|
||||
|
||||
static gpg_error_t
|
||||
gpg_error_t
|
||||
sexp_extract_param_sos (gcry_sexp_t sexp, const char *param, gcry_mpi_t *r_sos)
|
||||
{
|
||||
gpg_error_t err;
|
||||
|
15
g10/keygen.c
15
g10/keygen.c
@ -1329,19 +1329,10 @@ ecckey_from_sexp (gcry_mpi_t *array, gcry_sexp_t sexp, int algo)
|
||||
if (err)
|
||||
goto leave;
|
||||
|
||||
l2 = gcry_sexp_find_token (list, "q", 0);
|
||||
if (!l2)
|
||||
{
|
||||
err = gpg_error (GPG_ERR_NO_OBJ);
|
||||
err = sexp_extract_param_sos (list, "q", &array[1])
|
||||
if (err)
|
||||
goto leave;
|
||||
}
|
||||
array[1] = gcry_sexp_nth_mpi (l2, 1, GCRYMPI_FMT_OPAQUE);
|
||||
gcry_sexp_release (l2);
|
||||
if (!array[1])
|
||||
{
|
||||
err = gpg_error (GPG_ERR_INV_OBJ);
|
||||
goto leave;
|
||||
}
|
||||
|
||||
gcry_sexp_release (list);
|
||||
|
||||
if (algo == PUBKEY_ALGO_ECDH)
|
||||
|
@ -415,6 +415,9 @@ void pop_export_filters (void);
|
||||
|
||||
int exact_subkey_match_p (KEYDB_SEARCH_DESC *desc, kbnode_t node);
|
||||
|
||||
gpg_error_t sexp_extract_param_sos (gcry_sexp_t sexp, const char *param,
|
||||
gcry_mpi_t *r_sos);
|
||||
|
||||
int export_pubkeys (ctrl_t ctrl, strlist_t users, unsigned int options,
|
||||
export_stats_t stats);
|
||||
int export_seckeys (ctrl_t ctrl, strlist_t users, unsigned int options,
|
||||
|
Loading…
x
Reference in New Issue
Block a user