tsig.h
Go to the documentation of this file.
1 /*
2  * tsig.h -- defines for TSIG [RFC2845]
3  *
4  * Copyright (c) 2005-2008, NLnet Labs. All rights reserved.
5  *
6  * See LICENSE for the license.
7  */
8 
9 #ifndef LDNS_TSIG_H
10 #define LDNS_TSIG_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
27 {
28  const char *algorithm;
29  const char *keyname;
30  const char *keydata;
31  /* XXX More eventually. */
33 
34 const char *ldns_tsig_algorithm(const ldns_tsig_credentials *);
35 const char *ldns_tsig_keyname(const ldns_tsig_credentials *);
36 const char *ldns_tsig_keydata(const ldns_tsig_credentials *);
39 
51 bool ldns_pkt_tsig_verify(ldns_pkt *pkt, const uint8_t *wire, size_t wire_size, const char *key_name, const char *key_data, const ldns_rdf *mac);
52 
66 bool ldns_pkt_tsig_verify_next(ldns_pkt *pkt, const uint8_t *wire, size_t wire_size, const char *key_name, const char *key_data, const ldns_rdf *mac,
67  int tsig_timers_only);
68 
79 ldns_status ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge,
80  const char *algorithm_name, const ldns_rdf *query_mac);
81 
94 ldns_status ldns_pkt_tsig_sign_next(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge,
95  const char *algorithm_name, const ldns_rdf *query_mac, int tsig_timers_only);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* LDNS_TSIG_H */
enum ldns_enum_status ldns_status
Definition: error.h:148
DNS packet.
Definition: packet.h:235
Resource record data field.
Definition: rdata.h:197
Contains credentials for TSIG.
Definition: tsig.h:27
const char * keydata
Definition: tsig.h:30
const char * algorithm
Definition: tsig.h:28
const char * keyname
Definition: tsig.h:29
char * ldns_tsig_keyname_clone(const ldns_tsig_credentials *)
Definition: tsig.c:40
const char * ldns_tsig_keydata(const ldns_tsig_credentials *)
Definition: tsig.c:34
bool ldns_pkt_tsig_verify(ldns_pkt *pkt, const uint8_t *wire, size_t wire_size, const char *key_name, const char *key_data, const ldns_rdf *mac)
verifies the tsig rr for the given packet and key.
Definition: tsig.c:288
struct ldns_tsig_credentials_struct ldns_tsig_credentials
Contains credentials for TSIG.
ldns_status ldns_pkt_tsig_sign_next(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge, const char *algorithm_name, const ldns_rdf *query_mac, int tsig_timers_only)
creates a tsig rr for the given packet and key.
Definition: tsig.c:383
const char * ldns_tsig_keyname(const ldns_tsig_credentials *)
Definition: tsig.c:28
bool ldns_pkt_tsig_verify_next(ldns_pkt *pkt, const uint8_t *wire, size_t wire_size, const char *key_name, const char *key_data, const ldns_rdf *mac, int tsig_timers_only)
verifies the tsig rr for the given packet and key.
Definition: tsig.c:295
const char * ldns_tsig_algorithm(const ldns_tsig_credentials *)
Definition: tsig.c:22
char * ldns_tsig_keydata_clone(const ldns_tsig_credentials *)
Definition: tsig.c:46
ldns_status ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge, const char *algorithm_name, const ldns_rdf *query_mac)
creates a tsig rr for the given packet and key.
Definition: tsig.c:376