aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/export.c2
-rw-r--r--g10/keygen.c17
-rw-r--r--g10/main.h3
3 files changed, 8 insertions, 14 deletions
diff --git a/g10/export.c b/g10/export.c
index ba3521f2f..6930f9722 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -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;
diff --git a/g10/keygen.c b/g10/keygen.c
index 63e2f9cff..1f3d09994 100644
--- a/g10/keygen.c
+++ b/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);
- 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;
- }
+ err = sexp_extract_param_sos (list, "q", &array[1])
+ if (err)
+ goto leave;
+
gcry_sexp_release (list);
if (algo == PUBKEY_ALGO_ECDH)
diff --git a/g10/main.h b/g10/main.h
index dedd60e73..b4663df1b 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -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,