util: replace assert for missing MD5 with fatal log message
Apparently, on some systems the MD5 function is missing with the NSS support (freebl3). Instead of failing an assertion, exit with a log message.
This commit is contained in:
parent
e41042e258
commit
4da9f74d24
1 changed files with 6 additions and 8 deletions
14
util.c
14
util.c
|
@ -366,16 +366,14 @@ UTI_IPToRefid(IPAddr *ip)
|
||||||
case IPADDR_INET4:
|
case IPADDR_INET4:
|
||||||
return ip->addr.in4;
|
return ip->addr.in4;
|
||||||
case IPADDR_INET6:
|
case IPADDR_INET6:
|
||||||
if (MD5_hash < 0) {
|
if (MD5_hash < 0)
|
||||||
MD5_hash = HSH_GetHashId("MD5");
|
MD5_hash = HSH_GetHashId("MD5");
|
||||||
assert(MD5_hash >= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HSH_Hash(MD5_hash, (unsigned const char *)ip->addr.in6, sizeof
|
if (MD5_hash < 0 ||
|
||||||
(ip->addr.in6), NULL, 0, buf, 16) != 16) {
|
HSH_Hash(MD5_hash, (const unsigned char *)ip->addr.in6, sizeof (ip->addr.in6),
|
||||||
assert(0);
|
NULL, 0, buf, sizeof (buf)) != sizeof (buf))
|
||||||
return 0;
|
LOG_FATAL("Could not get MD5");
|
||||||
};
|
|
||||||
return (uint32_t)buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
|
return (uint32_t)buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue