t_dst.c revision 8d0470dbdb0953796a4ccad60db635bcb6bc9086
/*
* Copyright (C) 1999 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <config.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> /* XXX */
#include <isc/assertions.h>
static void t1(void);
/*
* adapted from the original dst_test.c program
*/
static void
return;
}
continue;
continue;
}
}
}
return;
}
static void
char *data = "This is some data";
unsigned char sig[512];
if (ret != exp_result) {
t_info("dst_sign(%d) returned (%s) expected (%s)\n",
++*nfails;
return;
}
if (ret != exp_result) {
t_info("dst_verify(%d) returned (%s) expected (%s)\n",
++*nfails;
}
}
static void
int rval;
char *p;
if (p == NULL) {
++*nprobs;
return;
}
if (ret != DST_R_SUCCESS) {
++*nfails;
return;
}
if (p == NULL) {
++*nprobs;
return;
}
if (rval != 0) {
++*nprobs;
return;
}
++*nprobs;
return;
}
if (ret != 0) {
++*nfails;
return;
}
++*nprobs;
return;
}
}
static void
if (ret != DST_R_SUCCESS) {
++*nfails;
return;
}
}
#define DBUFSIZ 25
static void
get_random(int *nfails) {
unsigned int i;
if (ret != DST_R_SUCCESS) {
++*nfails;
return;
}
if (ret != DST_R_SUCCESS) {
++*nfails;
return;
}
/* weak test, but better than nought */
t_info("data not random\n");
++*nfails;
}
if (T_debug) {
for (i = 0; i < sizeof(data1); i++)
for (i = 0; i < sizeof(data2); i++)
}
}
static char *a1 =
"the dst module provides the capability to "
"generate, store and retrieve public and private keys, "
"sign and verify data using the RSA, DSA and MD5 algorithms, "
"and generate random number sequences.";
static void
t1() {
int nfails;
int nprobs;
int result;
nfails = 0;
nprobs = 0;
if (isc_result != ISC_R_SUCCESS) {
return;
}
t_info("testing use of stored keys\n");
t_info("testing use of generated keys\n");
t_info("testing random number sequence generation\n");
get_random(&nfails);
else if (nfails)
}
testspec_t T_testlist[] = {
{ t1, "basic dst module verification" },
};