Skip to content
Snippets Groups Projects
Commit 0f92b40a authored by Niels Möller's avatar Niels Möller
Browse files

* pgp.h: Include bignum.h, don't pretend to work without bignums.

* pgp-encode.c (pgp_put_mpi, pgp_put_public_rsa_key)
(pgp_put_rsa_sha1_signature): Define unconditionally. Removed the
checking of HAVE_LIBGMP and WITH_PUBLIC_KEY.

Rev: nettle/pgp-encode.c:1.2
Rev: nettle/pgp.h:1.2
parent 9ce9c53e
No related branches found
No related tags found
No related merge requests found
...@@ -31,23 +31,12 @@ ...@@ -31,23 +31,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if HAVE_LIBGMP
# include "bignum.h"
#include "pgp.h" #include "pgp.h"
#else /* !HAVE_LIBGMP */
/* Kludge to make it possible to include pgp.h */
# define mpz_t int
# include "pgp.h"
# undef mpz_t
#endif /* !HAVE_LIBGMP */
#if WITH_PUBLIC_KEY
# include "rsa.h"
#endif
#include "base64.h" #include "base64.h"
#include "buffer.h" #include "buffer.h"
#include "macros.h" #include "macros.h"
#include "rsa.h"
int int
pgp_put_uint32(struct nettle_buffer *buffer, uint32_t i) pgp_put_uint32(struct nettle_buffer *buffer, uint32_t i)
...@@ -71,7 +60,6 @@ pgp_put_uint16(struct nettle_buffer *buffer, unsigned i) ...@@ -71,7 +60,6 @@ pgp_put_uint16(struct nettle_buffer *buffer, unsigned i)
return 1; return 1;
} }
#if HAVE_LIBGMP
int int
pgp_put_mpi(struct nettle_buffer *buffer, const mpz_t x) pgp_put_mpi(struct nettle_buffer *buffer, const mpz_t x)
{ {
...@@ -93,7 +81,6 @@ pgp_put_mpi(struct nettle_buffer *buffer, const mpz_t x) ...@@ -93,7 +81,6 @@ pgp_put_mpi(struct nettle_buffer *buffer, const mpz_t x)
return 1; return 1;
} }
#endif
int int
pgp_put_string(struct nettle_buffer *buffer, pgp_put_string(struct nettle_buffer *buffer,
...@@ -214,7 +201,6 @@ pgp_sub_packet_end(struct nettle_buffer *buffer, unsigned start) ...@@ -214,7 +201,6 @@ pgp_sub_packet_end(struct nettle_buffer *buffer, unsigned start)
WRITE_UINT32(buffer->contents + start - 2, length); WRITE_UINT32(buffer->contents + start - 2, length);
} }
#if WITH_PUBLIC_KEY
int int
pgp_put_public_rsa_key(struct nettle_buffer *buffer, pgp_put_public_rsa_key(struct nettle_buffer *buffer,
const struct rsa_public_key *pub, const struct rsa_public_key *pub,
...@@ -321,7 +307,6 @@ pgp_put_rsa_sha1_signature(struct nettle_buffer *buffer, ...@@ -321,7 +307,6 @@ pgp_put_rsa_sha1_signature(struct nettle_buffer *buffer,
return 1; return 1;
} }
#endif /* WITH_PUBLIC_KEY */
#define CRC24_INIT 0x0b704ceL #define CRC24_INIT 0x0b704ceL
#define CRC24_POLY 0x1864cfbL #define CRC24_POLY 0x1864cfbL
......
...@@ -29,10 +29,7 @@ ...@@ -29,10 +29,7 @@
#include <time.h> #include <time.h>
#include "nettle-types.h" #include "nettle-types.h"
#include "bignum.h"
/* FIXME: User must include bignum.h before this file, in order to get
mpz_t defined. We don't do that here, in order to kludge through
compilation without public key support and without gmp.h. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment