Branch: Tag:

2017-03-13

2017-03-13 14:33:21 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Nettle: Fixed potential compilation issues with old crippled hogweed.

553:   #ifdef HAVE_NETTLE_ECC_BIT_SIZE    push_int(ecc_bit_size(THIS->curve));   #else +  do { + #ifdef HAVE_CURVE_NETTLE_SECP_192R1    if (THIS->curve == &nettle_secp_192r1) {    push_int(192); -  } else if (THIS->curve == &nettle_secp_224r1) { +  break; +  } + #endif /* HAVE_CURVE_NETTLE_SECP_192R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_224R1 +  if (THIS->curve == &nettle_secp_224r1) {    push_int(224); -  } else if (THIS->curve == &nettle_secp_256r1) { +  break; +  } + #endif /* HAVE_CURVE_NETTLE_SECP_224R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_256R1 +  if (THIS->curve == &nettle_secp_256r1) {    push_int(256); -  } else if (THIS->curve == &nettle_secp_384r1) { +  break; +  } + #endif /* HAVE_CURVE_NETTLE_SECP_256R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_384R1 +  if (THIS->curve == &nettle_secp_384r1) {    push_int(384); -  } else if (THIS->curve == &nettle_secp_521r1) { +  break; +  } + #endif /* HAVE_CURVE_NETTLE_SECP_384R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_521R1 +  if (THIS->curve == &nettle_secp_521r1) {    push_int(521); -  } else { +  break; +  } + #endif /* HAVE_CURVE_NETTLE_SECP_521R1 */    push_int(0); -  +  } while(0); + #endif /* HAVE_NETTLE_ECC_BIT_SIZE */    } - #endif -  } +        /*! @decl Gmp.mpz new_scalar(function(int(0..):string(8bit)) rnd)    *!