Back to index

opendkim  2.6.6
Classes | Defines | Functions | Variables
dkim-rep.c File Reference
#include "build-config.h"
#include <sys/types.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <netdb.h>
#include <errno.h>
#include <openssl/md5.h>
#include "dkim-rep.h"

Go to the source code of this file.

Classes

struct  dkim_rep_query
struct  dkim_rep_handle
struct  dkim_rep_res_qh

Defines

#define MAXPACKET   8192
#define RES_UNC_T   unsigned char *
#define T_RRSIG   46
#define BUFRSZ   1024
#define DKIM_REP_DEFTIMEOUT   5
#define DKIM_REP_MAXERRORSTRING   256
#define DKIM_REP_MAXHOSTNAMELEN   256
#define FALSE   0
#define TRUE   1

Functions

static int dkim_rep_res_cancel (void *srv, void *qh)
static int dkim_rep_res_query (void *srv, int type, unsigned char *query, unsigned char *buf, size_t buflen, void **qh)
int dkim_rep_res_waitreply (void *srv, void *qh, struct timeval *to, size_t *bytes, int *error, int *dnssec)
static int dkim_rep_md5_to_string (void *md5, unsigned char *str, size_t len)
static _Bool dkim_rep_string_empty (char *str)
DKIM_REP dkim_rep_init (void *(*caller_mallocf)(void *closure, size_t nbytes), void(*caller_freef)(void *closure, void *p), void *closure)
void dkim_rep_close (DKIM_REP dr)
const u_char * dkim_rep_geterror (DKIM_REP dr)
void dkim_rep_setdomain (DKIM_REP dr, u_char *qroot)
DKIM_REP_STAT dkim_rep_query_start (DKIM_REP dr, u_char *user, u_char *domain, u_char *signdomain, void **qh)
DKIM_REP_STAT dkim_rep_query_check (DKIM_REP dr, void *qh, struct timeval *timeout, int *res)
DKIM_REP_STAT dkim_rep_query_cancel (DKIM_REP dr, void *qh)
void dkim_rep_settimeout (DKIM_REP dr, u_int timeout)
void dkim_rep_setcallbackint (DKIM_REP dr, u_int cbint)
void dkim_rep_setcallbackctx (DKIM_REP dr, void *ctx)
void dkim_rep_setdnscallback (DKIM_REP dr, void(*func)(const void *))
void * dkim_rep_dns_set_query_service (DKIM_REP dr, void *h)
void dkim_rep_dns_set_query_start (DKIM_REP dr, int(*func)(void *, int, unsigned char *, unsigned char *, size_t, void **))
void dkim_rep_dns_set_query_cancel (DKIM_REP dr, int(*func)(void *, void *))
void dkim_rep_dns_set_query_waitreply (DKIM_REP dr, int(*func)(void *, void *, struct timeval *, size_t *, int *, int *))

Variables

static char dkim_rep_c_id [] = "@(#)$Id: dkim-rep.c,v 1.13 2010/10/04 04:37:26 cm-msk Exp $"

Class Documentation

struct dkim_rep_query

Definition at line 68 of file dkim-rep.c.

Class Members
size_t drq_anslen
u_char drq_buf
void * drq_qh
struct dkim_rep_res_qh

Definition at line 106 of file dkim-rep.c.

Class Members
size_t rq_buflen
int rq_error

Define Documentation

#define BUFRSZ   1024

Definition at line 55 of file dkim-rep.c.

#define DKIM_REP_DEFTIMEOUT   5

Definition at line 56 of file dkim-rep.c.

#define DKIM_REP_MAXERRORSTRING   256

Definition at line 57 of file dkim-rep.c.

#define DKIM_REP_MAXHOSTNAMELEN   256

Definition at line 58 of file dkim-rep.c.

#define FALSE   0

Definition at line 61 of file dkim-rep.c.

#define MAXPACKET   8192

Definition at line 44 of file dkim-rep.c.

#define RES_UNC_T   unsigned char *

Definition at line 48 of file dkim-rep.c.

#define T_RRSIG   46

Definition at line 51 of file dkim-rep.c.

#define TRUE   1

Definition at line 64 of file dkim-rep.c.


Function Documentation

void dkim_rep_close ( DKIM_REP  dr)

