#include "auth/auth.h"
#include "auth/gensec/gensec.h"
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_DNS
+
static WERROR dns_copy_tsig(TALLOC_CTX *mem_ctx,
struct dns_res_rec *old,
struct dns_res_rec *new_rec)
/* The TSIG record needs to be the last additional record */
if (found_tsig && i + 1 != packet->arcount) {
- DEBUG(0, ("TSIG record not the last additional record!\n"));
+ DEBUG(1, ("TSIG record not the last additional record!\n"));
return DNS_ERR(FORMAT_ERROR);
}
/* We got a TSIG, so we need to sign our reply */
state->sign = true;
- state->tsig = talloc_zero(mem_ctx, struct dns_res_rec);
+ state->tsig = talloc_zero(state->mem_ctx, struct dns_res_rec);
if (state->tsig == NULL) {
return WERR_NOMEM;
}
}
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("Verifying tsig failed: %s\n", nt_errstr(status)));
+ DEBUG(1, ("Verifying tsig failed: %s\n", nt_errstr(status)));
return ntstatus_to_werror(status);
}
state->authenticated = true;
+ state->key_name = talloc_strdup(state->mem_ctx, tkey->name);
+ if (state->key_name == NULL) {
+ return WERR_NOMEM;
+ }
return WERR_OK;
}