{
enum ndr_err_code ndr_err;
NTSTATUS nt_status;
- int ret;
- static const struct samr_Password zero_hash;
struct samr_Password *lm_hash = NULL;
struct samr_Password *nt_hash = NULL;
struct PAC_CREDENTIAL_NTLM_SECPKG ntlm_secpkg = {
lm_hash = samdb_result_hash(mem_ctx, msg, "dBCSPwd");
if (lm_hash != NULL) {
- ret = memcmp(lm_hash->hash, zero_hash.hash, 16);
- if (ret == 0) {
+ bool zero = all_zero(lm_hash->hash, 16);
+ if (zero) {
lm_hash = NULL;
}
}
nt_hash = samdb_result_hash(mem_ctx, msg, "unicodePwd");
if (nt_hash != NULL) {
- ret = memcmp(nt_hash->hash, zero_hash.hash, 16);
- if (ret == 0) {
+ bool zero = all_zero(nt_hash->hash, 16);
+ if (zero) {
nt_hash = NULL;
}
}