Icinga / icingaweb2-module-x509

Keeps track of certificates as they are deployed in a network environment.
https://icinga.com/docs/x509/latest/
GNU General Public License v2.0
107 stars 24 forks source link

JobUtils: Use gmp function for checking whether an IP is inside #199

Closed yhabteab closed 1 year ago

yhabteab commented 1 year ago

This fixes a bug with IPV6 addresses, since previously a GMP object was passed to static::isIPV6() and thus the function always returned false. Furthermore, the standard PHP pow() function isn't really optimal for IPV6 either and is now replaced by gmp_pow() instead. Casting GMP objects to integer also causes many unwanted troubles when converting large numbers back with gmp_intval(), so static::isAddrInside() uses only gmp auxiliary functions.

All these problems are caught by the new unit tests added in 6536e25.