From: Mark Andrews Date: Tue, 1 May 2018 00:08:23 +0000 (+1000) Subject: simplify mask construction X-Git-Tag: v9.9.13rc1~30^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1d04fdffd7d4c49a1e884ba9011a9273ba7b1e9;p=thirdparty%2Fbind9.git simplify mask construction (cherry picked from commit 22fab3199fad15cd2dda526c63f4d95c38b67671) --- diff --git a/lib/dns/dst_parse.c b/lib/dns/dst_parse.c index 69d6ce01467..f7a6b0e3d3b 100644 --- a/lib/dns/dst_parse.c +++ b/lib/dns/dst_parse.c @@ -33,7 +33,6 @@ /*% * Principal Author: Brian Wellington - * $Id: dst_parse.c,v 1.29 2011/08/18 23:46:35 tbox Exp $ */ #include @@ -208,9 +207,7 @@ check_rsa(const dst_private_t *priv, isc_boolean_t external) { have[i] = ISC_TRUE; } - mask = ~0; - mask <<= sizeof(mask) * 8 - TAG_SHIFT; - mask >>= sizeof(mask) * 8 - TAG_SHIFT; + mask = (1ULL << TAG_SHIFT) - 1; if (have[TAG_RSA_ENGINE & mask]) ok = have[TAG_RSA_MODULUS & mask] && @@ -310,9 +307,7 @@ check_eddsa(const dst_private_t *priv, isc_boolean_t external) { have[i] = ISC_TRUE; } - mask = ~0; - mask <<= sizeof(mask) * 8 - TAG_SHIFT; - mask >>= sizeof(mask) * 8 - TAG_SHIFT; + mask = (1ULL << TAG_SHIFT) - 1; if (have[TAG_EDDSA_ENGINE & mask]) ok = have[TAG_EDDSA_LABEL & mask];