Commit b5f2e404 authored by Marek Vavruša's avatar Marek Vavruša

tsig: restore QNAME lettercase before checking

parent 153f8a6e
...@@ -533,6 +533,7 @@ static int process_query_out(knot_pkt_t *pkt, knot_process_t *ctx) ...@@ -533,6 +533,7 @@ static int process_query_out(knot_pkt_t *pkt, knot_process_t *ctx)
/* Restore original QNAME. */ /* Restore original QNAME. */
qname_case_restore(qdata, pkt); qname_case_restore(qdata, pkt);
if (pkt->current != KNOT_ADDITIONAL) { if (pkt->current != KNOT_ADDITIONAL) {
knot_pkt_begin(pkt, KNOT_ADDITIONAL); knot_pkt_begin(pkt, KNOT_ADDITIONAL);
} }
...@@ -620,8 +621,10 @@ int process_query_verify(struct query_data *qdata) ...@@ -620,8 +621,10 @@ int process_query_verify(struct query_data *qdata)
ctx->tsig_digestlen = tsig_rdata_mac_length(query->tsig_rr); ctx->tsig_digestlen = tsig_rdata_mac_length(query->tsig_rr);
/* Checking query. */ /* Checking query. */
qname_case_restore(qdata, query);
int ret = knot_tsig_server_check(query->tsig_rr, query->wire, int ret = knot_tsig_server_check(query->tsig_rr, query->wire,
query->size, ctx->tsig_key); query->size, ctx->tsig_key);
qname_case_lower(query);
dbg_ns("%s: QUERY TSIG check result = %s\n", __func__, knot_strerror(ret)); dbg_ns("%s: QUERY TSIG check result = %s\n", __func__, knot_strerror(ret));
......
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