aboutsummaryrefslogtreecommitdiffstats
path: root/common/openpgp-misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/openpgp-misc.c')
-rw-r--r--common/openpgp-misc.c20
1 files changed, 10 insertions, 10 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;
}