Fix to last commit.

This commit is contained in:
Simon Kelley
2014-01-25 23:46:23 +00:00
parent 8a9be9e493
commit 703c7ff429
2 changed files with 11 additions and 4 deletions

View File

@@ -1394,6 +1394,7 @@ unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name
return digest; /* bad packet */
}
hash->digest(ctx, hash->digest_size, digest);
return digest;
}

View File

@@ -1375,7 +1375,7 @@ unsigned char *tcp_request(int confd, time_t now,
{
struct server *firstsendto = NULL;
#ifdef HAVE_DNSSEC
unsigned char *newhash, *hash[HASH_SIZE];
unsigned char *newhash, hash[HASH_SIZE];
if ((newhash = hash_questions(header, (unsigned int)size, daemon->keyname)))
memcpy(hash, newhash, HASH_SIZE);
#else
@@ -1506,10 +1506,16 @@ unsigned char *tcp_request(int confd, time_t now,
#ifdef HAVE_DNSSEC
newhash = hash_questions(header, (unsigned int)m, daemon->namebuff);
if (!newhash || memcmp(hash, newhash, HASH_SIZE) != 0)
{
m = 0;
break;
}
#else
if (crc != questions_crc(header, (unsigned int)m, daemon->namebuff))
{
m = 0;
break;
}
#endif
m = process_reply(header, now, last_server, (unsigned int)m,