1 .\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (c) 1995-1999 by Internet Software Consortium
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
14 .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\" Id: tsig.man3,v 1.2 2009/01/21 00:12:34 each Exp
24 .Nm ns_sign_tcp_init ,
27 .Nm ns_verify_tcp_init ,
38 .Fa "const u_char *querysig"
42 .Fa "time_t in_timesigned"
45 .Fn ns_sign_tcp "u_char *msg" "int *msglen" "int msgsize" "int error" \
46 "ns_tcp_tsig_state *state" "int done"
48 .Fn ns_sign_tcp_init "void *k" "const u_char *querysig" "int querysiglen" \
49 "ns_tcp_tsig_state *state"
55 .Fa "const u_char *querysig"
59 .Fa "time_t in_timesigned"
63 .Fn ns_verify_tcp "u_char *msg" "int *msglen" "ns_tcp_tsig_state *state" \
66 .Fn ns_verify_tcp_init "void *k" "const u_char *querysig" "int querysiglen" \
67 "ns_tcp_tsig_state *state"
69 .Fn ns_find_tsig "u_char *msg" "u_char *eom"
71 The TSIG routines are used to implement transaction/request security of
77 are the basic routines.
81 are used to sign/verify TCP messages that may be split into multiple packets,
82 such as zone transfers, and
83 .Fn ns_sign_tcp_init ,
84 .Fn ns_verify_tcp_init
85 initialize the state structure necessary for TCP operations.
87 locates the TSIG record in a message, if one is present.
90 .Bl -tag -width "in_timesigned" -compact -offset indent
92 the incoming DNS message, which will be modified
94 the length of the DNS message, on input and output
96 the size of the buffer containing the DNS message on input
98 the value to be placed in the TSIG error field
100 the (DST_KEY *) to sign the data
102 for a response, the signature contained in the query
104 the length of the query signature
106 a buffer to be filled with the generated signature
108 the length of the signature buffer on input, the signature length on output
112 .Bl -tag -width "in_timesigned" -compact -offset indent
114 the incoming DNS message, which will be modified
116 the length of the DNS message, on input and output
118 the size of the buffer containing the DNS message on input
120 the value to be placed in the TSIG error field
122 the state of the operation
124 non-zero value signifies that this is the last packet
128 .Bl -tag -width "in_timesigned" -compact -offset indent
130 the (DST_KEY *) to sign the data
132 for a response, the signature contained in the query
134 the length of the query signature
136 the state of the operation, which this initializes
140 .Bl -tag -width "in_timesigned" -compact -offset indent
142 the incoming DNS message, which will be modified
144 the length of the DNS message, on input and output
146 the (DST_KEY *) to sign the data
148 for a response, the signature contained in the query
150 the length of the query signature
152 a buffer to be filled with the signature contained
154 the length of the signature buffer on input, the signature length on output
156 non-zero value means that the TSIG is left intact
160 .Bl -tag -width "in_timesigned" -compact -offset indent
162 the incoming DNS message, which will be modified
164 the length of the DNS message, on input and output
166 the state of the operation
168 non-zero value signifies that a TSIG record must be present at this step
171 .Fn ns_verify_tcp_init
172 .Bl -tag -width "in_timesigned" -compact -offset indent
174 the (DST_KEY *) to verify the data
176 for a response, the signature contained in the query
178 the length of the query signature
180 the state of the operation, which this initializes
184 .Bl -tag -width "in_timesigned" -compact -offset indent
186 the incoming DNS message
188 the length of the DNS message
192 returns a pointer to the TSIG record if one is found, and NULL otherwise.
194 All other routines return 0 on success, modifying arguments when necessary.
199 return the following errors:
200 .Bl -tag -width "NS_TSIG_ERROR_NO_SPACE" -compact -offset indent
203 .It Dv (-ns_r_badkey)
204 The key was invalid, or the signing failed
205 .It Dv NS_TSIG_ERROR_NO_SPACE
206 the message buffer is too small.
212 return the following errors:
213 .Bl -tag -width "NS_TSIG_ERROR_NO_SPACE" -compact -offset indent
216 .It Dv NS_TSIG_ERROR_FORMERR
217 The message is malformed
218 .It Dv NS_TSIG_ERROR_NO_TSIG
219 The message does not contain a TSIG record
220 .It Dv NS_TSIG_ERROR_ID_MISMATCH
221 The TSIG original ID field does not match the message ID
222 .It Dv (-ns_r_badkey)
223 Verification failed due to an invalid key
224 .It Dv (-ns_r_badsig)
225 Verification failed due to an invalid signature
226 .It Dv (-ns_r_badtime)
227 Verification failed due to an invalid timestamp
229 Verification succeeded but the message had an error of BADKEY
231 Verification succeeded but the message had an error of BADSIG
233 Verification succeeded but the message had an error of BADTIME
239 Brian Wellington, TISLabs at Network Associates