Back to index

opendkim  2.6.2
Functions | Variables
t-setup.c File Reference
#include "build-config.h"
#include <sys/types.h>
#include <assert.h>
#include <stdio.h>
#include "../dkim.h"
#include "t-testdata.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Variables

static char t_setup_c_id [] = "@(#)$Id: t-setup.c,v 1.2 2009/12/08 19:14:26 cm-msk Exp $"

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 38 of file t-setup.c.

{
       char *p;
       FILE *f;

       printf("*** test setup\n");

       f = fopen(KEYFILE, "w");
       assert(f != NULL);

       fprintf(f, "%s.%s.%s ", SELECTOR, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEY; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTOR2, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEY2; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTOR, DKIM_DNSKEYNAME, DOMAIN2);
       for (p = PUBLICKEYNOS; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTORBADV, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEYBADV; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTOR256, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEY256; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTORBADH, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEYBADH; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTORNOK, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEYNOK; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTORBADK, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEYBADK; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTOREMPTYP, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEYEMPTYP; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTORNOP, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEYNOP; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", SELECTORCORRUPTP, DKIM_DNSKEYNAME, DOMAIN);
       for (p = PUBLICKEYCORRUPTP; *p != '\0'; p++)
       {
              if (*p != '\n')
                     putc(*p, f);
       }
       fprintf(f, "\n");

       fprintf(f, "%s.%s.%s ", DKIM_DNSPOLICYNAME, DKIM_DNSKEYNAME, DOMAIN2);
       fprintf(f, "dkim=all; t=s; r=%s\n", REPLYADDRESS);

       fprintf(f, "%s exists\n", DOMAIN2);

       fclose(f);

       return 0;
}

Variable Documentation

char t_setup_c_id[] = "@(#)$Id: t-setup.c,v 1.2 2009/12/08 19:14:26 cm-msk Exp $" [static]

Definition at line 9 of file t-setup.c.