Back to index

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

Go to the source code of this file.

Defines

#define MAXHEADER   4096
#define BADKEY

Functions

int main (int argc, char **argv)

Variables

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

Define Documentation

#define BADKEY
Value:
"-----BEGIN RSA PRIVATE KEY-----" \
       "MIICXQIBAAKBgQC4GUGr*d/6SFNzVLYpphnRd0QPGKz2uWnV65RAxa1Pw352Bqiz" \
       "qiKOBjgYGzj8pJQSs8tOvv/2k6jpI809RnESqOFgF0gu3UJbNnu3+cd8k/kiQj+q" \
       "4cKKRpAT92ccxc7svhCNgN1sBGmROYZuysG3Vu3Dyc079gSLtnSrgXb+gQIDAQAB" \
       "AoGAemlI0opm1Kvs2T4VliH8/tvX5FXbBH8LEZQAUwVeFTB/UQlieXyCV39pIxZO" \
       "0Sa50qm8YNL9rb5HTSZiHQFOwyAKNqS4m/7JCsbuH4gQkPgPF561BHNL9oKfYgJq" \
       "9P4kEFfDTBoXKBMxwWtT7AKV8dYvCa3vYzPQ/1BnqQdw2zECQQDyscdgR9Ih59PQ" \
       "b72ddibdsxS65uXS2vzYLe7SKl+4R5JgJzw0M6DTAnoYFf6JAsKGZM15PCC0E16t" \
       "RRo47U9VAkEAwjEVrlQ0/8yPACbDggDJg/Zz/uRu1wK0zjqj4vKjleubaX4SEvj7" \
       "r6xxZm9hC1pMJAC9y3bbkbgCRBjXfyY6fQJBANe5aq2MaZ41wTOPf45NjbKXEiAo" \
       "SbUpboKCIbyyaa8V/2h0t7D3C0dE9l4efsguqdZoF7Rh2/f1F70QpYRgfJkCQQCH" \
       "oRrAeGXP50JVW72fNgeJGH/pnghgOa6of0JpxwhENJuGMZxUDfxTtUA6yD3iXP3j" \
       "A3WL/wbaHsfOYf9Y+g1NAkAGLhx67Ah+uBNK4Xvfz0YPGINX20m+CMsxAw7FOaNv" \
       "IW2oWFfZCB4APkIis79Ql45AHpavwx5XodBMzZwJUvlL\n" \
       "-----END RSA PRIVATE KEY-----\n"

Definition at line 30 of file t-test145.c.

#define MAXHEADER   4096

Definition at line 28 of file t-test145.c.


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 57 of file t-test145.c.

{
#ifdef TEST_KEEP_FILES
       u_int flags;
#endif /* TEST_KEEP_FILES */
       DKIM_STAT status;
       uint64_t fixed_time;
       DKIM *dkim;
       DKIM_LIB *lib;
       dkim_sigkey_t key;
       unsigned char hdr[MAXHEADER + 1];

       printf("*** invalid key preload test\n");

#ifdef USE_GNUTLS
       (void) gnutls_global_init();
#endif /* USE_GNUTLS */

       /* instantiate the library */
       lib = dkim_init(NULL, NULL);
       assert(lib != NULL);

#ifdef TEST_KEEP_FILES
       /* set flags */
       flags = (DKIM_LIBFLAGS_TMPFILES|DKIM_LIBFLAGS_KEEPFILES);
       (void) dkim_options(lib, DKIM_OP_SETOPT, DKIM_OPTS_FLAGS, &flags,
                           sizeof flags);
#endif /* TEST_KEEP_FILES */

       key = BADKEY;

       dkim = dkim_sign(lib, JOBID, NULL, key, SELECTOR, DOMAIN,
                        DKIM_CANON_RELAXED, DKIM_CANON_RELAXED,
                        DKIM_SIGN_RSASHA1, -1L, &status);
       assert(dkim != NULL);

       status = dkim_privkey_load(dkim);
       assert(status == DKIM_STAT_NORESOURCE);

       status = dkim_free(dkim);
       assert(status == DKIM_STAT_OK);

       dkim_close(lib);

       return 0;
}

Here is the call graph for this function:


Variable Documentation

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

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