Fixed elgamal key transerable key output - key size was not computed in that case

master
Edouard Tisserant 8 years ago
parent 97ebbb6988
commit fed3b718dc

2
dist/configure.ac vendored

@ -2,7 +2,7 @@
#
# Process this file with autoconf to produce a configure script.
AC_INIT([netpgp],[20140220],[Alistair Crooks <agc@netbsd.org> c0596823])
AC_INIT([netpgp],[beta0],[ pEp NetPGP Team <netpgp@pep-project.org> ])
AC_PREREQ(2.69)
AC_REVISION([$Revision$])

@ -176,6 +176,11 @@ pubkey_length(const pgp_pubkey_t *key)
case PGP_PKA_RSA:
return mpi_length(key->key.rsa.n) + mpi_length(key->key.rsa.e);
case PGP_PKA_ELGAMAL:
return mpi_length(key->key.elgamal.p) +
mpi_length(key->key.elgamal.g) +
mpi_length(key->key.elgamal.y);
default:
(void) fprintf(stderr,
"pubkey_length: unknown key algorithm\n");
@ -197,6 +202,11 @@ seckey_length(const pgp_seckey_t *key)
mpi_length(key->key.rsa.q) + mpi_length(key->key.rsa.u);
return (unsigned)(len + pubkey_length(&key->pubkey));
case PGP_PKA_ELGAMAL:
return (unsigned)(
mpi_length(key->key.dsa.x) + pubkey_length(&key->pubkey));
default:
(void) fprintf(stderr,
"seckey_length: unknown key algorithm\n");

@ -58,9 +58,9 @@
#endif
/* development versions have .99 suffix */
#define NETPGP_BASE_VERSION "3.99.17"
#define NETPGP_BASE_VERSION "3.99.99"
#define NETPGP_VERSION_CAT(a, b) "NetPGP portable " a "/[" b "]"
#define NETPGP_VERSION_CAT(a, b) "NetPGP for pEp " a "/[" b "]"
#define NETPGP_VERSION_STRING \
NETPGP_VERSION_CAT(NETPGP_BASE_VERSION, NETPGP_AUTOCONF_VERSION)

Loading…
Cancel
Save