Commit 703c7ff4 authored by Simon Kelley's avatar Simon Kelley

Fix to last commit.

parent 8a9be9e4
...@@ -1393,7 +1393,8 @@ unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name ...@@ -1393,7 +1393,8 @@ unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name
if (!CHECK_LEN(header, p, plen, 0)) if (!CHECK_LEN(header, p, plen, 0))
return digest; /* bad packet */ return digest; /* bad packet */
} }
hash->digest(ctx, hash->digest_size, digest);
return digest; return digest;
} }
......
...@@ -1375,7 +1375,7 @@ unsigned char *tcp_request(int confd, time_t now, ...@@ -1375,7 +1375,7 @@ unsigned char *tcp_request(int confd, time_t now,
{ {
struct server *firstsendto = NULL; struct server *firstsendto = NULL;
#ifdef HAVE_DNSSEC #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))) if ((newhash = hash_questions(header, (unsigned int)size, daemon->keyname)))
memcpy(hash, newhash, HASH_SIZE); memcpy(hash, newhash, HASH_SIZE);
#else #else
...@@ -1506,10 +1506,16 @@ unsigned char *tcp_request(int confd, time_t now, ...@@ -1506,10 +1506,16 @@ unsigned char *tcp_request(int confd, time_t now,
#ifdef HAVE_DNSSEC #ifdef HAVE_DNSSEC
newhash = hash_questions(header, (unsigned int)m, daemon->namebuff); newhash = hash_questions(header, (unsigned int)m, daemon->namebuff);
if (!newhash || memcmp(hash, newhash, HASH_SIZE) != 0) if (!newhash || memcmp(hash, newhash, HASH_SIZE) != 0)
break; {
m = 0;
break;
}
#else #else
if (crc != questions_crc(header, (unsigned int)m, daemon->namebuff)) if (crc != questions_crc(header, (unsigned int)m, daemon->namebuff))
break; {
m = 0;
break;
}
#endif #endif
m = process_reply(header, now, last_server, (unsigned int)m, m = process_reply(header, now, last_server, (unsigned int)m,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment