Branch: Tag:

2014-12-04

2014-12-04 19:25:56 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Build: Use the recommended way to detect Nettle API differences.

The main Nettle developers recommend using the function renaming
macros to detect Nettle API differences.

In this case we use <nettle/dsa.h>'s remapping of dsa_params_init
to nettle_dsa_params_init to detect Nettle 3.0 or later.

72:   PIKEFUN array(object(Gmp.mpz))    dsa_generate_keypair(int p_bits, int q_bits, function(int(0..):string(0..255)) rnd)   { - #ifdef HAVE_NETTLE_DSA_PARAMS_INIT + #ifdef dsa_params_init    /* Nettle 3.0 or later. */    struct dsa_params params;    mpz_t pub;
130:       dsa_private_key_clear(&key);    dsa_public_key_clear(&pub); - #endif /* HAVE_NETTLE_DSA_PARAMS_INIT */ + #endif /* dsa_params_init */       f_aggregate(5);    stack_pop_n_elems_keep_top(args); /* Remove p_bits, q_bits and rnd. */
187:    stack_pop_n_elems_keep_top(args); /* Remove bits, e and rnd. */   }    - #ifdef HAVE_NETTLE_DSA_PARAMS_INIT + #ifdef dsa_params_init      /*! @class DH_Params    *!
321:   /*! @endclass    */    - #endif /* HAVE_NETTLE_DSA_PARAMS_INIT */ + #endif /* dsa_params_init */      #ifdef HAVE_NETTLE_ECDSA_H   #include <nettle/ecc-curve.h>