Definition at line 411 of file dkim-rep.c.

{
       assert(dr != NULL);

       if (dr->dkim_rep_free != NULL)
              dr->dkim_rep_free(dr->dkim_rep_closure, dr);
       else
              free(dr);
}

Here is the caller graph for this function:

void dkim_rep_dns_set_query_cancel ( DKIM_REP  dr,
int(*)(void *, void *)  func 
)

Definition at line 1054 of file dkim-rep.c.

{
       assert(dr != NULL);

       dr->dkim_rep_dns_cancel = func;
}
void* dkim_rep_dns_set_query_service ( DKIM_REP  dr,
void *  h 
)

Definition at line 989 of file dkim-rep.c.

{
       void *old;

       assert(dr != NULL);

       old = dr->dkim_rep_dns_service;

       dr->dkim_rep_dns_service = h;

       return old;
}
void dkim_rep_dns_set_query_start ( DKIM_REP  dr,
int(*)(void *, int, unsigned char *, unsigned char *, size_t, void **)  func 
)

Definition at line 1025 of file dkim-rep.c.

{
       assert(dr != NULL);

       dr->dkim_rep_dns_start = func;
}
void dkim_rep_dns_set_query_waitreply ( DKIM_REP  dr,
int(*)(void *, void *, struct timeval *, size_t *, int *, int *)  func 
)

Definition at line 1084 of file dkim-rep.c.

{
       assert(dr != NULL);

       dr->dkim_rep_dns_waitreply = func;
}
const u_char* dkim_rep_geterror ( DKIM_REP  dr)

Definition at line 433 of file dkim-rep.c.

{
       assert(dr != NULL);

       return dr->dkim_rep_error;
}
DKIM_REP dkim_rep_init ( void *(*)(void *closure, size_t nbytes)  caller_mallocf,
void(*)(void *closure, void *p)  caller_freef,
void *  closure 
)

Definition at line 367 of file dkim-rep.c.

