the length of the signature buffer on input, the signature length on output

ns_sign_tcp()

msg

the incoming DNS message, which will be modified

msglen

the length of the DNS message, on input and output

msgsize

the size of the buffer containing the DNS message on input

error

the value to be placed in the TSIG error field

state

the state of the operation

done

non-zero value signifies that this is the last packet

ns_sign_tcp_init()

k

the (DST_KEY *) to sign the data

querysig

for a response, the signature contained in the query

querysiglen

the length of the query signature

state

the state of the operation, which this initializes

ns_verify()

msg

the incoming DNS message, which will be modified

msglen

the length of the DNS message, on input and output

k

the (DST_KEY *) to sign the data

querysig

for a response, the signature contained in the query

querysiglen

the length of the query signature

sig

a buffer to be filled with the signature contained

siglen

the length of the signature buffer on input, the signature length on output

nostrip

non-zero value means that the TSIG is left intact

ns_verify_tcp()

msg

the incoming DNS message, which will be modified

msglen

the length of the DNS message, on input and output

state

the state of the operation

required

non-zero value signifies that a TSIG record must be present at this step

ns_verify_tcp_init()

k

the (DST_KEY *) to verify the dat

querysig

for a response, the signature contained in the quer

querysiglen

the length of the query signature

state

the state of the operation, which this initializes

ns_find_tsig()

msg

the incoming DNS messag

eom

the length of the DNS message

Description

The TSIG functions are used to implement transaction/request security of DNS messages.

The ns_sign() and ns_verify() functions are the basic routines. The ns_sign_tcp() and
ns_verify_tcp() functions are used to sign/verify TCP messages that may be split
into multiple packets, such as zone transfers. The ns_sign_tcp_init() and ns_verify_tcp_init() functions initialize
the state structure necessary for TCP operations. The ns_find_tsig() function locates the
TSIG record in a message if one is present.

Return Values

The ns_find_tsig() function returns a pointer to the TSIG record if one
is found, and NULL otherwise.

All other functions return 0 on success, modifying arguments when necessary.

The ns_sign() and ns_sign_tcp() functions return the following values:

-1

bad input data

-ns_r_badkey

The key was invalid or the signing failed.

NS_TSIG_ERROR_NO_SPACE

The message buffer is too small.

The ns_verify() and ns_verify_tcp() functions return the following values: