aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/openpgp-misc.c20
-rw-r--r--common/openpgpdefs.h2
2 files changed, 11 insertions, 11 deletions
diff --git a/common/openpgp-misc.c b/common/openpgp-misc.c
index 0c2960c3c..2062b1d9d 100644
--- a/common/openpgp-misc.c
+++ b/common/openpgp-misc.c
@@ -53,34 +53,34 @@ openpgp_ecc_parse_key (pubkey_algo_t pkalgo, const char *curve,
/*
- * Fix up public key for OpenPGP adding the prefix.
+ * Fix up public/sec key for OpenPGP adding the prefix.
*/
gpg_error_t
-openpgp_fixup_pubkey_448 (int algo, gcry_mpi_t *p_pubkey)
+openpgp_fixup_key_448 (int algo, gcry_mpi_t *r_key)
{
- gcry_mpi_t pubkey_mpi;
+ gcry_mpi_t key_mpi;
gcry_mpi_t a;
unsigned char *p;
const unsigned char *p_key;
unsigned int nbits;
unsigned int len;
- pubkey_mpi = *p_pubkey;
- *p_pubkey = NULL;
- p_key = gcry_mpi_get_opaque (pubkey_mpi, &nbits);
+ key_mpi = *r_key;
+ *r_key = NULL;
+ p_key = gcry_mpi_get_opaque (key_mpi, &nbits);
len = (nbits+7)/8;
if ((algo == PUBKEY_ALGO_ECDH && len != 56)
|| (algo == PUBKEY_ALGO_EDDSA && len != 57)
|| (algo != PUBKEY_ALGO_ECDH && algo != PUBKEY_ALGO_EDDSA))
{
- gcry_mpi_release (pubkey_mpi);
+ gcry_mpi_release (key_mpi);
return gpg_error (GPG_ERR_BAD_PUBKEY);
}
p = xtrymalloc (1 + len);
if (!p)
{
- gcry_mpi_release (pubkey_mpi);
+ gcry_mpi_release (key_mpi);
return gpg_error_from_syserror ();
}
@@ -89,8 +89,8 @@ openpgp_fixup_pubkey_448 (int algo, gcry_mpi_t *p_pubkey)
a = gcry_mpi_set_opaque (NULL, p, len*8+7);
gcry_mpi_set_flag (a, GCRYMPI_FLAG_USER2);
- *p_pubkey = a;
- gcry_mpi_release (pubkey_mpi);
+ *r_key = a;
+ gcry_mpi_release (key_mpi);
return 0;
}
diff --git a/common/openpgpdefs.h b/common/openpgpdefs.h
index 01a0e0edf..9552d622e 100644
--- a/common/openpgpdefs.h
+++ b/common/openpgpdefs.h
@@ -242,6 +242,6 @@ enum gcry_pk_algos map_openpgp_pk_to_gcry (pubkey_algo_t algo);
/*-- openpgp-misc.c --*/
gcry_mpi_t openpgp_ecc_parse_key (pubkey_algo_t pkalgo, const char *curve,
gcry_mpi_t key);
-gpg_error_t openpgp_fixup_pubkey_448 (int algo, gcry_mpi_t *p_pubkey);
+gpg_error_t openpgp_fixup_key_448 (int algo, gcry_mpi_t *p_pubkey);
#endif /*GNUPG_COMMON_OPENPGPDEFS_H*/