{
       DKIM_REP new;

       if (caller_mallocf == NULL)
       {
              new = (DKIM_REP) malloc(sizeof(struct dkim_rep_handle));
       }
       else
       {
              new = (DKIM_REP) caller_mallocf(closure,
                                              sizeof(struct dkim_rep_handle));
       }

       if (new == NULL)
              return NULL;

       memset(new, '\0', sizeof(struct dkim_rep_handle));

       new->dkim_rep_timeout = DKIM_REP_DEFTIMEOUT;
       new->dkim_rep_closure = closure;
       new->dkim_rep_malloc = caller_mallocf;
       new->dkim_rep_free = caller_freef;
       new->dkim_rep_dns_start = dkim_rep_res_query;
       new->dkim_rep_dns_waitreply = dkim_rep_res_waitreply;
       new->dkim_rep_dns_cancel = dkim_rep_res_cancel;
       dkim_rep_setdomain(new, DKIM_REP_DEFROOT);

       return new;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int dkim_rep_md5_to_string ( void *  md5,
unsigned char *  str,
size_t  len 
) [static]

Definition at line 294 of file dkim-rep.c.

{
       int c;
       int out = 0;
       unsigned char *cvt;
       unsigned char digest[MD5_DIGEST_LENGTH];

       assert(md5 != NULL);
       assert(str != NULL);

       if (len < 2 * MD5_DIGEST_LENGTH + 1)
              return -1;

#ifdef USE_GNUTLS
       (void) gnutls_hash_deinit(md5, digest);
#else /* USE_GNUTLS */
       MD5_Final(digest, md5);
#endif /* USE_GNUTLS */

       for (cvt = str, c = 0; c < MD5_DIGEST_LENGTH; c++)
       {
              snprintf((char *) cvt, len, "%02x", digest[c]);
              cvt += 2;
              out += 2;
              len -= 2;
       }

       return out;
}

Here is the caller graph for this function:

DKIM_REP_STAT dkim_rep_query_cancel ( DKIM_REP  dr,
void *  qh 
)

Definition at line 880 of file dkim-rep.c.

{
       struct dkim_rep_query *rq;

       assert(dr != NULL);
       assert(qh != NULL);

       rq = qh;

       dr->dkim_rep_dns_cancel(dr->dkim_rep_dns_service, rq->drq_qh);

       if (dr->dkim_rep_free != NULL)
              dr->dkim_rep_free(dr->dkim_rep_closure, rq);
       else
              free(rq);

       return DKIM_REP_STAT_OK;
}
DKIM_REP_STAT dkim_rep_query_check ( DKIM_REP  dr,
void *  qh,
struct timeval *  timeout,
int *  res 
)

Definition at line 606 of file dkim-rep.c.

{
       int out;
       int c;
       int dnserr;
       int status;
       int n;
       int type;
       int class;
       int qdcount;
       int ancount;
       struct dkim_rep_query *rq;
       char *e;
       char *eq;
       char *p;
       char *eob;
       char *ctx;
       u_char *cp;
       u_char *eom;
       u_char *found = NULL;
       HEADER hdr;
       u_char qname[DKIM_REP_MAXHOSTNAMELEN + 1];
       char buf[BUFRSZ + 1];

       assert(dr != NULL);
       assert(qh != NULL);

       rq = qh;

       status = dr->dkim_rep_dns_waitreply(dr->dkim_rep_dns_service,
                                           rq->drq_qh, timeout,
                                           &rq->drq_anslen, &dnserr, NULL);

       if (status == DKIM_REP_DNS_ERROR)
       {
              snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                       "error during query");
              return DKIM_REP_STAT_ERROR;
       }
       else if (status == DKIM_REP_DNS_NOREPLY)
       {
              return DKIM_REP_STAT_NOREPLY;
       }
       else if (status == DKIM_REP_DNS_EXPIRED)
       {
              return DKIM_REP_STAT_EXPIRED;
       }

       /* set up pointers */
       memcpy(&hdr, rq->drq_buf, sizeof hdr);
       cp = (u_char *) rq->drq_buf + HFIXEDSZ;
       eom = (u_char *) rq->drq_buf + rq->drq_anslen;

       /* skip over the name at the front of the answer */
       for (qdcount = ntohs((unsigned short) hdr.qdcount);
            qdcount > 0;
            qdcount--)
       {
              /* copy it first */
              (void) dn_expand((unsigned char *) rq->drq_buf, eom, cp,
                               (char *) qname, sizeof qname);
 
              if ((n = dn_skipname(cp, eom)) < 0)
              {
                     snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                              "'%s' reply corrupt", qname);
                     return DKIM_REP_STAT_ERROR;
              }
              cp += n;

              /* extract the type and class */
              if (cp + INT16SZ + INT16SZ > eom)
              {
                     snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                              "'%s' reply corrupt", qname);
                     return DKIM_REP_STAT_ERROR;
              }
              GETSHORT(type, cp);
              GETSHORT(class, cp);
       }

       if (type != T_TXT || class != C_IN)
       {
              snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                       "'%s' unexpected reply type/class", qname);
              return DKIM_REP_STAT_ERROR;
       }

       if (hdr.rcode == NXDOMAIN)
              return DKIM_REP_STAT_NOTFOUND;

       /* get the answer count */
       ancount = ntohs((unsigned short) hdr.ancount);
       if (ancount == 0)
              return DKIM_REP_STAT_NOTFOUND;

       /*
       **  Extract the data from the first TXT answer.
       */

       while (--ancount >= 0 && cp < eom)
       {
              /* grab the label, even though we know what we asked... */
              if ((n = dn_expand((unsigned char *) rq->drq_buf, eom, cp,
                                 (RES_UNC_T) qname, sizeof qname)) < 0)
              {
                     snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                              "'%s' reply corrupt", qname);
                     return DKIM_REP_STAT_ERROR;
              }
              /* ...and move past it */
              cp += n;

              /* extract the type and class */
              if (cp + INT16SZ + INT16SZ > eom)
              {
                     snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                              "'%s' reply corrupt", qname);
                     return DKIM_REP_STAT_ERROR;
              }

              GETSHORT(type, cp);
              GETSHORT(class, cp);

              /* skip the TTL */
              cp += INT32SZ;

              /* skip CNAME if found; assume it was resolved */
              if (type == T_CNAME)
              {
                     char chost[DKIM_REP_MAXHOSTNAMELEN + 1];

                     n = dn_expand((u_char *) rq->drq_buf, eom, cp,
                                   chost, DKIM_REP_MAXHOSTNAMELEN);
                     cp += n;
                     continue;
              }
              else if (type == T_RRSIG)
              {
                     /* get payload length */
                     if (cp + INT16SZ > eom)
                     {
                            snprintf(dr->dkim_rep_error,
                                     sizeof dr->dkim_rep_error,
                                     "'%s' reply corrupt", qname);
                            return DKIM_REP_STAT_ERROR;
                     }
                     GETSHORT(n, cp);

                     cp += n;

                     continue;
              }
              else if (type != T_TXT)
              {
                     snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                              "'%s' unexpected reply type/class", qname);
                     return DKIM_REP_STAT_ERROR;
              }

              if (found != NULL)
              {
                     snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                              "multiple replies for '%s'", qname);
                     return DKIM_REP_STAT_ERROR;
              }

              /* remember where this one started */
              found = cp;

              /* get payload length */
              if (cp + INT16SZ > eom)
              {
                     snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                              "'%s' reply corrupt", qname);
                     return DKIM_REP_STAT_ERROR;
              }
              GETSHORT(n, cp);

              /* move forward for now */
              cp += n;
       }

       /* if ancount went below 0, there were no good records */
       if (found == NULL)
       {
              snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                       "'%s' reply was unresolved CNAME", qname);
              return DKIM_REP_STAT_ERROR;
       }

       /* come back to the one we found */
       cp = found;

       /* get payload length */
       if (cp + INT16SZ > eom)
       {
              snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                       "'%s' reply corrupt", qname);
              return DKIM_REP_STAT_ERROR;
       }

       GETSHORT(n, cp);

       if (cp + n > eom)
       {
              snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                       "'%s' reply corrupt", qname);
              return DKIM_REP_STAT_ERROR;
       }

       /* extract the payload */
       memset(buf, '\0', sizeof buf);
       p = buf;
       eob = buf + sizeof buf - 1;
       while (n > 0 && p < eob)
       {
              c = *cp++;
              n--;
              while (c > 0 && p < eob)
              {
                     *p++ = *cp++;
                     c--;
                     n--;
              }
       }

       /* parse the result and return it */
       out = 0;
       for (p = strtok_r(buf, ";", &ctx);
            p != NULL;
            p = strtok_r(NULL, ";", &ctx))
       {
              eq = strchr(p, '=');
              if (eq == NULL)
                     continue;

              if (dkim_rep_string_empty(eq + 1))
                     continue;

              *eq = '\0';

              if (strcmp(p, "rep") != 0)
                     continue;            /* XXX -- other values? */

              errno = 0;
              out = (int) strtol(eq + 1, &e, 10);
              if (*e != '\0' || errno == EINVAL)
              {
                     snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                              "invalid reputation '%s'", eq + 1);
                     return DKIM_REP_STAT_SYNTAX;
              }

              *res = out;
              break;
       }

       return DKIM_REP_STAT_FOUND;
}

