Commit b979bd37 authored by Daniel Salzman's avatar Daniel Salzman

tsig: review cleanup

parent 22c33d4a
......@@ -322,8 +322,6 @@ src/libknot/descriptor.c
src/libknot/descriptor.h
src/libknot/dname.c
src/libknot/dname.h
src/libknot/dnssec/key.c
src/libknot/dnssec/key.h
src/libknot/errcode.c
src/libknot/errcode.h
src/libknot/internal/array-sort.h
......@@ -417,6 +415,8 @@ src/libknot/rrtype/tsig.c
src/libknot/rrtype/tsig.h
src/libknot/tsig-op.c
src/libknot/tsig-op.h
src/libknot/tsig.c
src/libknot/tsig.h
src/libknot/yparser/yparser.c
src/libknot/yparser/yparser.h
src/libknot/yparser/ypbody.c
......@@ -439,6 +439,8 @@ src/utils/common/params.c
src/utils/common/params.h
src/utils/common/resolv.c
src/utils/common/resolv.h
src/utils/common/sign.c
src/utils/common/sign.h
src/utils/common/strtonum.h
src/utils/common/token.c
src/utils/common/token.h
......@@ -512,6 +514,7 @@ tests/rrset.c
tests/rrset_wire.c
tests/server.c
tests/test_conf.h
tests/tsig_key.c
tests/utils.c
tests/wire.c
tests/worker_pool.c
......
......@@ -86,11 +86,9 @@ Enable debug messages.
Print help and usage.
.TP
\fB\-k\fP \fIkeyfile\fP
Use TSIG or SIG\-0 key stored in a file \fIkeyfile\fP to authenticate the request.
Supported file format is the same as generated by ISC \fBdnssec\-keygen\fP\&.
The key comprises of public (.key extension) and private part (.private
extension). Either of these file names or a name without the extension can be
specified as \fIkeyfile\fP parameter.
Use TSIG key stored in a file \fIkeyfile\fP to authenticate the request. The
file must contain the key in the same format, which is accepted by the
\fB\-y\fP option.
.TP
\fB\-p\fP \fIport\fP
Set nameserver port number or service name to send a query to. The default
......
......@@ -50,10 +50,12 @@ Remote UNIX socket/IP address (default is \fB@run_dir@/knot.sock\fP).
Remote server port (only for IP).
.TP
\fB\-y\fP, \fB\-\-key\fP [\fIalg\fP:]\fIname\fP:\fIkey\fP
Use key specified on the command line (default algorithm is hmac\-md5).
Use TSIG key specified on the command line (default algorithm is hmac\-md5).
.TP
\fB\-k\fP, \fB\-\-keyfile\fP \fIfile\fP
Use key file.
Use TSIG key stored in a file \fIfile\fP to authenticate the request. The
file must contain the key in the same format, which is accepted by the
\fB\-y\fP option.
.TP
\fB\-f\fP, \fB\-\-force\fP
Force operation. Overrides some checks.
......
......@@ -52,11 +52,9 @@ Enable debug messages.
Print help and usage.
.TP
\fB\-k\fP \fIkeyfile\fP
Use TSIG or SIG\-0 key stored in a file \fIkeyfile\fP to authenticate the request.
Supported file format is the same as generated by ISC \fBdnssec\-keygen\fP\&.
The key comprises of public (.key extension) and private part (.private
extension). Either of these file names or a name without the extension can be
specified as \fIkeyfile\fP parameter.
Use TSIG key stored in a file \fIkeyfile\fP to authenticate the request. The
file should contain the key in the same format, which is accepted by the
\fB\-y\fP option.
.TP
\fB\-p\fP \fIport\fP
Set the port to use for connections to the server (if not explicitly specified
......
......@@ -488,7 +488,7 @@ static int process_query_packet(const knot_pkt_t *query,
net_t *net,
const query_t *query_ctx,
const bool ignore_tc,
const sign_context_t *sign_ctx,
const sign_context_t *sign_ctx,
const style_t *style)
{
struct timeval t_start, t_query, t_end;
......
......@@ -920,9 +920,11 @@ query_t* query_create(const char *owner, const query_t *conf)
query->dt_reader = conf->dt_reader;
query->dt_writer = conf->dt_writer;
#endif // USE_DNSTAP
if (conf->tsig_key.name) {
int r = knot_tsig_key_copy(&query->tsig_key, &conf->tsig_key);
if (r != KNOT_EOK) {
int ret = knot_tsig_key_copy(&query->tsig_key,
&conf->tsig_key);
if (ret != KNOT_EOK) {
query_free(query);
return NULL;
}
......
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