3 .\" Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
5 .\" Permission to use, copy, modify, and/or distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 .\" PERFORMANCE OF THIS SOFTWARE.
17 .\" Id: tsig.3,v 1.3 2009/01/22 23:49:23 tbox Exp
21 .Dt TSIG @SYSCALL_EXT@
25 .Nm ns_sign_tcp_init ,
28 .Nm ns_verify_tcp_init ,
39 .Fa "const u_char *querysig"
43 .Fa "time_t in_timesigned"
46 .Fn ns_sign_tcp "u_char *msg" "int *msglen" "int msgsize" "int error" \
47 "ns_tcp_tsig_state *state" "int done"
49 .Fn ns_sign_tcp_init "void *k" "const u_char *querysig" "int querysiglen" \
50 "ns_tcp_tsig_state *state"
56 .Fa "const u_char *querysig"
60 .Fa "time_t in_timesigned"
64 .Fn ns_verify_tcp "u_char *msg" "int *msglen" "ns_tcp_tsig_state *state" \
67 .Fn ns_verify_tcp_init "void *k" "const u_char *querysig" "int querysiglen" \
68 "ns_tcp_tsig_state *state"
70 .Fn ns_find_tsig "u_char *msg" "u_char *eom"
72 The TSIG routines are used to implement transaction/request security of
78 are the basic routines.
82 are used to sign/verify TCP messages that may be split into multiple packets,
83 such as zone transfers, and
84 .Fn ns_sign_tcp_init ,
85 .Fn ns_verify_tcp_init
86 initialize the state structure necessary for TCP operations.
88 locates the TSIG record in a message, if one is present.
91 .Bl -tag -width "in_timesigned" -compact -offset indent
93 the incoming DNS message, which will be modified
95 the length of the DNS message, on input and output
97 the size of the buffer containing the DNS message on input
99 the value to be placed in the TSIG error field
101 the (DST_KEY *) to sign the data
103 for a response, the signature contained in the query
105 the length of the query signature
107 a buffer to be filled with the generated signature
109 the length of the signature buffer on input, the signature length on output
113 .Bl -tag -width "in_timesigned" -compact -offset indent
115 the incoming DNS message, which will be modified
117 the length of the DNS message, on input and output
119 the size of the buffer containing the DNS message on input
121 the value to be placed in the TSIG error field
123 the state of the operation
125 non-zero value signifies that this is the last packet
129 .Bl -tag -width "in_timesigned" -compact -offset indent
131 the (DST_KEY *) to sign the data
133 for a response, the signature contained in the query
135 the length of the query signature
137 the state of the operation, which this initializes
141 .Bl -tag -width "in_timesigned" -compact -offset indent
143 the incoming DNS message, which will be modified
145 the length of the DNS message, on input and output
147 the (DST_KEY *) to sign the data
149 for a response, the signature contained in the query
151 the length of the query signature
153 a buffer to be filled with the signature contained
155 the length of the signature buffer on input, the signature length on output
157 non-zero value means that the TSIG is left intact
161 .Bl -tag -width "in_timesigned" -compact -offset indent
163 the incoming DNS message, which will be modified
165 the length of the DNS message, on input and output
167 the state of the operation
169 non-zero value signifies that a TSIG record must be present at this step
172 .Fn ns_verify_tcp_init
173 .Bl -tag -width "in_timesigned" -compact -offset indent
175 the (DST_KEY *) to verify the data
177 for a response, the signature contained in the query
179 the length of the query signature
181 the state of the operation, which this initializes
185 .Bl -tag -width "in_timesigned" -compact -offset indent
187 the incoming DNS message
189 the length of the DNS message
193 returns a pointer to the TSIG record if one is found, and NULL otherwise.
195 All other routines return 0 on success, modifying arguments when necessary.
200 return the following errors:
201 .Bl -tag -width "NS_TSIG_ERROR_NO_SPACE" -compact -offset indent
204 .It Dv (-ns_r_badkey)
205 The key was invalid, or the signing failed
206 .It Dv NS_TSIG_ERROR_NO_SPACE
207 the message buffer is too small.
213 return the following errors:
214 .Bl -tag -width "NS_TSIG_ERROR_NO_SPACE" -compact -offset indent
217 .It Dv NS_TSIG_ERROR_FORMERR
218 The message is malformed
219 .It Dv NS_TSIG_ERROR_NO_TSIG
220 The message does not contain a TSIG record
221 .It Dv NS_TSIG_ERROR_ID_MISMATCH
222 The TSIG original ID field does not match the message ID
223 .It Dv (-ns_r_badkey)
224 Verification failed due to an invalid key
225 .It Dv (-ns_r_badsig)
226 Verification failed due to an invalid signature
227 .It Dv (-ns_r_badtime)
228 Verification failed due to an invalid timestamp
230 Verification succeeded but the message had an error of BADKEY
232 Verification succeeded but the message had an error of BADSIG
234 Verification succeeded but the message had an error of BADTIME
240 Brian Wellington, TISLabs at Network Associates