OpenDNSSEC-signer  1.4.5
Data Structures | Macros | Typedefs | Functions | Variables
tsig.c File Reference
#include "config.h"
#include "compat.h"
#include "shared/duration.h"
#include "shared/file.h"
#include "shared/log.h"
#include "shared/status.h"
#include "shared/util.h"
#include "wire/buffer.h"
#include "wire/tsig.h"
#include "wire/tsig-openssl.h"
#include <arpa/inet.h>
Include dependency graph for tsig.c:

Go to the source code of this file.

Data Structures

struct  tsig_key_table_struct
struct  tsig_algo_table_struct

Macros

#define TSIG_SIGNED_TIME_FUDGE   300

Typedefs

typedef struct
tsig_key_table_struct 
tsig_key_table_type
typedef struct
tsig_algo_table_struct 
tsig_algo_table_type

Functions

void tsig_handler_add_key (tsig_key_type *key)
void tsig_handler_add_algo (tsig_algo_type *algo)
ods_status tsig_handler_init (allocator_type *allocator)
void tsig_handler_cleanup (void)
tsig_key_typetsig_key_create (allocator_type *allocator, tsig_type *tsig)
tsig_typetsig_create (allocator_type *allocator, char *name, char *algo, char *secret)
tsig_typetsig_lookup_by_name (tsig_type *tsig, const char *name)
tsig_algo_typetsig_lookup_algo (const char *name)
tsig_rr_typetsig_rr_create (allocator_type *allocator)
void tsig_rr_reset (tsig_rr_type *trr, tsig_algo_type *algo, tsig_key_type *key)
int tsig_rr_parse (tsig_rr_type *trr, buffer_type *buffer)
int tsig_rr_find (tsig_rr_type *trr, buffer_type *buffer)
int tsig_rr_lookup (tsig_rr_type *trr)
void tsig_rr_prepare (tsig_rr_type *trr)
void tsig_rr_update (tsig_rr_type *trr, buffer_type *buffer, size_t length)
void tsig_rr_sign (tsig_rr_type *trr)
int tsig_rr_verify (tsig_rr_type *trr)
void tsig_rr_append (tsig_rr_type *trr, buffer_type *buffer)
size_t tsig_rr_reserved_space (tsig_rr_type *trr)
void tsig_rr_error (tsig_rr_type *trr)
const char * tsig_status2str (tsig_status status)
const char * tsig_strerror (uint16_t error)
void tsig_rr_free (tsig_rr_type *trr)
void tsig_rr_cleanup (tsig_rr_type *trr)
void tsig_cleanup (tsig_type *tsig, allocator_type *allocator)

Variables

tsig_lookup_table tsig_supported_algorithms []

Macro Definition Documentation

#define TSIG_SIGNED_TIME_FUDGE   300

TSIG.

Definition at line 47 of file tsig.c.

Referenced by tsig_rr_sign().

Typedef Documentation

algorithm table

Definition at line 60 of file tsig.c.

key table

Definition at line 53 of file tsig.c.

Function Documentation

void tsig_cleanup ( tsig_type tsig,
allocator_type allocator 
)
tsig_type* tsig_create ( allocator_type allocator,
char *  name,
char *  algo,
char *  secret 
)
void tsig_handler_add_algo ( tsig_algo_type algo)

Add algorithm to TSIG handler.

Definition at line 108 of file tsig.c.

References tsig_algo_table_struct::algorithm, allocator_alloc(), tsig_algo_struct::max_digest_size, and tsig_algo_table_struct::next.

void tsig_handler_add_key ( tsig_key_type key)

Add key to TSIG handler.

Definition at line 86 of file tsig.c.

References allocator_alloc(), tsig_key_table_struct::key, and tsig_key_table_struct::next.

Referenced by tsig_key_create().

void tsig_handler_cleanup ( void  )
ods_status tsig_handler_init ( allocator_type allocator)

Initialize TSIG handler.

Definition at line 133 of file tsig.c.

References ods_log_debug(), ODS_STATUS_ERR, and ODS_STATUS_OK.

tsig_key_type* tsig_key_create ( allocator_type allocator,
tsig_type tsig 
)
tsig_algo_type* tsig_lookup_algo ( const char *  name)

Lookup TSIG algorithm by name.

Definition at line 288 of file tsig.c.

References tsig_algo_table_struct::algorithm, tsig_algo_table_struct::next, ods_strlowercmp(), and tsig_algo_struct::txt_name.

tsig_type* tsig_lookup_by_name ( tsig_type tsig,
const char *  name 
)

Lookup TSIG by key name.

Definition at line 266 of file tsig.c.

References tsig_struct::name, tsig_struct::next, and ods_strlowercmp().

Referenced by acl_create().

void tsig_rr_append ( tsig_rr_type trr,
buffer_type buffer 
)
void tsig_rr_cleanup ( tsig_rr_type trr)

Cleanup TSIG RR.

Definition at line 883 of file tsig.c.

References tsig_rr_struct::allocator, allocator_deallocate(), and tsig_rr_free().

Referenced by notify_cleanup(), query_cleanup(), and xfrd_cleanup().

tsig_rr_type* tsig_rr_create ( allocator_type allocator)
void tsig_rr_error ( tsig_rr_type trr)

Reply with error TSIG RR.

Definition at line 791 of file tsig.c.

References tsig_rr_struct::mac_data, and tsig_rr_struct::mac_size.

Referenced by query_add_optional().

int tsig_rr_find ( tsig_rr_type trr,
buffer_type buffer 
)
void tsig_rr_free ( tsig_rr_type trr)
int tsig_rr_lookup ( tsig_rr_type trr)
int tsig_rr_parse ( tsig_rr_type trr,
buffer_type buffer 
)
void tsig_rr_prepare ( tsig_rr_type trr)
size_t tsig_rr_reserved_space ( tsig_rr_type trr)
void tsig_rr_reset ( tsig_rr_type trr,
tsig_algo_type algo,
tsig_key_type key 
)
void tsig_rr_sign ( tsig_rr_type trr)
void tsig_rr_update ( tsig_rr_type trr,
buffer_type buffer,
size_t  length 
)
int tsig_rr_verify ( tsig_rr_type trr)
const char* tsig_status2str ( tsig_status  status)

Print TSIG status.

Definition at line 809 of file tsig.c.

References TSIG_ERROR, TSIG_NOT_PRESENT, and TSIG_OK.

Referenced by query_process().

const char* tsig_strerror ( uint16_t  error)

Get human readable TSIG error code.

Definition at line 828 of file tsig.c.

References TSIG_ERROR_BADKEY, TSIG_ERROR_BADSIG, and TSIG_ERROR_BADTIME.

Variable Documentation

tsig_lookup_table tsig_supported_algorithms[]
Initial value:
{
{ TSIG_HMAC_MD5, "hmac-md5" },
{ 0, NULL }
}

lookup algorithm table

Definition at line 69 of file tsig.c.