Branch: Tag:


2014-12-04 19:26:42 by Henrik Grubbström (Grubba) <>

Nettle: Improved compatibility with older Nettles.

In older versions of Nettle, the nettle_*_func typedefs were
function pointers, while in more recent versions they are functions.

Also unifies the naming conventions for Pike-specific typedefs by
renaming the crypt_func typedef to pike_nettle_crypt_func.

38:   #ifdef HAVE_NETTLE_DSA_H   #include <nettle/dsa.h>   #endif +    #ifdef dsa_params_init   /* We use the presence of the dsa_params_init remapping to detect Nettle    * 3.0 or later. This is the recommended way to detect Nettle version
49:   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 */ + 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; + #endif    -  +    char *pike_crypt_md5(int pl, const char *const pw,    int sl, const char *const salt,    int ml, const char *const magic);