Here is the call graph for this function:

Here is the caller graph for this function:

DKIM_REP_STAT dkim_rep_query_start ( DKIM_REP  dr,
u_char *  user,
u_char *  domain,
u_char *  signdomain,
void **  qh 
)

Definition at line 478 of file dkim-rep.c.

{
       int out;
       size_t anslen;
       int qdcount;
       int ancount;
       int n;
       int type;
       int class;
       int status;
#ifdef QUERY_CACHE
       uint32_t ttl;
#endif /* QUERY_CACHE */
       int error;
       struct dkim_rep_query *q;
       void *rq;
       char *eq;
       char *e;
#ifdef USE_GNUTLS
       gnutls_hash_hd_t md5_user;
       gnutls_hash_hd_t md5_domain;
       gnutls_hash_hd_t md5_signdomain;
#else /* USE_GNUTLS */
       MD5_CTX md5_user;
       MD5_CTX md5_domain;
       MD5_CTX md5_signdomain;
#endif /* USE_GNUTLS */
       struct timeval timeout;
       unsigned char md5_user_str[MD5_DIGEST_LENGTH * 2 + 1];
       unsigned char md5_domain_str[MD5_DIGEST_LENGTH * 2 + 1];
       unsigned char md5_signdomain_str[MD5_DIGEST_LENGTH * 2 + 1];
       unsigned char ansbuf[MAXPACKET];
       char query[DKIM_REP_MAXHOSTNAMELEN + 1];
       char qname[DKIM_REP_MAXHOSTNAMELEN + 1];

       assert(dr != NULL);
       assert(user != NULL);
       assert(domain != NULL);
       assert(signdomain != NULL);
       assert(qh != NULL);

       q = (struct dkim_rep_query *) malloc(sizeof(struct dkim_rep_query));
       if (q == NULL)
              return DKIM_REP_STAT_ERROR;

       /* hash the values */
       memset(md5_user_str, '\0', sizeof md5_user_str);
#ifdef USE_GNUTLS
       if (gnutls_hash_init(&md5_user, GNUTLS_DIG_MD5) == 0)
              gnutls_hash(md5_user, (void *) user, strlen((char *) user));
#else /* USE_GNUTLS */
       MD5_Init(&md5_user);
       MD5_Update(&md5_user, (void *) user, strlen((char *) user));
#endif /* USE_GNUTLS */
       (void) dkim_rep_md5_to_string(&md5_user, md5_user_str,
                                     sizeof md5_user_str);

       memset(md5_domain_str, '\0', sizeof md5_domain_str);
#ifdef USE_GNUTLS
       if (gnutls_hash_init(&md5_domain, GNUTLS_DIG_MD5) == 0)
       {
              gnutls_hash(md5_domain, (void *) domain,
                          strlen((char *) domain));
       }
#else /* USE_GNUTLS */
       MD5_Init(&md5_domain);
       MD5_Update(&md5_domain, (void *) domain, strlen((char *) domain));
#endif /* USE_GNUTLS */
       (void) dkim_rep_md5_to_string(&md5_domain, md5_domain_str,
                                     sizeof md5_domain_str);

       memset(md5_signdomain_str, '\0', sizeof md5_signdomain_str);
#ifdef USE_GNUTLS
       if (gnutls_hash_init(&md5_signdomain, GNUTLS_DIG_MD5) == 0)
       {
              gnutls_hash(md5_signdomain, (void *) signdomain,
                          strlen((char *) signdomain));
       }
#else /* USE_GNUTLS */
       MD5_Init(&md5_signdomain);
       MD5_Update(&md5_signdomain, (void *) signdomain, strlen(signdomain));
#endif /* USE_GNUTLS */
       (void) dkim_rep_md5_to_string(&md5_signdomain, md5_signdomain_str,
                                     sizeof md5_signdomain_str);

       /* construct the query */
       snprintf(query, sizeof query, "%s.%s.%s.%s", md5_user_str,
                md5_domain_str, md5_signdomain_str, dr->dkim_rep_qroot);

       /* start the query */
       timeout.tv_sec = dr->dkim_rep_timeout;
       timeout.tv_usec = 0;

       anslen = sizeof ansbuf;

       status = dr->dkim_rep_dns_start(dr->dkim_rep_dns_service, T_TXT,
                                       query, q->drq_buf, sizeof q->drq_buf,
                                       &rq);

       if (status != 0)
       {
              snprintf(dr->dkim_rep_error, sizeof dr->dkim_rep_error,
                       "DNS query for '%s' failed", query);
              return DKIM_REP_STAT_ERROR;
       }

       q->drq_qh = rq;

       *qh = q;

       return DKIM_REP_STAT_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int dkim_rep_res_cancel ( void *  srv,
void *  qh 
) [static]

Definition at line 129 of file dkim-rep.c.

{
       if (qh != NULL)
              free(qh);

       return 0;
}

Here is the caller graph for this function:

static int dkim_rep_res_query ( void *  srv,
int  type,
unsigned char *  query,
unsigned char *  buf,
size_t  buflen,
void **  qh 
) [static]

Definition at line 159 of file dkim-rep.c.

{
       int n;
       int ret;
       struct dkim_rep_res_qh *rq;
       unsigned char qbuf[HFIXEDSZ + MAXPACKET];
#ifdef HAVE_RES_NINIT
       struct __res_state statp;
#endif /* HAVE_RES_NINIT */

#ifdef HAVE_RES_NINIT
       memset(&statp, '\0', sizeof statp);
       res_ninit(&statp);
#endif /* HAVE_RES_NINIT */

#ifdef HAVE_RES_NINIT
       n = res_nmkquery(&statp, QUERY, (char *) query, C_IN, type, NULL, 0,
                        NULL, qbuf, sizeof qbuf);
#else /* HAVE_RES_NINIT */
       n = res_mkquery(QUERY, (char *) query, C_IN, type, NULL, 0, NULL, qbuf,
                       sizeof qbuf);
#endif /* HAVE_RES_NINIT */
       if (n == (size_t) -1)
       {
#ifdef HAVE_RES_NINIT
              res_nclose(&statp);
#endif /* HAVE_RES_NINIT */
              return DKIM_REP_DNS_ERROR;
       }

#ifdef HAVE_RES_NINIT
       ret = res_nsend(&statp, qbuf, n, buf, buflen);
#else /* HAVE_RES_NINIT */
       ret = res_send(qbuf, n, buf, buflen);
#endif /* HAVE_RES_NINIT */
       if (ret == -1)
       {
#ifdef HAVE_RES_NINIT
              res_nclose(&statp);
#endif /* HAVE_RES_NINIT */
              return DKIM_REP_DNS_ERROR;
       }

#ifdef HAVE_RES_NINIT
       res_nclose(&statp);
#endif /* HAVE_RES_NINIT */

       rq = (struct dkim_rep_res_qh *) malloc(sizeof *rq);
       if (rq == NULL)
              return DKIM_REP_DNS_ERROR;

       if (ret == -1)
       {
              rq->rq_error = errno;
              rq->rq_buflen = 0;
       }
       else
       {
              rq->rq_error = 0;
              rq->rq_buflen = (size_t) ret;
       }

       *qh = (void *) rq;

       return DKIM_REP_DNS_SUCCESS;
}

Here is the caller graph for this function:

int dkim_rep_res_waitreply ( void *  srv,
void *  qh,
struct timeval *  to,
size_t *  bytes,
int *  error,
int *  dnssec 
)

Definition at line 246 of file dkim-rep.c.

{
       struct dkim_rep_res_qh *rq;

       assert(qh != NULL);

       rq = qh;

       if (bytes != NULL)
              *bytes = rq->rq_buflen;
       if (error != NULL)
              *error = rq->rq_error;

       return DKIM_REP_DNS_SUCCESS;
}

Here is the caller graph for this function:

void dkim_rep_setcallbackctx ( DKIM_REP  dr,
void *  ctx 
)

Definition at line 949 of file dkim-rep.c.

{
       assert(dr != NULL);

       dr->dkim_rep_cbctx = ctx;
}
void dkim_rep_setcallbackint ( DKIM_REP  dr,
u_int  cbint 
)

Definition at line 930 of file dkim-rep.c.

{
       assert(dr != NULL);

       dr->dkim_rep_cbint = cbint;
}
void dkim_rep_setdnscallback ( DKIM_REP  dr,
void(*)(const void *)  func 
)

Definition at line 968 of file dkim-rep.c.

{
       assert(dr != NULL);

       dr->dkim_rep_dns_callback = func;
}
void dkim_rep_setdomain ( DKIM_REP  dr,
u_char *  qroot 
)

Definition at line 452 of file dkim-rep.c.

{
       assert(dr != NULL);
       assert(qroot != NULL);

       strncpy(dr->dkim_rep_qroot, qroot, sizeof dr->dkim_rep_qroot);
       dr->dkim_rep_qroot[sizeof dr->dkim_rep_qroot - 1] = '\0';
}

Here is the caller graph for this function:

void dkim_rep_settimeout ( DKIM_REP  dr,
u_int  timeout 
)

Definition at line 911 of file dkim-rep.c.

{
       assert(dr != NULL);

       dr->dkim_rep_timeout = timeout;
}
static _Bool dkim_rep_string_empty ( char *  str) [static]

Definition at line 335 of file dkim-rep.c.

{
       char *p;

       assert(str != NULL);

       for (p = str; *p != '\0'; p++)
       {
              if (!isascii(*p) || !isspace(*p))
                     return FALSE;
       }

       return TRUE;
}

Here is the caller graph for this function:


Variable Documentation

char dkim_rep_c_id[] = "@(#)$Id: dkim-rep.c,v 1.13 2010/10/04 04:37:26 cm-msk Exp $" [static]

Definition at line 9 of file dkim-rep.c.