Skip to content

Commit

Permalink
dns: Simplify logic a bit
Browse files Browse the repository at this point in the history
We don't need a separate boolean variable

Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
  • Loading branch information
vlendec authored and cryptomilk committed Jun 1, 2018
1 parent d3c82e6 commit d8acbe7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source4/dns_server/dns_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ WERROR dns_verify_tsig(struct dns_server *dns,
WERROR werror;
NTSTATUS status;
enum ndr_err_code ndr_err;
bool found_tsig = false;
uint16_t i, arcount = 0;
DATA_BLOB tsig_blob, fake_tsig_blob, sig;
uint8_t *buffer = NULL;
Expand All @@ -113,12 +112,12 @@ WERROR dns_verify_tsig(struct dns_server *dns,
/* Find the first TSIG record in the additional records */
for (i=0; i < packet->arcount; i++) {
if (packet->additional[i].rr_type == DNS_QTYPE_TSIG) {
found_tsig = true;
break;
}
}

if (!found_tsig) {
if (i == packet->arcount) {
/* no TSIG around */
return WERR_OK;
}

Expand Down

0 comments on commit d8acbe7

Please sign in to comment.