diff --git a/src/post_modules/Nettle/mac.cmod b/src/post_modules/Nettle/mac.cmod index cbfd294d18671dc43660641fc0514d3f55a3e5ef..a1ee17b7570ebc28b2bd5c3092b540f35bebc095 100644 --- a/src/post_modules/Nettle/mac.cmod +++ b/src/post_modules/Nettle/mac.cmod @@ -20,6 +20,10 @@ DECLARATIONS +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif /* HAVE_STDINT_H */ + #include "nettle.h" #ifdef HAVE_NETTLE_POLY1305_H diff --git a/src/post_modules/Nettle/nettle.cmod b/src/post_modules/Nettle/nettle.cmod index 765ddd182d3b0b312e7763dd7cdc8a9c5fab182f..a9cdeb230260b53d4cfdaae36c9c568649d08d51 100644 --- a/src/post_modules/Nettle/nettle.cmod +++ b/src/post_modules/Nettle/nettle.cmod @@ -22,6 +22,10 @@ #include <stdio.h> #include <stdarg.h> +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif /* HAVE_STDINT_H */ + DECLARATIONS /*! @module Nettle diff --git a/src/post_modules/Nettle/nettle.h b/src/post_modules/Nettle/nettle.h index 6cd2e77684b3848af4538db18b8090b0565d9486..b02ce114f094e029681211d265b647afd8851b5b 100644 --- a/src/post_modules/Nettle/nettle.h +++ b/src/post_modules/Nettle/nettle.h @@ -50,25 +50,28 @@ typedef size_t pike_nettle_size_t; typedef unsigned pike_nettle_size_t; #endif -/* In Nettle 2.0 the nettle_*_func typedefs lost their pointers. */ -#ifdef HAVE_NETTLE_CRYPT_FUNC_IS_POINTER -/* Nettle 1.x */ -typedef nettle_crypt_func pike_nettle_crypt_func; -typedef nettle_hash_digest_func pike_nettle_hash_digest_func; -typedef nettle_hash_update_func pike_nettle_hash_update_func; -#else -/* Nettle 2.0 */ - -#ifdef dsa_params_init -/* Nettle 3.0 */ -typedef nettle_cipher_func *pike_nettle_crypt_func; -#else -typedef nettle_crypt_func *pike_nettle_crypt_func; -#endif - -typedef nettle_hash_digest_func *pike_nettle_hash_digest_func; -typedef nettle_hash_update_func *pike_nettle_hash_update_func; -#endif +/* In Nettle 2.0 the nettle_*_func typedefs lost their pointers. */ +#ifdef HAVE_NETTLE_CRYPT_FUNC_IS_POINTER +/* Nettle 1.x */ +typedef nettle_crypt_func pike_nettle_crypt_func; +typedef nettle_hash_digest_func pike_nettle_hash_digest_func; +typedef nettle_hash_update_func pike_nettle_hash_update_func; +#else +/* Nettle 2.0 */ +typedef void (*pike_nettle_crypt_func)(void *ctx, + unsigned length, uint8_t *dst, + const uint8_t *src); + +typedef void (*pike_nettle_hash_digest_func)(void *ctx, + unsigned length, uint8_t *dst); + +typedef void (*pike_nettle_hash_update_func)(void *ctx, + unsigned length, + const uint8_t *src); + +/* Nettle 3.0 */ + +#endif char *pike_crypt_md5(int pl, const char *const pw,