Change functions to ANSI C.

This commit is contained in:
Ulf Möller 1999-04-19 21:31:43 +00:00
parent 3edd7ed15d
commit 6b691a5c85
491 changed files with 2834 additions and 7415 deletions

View File

@ -5,6 +5,9 @@
Changes between 0.9.2b and 0.9.3 Changes between 0.9.2b and 0.9.3
*) Change functions to ANSI C.
[Ulf Möller]
*) Fix typos in error codes. *) Fix typos in error codes.
[Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller] [Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller]

View File

@ -76,10 +76,7 @@ int app_init();
#endif #endif
#ifdef undef /* never finished - probably never will be :-) */ #ifdef undef /* never finished - probably never will be :-) */
int args_from_file(file,argc,argv) int args_from_file(char *file, int *argc, char **argv[])
char *file;
int *argc;
char **argv[];
{ {
FILE *fp; FILE *fp;
int num,i; int num,i;
@ -157,8 +154,7 @@ char **argv[];
} }
#endif #endif
int str2fmt(s) int str2fmt(char *s)
char *s;
{ {
if ((*s == 'D') || (*s == 'd')) if ((*s == 'D') || (*s == 'd'))
return(FORMAT_ASN1); return(FORMAT_ASN1);
@ -173,10 +169,7 @@ char *s;
} }
#if defined(MSDOS) || defined(WIN32) || defined(WIN16) #if defined(MSDOS) || defined(WIN32) || defined(WIN16)
void program_name(in,out,size) void program_name(char *in, char *out, int size)
char *in;
char *out;
int size;
{ {
int i,n; int i,n;
char *p=NULL; char *p=NULL;
@ -213,10 +206,7 @@ int size;
out[n]='\0'; out[n]='\0';
} }
#else #else
void program_name(in,out,size) void program_name(char *in, char *out, int size)
char *in;
char *out;
int size;
{ {
char *p; char *p;
@ -231,9 +221,7 @@ int size;
#endif #endif
#ifdef WIN32 #ifdef WIN32
int WIN32_rename(from,to) int WIN32_rename(char *from, char *to)
char *from;
char *to;
{ {
int ret; int ret;
@ -242,11 +230,7 @@ char *to;
} }
#endif #endif
int chopup_args(arg,buf,argc,argv) int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
ARGS *arg;
char *buf;
int *argc;
char **argv[];
{ {
int num,len,i; int num,len,i;
char *p; char *p;
@ -312,8 +296,7 @@ char **argv[];
} }
#ifndef APP_INIT #ifndef APP_INIT
int app_init(mesgwin) int app_init(long mesgwin)
long mesgwin;
{ {
return(1); return(1);
} }

View File

@ -80,9 +80,7 @@
#undef PROG #undef PROG
#define PROG asn1parse_main #define PROG asn1parse_main
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int i,badops=0,offset=0,ret=1,j; int i,badops=0,offset=0,ret=1,j;
unsigned int length=0; unsigned int length=0;

136
apps/ca.c
View File

@ -215,9 +215,7 @@ static char *section=NULL;
static int preserve=0; static int preserve=0;
static int msie_hack=0; static int msie_hack=0;
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int total=0; int total=0;
int total_done=0; int total_done=0;
@ -1179,16 +1177,12 @@ err:
EXIT(ret); EXIT(ret);
} }
static void lookup_fail(name,tag) static void lookup_fail(char *name, char *tag)
char *name;
char *tag;
{ {
BIO_printf(bio_err,"variable lookup failed for %s::%s\n",name,tag); BIO_printf(bio_err,"variable lookup failed for %s::%s\n",name,tag);
} }
static int MS_CALLBACK key_callback(buf,len,verify) static int MS_CALLBACK key_callback(char *buf, int len, int verify)
char *buf;
int len,verify;
{ {
int i; int i;
@ -1199,8 +1193,7 @@ int len,verify;
return(i); return(i);
} }
static unsigned long index_serial_hash(a) static unsigned long index_serial_hash(char **a)
char **a;
{ {
char *n; char *n;
@ -1209,9 +1202,7 @@ char **a;
return(lh_strhash(n)); return(lh_strhash(n));
} }
static int index_serial_cmp(a,b) static int index_serial_cmp(char **a, char **b)
char **a;
char **b;
{ {
char *aa,*bb; char *aa,*bb;
@ -1220,21 +1211,17 @@ char **b;
return(strcmp(aa,bb)); return(strcmp(aa,bb));
} }
static unsigned long index_name_hash(a) static unsigned long index_name_hash(char **a)
char **a;
{ return(lh_strhash(a[DB_name])); } { return(lh_strhash(a[DB_name])); }
static int index_name_qual(a) static int index_name_qual(char **a)
char **a;
{ return(a[0][0] == 'V'); } { return(a[0][0] == 'V'); }
static int index_name_cmp(a,b) static int index_name_cmp(char **a, char **b)
char **a; { return(strcmp(a[DB_name],
char **b; b[DB_name])); }
{ return(strcmp(a[DB_name],b[DB_name])); }
static BIGNUM *load_serial(serialfile) static BIGNUM *load_serial(char *serialfile)
char *serialfile;
{ {
BIO *in=NULL; BIO *in=NULL;
BIGNUM *ret=NULL; BIGNUM *ret=NULL;
@ -1272,9 +1259,7 @@ err:
return(ret); return(ret);
} }
static int save_serial(serialfile,serial) static int save_serial(char *serialfile, BIGNUM *serial)
char *serialfile;
BIGNUM *serial;
{ {
BIO *out; BIO *out;
int ret=0; int ret=0;
@ -1306,22 +1291,10 @@ err:
return(ret); return(ret);
} }
static int certify(xret,infile,pkey,x509,dgst,policy,db,serial,startdate,days, static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
batch,ext_sect,lconf,verbose) const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial,
X509 **xret; char *startdate, int days, int batch, char *ext_sect, LHASH *lconf,
char *infile; int verbose)
EVP_PKEY *pkey;
X509 *x509;
const EVP_MD *dgst;
STACK *policy;
TXT_DB *db;
BIGNUM *serial;
char *startdate;
int days;
int batch;
char *ext_sect;
LHASH *lconf;
int verbose;
{ {
X509_REQ *req=NULL; X509_REQ *req=NULL;
BIO *in=NULL; BIO *in=NULL;
@ -1377,22 +1350,11 @@ err:
return(ok); return(ok);
} }
static int certify_cert(xret,infile,pkey,x509,dgst,policy,db,serial,startdate, static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
days,batch,ext_sect,lconf,verbose) const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial,
X509 **xret; char *startdate, int days, int batch, char *ext_sect, LHASH *lconf,
char *infile; int verbose)
EVP_PKEY *pkey;
X509 *x509;
const EVP_MD *dgst;
STACK *policy;
TXT_DB *db;
BIGNUM *serial;
char *startdate;
int days;
int batch;
char *ext_sect;
LHASH *lconf;
int verbose;
{ {
X509 *req=NULL; X509 *req=NULL;
X509_REQ *rreq=NULL; X509_REQ *rreq=NULL;
@ -1452,22 +1414,9 @@ err:
return(ok); return(ok);
} }
static int do_body(xret,pkey,x509,dgst,policy,db,serial,startdate,days, static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
batch,verbose,req,ext_sect,lconf) STACK *policy, TXT_DB *db, BIGNUM *serial, char *startdate, int days,
X509 **xret; int batch, int verbose, X509_REQ *req, char *ext_sect, LHASH *lconf)
EVP_PKEY *pkey;
X509 *x509;
const EVP_MD *dgst;
STACK *policy;
TXT_DB *db;
BIGNUM *serial;
char *startdate;
int days;
int batch;
int verbose;
X509_REQ *req;
char *ext_sect;
LHASH *lconf;
{ {
X509_NAME *name=NULL,*CAname=NULL,*subject=NULL; X509_NAME *name=NULL,*CAname=NULL,*subject=NULL;
ASN1_UTCTIME *tm,*tmptm; ASN1_UTCTIME *tm,*tmptm;
@ -1895,10 +1844,7 @@ err:
return(ok); return(ok);
} }
static void write_new_certificate(bp,x, output_der) static void write_new_certificate(BIO *bp, X509 *x, int output_der)
BIO *bp;
X509 *x;
int output_der;
{ {
char *f; char *f;
char buf[256]; char buf[256];
@ -1924,21 +1870,9 @@ int output_der;
BIO_puts(bp,"\n"); BIO_puts(bp,"\n");
} }
static int certify_spkac(xret,infile,pkey,x509,dgst,policy,db,serial, static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
startdate,days,ext_sect,lconf,verbose) const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial,
X509 **xret; char *startdate, int days, char *ext_sect, LHASH *lconf, int verbose)
char *infile;
EVP_PKEY *pkey;
X509 *x509;
const EVP_MD *dgst;
STACK *policy;
TXT_DB *db;
BIGNUM *serial;
char *startdate;
int days;
char *ext_sect;
LHASH *lconf;
int verbose;
{ {
STACK *sk=NULL; STACK *sk=NULL;
LHASH *parms=NULL; LHASH *parms=NULL;
@ -2094,9 +2028,7 @@ err:
return(ok); return(ok);
} }
static int fix_data(nid,type) static int fix_data(int nid, int *type)
int nid;
int *type;
{ {
if (nid == NID_pkcs9_emailAddress) if (nid == NID_pkcs9_emailAddress)
*type=V_ASN1_IA5STRING; *type=V_ASN1_IA5STRING;
@ -2111,8 +2043,7 @@ int *type;
return(1); return(1);
} }
static int check_time_format(str) static int check_time_format(char *str)
char *str;
{ {
ASN1_UTCTIME tm; ASN1_UTCTIME tm;
@ -2122,8 +2053,7 @@ char *str;
return(ASN1_UTCTIME_check(&tm)); return(ASN1_UTCTIME_check(&tm));
} }
static int add_oid_section(hconf) static int add_oid_section(LHASH *hconf)
LHASH *hconf;
{ {
char *p; char *p;
STACK *sktmp; STACK *sktmp;
@ -2145,9 +2075,7 @@ LHASH *hconf;
return 1; return 1;
} }
static int do_revoke(x509,db) static int do_revoke(X509 *x509, TXT_DB *db)
X509 *x509;
TXT_DB *db;
{ {
ASN1_UTCTIME *tm=NULL; ASN1_UTCTIME *tm=NULL;
char *row[DB_NUMBER],**rrow,**irow; char *row[DB_NUMBER],**rrow,**irow;

View File

@ -77,9 +77,7 @@ static char *ciphers_usage[]={
NULL NULL
}; };
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int ret=1,i; int ret=1,i;
int verbose=0; int verbose=0;

View File

@ -96,9 +96,7 @@ static X509_CRL *load_crl();
static BIO *bio_out=NULL; static BIO *bio_out=NULL;
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
X509_CRL *x=NULL; X509_CRL *x=NULL;
int ret=1,i,num,badops=0; int ret=1,i,num,badops=0;
@ -262,9 +260,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static X509_CRL *load_crl(infile, format) static X509_CRL *load_crl(char *infile, int format)
char *infile;
int format;
{ {
X509_CRL *x=NULL; X509_CRL *x=NULL;
BIO *in=NULL; BIO *in=NULL;

View File

@ -87,9 +87,7 @@ static int add_certs_from_file();
* -out arg - output file - default stdout * -out arg - output file - default stdout
*/ */
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int i,badops=0; int i,badops=0;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
@ -288,9 +286,7 @@ end:
* number of certs added if successful, -1 if not. * number of certs added if successful, -1 if not.
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
static int add_certs_from_file(stack,certfile) static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
STACK_OF(X509) *stack;
char *certfile;
{ {
struct stat st; struct stat st;
BIO *in=NULL; BIO *in=NULL;

View File

@ -79,9 +79,7 @@ void do_fp(unsigned char *buf,BIO *f,int sep);
void do_fp(); void do_fp();
#endif #endif
int MAIN(argc,argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
unsigned char *buf=NULL; unsigned char *buf=NULL;
int i,err=0; int i,err=0;
@ -203,10 +201,7 @@ end:
EXIT(err); EXIT(err);
} }
void do_fp(buf,bp,sep) void do_fp(unsigned char *buf, BIO *bp, int sep)
unsigned char *buf;
BIO *bp;
int sep;
{ {
int len; int len;
int i; int i;

View File

@ -81,9 +81,7 @@
* -C * -C
*/ */
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
DH *dh=NULL; DH *dh=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;

View File

@ -82,9 +82,7 @@
* -modulus - print the DSA public key * -modulus - print the DSA public key
*/ */
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int ret=1; int ret=1;
DSA *dsa=NULL; DSA *dsa=NULL;

View File

@ -89,9 +89,7 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg);
static void MS_CALLBACK dsa_cb(); static void MS_CALLBACK dsa_cb();
#endif #endif
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
DSA *dsa=NULL; DSA *dsa=NULL;
int i,badops=0,text=0; int i,badops=0,text=0;
@ -342,10 +340,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static void MS_CALLBACK dsa_cb(p, n, arg) static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
int p;
int n;
char *arg;
{ {
char c='*'; char c='*';

View File

@ -84,9 +84,7 @@ int set_hex();
#define BSIZE (8*1024) #define BSIZE (8*1024)
#define PROG enc_main #define PROG enc_main
int MAIN(argc,argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
char *strbuf=NULL; char *strbuf=NULL;
unsigned char *buff=NULL,*bufsize=NULL; unsigned char *buff=NULL,*bufsize=NULL;
@ -521,10 +519,7 @@ end:
EXIT(ret); EXIT(ret);
} }
int set_hex(in,out,size) int set_hex(char *in, unsigned char *out, int size)
char *in;
unsigned char *out;
int size;
{ {
int i,n; int i,n;
unsigned char j; unsigned char j;

View File

@ -68,9 +68,7 @@
#undef PROG #undef PROG
#define PROG errstr_main #define PROG errstr_main
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int i,ret=0; int i,ret=0;
char buf[256]; char buf[256];

View File

@ -81,9 +81,7 @@ static void MS_CALLBACK dh_cb();
static long dh_load_rand(); static long dh_load_rand();
#endif #endif
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
char buffer[200]; char buffer[200];
DH *dh=NULL; DH *dh=NULL;
@ -191,10 +189,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static void MS_CALLBACK dh_cb(p,n,arg) static void MS_CALLBACK dh_cb(int p, int n, char *arg)
int p;
int n;
char *arg;
{ {
char c='*'; char c='*';
@ -209,8 +204,7 @@ char *arg;
#endif #endif
} }
static long dh_load_rand(name) static long dh_load_rand(char *name)
char *name;
{ {
char *p,*n; char *p,*n;
int last; int last;

View File

@ -79,9 +79,7 @@ static long dsa_load_rand(char *names);
static long dsa_load_rand(); static long dsa_load_rand();
#endif #endif
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
char buffer[200]; char buffer[200];
DSA *dsa=NULL; DSA *dsa=NULL;
@ -214,8 +212,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static long dsa_load_rand(name) static long dsa_load_rand(char *name)
char *name;
{ {
char *p,*n; char *p,*n;
int last; int last;

View File

@ -82,9 +82,7 @@ static void MS_CALLBACK genrsa_cb();
static long gr_load_rand(); static long gr_load_rand();
#endif #endif
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int ret=1; int ret=1;
char buffer[200]; char buffer[200];
@ -234,10 +232,7 @@ err:
EXIT(ret); EXIT(ret);
} }
static void MS_CALLBACK genrsa_cb(p, n, arg) static void MS_CALLBACK genrsa_cb(int p, int n, char *arg)
int p;
int n;
char *arg;
{ {
char c='*'; char c='*';
@ -252,8 +247,7 @@ char *arg;
#endif #endif
} }
static long gr_load_rand(name) static long gr_load_rand(char *name)
char *name;
{ {
char *p,*n; char *p,*n;
int last; int last;

View File

@ -70,9 +70,7 @@ static int dump_cert_text(BIO *out, X509 *x);
static int dump_cert_text(); static int dump_cert_text();
#endif #endif
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
char **args, *infile = NULL, *outfile = NULL; char **args, *infile = NULL, *outfile = NULL;
BIO *in = NULL, *out = NULL; BIO *in = NULL, *out = NULL;
@ -163,9 +161,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static int dump_cert_text(out, x) static int dump_cert_text(BIO *out, X509 *x)
BIO *out;
X509 *x;
{ {
char buf[256]; char buf[256];
X509_NAME_oneline(X509_get_subject_name(x),buf,256); X509_NAME_oneline(X509_get_subject_name(x),buf,256);

View File

@ -99,8 +99,7 @@ LHASH *config=NULL;
char *default_config_file=NULL; char *default_config_file=NULL;
#ifdef DEBUG #ifdef DEBUG
static void sig_stop(i) static void sig_stop(int i)
int i;
{ {
char *a=NULL; char *a=NULL;
@ -113,9 +112,7 @@ int i;
BIO *bio_err=NULL; BIO *bio_err=NULL;
#endif #endif
int main(Argc,Argv) int main(int Argc, char *Argv[])
int Argc;
char *Argv[];
{ {
ARGS arg; ARGS arg;
#define PROG_NAME_SIZE 16 #define PROG_NAME_SIZE 16
@ -258,10 +255,7 @@ end:
#define LIST_MESSAGE_DIGEST_COMMANDS "list-message-digest-commands" #define LIST_MESSAGE_DIGEST_COMMANDS "list-message-digest-commands"
#define LIST_CIPHER_COMMANDS "list-cipher-commands" #define LIST_CIPHER_COMMANDS "list-cipher-commands"
static int do_cmd(prog,argc,argv) static int do_cmd(LHASH *prog, int argc, char *argv[])
LHASH *prog;
int argc;
char *argv[];
{ {
FUNCTION f,*fp; FUNCTION f,*fp;
int i,ret=1,tp,nl; int i,ret=1,tp,nl;
@ -354,7 +348,7 @@ static int SortFnByName(const void *_f1,const void *_f2)
return strcmp(f1->name,f2->name); return strcmp(f1->name,f2->name);
} }
static LHASH *prog_init() static LHASH *prog_init(void)
{ {
LHASH *ret; LHASH *ret;
FUNCTION *f; FUNCTION *f;
@ -372,14 +366,12 @@ static LHASH *prog_init()
return(ret); return(ret);
} }
static int MS_CALLBACK cmp(a,b) static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b)
FUNCTION *a,*b;
{ {
return(strncmp(a->name,b->name,8)); return(strncmp(a->name,b->name,8));
} }
static unsigned long MS_CALLBACK hash(a) static unsigned long MS_CALLBACK hash(FUNCTION *a)
FUNCTION *a;
{ {
return(lh_strhash(a->name)); return(lh_strhash(a->name));
} }

View File

@ -87,9 +87,7 @@ typedef struct lines_St
struct lines_st *next; struct lines_st *next;
} LINES; } LINES;
int main(argc, argv) int main(int argc, char **argv)
int argc;
char **argv;
{ {
FILE *in; FILE *in;
RSA *rsa=NULL; RSA *rsa=NULL;

View File

@ -96,9 +96,7 @@ int alg_print();
int cert_load(); int cert_load();
#endif #endif
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
char *infile=NULL, *outfile=NULL, *keyname = NULL; char *infile=NULL, *outfile=NULL, *keyname = NULL;
char *certfile=NULL; char *certfile=NULL;
@ -440,9 +438,7 @@ if (export_cert) {
EXIT(ret); EXIT(ret);
} }
int dump_cert_text (out, x) int dump_cert_text (BIO *out, X509 *x)
BIO *out;
X509 *x;
{ {
char buf[256]; char buf[256];
X509_NAME_oneline(X509_get_subject_name(x),buf,256); X509_NAME_oneline(X509_get_subject_name(x),buf,256);
@ -456,12 +452,8 @@ X509 *x;
return 0; return 0;
} }
int dump_certs_keys_p12 (out, p12, pass, passlen, options) int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, unsigned char *pass,
BIO *out; int passlen, int options)
PKCS12 *p12;
unsigned char *pass;
int passlen;
int options;
{ {
STACK *asafes, *bags; STACK *asafes, *bags;
int i, bagnid; int i, bagnid;
@ -493,12 +485,8 @@ int options;
return 1; return 1;
} }
int dump_certs_pkeys_bags (out, bags, pass, passlen, options) int dump_certs_pkeys_bags (BIO *out, STACK *bags, unsigned char *pass,
BIO *out; int passlen, int options)
STACK *bags;
unsigned char *pass;
int passlen;
int options;
{ {
int i; int i;
for (i = 0; i < sk_num (bags); i++) { for (i = 0; i < sk_num (bags); i++) {
@ -509,12 +497,8 @@ int options;
return 1; return 1;
} }
int dump_certs_pkeys_bag (out, bag, pass, passlen, options) int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, unsigned char *pass,
BIO *out; int passlen, int options)
PKCS12_SAFEBAG *bag;
unsigned char *pass;
int passlen;
int options;
{ {
EVP_PKEY *pkey; EVP_PKEY *pkey;
PKCS8_PRIV_KEY_INFO *p8; PKCS8_PRIV_KEY_INFO *p8;
@ -584,9 +568,7 @@ int options;
/* Hope this is OK .... */ /* Hope this is OK .... */
int get_cert_chain (cert, chain) int get_cert_chain (X509 *cert, STACK **chain)
X509 *cert;
STACK **chain;
{ {
X509_STORE *store; X509_STORE *store;
X509_STORE_CTX store_ctx; X509_STORE_CTX store_ctx;
@ -614,9 +596,7 @@ err:
return i; return i;
} }
int alg_print (x, alg) int alg_print (BIO *x, X509_ALGOR *alg)
BIO *x;
X509_ALGOR *alg;
{ {
PBEPARAM *pbe; PBEPARAM *pbe;
unsigned char *p; unsigned char *p;
@ -630,9 +610,7 @@ X509_ALGOR *alg;
/* Load all certificates from a given file */ /* Load all certificates from a given file */
int cert_load(in, sk) int cert_load(BIO *in, STACK *sk)
BIO *in;
STACK *sk;
{ {
int ret; int ret;
X509 *cert; X509 *cert;
@ -647,10 +625,7 @@ STACK *sk;
/* Generalised attribute print: handle PKCS#8 and bag attributes */ /* Generalised attribute print: handle PKCS#8 and bag attributes */
int print_attribs (out, attrlst, name) int print_attribs (BIO *out, STACK *attrlst, char *name)
BIO *out;
STACK *attrlst;
char *name;
{ {
X509_ATTRIBUTE *attr; X509_ATTRIBUTE *attr;
ASN1_TYPE *av; ASN1_TYPE *av;
@ -705,10 +680,7 @@ char *name;
return 1; return 1;
} }
void hex_prin(out, buf, len) void hex_prin(BIO *out, unsigned char *buf, int len)
BIO *out;
unsigned char *buf;
int len;
{ {
int i; int i;
for (i = 0; i < len; i++) BIO_printf (out, "%02X ", buf[i]); for (i = 0; i < len; i++) BIO_printf (out, "%02X ", buf[i]);

View File

@ -81,9 +81,7 @@
* -print_certs * -print_certs
*/ */
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
PKCS7 *p7=NULL; PKCS7 *p7=NULL;
int i,badops=0; int i,badops=0;

View File

@ -137,9 +137,7 @@ static LHASH *req_conf=NULL;
#define TYPE_DSA 2 #define TYPE_DSA 2
#define TYPE_DH 3 #define TYPE_DH 3
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
#ifndef NO_DSA #ifndef NO_DSA
DSA *dsa_params=NULL; DSA *dsa_params=NULL;
@ -825,10 +823,7 @@ end:
EXIT(ex); EXIT(ex);
} }
static int make_REQ(req,pkey,attribs) static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
X509_REQ *req;
EVP_PKEY *pkey;
int attribs;
{ {
int ret=0,i; int ret=0,i;
unsigned char *p,*q; unsigned char *p,*q;
@ -984,14 +979,8 @@ err:
return(ret); return(ret);
} }
static int add_DN_object(n,text,def,value,nid,min,max) static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
X509_NAME *n; int nid, int min, int max)
char *text;
char *def;
char *value;
int nid;
int min;
int max;
{ {
int i,j,ret=0; int i,j,ret=0;
X509_NAME_ENTRY *ne=NULL; X509_NAME_ENTRY *ne=NULL;
@ -1044,14 +1033,8 @@ err:
return(ret); return(ret);
} }
static int add_attribute_object(n,text,def,value,nid,min,max) static int add_attribute_object(STACK *n, char *text, char *def, char *value,
STACK *n; int nid, int min, int max)
char *text;
char *def;
char *value;
int nid;
int min;
int max;
{ {
int i,z; int i,z;
X509_ATTRIBUTE *xa=NULL; X509_ATTRIBUTE *xa=NULL;
@ -1135,10 +1118,7 @@ err:
return(0); return(0);
} }
static void MS_CALLBACK req_cb(p,n,arg) static void MS_CALLBACK req_cb(int p, int n, char *arg)
int p;
int n;
char *arg;
{ {
char c='*'; char c='*';
@ -1153,10 +1133,7 @@ char *arg;
#endif #endif
} }
static int req_fix_data(nid,type,len,min,max) static int req_fix_data(int nid, int *type, int len, int min, int max)
int nid;
int *type;
int len,min,max;
{ {
if (nid == NID_pkcs9_emailAddress) if (nid == NID_pkcs9_emailAddress)
*type=V_ASN1_IA5STRING; *type=V_ASN1_IA5STRING;
@ -1189,9 +1166,7 @@ int len,min,max;
} }
/* Check if the end of a string matches 'end' */ /* Check if the end of a string matches 'end' */
static int check_end(str, end) static int check_end(char *str, char *end)
char *str;
char *end;
{ {
int elen, slen; int elen, slen;
char *tmp; char *tmp;
@ -1202,8 +1177,7 @@ char *end;
return strcmp(tmp, end); return strcmp(tmp, end);
} }
static int add_oid_section(conf) static int add_oid_section(LHASH *conf)
LHASH *conf;
{ {
char *p; char *p;
STACK *sktmp; STACK *sktmp;

View File

@ -82,9 +82,7 @@
* -modulus - print the RSA key modulus * -modulus - print the RSA key modulus
*/ */
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int ret=1; int ret=1;
RSA *rsa=NULL; RSA *rsa=NULL;

View File

@ -71,9 +71,7 @@
int verify_depth=0; int verify_depth=0;
int verify_error=X509_V_OK; int verify_error=X509_V_OK;
int MS_CALLBACK verify_callback(ok, ctx) int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
int ok;
X509_STORE_CTX *ctx;
{ {
char buf[256]; char buf[256];
X509 *err_cert; X509 *err_cert;
@ -123,10 +121,7 @@ X509_STORE_CTX *ctx;
return(ok); return(ok);
} }
int set_cert_stuff(ctx, cert_file, key_file) int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
SSL_CTX *ctx;
char *cert_file;
char *key_file;
{ {
if (cert_file != NULL) if (cert_file != NULL)
{ {
@ -181,13 +176,8 @@ char *key_file;
return(1); return(1);
} }
long MS_CALLBACK bio_dump_cb(bio,cmd,argp,argi,argl,ret) long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi,
BIO *bio; long argl, long ret)
int cmd;
const char *argp;
int argi;
long argl;
long ret;
{ {
BIO *out; BIO *out;
@ -210,10 +200,7 @@ long ret;
return(ret); return(ret);
} }
void MS_CALLBACK apps_ssl_info_callback(s,where,ret) void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret)
SSL *s;
int where;
int ret;
{ {
char *str; char *str;
int w; int w;

View File

@ -103,7 +103,7 @@ static void print_stuff();
static BIO *bio_c_out=NULL; static BIO *bio_c_out=NULL;
static int c_quiet=0; static int c_quiet=0;
static void sc_usage() static void sc_usage(void)
{ {
BIO_printf(bio_err,"usage: s_client args\n"); BIO_printf(bio_err,"usage: s_client args\n");
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
@ -137,9 +137,7 @@ static void sc_usage()
} }
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int off=0; int off=0;
SSL *con=NULL,*con2=NULL; SSL *con=NULL,*con2=NULL;
@ -657,10 +655,7 @@ end:
} }
static void print_stuff(bio,s,full) static void print_stuff(BIO *bio, SSL *s, int full)
BIO *bio;
SSL *s;
int full;
{ {
X509 *peer=NULL; X509 *peer=NULL;
char *p; char *p;

View File

@ -120,7 +120,7 @@ static unsigned char dh512_g[]={
0x02, 0x02,
}; };
static DH *get_dh512() static DH *get_dh512(void)
{ {
DH *dh=NULL; DH *dh=NULL;
@ -164,7 +164,7 @@ static int s_debug=0;
static int s_quiet=0; static int s_quiet=0;
#if 0 #if 0
static void s_server_init() static void s_server_init(void)
{ {
cipher=NULL; cipher=NULL;
s_server_verify=SSL_VERIFY_NONE; s_server_verify=SSL_VERIFY_NONE;
@ -185,7 +185,7 @@ static void s_server_init()
} }
#endif #endif
static void sv_usage() static void sv_usage(void)
{ {
BIO_printf(bio_err,"usage: s_server [args ...]\n"); BIO_printf(bio_err,"usage: s_server [args ...]\n");
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
@ -226,9 +226,7 @@ static int local_argc=0;
static char **local_argv; static char **local_argv;
static int hack=0; static int hack=0;
int MAIN(argc, argv) int MAIN(int argc, char *argv[])
int argc;
char *argv[];
{ {
short port=PORT; short port=PORT;
char *CApath=NULL,*CAfile=NULL; char *CApath=NULL,*CAfile=NULL;
@ -533,9 +531,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static void print_stats(bio,ssl_ctx) static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
BIO *bio;
SSL_CTX *ssl_ctx;
{ {
BIO_printf(bio,"%4ld items in the session cache\n", BIO_printf(bio,"%4ld items in the session cache\n",
SSL_CTX_sess_number(ssl_ctx)); SSL_CTX_sess_number(ssl_ctx));
@ -560,10 +556,7 @@ SSL_CTX *ssl_ctx;
SSL_CTX_sess_get_cache_size(ssl_ctx)); SSL_CTX_sess_get_cache_size(ssl_ctx));
} }
static int sv_body(hostname, s, context) static int sv_body(char *hostname, int s, char *context)
char *hostname;
int s;
char *context;
{ {
char *buf=NULL; char *buf=NULL;
fd_set readfds; fd_set readfds;
@ -779,7 +772,7 @@ err:
return(ret); return(ret);
} }
static void close_accept_socket() static void close_accept_socket(void)
{ {
BIO_printf(bio_err,"shutdown accept socket\n"); BIO_printf(bio_err,"shutdown accept socket\n");
if (accept_socket >= 0) if (accept_socket >= 0)
@ -788,8 +781,7 @@ static void close_accept_socket()
} }
} }
static int init_ssl_connection(con) static int init_ssl_connection(SSL *con)
SSL *con;
{ {
int i; int i;
const char *str; const char *str;
@ -844,7 +836,7 @@ SSL *con;
} }
#ifndef NO_DH #ifndef NO_DH
static DH *load_dh_param() static DH *load_dh_param(void)
{ {
DH *ret=NULL; DH *ret=NULL;
BIO *bio; BIO *bio;
@ -859,9 +851,7 @@ err:
#endif #endif
#if 0 #if 0
static int load_CA(ctx,file) static int load_CA(SSL_CTX *ctx, char *file)
SSL_CTX *ctx;
char *file;
{ {
FILE *in; FILE *in;
X509 *x=NULL; X509 *x=NULL;
@ -881,10 +871,7 @@ char *file;
} }
#endif #endif
static int www_body(hostname, s, context) static int www_body(char *hostname, int s, char *context)
char *hostname;
int s;
char *context;
{ {
char *buf=NULL; char *buf=NULL;
int ret=1; int ret=1;
@ -1226,10 +1213,7 @@ err:
return(ret); return(ret);
} }
static RSA MS_CALLBACK *tmp_rsa_cb(s,export,keylength) static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength)
SSL *s;
int export;
int keylength;
{ {
static RSA *rsa_tmp=NULL; static RSA *rsa_tmp=NULL;

View File

@ -93,11 +93,8 @@ static FARPROC lpTopWndProc=NULL;
static FARPROC lpTopHookProc=NULL; static FARPROC lpTopHookProc=NULL;
extern HINSTANCE _hInstance; /* nice global CRT provides */ extern HINSTANCE _hInstance; /* nice global CRT provides */
static LONG FAR PASCAL topHookProc(hwnd,message,wParam,lParam) static LONG FAR PASCAL topHookProc(HWND hwnd, UINT message, WPARAM wParam,
HWND hwnd; LPARAM lParam)
UINT message;
WPARAM wParam;
LPARAM lParam;
{ {
if (hwnd == topWnd) if (hwnd == topWnd)
{ {
@ -122,7 +119,7 @@ static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
#endif /* WIN32 */ #endif /* WIN32 */
#endif /* WINDOWS */ #endif /* WINDOWS */
void sock_cleanup() void sock_cleanup(void)
{ {
#ifdef WINDOWS #ifdef WINDOWS
if (wsa_init_done) if (wsa_init_done)
@ -134,7 +131,7 @@ void sock_cleanup()
#endif #endif
} }
int sock_init() int sock_init(void)
{ {
#ifdef WINDOWS #ifdef WINDOWS
if (!wsa_init_done) if (!wsa_init_done)
@ -165,10 +162,7 @@ int sock_init()
return(1); return(1);
} }
int init_client(sock, host, port) int init_client(int *sock, char *host, int port)
int *sock;
char *host;
int port;
{ {
unsigned char ip[4]; unsigned char ip[4];
short p=0; short p=0;
@ -181,10 +175,7 @@ int port;
return(init_client_ip(sock,ip,port)); return(init_client_ip(sock,ip,port));
} }
int init_client_ip(sock, ip, port) int init_client_ip(int *sock, unsigned char ip[4], int port)
int *sock;
unsigned char ip[4];
int port;
{ {
unsigned long addr; unsigned long addr;
struct sockaddr_in them; struct sockaddr_in them;
@ -215,8 +206,7 @@ int port;
return(1); return(1);
} }
int nbio_sock_error(sock) int nbio_sock_error(int sock)
int sock;
{ {
int j,i,size; int j,i,size;
@ -228,10 +218,7 @@ int sock;
return(j); return(j);
} }
int nbio_init_client_ip(sock, ip, port) int nbio_init_client_ip(int *sock, unsigned char ip[4], int port)
int *sock;
unsigned char ip[4];
int port;
{ {
unsigned long addr; unsigned long addr;
struct sockaddr_in them; struct sockaddr_in them;
@ -280,11 +267,7 @@ int port;
return(1); return(1);
} }
int do_server(port, ret, cb, context) int do_server(int port, int *ret, int (*cb)(), char *context)
int port;
int *ret;
int (*cb)();
char *context;
{ {
int sock; int sock;
char *name; char *name;
@ -316,10 +299,7 @@ char *context;
} }
} }
int init_server_long(sock, port, ip) int init_server_long(int *sock, int port, char *ip)
int *sock;
int port;
char *ip;
{ {
int ret=0; int ret=0;
struct sockaddr_in server; struct sockaddr_in server;
@ -369,17 +349,12 @@ err:
return(ret); return(ret);
} }
int init_server(sock,port) int init_server(int *sock, int port)
int *sock;
int port;
{ {
return(init_server_long(sock, port, NULL)); return(init_server_long(sock, port, NULL));
} }
int do_accept(acc_sock, sock, host) int do_accept(int acc_sock, int *sock, char **host)
int acc_sock;
int *sock;
char **host;
{ {
int ret,i; int ret,i;
struct hostent *h1,*h2; struct hostent *h1,*h2;
@ -465,11 +440,8 @@ end:
return(1); return(1);
} }
int extract_host_port(str,host_ptr,ip,port_ptr) int extract_host_port(char *str, char **host_ptr, unsigned char *ip,
char *str; short *port_ptr)
char **host_ptr;
unsigned char *ip;
short *port_ptr;
{ {
char *h,*p; char *h,*p;
@ -493,9 +465,7 @@ err:
return(0); return(0);
} }
int host_ip(str,ip) int host_ip(char *str, unsigned char ip[4])
char *str;
unsigned char ip[4];
{ {
unsigned int in[4]; unsigned int in[4];
int i; int i;
@ -541,9 +511,7 @@ err:
return(0); return(0);
} }
int extract_port(str,port_ptr) int extract_port(char *str, short *port_ptr)
char *str;
short *port_ptr;
{ {
int i; int i;
struct servent *s; struct servent *s;
@ -575,8 +543,7 @@ static struct ghbn_cache_st
static unsigned long ghbn_hits=0L; static unsigned long ghbn_hits=0L;
static unsigned long ghbn_miss=0L; static unsigned long ghbn_miss=0L;
static struct hostent *GetHostByName(name) static struct hostent *GetHostByName(char *name)
char *name;
{ {
struct hostent *ret; struct hostent *ret;
int i,lowi=0; int i,lowi=0;
@ -616,11 +583,7 @@ char *name;
} }
#ifndef MSDOS #ifndef MSDOS
int spawn(argc, argv, in, out) int spawn(int argc, char **argv, int *in, int *out)
int argc;
char **argv;
int *in;
int *out;
{ {
int pid; int pid;
#define CHILD_READ p1[0] #define CHILD_READ p1[0]

View File

@ -190,7 +190,7 @@ static int t_nbio=0;
static int exitNow = 0; /* Set when it's time to exit main */ static int exitNow = 0; /* Set when it's time to exit main */
#endif #endif
static void s_time_init() static void s_time_init(void)
{ {
host=SSL_CONNECT_NAME; host=SSL_CONNECT_NAME;
t_cert_file=NULL; t_cert_file=NULL;
@ -218,7 +218,7 @@ static void s_time_init()
/*********************************************************************** /***********************************************************************
* usage - display usage message * usage - display usage message
*/ */
static void s_time_usage() static void s_time_usage(void)
{ {
static char umsg[] = "\ static char umsg[] = "\
-time arg - max number of seconds to collect data, default %d\n\ -time arg - max number of seconds to collect data, default %d\n\
@ -250,9 +250,7 @@ static void s_time_usage()
* *
* Returns 0 if ok, -1 on bad args * Returns 0 if ok, -1 on bad args
*/ */
static int parseArgs(argc,argv) static int parseArgs(int argc, char **argv)
int argc;
char **argv;
{ {
int badop = 0; int badop = 0;
@ -377,8 +375,7 @@ bad:
#define START 0 #define START 0
#define STOP 1 #define STOP 1
static double tm_Time_F(s) static double tm_Time_F(int s)
int s;
{ {
static double ret; static double ret;
#ifdef TIMES #ifdef TIMES
@ -412,10 +409,7 @@ int s;
* MAIN - main processing area for client * MAIN - main processing area for client
* real name depends on MONOLITH * real name depends on MONOLITH
*/ */
int int MAIN(int argc, char **argv)
MAIN(argc,argv)
int argc;
char **argv;
{ {
double totalTime = 0.0; double totalTime = 0.0;
int nConn = 0; int nConn = 0;
@ -639,9 +633,7 @@ end:
* Returns: * Returns:
* SSL * = the connection pointer. * SSL * = the connection pointer.
*/ */
static SSL * static SSL *doConnection(SSL *scon)
doConnection(scon)
SSL *scon;
{ {
BIO *conn; BIO *conn;
SSL *serverCon; SSL *serverCon;

View File

@ -110,7 +110,7 @@ static void print_stuff();
static BIO *bio_c_out=NULL; static BIO *bio_c_out=NULL;
static int c_quiet=0; static int c_quiet=0;
static void sc_usage() static void sc_usage(void)
{ {
BIO_printf(bio_err,"usage: client args\n"); BIO_printf(bio_err,"usage: client args\n");
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
@ -143,9 +143,7 @@ static void sc_usage()
} }
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int off=0; int off=0;
SSL *con=NULL,*con2=NULL; SSL *con=NULL,*con2=NULL;

View File

@ -89,9 +89,7 @@ static SSL_SESSION *load_sess_id(char *file, int format);
static SSL_SESSION *load_sess_id(); static SSL_SESSION *load_sess_id();
#endif #endif
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
SSL_SESSION *x=NULL; SSL_SESSION *x=NULL;
int ret=1,i,num,badops=0; int ret=1,i,num,badops=0;
@ -271,9 +269,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static SSL_SESSION *load_sess_id(infile, format) static SSL_SESSION *load_sess_id(char *infile, int format)
char *infile;
int format;
{ {
SSL_SESSION *x=NULL; SSL_SESSION *x=NULL;
BIO *in=NULL; BIO *in=NULL;

View File

@ -204,8 +204,7 @@ static SIGRETTYPE sig_done(int sig);
static SIGRETTYPE sig_done(); static SIGRETTYPE sig_done();
#endif #endif
static SIGRETTYPE sig_done(sig) static SIGRETTYPE sig_done(int sig)
int sig;
{ {
signal(SIGALRM,sig_done); signal(SIGALRM,sig_done);
run=0; run=0;
@ -218,8 +217,7 @@ int sig;
#define START 0 #define START 0
#define STOP 1 #define STOP 1
static double Time_F(s) static double Time_F(int s)
int s;
{ {
double ret; double ret;
#ifdef TIMES #ifdef TIMES
@ -255,9 +253,7 @@ int s;
#endif #endif
} }
int MAIN(argc,argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
unsigned char *buf=NULL,*buf2=NULL; unsigned char *buf=NULL,*buf2=NULL;
int ret=1; int ret=1;
@ -1183,10 +1179,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static void print_message(s,num,length) static void print_message(char *s, long num, int length)
char *s;
long num;
int length;
{ {
#ifdef SIGALRM #ifdef SIGALRM
BIO_printf(bio_err,"Doing %s for %ds on %d size blocks: ",s,SECONDS,length); BIO_printf(bio_err,"Doing %s for %ds on %d size blocks: ",s,SECONDS,length);
@ -1201,12 +1194,8 @@ int length;
#endif #endif
} }
static void pkey_print_message(str,str2,num,bits,tm) static void pkey_print_message(char *str, char *str2, long num, int bits,
char *str; int tm)
char *str2;
long num;
int bits;
int tm;
{ {
#ifdef SIGALRM #ifdef SIGALRM
BIO_printf(bio_err,"Doing %d bit %s %s's for %ds: ",bits,str,str2,tm); BIO_printf(bio_err,"Doing %d bit %s %s's for %ds: ",bits,str,str2,tm);

View File

@ -78,9 +78,7 @@ static int check();
static int v_verbose=0; static int v_verbose=0;
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int i,ret=1; int i,ret=1;
char *CApath=NULL,*CAfile=NULL; char *CApath=NULL,*CAfile=NULL;
@ -154,9 +152,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static int check(ctx,file) static int check(X509_STORE *ctx, char *file)
X509_STORE *ctx;
char *file;
{ {
X509 *x=NULL; X509 *x=NULL;
BIO *in=NULL; BIO *in=NULL;
@ -210,9 +206,7 @@ end:
return(ret); return(ret);
} }
static int MS_CALLBACK cb(ok,ctx) static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
int ok;
X509_STORE_CTX *ctx;
{ {
char buf[256]; char buf[256];

View File

@ -66,9 +66,7 @@
#undef PROG #undef PROG
#define PROG version_main #define PROG version_main
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int i,ret=0; int i,ret=0;
int cflags=0,version=0,date=0,options=0,platform=0; int cflags=0,version=0,date=0,options=0,platform=0;

View File

@ -135,9 +135,7 @@ static int x509_certify ();
static int reqfile=0; static int reqfile=0;
int MAIN(argc, argv) int MAIN(int argc, char **argv)
int argc;
char **argv;
{ {
int ret=1; int ret=1;
X509_REQ *req=NULL; X509_REQ *req=NULL;
@ -704,16 +702,9 @@ end:
EXIT(ret); EXIT(ret);
} }
static int x509_certify(ctx,CAfile,digest,x,xca,pkey,serialfile,create,days) static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
X509_STORE *ctx; X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create,
char *CAfile; int days)
const EVP_MD *digest;
X509 *x;
X509 *xca;
EVP_PKEY *pkey;
char *serialfile;
int create;
int days;
{ {
int ret=0; int ret=0;
BIO *io=NULL; BIO *io=NULL;
@ -859,9 +850,7 @@ end:
return(ret); return(ret);
} }
static int MS_CALLBACK callb(ok, ctx) static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
int ok;
X509_STORE_CTX *ctx;
{ {
char buf[256]; char buf[256];
int err; int err;
@ -894,9 +883,7 @@ X509_STORE_CTX *ctx;
} }
} }
static EVP_PKEY *load_key(file, format) static EVP_PKEY *load_key(char *file, int format)
char *file;
int format;
{ {
BIO *key=NULL; BIO *key=NULL;
EVP_PKEY *pkey=NULL; EVP_PKEY *pkey=NULL;
@ -949,9 +936,7 @@ end:
return(pkey); return(pkey);
} }
static X509 *load_cert(file, format) static X509 *load_cert(char *file, int format)
char *file;
int format;
{ {
ASN1_HEADER *ah=NULL; ASN1_HEADER *ah=NULL;
BUF_MEM *buf=NULL; BUF_MEM *buf=NULL;
@ -1038,11 +1023,7 @@ end:
} }
/* self sign */ /* self sign */
static int sign(x, pkey, days, digest) static int sign(X509 *x, EVP_PKEY *pkey, int days, const EVP_MD *digest)
X509 *x;
EVP_PKEY *pkey;
int days;
const EVP_MD *digest;
{ {
EVP_PKEY *pktmp; EVP_PKEY *pktmp;

View File

@ -64,9 +64,7 @@
* ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,ASN1_R_EXPECTING_A_BIT_STRING); * ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,ASN1_R_EXPECTING_A_BIT_STRING);
*/ */
int i2d_ASN1_BIT_STRING(a,pp) int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
ASN1_BIT_STRING *a;
unsigned char **pp;
{ {
int ret,j,r,bits,len; int ret,j,r,bits,len;
unsigned char *p,*d; unsigned char *p,*d;
@ -116,10 +114,8 @@ unsigned char **pp;
return(r); return(r);
} }
ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(a, pp, length) ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
ASN1_BIT_STRING **a; long length)
unsigned char **pp;
long length;
{ {
ASN1_BIT_STRING *ret=NULL; ASN1_BIT_STRING *ret=NULL;
unsigned char *p,*s; unsigned char *p,*s;
@ -187,10 +183,7 @@ err:
/* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de> /* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de>
*/ */
int ASN1_BIT_STRING_set_bit(a,n,value) int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
ASN1_BIT_STRING *a;
int n;
int value;
{ {
int w,v,iv; int w,v,iv;
unsigned char *c; unsigned char *c;
@ -220,9 +213,7 @@ int value;
return(1); return(1);
} }
int ASN1_BIT_STRING_get_bit(a,n) int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n)
ASN1_BIT_STRING *a;
int n;
{ {
int w,v; int w,v;

View File

@ -63,18 +63,14 @@
/* ASN1err(ASN1_F_D2I_ASN1_BMPSTRING,ASN1_R_EXPECTING_AN_INTEGER); /* ASN1err(ASN1_F_D2I_ASN1_BMPSTRING,ASN1_R_EXPECTING_AN_INTEGER);
*/ */
int i2d_ASN1_BMPSTRING(a, pp) int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp)
ASN1_BMPSTRING *a;
unsigned char **pp;
{ {
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
V_ASN1_BMPSTRING,V_ASN1_UNIVERSAL)); V_ASN1_BMPSTRING,V_ASN1_UNIVERSAL));
} }
ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(a, pp, length) ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, unsigned char **pp,
ASN1_BMPSTRING **a; long length)
unsigned char **pp;
long length;
{ {
ASN1_BMPSTRING *ret=NULL; ASN1_BMPSTRING *ret=NULL;

View File

@ -64,9 +64,7 @@
* ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,ASN1_R_BOOLEAN_IS_WRONG_LENGTH); * ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
*/ */
int i2d_ASN1_BOOLEAN(a,pp) int i2d_ASN1_BOOLEAN(int a, unsigned char **pp)
int a;
unsigned char **pp;
{ {
int r; int r;
unsigned char *p; unsigned char *p;
@ -81,10 +79,7 @@ unsigned char **pp;
return(r); return(r);
} }
int d2i_ASN1_BOOLEAN(a, pp, length) int d2i_ASN1_BOOLEAN(int *a, unsigned char **pp, long length)
int *a;
unsigned char **pp;
long length;
{ {
int ret= -1; int ret= -1;
unsigned char *p; unsigned char *p;

View File

@ -83,11 +83,8 @@ static int asn1_collate_primative();
/* type is a 'bitmap' of acceptable string types. /* type is a 'bitmap' of acceptable string types.
*/ */
ASN1_STRING *d2i_ASN1_type_bytes(a, pp, length, type) ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp,
ASN1_STRING **a; long length, int type)
unsigned char **pp;
long length;
int type;
{ {
ASN1_STRING *ret=NULL; ASN1_STRING *ret=NULL;
unsigned char *p,*s; unsigned char *p,*s;
@ -150,11 +147,7 @@ err:
return(NULL); return(NULL);
} }
int i2d_ASN1_bytes(a, pp, tag, xclass) int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass)
ASN1_STRING *a;
unsigned char **pp;
int tag;
int xclass;
{ {
int ret,r,constructed; int ret,r,constructed;
unsigned char *p; unsigned char *p;
@ -180,12 +173,8 @@ int xclass;
return(r); return(r);
} }
ASN1_STRING *d2i_ASN1_bytes(a, pp, length, Ptag, Pclass) ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
ASN1_STRING **a; int Ptag, int Pclass)
unsigned char **pp;
long length;
int Ptag;
int Pclass;
{ {
ASN1_STRING *ret=NULL; ASN1_STRING *ret=NULL;
unsigned char *p,*s; unsigned char *p,*s;
@ -277,9 +266,7 @@ err:
* them into the one struture that is then returned */ * them into the one struture that is then returned */
/* There have been a few bug fixes for this function from /* There have been a few bug fixes for this function from
* Paul Keogh <paul.keogh@sse.ie>, many thanks to him */ * Paul Keogh <paul.keogh@sse.ie>, many thanks to him */
static int asn1_collate_primative(a,c) static int asn1_collate_primative(ASN1_STRING *a, ASN1_CTX *c)
ASN1_STRING *a;
ASN1_CTX *c;
{ {
ASN1_STRING *os=NULL; ASN1_STRING *os=NULL;
BUF_MEM b; BUF_MEM b;

View File

@ -64,11 +64,8 @@
#define HEADER_SIZE 8 #define HEADER_SIZE 8
#ifndef NO_FP_API #ifndef NO_FP_API
char *ASN1_d2i_fp(xnew,d2i,in,x) char *ASN1_d2i_fp(char *(*xnew)(), char *(*d2i)(), FILE *in,
char *(*xnew)(); unsigned char **x)
char *(*d2i)();
FILE *in;
unsigned char **x;
{ {
BIO *b; BIO *b;
char *ret; char *ret;
@ -85,11 +82,8 @@ unsigned char **x;
} }
#endif #endif
char *ASN1_d2i_bio(xnew,d2i,in,x) char *ASN1_d2i_bio(char *(*xnew)(), char *(*d2i)(), BIO *in,
char *(*xnew)(); unsigned char **x)
char *(*d2i)();
BIO *in;
unsigned char **x;
{ {
BUF_MEM *b; BUF_MEM *b;
unsigned char *p; unsigned char *p;

View File

@ -66,12 +66,8 @@
#include "x509.h" #include "x509.h"
#include "buffer.h" #include "buffer.h"
int ASN1_digest(i2d,type,data,md,len) int ASN1_digest(int (*i2d)(), EVP_MD *type, char *data, unsigned char *md,
int (*i2d)(); unsigned int *len)
EVP_MD *type;
char *data;
unsigned char *md;
unsigned int *len;
{ {
EVP_MD_CTX ctx; EVP_MD_CTX ctx;
int i; int i;

View File

@ -62,10 +62,7 @@
#define READ_CHUNK 2048 #define READ_CHUNK 2048
char *ASN1_dup(i2d,d2i,x) char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x)
int (*i2d)();
char *(*d2i)();
char *x;
{ {
unsigned char *b,*p; unsigned char *b,*p;
long i; long i;

View File

@ -65,9 +65,7 @@
/* ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,ASN1_R_EXPECTING_AN_ENUMERATED); /* ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,ASN1_R_EXPECTING_AN_ENUMERATED);
*/ */
int i2d_ASN1_ENUMERATED(a,pp) int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp)
ASN1_ENUMERATED *a;
unsigned char **pp;
{ {
int pad=0,ret,r,i,t; int pad=0,ret,r,i,t;
unsigned char *p,*pt,*n,pb=0; unsigned char *p,*pt,*n,pb=0;
@ -118,10 +116,8 @@ unsigned char **pp;
return(r); return(r);
} }
ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(a, pp, length) ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
ASN1_ENUMERATED **a; long length)
unsigned char **pp;
long length;
{ {
ASN1_ENUMERATED *ret=NULL; ASN1_ENUMERATED *ret=NULL;
unsigned char *p,*to,*s; unsigned char *p,*to,*s;
@ -196,9 +192,7 @@ err:
return(NULL); return(NULL);
} }
int ASN1_ENUMERATED_set(a,v) int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
ASN1_ENUMERATED *a;
long v;
{ {
int i,j,k; int i,j,k;
unsigned char buf[sizeof(long)+1]; unsigned char buf[sizeof(long)+1];
@ -238,8 +232,7 @@ long v;
return(1); return(1);
} }
long ASN1_ENUMERATED_get(a) long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a)
ASN1_ENUMERATED *a;
{ {
int neg=0,i; int neg=0,i;
long r=0; long r=0;
@ -268,9 +261,7 @@ ASN1_ENUMERATED *a;
return(r); return(r);
} }
ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(bn,ai) ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
BIGNUM *bn;
ASN1_ENUMERATED *ai;
{ {
ASN1_ENUMERATED *ret; ASN1_ENUMERATED *ret;
int len,j; int len,j;
@ -295,9 +286,7 @@ err:
return(NULL); return(NULL);
} }
BIGNUM *ASN1_ENUMERATED_to_BN(ai,bn) BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn)
ASN1_ENUMERATED *ai;
BIGNUM *bn;
{ {
BIGNUM *ret; BIGNUM *ret;

View File

@ -67,19 +67,15 @@
* ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME,ASN1_R_EXPECTING_A_GENERALIZEDTIME); * ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME,ASN1_R_EXPECTING_A_GENERALIZEDTIME);
*/ */
int i2d_ASN1_GENERALIZEDTIME(a,pp) int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp)
ASN1_GENERALIZEDTIME *a;
unsigned char **pp;
{ {
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
V_ASN1_GENERALIZEDTIME,V_ASN1_UNIVERSAL)); V_ASN1_GENERALIZEDTIME,V_ASN1_UNIVERSAL));
} }
ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(a, pp, length) ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,
ASN1_GENERALIZEDTIME **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
ASN1_GENERALIZEDTIME *ret=NULL; ASN1_GENERALIZEDTIME *ret=NULL;
@ -103,8 +99,7 @@ err:
return(NULL); return(NULL);
} }
int ASN1_GENERALIZEDTIME_check(d) int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d)
ASN1_GENERALIZEDTIME *d;
{ {
static int min[9]={ 0, 0, 1, 1, 0, 0, 0, 0, 0}; static int min[9]={ 0, 0, 1, 1, 0, 0, 0, 0, 0};
static int max[9]={99, 99,12,31,23,59,59,12,59}; static int max[9]={99, 99,12,31,23,59,59,12,59};
@ -157,9 +152,7 @@ err:
return(0); return(0);
} }
int ASN1_GENERALIZEDTIME_set_string(s,str) int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str)
ASN1_GENERALIZEDTIME *s;
char *str;
{ {
ASN1_GENERALIZEDTIME t; ASN1_GENERALIZEDTIME t;
@ -179,9 +172,8 @@ char *str;
return(0); return(0);
} }
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(s, t) ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
ASN1_GENERALIZEDTIME *s; time_t t)
time_t t;
{ {
char *p; char *p;
struct tm *ts; struct tm *ts;

View File

@ -68,9 +68,7 @@
* ASN1err(ASN1_F_ASN1_HEADER_NEW,ERR_R_BAD_GET_ASN1_OBJECT_CALL); * ASN1err(ASN1_F_ASN1_HEADER_NEW,ERR_R_BAD_GET_ASN1_OBJECT_CALL);
*/ */
int i2d_ASN1_HEADER(a,pp) int i2d_ASN1_HEADER(ASN1_HEADER *a, unsigned char **pp)
ASN1_HEADER *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -85,10 +83,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
ASN1_HEADER *d2i_ASN1_HEADER(a,pp,length) ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a, unsigned char **pp,
ASN1_HEADER **a; long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,ASN1_HEADER *,ASN1_HEADER_new); M_ASN1_D2I_vars(a,ASN1_HEADER *,ASN1_HEADER_new);
@ -107,7 +103,7 @@ long length;
M_ASN1_D2I_Finish(a,ASN1_HEADER_free,ASN1_F_D2I_ASN1_HEADER); M_ASN1_D2I_Finish(a,ASN1_HEADER_free,ASN1_F_D2I_ASN1_HEADER);
} }
ASN1_HEADER *ASN1_HEADER_new() ASN1_HEADER *ASN1_HEADER_new(void)
{ {
ASN1_HEADER *ret=NULL; ASN1_HEADER *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -120,8 +116,7 @@ ASN1_HEADER *ASN1_HEADER_new()
M_ASN1_New_Error(ASN1_F_ASN1_HEADER_NEW); M_ASN1_New_Error(ASN1_F_ASN1_HEADER_NEW);
} }
void ASN1_HEADER_free(a) void ASN1_HEADER_free(ASN1_HEADER *a)
ASN1_HEADER *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_OCTET_STRING_free(a->header); ASN1_OCTET_STRING_free(a->header);

View File

@ -62,10 +62,7 @@
#include "asn1_mac.h" #include "asn1_mac.h"
#ifndef NO_FP_API #ifndef NO_FP_API
int ASN1_i2d_fp(i2d,out,x) int ASN1_i2d_fp(int (*i2d)(), FILE *out, unsigned char *x)
int (*i2d)();
FILE *out;
unsigned char *x;
{ {
BIO *b; BIO *b;
int ret; int ret;
@ -82,10 +79,7 @@ unsigned char *x;
} }
#endif #endif
int ASN1_i2d_bio(i2d,out,x) int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x)
int (*i2d)();
BIO *out;
unsigned char *x;
{ {
char *b; char *b;
unsigned char *p; unsigned char *p;

View File

@ -63,9 +63,7 @@
/* ASN1err(ASN1_F_D2I_ASN1_INTEGER,ASN1_R_EXPECTING_AN_INTEGER); /* ASN1err(ASN1_F_D2I_ASN1_INTEGER,ASN1_R_EXPECTING_AN_INTEGER);
*/ */
int i2d_ASN1_INTEGER(a,pp) int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
ASN1_INTEGER *a;
unsigned char **pp;
{ {
int pad=0,ret,r,i,t; int pad=0,ret,r,i,t;
unsigned char *p,*pt,*n,pb=0; unsigned char *p,*pt,*n,pb=0;
@ -116,10 +114,8 @@ unsigned char **pp;
return(r); return(r);
} }
ASN1_INTEGER *d2i_ASN1_INTEGER(a, pp, length) ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
ASN1_INTEGER **a; long length)
unsigned char **pp;
long length;
{ {
ASN1_INTEGER *ret=NULL; ASN1_INTEGER *ret=NULL;
unsigned char *p,*to,*s; unsigned char *p,*to,*s;
@ -194,9 +190,7 @@ err:
return(NULL); return(NULL);
} }
int ASN1_INTEGER_set(a,v) int ASN1_INTEGER_set(ASN1_INTEGER *a, long v)
ASN1_INTEGER *a;
long v;
{ {
int i,j,k; int i,j,k;
unsigned char buf[sizeof(long)+1]; unsigned char buf[sizeof(long)+1];
@ -236,8 +230,7 @@ long v;
return(1); return(1);
} }
long ASN1_INTEGER_get(a) long ASN1_INTEGER_get(ASN1_INTEGER *a)
ASN1_INTEGER *a;
{ {
int neg=0,i; int neg=0,i;
long r=0; long r=0;
@ -266,9 +259,7 @@ ASN1_INTEGER *a;
return(r); return(r);
} }
ASN1_INTEGER *BN_to_ASN1_INTEGER(bn,ai) ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
BIGNUM *bn;
ASN1_INTEGER *ai;
{ {
ASN1_INTEGER *ret; ASN1_INTEGER *ret;
int len,j; int len,j;
@ -293,9 +284,7 @@ err:
return(NULL); return(NULL);
} }
BIGNUM *ASN1_INTEGER_to_BN(ai,bn) BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai, BIGNUM *bn)
ASN1_INTEGER *ai;
BIGNUM *bn;
{ {
BIGNUM *ret; BIGNUM *ret;

View File

@ -73,12 +73,12 @@ static ASN1_METHOD bit_string_meth={
(char *(*)()) ASN1_STRING_new, (char *(*)()) ASN1_STRING_new,
(void (*)()) ASN1_STRING_free}; (void (*)()) ASN1_STRING_free};
ASN1_METHOD *ASN1_IA5STRING_asn1_meth() ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void)
{ {
return(&ia5string_meth); return(&ia5string_meth);
} }
ASN1_METHOD *ASN1_BIT_STRING_asn1_meth() ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void)
{ {
return(&bit_string_meth); return(&bit_string_meth);
} }

View File

@ -67,9 +67,7 @@
* ASN1err(ASN1_F_I2T_ASN1_OBJECT,ASN1_R_BAD_OBJECT_HEADER); * ASN1err(ASN1_F_I2T_ASN1_OBJECT,ASN1_R_BAD_OBJECT_HEADER);
*/ */
int i2d_ASN1_OBJECT(a, pp) int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
ASN1_OBJECT *a;
unsigned char **pp;
{ {
unsigned char *p; unsigned char *p;
@ -87,11 +85,7 @@ unsigned char **pp;
return(a->length); return(a->length);
} }
int a2d_ASN1_OBJECT(out,olen,buf,num) int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
unsigned char *out;
int olen;
const char *buf;
int num;
{ {
int i,first,len=0,c; int i,first,len=0,c;
char tmp[24]; char tmp[24];
@ -181,10 +175,7 @@ err:
return(0); return(0);
} }
int i2t_ASN1_OBJECT(buf,buf_len,a) int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a)
char *buf;
int buf_len;
ASN1_OBJECT *a;
{ {
int i,idx=0,n=0,len,nid; int i,idx=0,n=0,len,nid;
unsigned long l; unsigned long l;
@ -257,9 +248,7 @@ ASN1_OBJECT *a;
return(n); return(n);
} }
int i2a_ASN1_OBJECT(bp,a) int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)
BIO *bp;
ASN1_OBJECT *a;
{ {
char buf[80]; char buf[80];
int i; int i;
@ -272,10 +261,8 @@ ASN1_OBJECT *a;
return(i); return(i);
} }
ASN1_OBJECT *d2i_ASN1_OBJECT(a, pp, length) ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
ASN1_OBJECT **a; long length)
unsigned char **pp;
long length;
{ {
ASN1_OBJECT *ret=NULL; ASN1_OBJECT *ret=NULL;
unsigned char *p; unsigned char *p;
@ -331,7 +318,7 @@ err:
return(NULL); return(NULL);
} }
ASN1_OBJECT *ASN1_OBJECT_new() ASN1_OBJECT *ASN1_OBJECT_new(void)
{ {
ASN1_OBJECT *ret; ASN1_OBJECT *ret;
@ -350,8 +337,7 @@ ASN1_OBJECT *ASN1_OBJECT_new()
return(ret); return(ret);
} }
void ASN1_OBJECT_free(a) void ASN1_OBJECT_free(ASN1_OBJECT *a)
ASN1_OBJECT *a;
{ {
if (a == NULL) return; if (a == NULL) return;
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS)
@ -372,11 +358,8 @@ ASN1_OBJECT *a;
Free(a); Free(a);
} }
ASN1_OBJECT *ASN1_OBJECT_create(nid,data,len,sn,ln) ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
int nid; char *sn, char *ln)
unsigned char *data;
int len;
char *sn,*ln;
{ {
ASN1_OBJECT o; ASN1_OBJECT o;

View File

@ -63,18 +63,14 @@
/* ASN1err(ASN1_F_D2I_ASN1_OCTET_STRING,ASN1_R_EXPECTING_AN_OCTET_STRING); /* ASN1err(ASN1_F_D2I_ASN1_OCTET_STRING,ASN1_R_EXPECTING_AN_OCTET_STRING);
*/ */
int i2d_ASN1_OCTET_STRING(a, pp) int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **pp)
ASN1_OCTET_STRING *a;
unsigned char **pp;
{ {
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
V_ASN1_OCTET_STRING,V_ASN1_UNIVERSAL)); V_ASN1_OCTET_STRING,V_ASN1_UNIVERSAL));
} }
ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(a, pp, length) ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a,
ASN1_OCTET_STRING **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
ASN1_OCTET_STRING *ret=NULL; ASN1_OCTET_STRING *ret=NULL;

View File

@ -64,43 +64,30 @@
* ASN1err(ASN1_F_D2I_ASN1_PRINT_TYPE,ASN1_R_TAG_VALUE_TOO_HIGH); * ASN1err(ASN1_F_D2I_ASN1_PRINT_TYPE,ASN1_R_TAG_VALUE_TOO_HIGH);
*/ */
int i2d_ASN1_IA5STRING(a,pp) int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **pp)
ASN1_IA5STRING *a;
unsigned char **pp;
{ return(M_i2d_ASN1_IA5STRING(a,pp)); } { return(M_i2d_ASN1_IA5STRING(a,pp)); }
ASN1_IA5STRING *d2i_ASN1_IA5STRING(a,pp,l) ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, unsigned char **pp,
ASN1_IA5STRING **a; long l)
unsigned char **pp;
long l;
{ return(M_d2i_ASN1_IA5STRING(a,pp,l)); } { return(M_d2i_ASN1_IA5STRING(a,pp,l)); }
ASN1_T61STRING *d2i_ASN1_T61STRING(a,pp,l) ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, unsigned char **pp,
ASN1_T61STRING **a; long l)
unsigned char **pp;
long l;
{ return(M_d2i_ASN1_T61STRING(a,pp,l)); } { return(M_d2i_ASN1_T61STRING(a,pp,l)); }
ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(a,pp,l) ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a,
ASN1_PRINTABLESTRING **a; unsigned char **pp, long l)
unsigned char **pp; { return(M_d2i_ASN1_PRINTABLESTRING(a,pp,
long l; l)); }
{ return(M_d2i_ASN1_PRINTABLESTRING(a,pp,l)); }
int i2d_ASN1_PRINTABLE(a,pp) int i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **pp)
ASN1_STRING *a;
unsigned char **pp;
{ return(M_i2d_ASN1_PRINTABLE(a,pp)); } { return(M_i2d_ASN1_PRINTABLE(a,pp)); }
ASN1_STRING *d2i_ASN1_PRINTABLE(a,pp,l) ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a, unsigned char **pp,
ASN1_STRING **a; long l)
unsigned char **pp;
long l;
{ return(M_d2i_ASN1_PRINTABLE(a,pp,l)); } { return(M_d2i_ASN1_PRINTABLE(a,pp,l)); }
int ASN1_PRINTABLE_type(s,len) int ASN1_PRINTABLE_type(unsigned char *s, int len)
unsigned char *s;
int len;
{ {
int c; int c;
int ia5=0; int ia5=0;
@ -131,8 +118,7 @@ int len;
return(V_ASN1_PRINTABLESTRING); return(V_ASN1_PRINTABLESTRING);
} }
int ASN1_UNIVERSALSTRING_to_string(s) int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
ASN1_UNIVERSALSTRING *s;
{ {
int i; int i;
unsigned char *p; unsigned char *p;
@ -160,24 +146,16 @@ ASN1_UNIVERSALSTRING *s;
} }
int i2d_DIRECTORYSTRING(a,pp) int i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **pp)
ASN1_STRING *a;
unsigned char **pp;
{ return(M_i2d_DIRECTORYSTRING(a,pp)); } { return(M_i2d_DIRECTORYSTRING(a,pp)); }
ASN1_STRING *d2i_DIRECTORYSTRING(a,pp,l) ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp,
ASN1_STRING **a; long l)
unsigned char **pp;
long l;
{ return(M_d2i_DIRECTORYSTRING(a,pp,l)); } { return(M_d2i_DIRECTORYSTRING(a,pp,l)); }
int i2d_DISPLAYTEXT(a,pp) int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **pp)
ASN1_STRING *a;
unsigned char **pp;
{ return(M_i2d_DISPLAYTEXT(a,pp)); } { return(M_i2d_DISPLAYTEXT(a,pp)); }
ASN1_STRING *d2i_DISPLAYTEXT(a,pp,l) ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, unsigned char **pp,
ASN1_STRING **a; long l)
unsigned char **pp;
long l;
{ return(M_d2i_DISPLAYTEXT(a,pp,l)); } { return(M_d2i_DISPLAYTEXT(a,pp,l)); }

View File

@ -84,14 +84,9 @@ static int SetBlobCmp(const void *elem1, const void *elem2 )
return b1->cbData-b2->cbData; return b1->cbData-b2->cbData;
} }
int i2d_ASN1_SET(a,pp,func,ex_tag,ex_class,is_set) /* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */
STACK *a; int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
unsigned char **pp; int ex_class, int is_set)
int (*func)();
int ex_tag;
int ex_class;
int is_set; /* if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */
{ {
int ret=0,r; int ret=0,r;
int i; int i;
@ -158,14 +153,8 @@ SetBlob
return(r); return(r);
} }
STACK *d2i_ASN1_SET(a,pp,length,func,free_func,ex_tag,ex_class) STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
STACK **a; char *(*func)(), void (*free_func)(), int ex_tag, int ex_class)
unsigned char **pp;
long length;
char *(*func)();
void (*free_func)();
int ex_tag;
int ex_class;
{ {
ASN1_CTX c; ASN1_CTX c;
STACK *ret=NULL; STACK *ret=NULL;

View File

@ -68,14 +68,9 @@
#include "objects.h" #include "objects.h"
#include "buffer.h" #include "buffer.h"
int ASN1_sign(i2d,algor1,algor2,signature,data,pkey,type) int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
int (*i2d)(); ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey,
X509_ALGOR *algor1; const EVP_MD *type)
X509_ALGOR *algor2;
ASN1_BIT_STRING *signature;
char *data;
EVP_PKEY *pkey;
const EVP_MD *type;
{ {
EVP_MD_CTX ctx; EVP_MD_CTX ctx;
unsigned char *p,*buf_in=NULL,*buf_out=NULL; unsigned char *p,*buf_in=NULL,*buf_out=NULL;

View File

@ -66,9 +66,7 @@
#include "cryptlib.h" #include "cryptlib.h"
#include "asn1.h" #include "asn1.h"
int i2d_ASN1_TIME(a,pp) int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp)
ASN1_TIME *a;
unsigned char **pp;
{ {
if(a->type == V_ASN1_UTCTIME || a->type == V_ASN1_GENERALIZEDTIME) if(a->type == V_ASN1_UTCTIME || a->type == V_ASN1_GENERALIZEDTIME)
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
@ -78,10 +76,7 @@ unsigned char **pp;
} }
ASN1_TIME *d2i_ASN1_TIME(a, pp, length) ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, unsigned char **pp, long length)
ASN1_TIME **a;
unsigned char **pp;
long length;
{ {
unsigned char tag; unsigned char tag;
tag = **pp & ~V_ASN1_CONSTRUCTED; tag = **pp & ~V_ASN1_CONSTRUCTED;
@ -94,9 +89,7 @@ long length;
} }
ASN1_TIME *ASN1_TIME_set(s, t) ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
ASN1_TIME *s;
time_t t;
{ {
struct tm *ts; struct tm *ts;
#if defined(THREADS) && !defined(WIN32) #if defined(THREADS) && !defined(WIN32)

View File

@ -70,9 +70,7 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a);
static void ASN1_TYPE_component_free(); static void ASN1_TYPE_component_free();
#endif #endif
int i2d_ASN1_TYPE(a,pp) int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **pp)
ASN1_TYPE *a;
unsigned char **pp;
{ {
int r=0; int r=0;
@ -150,10 +148,7 @@ unsigned char **pp;
return(r); return(r);
} }
ASN1_TYPE *d2i_ASN1_TYPE(a,pp,length) ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length)
ASN1_TYPE **a;
unsigned char **pp;
long length;
{ {
ASN1_TYPE *ret=NULL; ASN1_TYPE *ret=NULL;
unsigned char *q,*p,*max; unsigned char *q,*p,*max;
@ -280,7 +275,7 @@ err:
return(NULL); return(NULL);
} }
ASN1_TYPE *ASN1_TYPE_new() ASN1_TYPE *ASN1_TYPE_new(void)
{ {
ASN1_TYPE *ret=NULL; ASN1_TYPE *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -292,16 +287,14 @@ ASN1_TYPE *ASN1_TYPE_new()
M_ASN1_New_Error(ASN1_F_ASN1_TYPE_NEW); M_ASN1_New_Error(ASN1_F_ASN1_TYPE_NEW);
} }
void ASN1_TYPE_free(a) void ASN1_TYPE_free(ASN1_TYPE *a)
ASN1_TYPE *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_TYPE_component_free(a); ASN1_TYPE_component_free(a);
Free((char *)(char *)a); Free((char *)(char *)a);
} }
int ASN1_TYPE_get(a) int ASN1_TYPE_get(ASN1_TYPE *a)
ASN1_TYPE *a;
{ {
if (a->value.ptr != NULL) if (a->value.ptr != NULL)
return(a->type); return(a->type);
@ -309,10 +302,7 @@ ASN1_TYPE *a;
return(0); return(0);
} }
void ASN1_TYPE_set(a,type,value) void ASN1_TYPE_set(ASN1_TYPE *a, int type, char *value)
ASN1_TYPE *a;
int type;
char *value;
{ {
if (a->value.ptr != NULL) if (a->value.ptr != NULL)
ASN1_TYPE_component_free(a); ASN1_TYPE_component_free(a);
@ -320,8 +310,7 @@ char *value;
a->value.ptr=value; a->value.ptr=value;
} }
static void ASN1_TYPE_component_free(a) static void ASN1_TYPE_component_free(ASN1_TYPE *a)
ASN1_TYPE *a;
{ {
if (a == NULL) return; if (a == NULL) return;

View File

@ -65,19 +65,15 @@
* ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ASN1_R_EXPECTING_A_UTCTIME); * ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ASN1_R_EXPECTING_A_UTCTIME);
*/ */
int i2d_ASN1_UTCTIME(a,pp) int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp)
ASN1_UTCTIME *a;
unsigned char **pp;
{ {
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
V_ASN1_UTCTIME,V_ASN1_UNIVERSAL)); V_ASN1_UTCTIME,V_ASN1_UNIVERSAL));
} }
ASN1_UTCTIME *d2i_ASN1_UTCTIME(a, pp, length) ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp,
ASN1_UTCTIME **a; long length)
unsigned char **pp;
long length;
{ {
ASN1_UTCTIME *ret=NULL; ASN1_UTCTIME *ret=NULL;
@ -101,8 +97,7 @@ err:
return(NULL); return(NULL);
} }
int ASN1_UTCTIME_check(d) int ASN1_UTCTIME_check(ASN1_UTCTIME *d)
ASN1_UTCTIME *d;
{ {
static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0}; static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0};
static int max[8]={99,12,31,23,59,59,12,59}; static int max[8]={99,12,31,23,59,59,12,59};
@ -152,9 +147,7 @@ err:
return(0); return(0);
} }
int ASN1_UTCTIME_set_string(s,str) int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str)
ASN1_UTCTIME *s;
char *str;
{ {
ASN1_UTCTIME t; ASN1_UTCTIME t;
@ -174,9 +167,7 @@ char *str;
return(0); return(0);
} }
ASN1_UTCTIME *ASN1_UTCTIME_set(s, t) ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
ASN1_UTCTIME *s;
time_t t;
{ {
char *p; char *p;
struct tm *ts; struct tm *ts;

View File

@ -63,18 +63,14 @@
/* ASN1err(ASN1_F_D2I_ASN1_UTF8STRING,ERR_R_MALLOC_FAILURE); /* ASN1err(ASN1_F_D2I_ASN1_UTF8STRING,ERR_R_MALLOC_FAILURE);
*/ */
int i2d_ASN1_UTF8STRING(a, pp) int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **pp)
ASN1_UTF8STRING *a;
unsigned char **pp;
{ {
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
V_ASN1_UTF8STRING,V_ASN1_UNIVERSAL)); V_ASN1_UTF8STRING,V_ASN1_UNIVERSAL));
} }
ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(a, pp, length) ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, unsigned char **pp,
ASN1_UTF8STRING **a; long length)
unsigned char **pp;
long length;
{ {
ASN1_UTF8STRING *ret=NULL; ASN1_UTF8STRING *ret=NULL;

View File

@ -68,12 +68,8 @@
#include "buffer.h" #include "buffer.h"
#include "evp.h" #include "evp.h"
int ASN1_verify(i2d,a,signature,data,pkey) int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature,
int (*i2d)(); char *data, EVP_PKEY *pkey)
X509_ALGOR *a;
ASN1_BIT_STRING *signature;
char *data;
EVP_PKEY *pkey;
{ {
EVP_MD_CTX ctx; EVP_MD_CTX ctx;
const EVP_MD *type; const EVP_MD *type;

View File

@ -63,18 +63,14 @@
/* ASN1err(ASN1_F_D2I_ASN1_VISIBLESTRING,ERR_R_MALLOC_FAILURE); /* ASN1err(ASN1_F_D2I_ASN1_VISIBLESTRING,ERR_R_MALLOC_FAILURE);
*/ */
int i2d_ASN1_VISIBLESTRING(a, pp) int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **pp)
ASN1_VISIBLESTRING *a;
unsigned char **pp;
{ {
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
V_ASN1_VISIBLESTRING,V_ASN1_UNIVERSAL)); V_ASN1_VISIBLESTRING,V_ASN1_UNIVERSAL));
} }
ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(a, pp, length) ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a,
ASN1_VISIBLESTRING **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
ASN1_VISIBLESTRING *ret=NULL; ASN1_VISIBLESTRING *ret=NULL;

View File

@ -306,7 +306,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
#endif #endif
void ERR_load_ASN1_strings() void ERR_load_ASN1_strings(void)
{ {
static int init=1; static int init=1;

View File

@ -71,9 +71,7 @@ static void asn1_put_length();
const char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT; const char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT;
int ASN1_check_infinite_end(p,len) int ASN1_check_infinite_end(unsigned char **p, long len)
unsigned char **p;
long len;
{ {
/* If there is 0 or 1 byte left, the length check should pick /* If there is 0 or 1 byte left, the length check should pick
* things up */ * things up */
@ -88,12 +86,8 @@ long len;
} }
int ASN1_get_object(pp, plength, ptag, pclass, omax) int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
unsigned char **pp; long omax)
long *plength;
int *ptag;
int *pclass;
long omax;
{ {
int i,ret; int i,ret;
long l; long l;
@ -152,11 +146,7 @@ err:
return(0x80); return(0x80);
} }
static int asn1_get_length(pp,inf,rl,max) static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
unsigned char **pp;
int *inf;
long *rl;
int max;
{ {
unsigned char *p= *pp; unsigned char *p= *pp;
long ret=0; long ret=0;
@ -193,12 +183,8 @@ int max;
/* class 0 is constructed /* class 0 is constructed
* constructed == 2 for indefinitle length constructed */ * constructed == 2 for indefinitle length constructed */
void ASN1_put_object(pp,constructed,length,tag,xclass) void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
unsigned char **pp; int xclass)
int constructed;
int length;
int tag;
int xclass;
{ {
unsigned char *p= *pp; unsigned char *p= *pp;
int i; int i;
@ -224,9 +210,7 @@ int xclass;
*pp=p; *pp=p;
} }
static void asn1_put_length(pp, length) static void asn1_put_length(unsigned char **pp, int length)
unsigned char **pp;
int length;
{ {
unsigned char *p= *pp; unsigned char *p= *pp;
int i,l; int i,l;
@ -249,10 +233,7 @@ int length;
*pp=p; *pp=p;
} }
int ASN1_object_size(constructed, length, tag) int ASN1_object_size(int constructed, int length, int tag)
int constructed;
int length;
int tag;
{ {
int ret; int ret;
@ -280,8 +261,7 @@ int tag;
return(ret); return(ret);
} }
int asn1_Finish(c) int asn1_Finish(ASN1_CTX *c)
ASN1_CTX *c;
{ {
if ((c->inf == (1|V_ASN1_CONSTRUCTED)) && (!c->eos)) if ((c->inf == (1|V_ASN1_CONSTRUCTED)) && (!c->eos))
{ {
@ -300,9 +280,7 @@ ASN1_CTX *c;
return(1); return(1);
} }
int asn1_GetSequence(c,length) int asn1_GetSequence(ASN1_CTX *c, long *length)
ASN1_CTX *c;
long *length;
{ {
unsigned char *q; unsigned char *q;
@ -331,8 +309,7 @@ long *length;
return(1); return(1);
} }
ASN1_STRING *ASN1_STRING_dup(str) ASN1_STRING *ASN1_STRING_dup(ASN1_STRING *str)
ASN1_STRING *str;
{ {
ASN1_STRING *ret; ASN1_STRING *ret;
@ -347,10 +324,7 @@ ASN1_STRING *str;
return(ret); return(ret);
} }
int ASN1_STRING_set(str,data,len) int ASN1_STRING_set(ASN1_STRING *str, unsigned char *data, int len)
ASN1_STRING *str;
unsigned char *data;
int len;
{ {
char *c; char *c;
@ -385,14 +359,13 @@ int len;
return(1); return(1);
} }
ASN1_STRING *ASN1_STRING_new() ASN1_STRING *ASN1_STRING_new(void)
{ {
return(ASN1_STRING_type_new(V_ASN1_OCTET_STRING)); return(ASN1_STRING_type_new(V_ASN1_OCTET_STRING));
} }
ASN1_STRING *ASN1_STRING_type_new(type) ASN1_STRING *ASN1_STRING_type_new(int type)
int type;
{ {
ASN1_STRING *ret; ASN1_STRING *ret;
@ -409,16 +382,14 @@ int type;
return(ret); return(ret);
} }
void ASN1_STRING_free(a) void ASN1_STRING_free(ASN1_STRING *a)
ASN1_STRING *a;
{ {
if (a == NULL) return; if (a == NULL) return;
if (a->data != NULL) Free((char *)a->data); if (a->data != NULL) Free((char *)a->data);
Free((char *)a); Free((char *)a);
} }
int ASN1_STRING_cmp(a,b) int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b)
ASN1_STRING *a,*b;
{ {
int i; int i;
@ -435,9 +406,7 @@ ASN1_STRING *a,*b;
return(i); return(i);
} }
void asn1_add_error(address,offset) void asn1_add_error(unsigned char *address, int offset)
unsigned char *address;
int offset;
{ {
char buf1[16],buf2[16]; char buf1[16],buf2[16];

View File

@ -72,12 +72,8 @@ static int asn1_print_info();
static int asn1_parse2(); static int asn1_parse2();
#endif #endif
static int asn1_print_info(bp, tag, xclass, constructed,indent) static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
BIO *bp; int indent)
int tag;
int xclass;
int constructed;
int indent;
{ {
static const char fmt[]="%-18s"; static const char fmt[]="%-18s";
static const char fmt2[]="%2d %-15s"; static const char fmt2[]="%2d %-15s";
@ -165,22 +161,13 @@ err:
return(0); return(0);
} }
int ASN1_parse(bp, pp, len, indent) int ASN1_parse(BIO *bp, unsigned char *pp, long len, int indent)
BIO *bp;
unsigned char *pp;
long len;
int indent;
{ {
return(asn1_parse2(bp,&pp,len,0,0,indent)); return(asn1_parse2(bp,&pp,len,0,0,indent));
} }
static int asn1_parse2(bp, pp, length, offset, depth, indent) static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
BIO *bp; int depth, int indent)
unsigned char **pp;
long length;
int offset;
int depth;
int indent;
{ {
unsigned char *p,*ep,*tot,*op,*opp; unsigned char *p,*ep,*tot,*op,*opp;
long len; long len;

View File

@ -64,11 +64,8 @@
/* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */
STACK *ASN1_seq_unpack(buf, len, d2i, free_func) STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
unsigned char *buf; void (*free_func)())
int len;
char *(*d2i)();
void (*free_func)();
{ {
STACK *sk; STACK *sk;
unsigned char *pbuf; unsigned char *pbuf;
@ -83,11 +80,8 @@ void (*free_func)();
* Malloc'ed buffer * Malloc'ed buffer
*/ */
unsigned char *ASN1_seq_pack(safes, i2d, buf, len) unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
STACK *safes; int *len)
int (*i2d)();
unsigned char **buf;
int *len;
{ {
int safelen; int safelen;
unsigned char *safe, *p; unsigned char *safe, *p;
@ -110,9 +104,7 @@ int *len;
/* Extract an ASN1 object from an ASN1_STRING */ /* Extract an ASN1 object from an ASN1_STRING */
char *ASN1_unpack_string (oct, d2i) char *ASN1_unpack_string (ASN1_STRING *oct, char *(*d2i)())
ASN1_STRING *oct;
char *(*d2i)();
{ {
unsigned char *p; unsigned char *p;
char *ret; char *ret;
@ -125,10 +117,7 @@ char *(*d2i)();
/* Pack an ASN1 object into an ASN1_STRING */ /* Pack an ASN1 object into an ASN1_STRING */
ASN1_STRING *ASN1_pack_string (obj, i2d, oct) ASN1_STRING *ASN1_pack_string (char *obj, int (*i2d)(), ASN1_STRING **oct)
char *obj;
int (*i2d)();
ASN1_STRING **oct;
{ {
unsigned char *p; unsigned char *p;
ASN1_STRING *octmp; ASN1_STRING *octmp;

View File

@ -68,10 +68,7 @@
* ASN1err(ASN1_F_I2D_DHPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); * ASN1err(ASN1_F_I2D_DHPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
*/ */
DH *d2i_DHparams(a,pp,length) DH *d2i_DHparams(DH **a, unsigned char **pp, long length)
DH **a;
unsigned char **pp;
long length;
{ {
int i=ERR_R_NESTED_ASN1_ERROR; int i=ERR_R_NESTED_ASN1_ERROR;
ASN1_INTEGER *bs=NULL; ASN1_INTEGER *bs=NULL;

View File

@ -68,10 +68,7 @@
* ASN1err(ASN1_F_I2D_DSAPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); * ASN1err(ASN1_F_I2D_DSAPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
*/ */
DSA *d2i_DSAparams(a,pp,length) DSA *d2i_DSAparams(DSA **a, unsigned char **pp, long length)
DSA **a;
unsigned char **pp;
long length;
{ {
int i=ERR_R_NESTED_ASN1_ERROR; int i=ERR_R_NESTED_ASN1_ERROR;
ASN1_INTEGER *bs=NULL; ASN1_INTEGER *bs=NULL;

View File

@ -63,11 +63,8 @@
#include "objects.h" #include "objects.h"
#include "x509.h" #include "x509.h"
EVP_PKEY *d2i_PrivateKey(type,a,pp,length) EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp,
int type; long length)
EVP_PKEY **a;
unsigned char **pp;
long length;
{ {
EVP_PKEY *ret; EVP_PKEY *ret;

View File

@ -63,11 +63,8 @@
#include "objects.h" #include "objects.h"
#include "x509.h" #include "x509.h"
EVP_PKEY *d2i_PublicKey(type,a,pp,length) EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
int type; long length)
EVP_PKEY **a;
unsigned char **pp;
long length;
{ {
EVP_PKEY *ret; EVP_PKEY *ret;

View File

@ -75,15 +75,12 @@ static ASN1_METHOD method={
(char *(*)())RSA_new, (char *(*)())RSA_new,
(void (*)()) RSA_free}; (void (*)()) RSA_free};
ASN1_METHOD *RSAPrivateKey_asn1_meth() ASN1_METHOD *RSAPrivateKey_asn1_meth(void)
{ {
return(&method); return(&method);
} }
RSA *d2i_RSAPrivateKey(a,pp,length) RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length)
RSA **a;
unsigned char **pp;
long length;
{ {
int i=ASN1_R_PARSING; int i=ASN1_R_PARSING;
ASN1_INTEGER *bs=NULL; ASN1_INTEGER *bs=NULL;

View File

@ -68,10 +68,7 @@
* ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); * ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
*/ */
RSA *d2i_RSAPublicKey(a,pp,length) RSA *d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length)
RSA **a;
unsigned char **pp;
long length;
{ {
int i=ASN1_R_PARSING; int i=ASN1_R_PARSING;
ASN1_INTEGER *bs=NULL; ASN1_INTEGER *bs=NULL;

View File

@ -71,10 +71,7 @@
* ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ASN1_R_PARSING); * ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ASN1_R_PARSING);
*/ */
DSA *d2i_DSAPrivateKey(a,pp,length) DSA *d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length)
DSA **a;
unsigned char **pp;
long length;
{ {
int i=ASN1_R_PARSING; int i=ASN1_R_PARSING;
ASN1_INTEGER *bs=NULL; ASN1_INTEGER *bs=NULL;

View File

@ -70,10 +70,7 @@
* ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); * ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
*/ */
DSA *d2i_DSAPublicKey(a,pp,length) DSA *d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length)
DSA **a;
unsigned char **pp;
long length;
{ {
int i=ASN1_R_PARSING; int i=ASN1_R_PARSING;
ASN1_INTEGER *bs=NULL; ASN1_INTEGER *bs=NULL;

View File

@ -61,10 +61,7 @@
#include "asn1.h" #include "asn1.h"
#include "asn1_mac.h" #include "asn1_mac.h"
int ASN1_TYPE_set_octetstring(a,data,len) int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
ASN1_TYPE *a;
unsigned char *data;
int len;
{ {
ASN1_STRING *os; ASN1_STRING *os;
@ -74,10 +71,9 @@ int len;
return(1); return(1);
} }
int ASN1_TYPE_get_octetstring(a,data,max_len) /* int max_len: for returned value */
ASN1_TYPE *a; int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data,
unsigned char *data; int max_len)
int max_len; /* for returned value */
{ {
int ret,num; int ret,num;
unsigned char *p; unsigned char *p;
@ -97,11 +93,8 @@ int max_len; /* for returned value */
return(ret); return(ret);
} }
int ASN1_TYPE_set_int_octetstring(a,num,data,len) int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data,
ASN1_TYPE *a; int len)
long num;
unsigned char *data;
int len;
{ {
int n,size; int n,size;
ASN1_OCTET_STRING os,*osp; ASN1_OCTET_STRING os,*osp;
@ -137,11 +130,9 @@ int len;
/* we return the actual length..., num may be missing, in which /* we return the actual length..., num may be missing, in which
* case, set it to zero */ * case, set it to zero */
int ASN1_TYPE_get_int_octetstring(a,num,data,max_len) /* int max_len: for returned value */
ASN1_TYPE *a; int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data,
long *num; int max_len)
unsigned char *data;
int max_len; /* for returned value */
{ {
int ret= -1,n; int ret= -1,n;
ASN1_INTEGER *ai=NULL; ASN1_INTEGER *ai=NULL;

View File

@ -63,9 +63,7 @@
/* Based on a_int.c: equivalent ENUMERATED functions */ /* Based on a_int.c: equivalent ENUMERATED functions */
int i2a_ASN1_ENUMERATED(bp, a) int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a)
BIO *bp;
ASN1_ENUMERATED *a;
{ {
int i,n=0; int i,n=0;
static const char *h="0123456789ABCDEF"; static const char *h="0123456789ABCDEF";
@ -98,11 +96,7 @@ err:
return(-1); return(-1);
} }
int a2i_ASN1_ENUMERATED(bp,bs,buf,size) int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
BIO *bp;
ASN1_ENUMERATED *bs;
char *buf;
int size;
{ {
int ret=0; int ret=0;
int i,j,k,m,n,again,bufsize; int i,j,k,m,n,again,bufsize;

View File

@ -61,9 +61,7 @@
#include "buffer.h" #include "buffer.h"
#include "x509.h" #include "x509.h"
int i2a_ASN1_INTEGER(bp, a) int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a)
BIO *bp;
ASN1_INTEGER *a;
{ {
int i,n=0; int i,n=0;
static const char *h="0123456789ABCDEF"; static const char *h="0123456789ABCDEF";
@ -96,11 +94,7 @@ err:
return(-1); return(-1);
} }
int a2i_ASN1_INTEGER(bp,bs,buf,size) int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
BIO *bp;
ASN1_INTEGER *bs;
char *buf;
int size;
{ {
int ret=0; int ret=0;
int i,j,k,m,n,again,bufsize; int i,j,k,m,n,again,bufsize;

View File

@ -61,10 +61,7 @@
#include "buffer.h" #include "buffer.h"
#include "x509.h" #include "x509.h"
int i2a_ASN1_STRING(bp, a, type) int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type)
BIO *bp;
ASN1_STRING *a;
int type;
{ {
int i,n=0; int i,n=0;
static const char *h="0123456789ABCDEF"; static const char *h="0123456789ABCDEF";
@ -97,11 +94,7 @@ err:
return(-1); return(-1);
} }
int a2i_ASN1_STRING(bp,bs,buf,size) int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
BIO *bp;
ASN1_STRING *bs;
char *buf;
int size;
{ {
int ret=0; int ret=0;
int i,j,k,m,n,again,bufsize; int i,j,k,m,n,again,bufsize;

View File

@ -67,9 +67,7 @@
* ASN1err(ASN1_F_X509_DHPARAMS_NEW,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_X509_DHPARAMS_NEW,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_DHparams(a,pp) int i2d_DHparams(DH *a, unsigned char **pp)
DH *a;
unsigned char **pp;
{ {
BIGNUM *num[3]; BIGNUM *num[3];
ASN1_INTEGER bs; ASN1_INTEGER bs;

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_DSAPARAMS,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_DSAPARAMS,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_DSAparams(a,pp) int i2d_DSAparams(DSA *a, unsigned char **pp)
DSA *a;
unsigned char **pp;
{ {
BIGNUM *num[3]; BIGNUM *num[3];
ASN1_INTEGER bs; ASN1_INTEGER bs;

View File

@ -62,9 +62,7 @@
#include "evp.h" #include "evp.h"
#include "objects.h" #include "objects.h"
int i2d_PrivateKey(a,pp) int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
EVP_PKEY *a;
unsigned char **pp;
{ {
#ifndef NO_RSA #ifndef NO_RSA
if (a->type == EVP_PKEY_RSA) if (a->type == EVP_PKEY_RSA)

View File

@ -62,9 +62,7 @@
#include "evp.h" #include "evp.h"
#include "objects.h" #include "objects.h"
int i2d_PublicKey(a,pp) int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp)
EVP_PKEY *a;
unsigned char **pp;
{ {
switch (a->type) switch (a->type)
{ {

View File

@ -68,9 +68,7 @@
* ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); * ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
*/ */
int i2d_RSAPrivateKey(a,pp) int i2d_RSAPrivateKey(RSA *a, unsigned char **pp)
RSA *a;
unsigned char **pp;
{ {
BIGNUM *num[9]; BIGNUM *num[9];
unsigned char data[1]; unsigned char data[1];

View File

@ -68,9 +68,7 @@
* ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); * ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
*/ */
int i2d_RSAPublicKey(a,pp) int i2d_RSAPublicKey(RSA *a, unsigned char **pp)
RSA *a;
unsigned char **pp;
{ {
BIGNUM *num[2]; BIGNUM *num[2];
ASN1_INTEGER bs; ASN1_INTEGER bs;

View File

@ -67,9 +67,7 @@
* ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); * ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
*/ */
int i2d_DSAPrivateKey(a,pp) int i2d_DSAPrivateKey(DSA *a, unsigned char **pp)
DSA *a;
unsigned char **pp;
{ {
BIGNUM *num[6]; BIGNUM *num[6];
unsigned char data[1]; unsigned char data[1];

View File

@ -67,9 +67,7 @@
* ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); * ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
*/ */
int i2d_DSAPublicKey(a,pp) int i2d_DSAPublicKey(DSA *a, unsigned char **pp)
DSA *a;
unsigned char **pp;
{ {
BIGNUM *num[4]; BIGNUM *num[4];
ASN1_INTEGER bs; ASN1_INTEGER bs;

View File

@ -92,10 +92,7 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new();
static void NETSCAPE_PKEY_free(); static void NETSCAPE_PKEY_free();
#endif #endif
int i2d_Netscape_RSA(a,pp,cb) int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
RSA *a;
unsigned char **pp;
int (*cb)();
{ {
int i,j,l[6]; int i,j,l[6];
NETSCAPE_PKEY *pkey; NETSCAPE_PKEY *pkey;
@ -204,11 +201,7 @@ err:
return(ret); return(ret);
} }
RSA *d2i_Netscape_RSA(a,pp,length,cb) RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)())
RSA **a;
unsigned char **pp;
long length;
int (*cb)();
{ {
RSA *ret=NULL; RSA *ret=NULL;
ASN1_OCTET_STRING *os=NULL; ASN1_OCTET_STRING *os=NULL;
@ -235,11 +228,8 @@ int (*cb)();
M_ASN1_D2I_Finish(a,RSA_free,ASN1_F_D2I_NETSCAPE_RSA); M_ASN1_D2I_Finish(a,RSA_free,ASN1_F_D2I_NETSCAPE_RSA);
} }
RSA *d2i_Netscape_RSA_2(a,pp,length,cb) RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length,
RSA **a; int (*cb)())
unsigned char **pp;
long length;
int (*cb)();
{ {
NETSCAPE_PKEY *pkey=NULL; NETSCAPE_PKEY *pkey=NULL;
RSA *ret=NULL; RSA *ret=NULL;
@ -306,9 +296,7 @@ err:
return(ret); return(ret);
} }
static int i2d_NETSCAPE_PKEY(a,pp) static int i2d_NETSCAPE_PKEY(NETSCAPE_PKEY *a, unsigned char **pp)
NETSCAPE_PKEY *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -326,10 +314,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(a,pp,length) static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(NETSCAPE_PKEY **a, unsigned char **pp,
NETSCAPE_PKEY **a; long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,NETSCAPE_PKEY *,NETSCAPE_PKEY_new); M_ASN1_D2I_vars(a,NETSCAPE_PKEY *,NETSCAPE_PKEY_new);
@ -341,7 +327,7 @@ long length;
M_ASN1_D2I_Finish(a,NETSCAPE_PKEY_free,ASN1_F_D2I_NETSCAPE_PKEY); M_ASN1_D2I_Finish(a,NETSCAPE_PKEY_free,ASN1_F_D2I_NETSCAPE_PKEY);
} }
static NETSCAPE_PKEY *NETSCAPE_PKEY_new() static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void)
{ {
NETSCAPE_PKEY *ret=NULL; NETSCAPE_PKEY *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -354,8 +340,7 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new()
M_ASN1_New_Error(ASN1_F_NETSCAPE_PKEY_NEW); M_ASN1_New_Error(ASN1_F_NETSCAPE_PKEY_NEW);
} }
static void NETSCAPE_PKEY_free(a) static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a)
NETSCAPE_PKEY *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free(a->version); ASN1_INTEGER_free(a->version);

View File

@ -70,9 +70,7 @@
* ASN1err(ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE,ERR_R_MALLOC_FAILURE); * ASN1err(ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE,ERR_R_MALLOC_FAILURE);
*/ */
int i2d_NETSCAPE_CERT_SEQUENCE(a,pp) int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **pp)
NETSCAPE_CERT_SEQUENCE *a;
unsigned char **pp;
{ {
int v = 0; int v = 0;
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -89,7 +87,7 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new() NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void)
{ {
NETSCAPE_CERT_SEQUENCE *ret=NULL; NETSCAPE_CERT_SEQUENCE *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -101,10 +99,8 @@ NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new()
M_ASN1_New_Error(ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW); M_ASN1_New_Error(ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW);
} }
NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(a,pp,length) NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a,
NETSCAPE_CERT_SEQUENCE **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,NETSCAPE_CERT_SEQUENCE *, M_ASN1_D2I_vars(a,NETSCAPE_CERT_SEQUENCE *,
NETSCAPE_CERT_SEQUENCE_new); NETSCAPE_CERT_SEQUENCE_new);
@ -116,8 +112,7 @@ long length;
M_ASN1_D2I_Finish(a, NETSCAPE_CERT_SEQUENCE_free, ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE); M_ASN1_D2I_Finish(a, NETSCAPE_CERT_SEQUENCE_free, ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE);
} }
void NETSCAPE_CERT_SEQUENCE_free (a) void NETSCAPE_CERT_SEQUENCE_free (NETSCAPE_CERT_SEQUENCE *a)
NETSCAPE_CERT_SEQUENCE *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_OBJECT_free(a->type); ASN1_OBJECT_free(a->type);

View File

@ -70,9 +70,7 @@
*ASN1err(ASN1_F_D2I_PBEPARAM,ASN1_R_DECODE_ERROR) *ASN1err(ASN1_F_D2I_PBEPARAM,ASN1_R_DECODE_ERROR)
*/ */
int i2d_PBEPARAM(a, pp) int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp)
PBEPARAM *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING); M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING);
@ -85,7 +83,7 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PBEPARAM *PBEPARAM_new() PBEPARAM *PBEPARAM_new(void)
{ {
PBEPARAM *ret=NULL; PBEPARAM *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -96,10 +94,7 @@ PBEPARAM *PBEPARAM_new()
M_ASN1_New_Error(ASN1_F_PBEPARAM_NEW); M_ASN1_New_Error(ASN1_F_PBEPARAM_NEW);
} }
PBEPARAM *d2i_PBEPARAM(a,pp,length) PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length)
PBEPARAM **a;
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PBEPARAM *,PBEPARAM_new); M_ASN1_D2I_vars(a,PBEPARAM *,PBEPARAM_new);
M_ASN1_D2I_Init(); M_ASN1_D2I_Init();
@ -109,8 +104,7 @@ long length;
M_ASN1_D2I_Finish(a, PBEPARAM_free, ASN1_F_D2I_PBEPARAM); M_ASN1_D2I_Finish(a, PBEPARAM_free, ASN1_F_D2I_PBEPARAM);
} }
void PBEPARAM_free (a) void PBEPARAM_free (PBEPARAM *a)
PBEPARAM *a;
{ {
if(a==NULL) return; if(a==NULL) return;
ASN1_OCTET_STRING_free(a->salt); ASN1_OCTET_STRING_free(a->salt);
@ -120,11 +114,8 @@ PBEPARAM *a;
/* Return an algorithm identifier for a PKCS#5 PBE algorithm */ /* Return an algorithm identifier for a PKCS#5 PBE algorithm */
X509_ALGOR *PKCS5_pbe_set(alg, iter, salt, saltlen) X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt,
int alg; int saltlen)
int iter;
unsigned char *salt;
int saltlen;
{ {
unsigned char *pdata, *ptmp; unsigned char *pdata, *ptmp;
int plen; int plen;

View File

@ -70,9 +70,7 @@
*ASN1err(ASN1_F_D2I_PBKDF2PARAM,ASN1_R_DECODE_ERROR) *ASN1err(ASN1_F_D2I_PBKDF2PARAM,ASN1_R_DECODE_ERROR)
*/ */
int i2d_PBE2PARAM(a, pp) int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **pp)
PBE2PARAM *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
M_ASN1_I2D_len (a->keyfunc, i2d_X509_ALGOR); M_ASN1_I2D_len (a->keyfunc, i2d_X509_ALGOR);
@ -86,7 +84,7 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PBE2PARAM *PBE2PARAM_new() PBE2PARAM *PBE2PARAM_new(void)
{ {
PBE2PARAM *ret=NULL; PBE2PARAM *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -97,10 +95,7 @@ PBE2PARAM *PBE2PARAM_new()
M_ASN1_New_Error(ASN1_F_PBE2PARAM_NEW); M_ASN1_New_Error(ASN1_F_PBE2PARAM_NEW);
} }
PBE2PARAM *d2i_PBE2PARAM(a,pp,length) PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, unsigned char **pp, long length)
PBE2PARAM **a;
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PBE2PARAM *,PBE2PARAM_new); M_ASN1_D2I_vars(a,PBE2PARAM *,PBE2PARAM_new);
M_ASN1_D2I_Init(); M_ASN1_D2I_Init();
@ -110,8 +105,7 @@ long length;
M_ASN1_D2I_Finish(a, PBE2PARAM_free, ASN1_F_D2I_PBE2PARAM); M_ASN1_D2I_Finish(a, PBE2PARAM_free, ASN1_F_D2I_PBE2PARAM);
} }
void PBE2PARAM_free (a) void PBE2PARAM_free (PBE2PARAM *a)
PBE2PARAM *a;
{ {
if(a==NULL) return; if(a==NULL) return;
X509_ALGOR_free(a->keyfunc); X509_ALGOR_free(a->keyfunc);
@ -119,9 +113,7 @@ PBE2PARAM *a;
Free ((char *)a); Free ((char *)a);
} }
int i2d_PBKDF2PARAM(a, pp) int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp)
PBKDF2PARAM *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING); M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING);
@ -139,7 +131,7 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PBKDF2PARAM *PBKDF2PARAM_new() PBKDF2PARAM *PBKDF2PARAM_new(void)
{ {
PBKDF2PARAM *ret=NULL; PBKDF2PARAM *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -152,10 +144,8 @@ PBKDF2PARAM *PBKDF2PARAM_new()
M_ASN1_New_Error(ASN1_F_PBKDF2PARAM_NEW); M_ASN1_New_Error(ASN1_F_PBKDF2PARAM_NEW);
} }
PBKDF2PARAM *d2i_PBKDF2PARAM(a,pp,length) PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, unsigned char **pp,
PBKDF2PARAM **a; long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PBKDF2PARAM *,PBKDF2PARAM_new); M_ASN1_D2I_vars(a,PBKDF2PARAM *,PBKDF2PARAM_new);
M_ASN1_D2I_Init(); M_ASN1_D2I_Init();
@ -167,8 +157,7 @@ long length;
M_ASN1_D2I_Finish(a, PBKDF2PARAM_free, ASN1_F_D2I_PBKDF2PARAM); M_ASN1_D2I_Finish(a, PBKDF2PARAM_free, ASN1_F_D2I_PBKDF2PARAM);
} }
void PBKDF2PARAM_free (a) void PBKDF2PARAM_free (PBKDF2PARAM *a)
PBKDF2PARAM *a;
{ {
if(a==NULL) return; if(a==NULL) return;
ASN1_OCTET_STRING_free(a->salt); ASN1_OCTET_STRING_free(a->salt);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_PKCS7_DIGEST,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_DIGEST,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_DIGEST(a,pp) int i2d_PKCS7_DIGEST(PKCS7_DIGEST *a, unsigned char **pp)
PKCS7_DIGEST *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -87,10 +85,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_DIGEST *d2i_PKCS7_DIGEST(a,pp,length) PKCS7_DIGEST *d2i_PKCS7_DIGEST(PKCS7_DIGEST **a, unsigned char **pp,
PKCS7_DIGEST **a; long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_DIGEST *,PKCS7_DIGEST_new); M_ASN1_D2I_vars(a,PKCS7_DIGEST *,PKCS7_DIGEST_new);
@ -104,7 +100,7 @@ long length;
M_ASN1_D2I_Finish(a,PKCS7_DIGEST_free,ASN1_F_D2I_PKCS7_DIGEST); M_ASN1_D2I_Finish(a,PKCS7_DIGEST_free,ASN1_F_D2I_PKCS7_DIGEST);
} }
PKCS7_DIGEST *PKCS7_DIGEST_new() PKCS7_DIGEST *PKCS7_DIGEST_new(void)
{ {
PKCS7_DIGEST *ret=NULL; PKCS7_DIGEST *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -118,8 +114,7 @@ PKCS7_DIGEST *PKCS7_DIGEST_new()
M_ASN1_New_Error(ASN1_F_PKCS7_DIGEST_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_DIGEST_NEW);
} }
void PKCS7_DIGEST_free(a) void PKCS7_DIGEST_free(PKCS7_DIGEST *a)
PKCS7_DIGEST *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free(a->version); ASN1_INTEGER_free(a->version);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_PKCS7_ENCRYPT,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_ENCRYPT,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_ENCRYPT(a,pp) int i2d_PKCS7_ENCRYPT(PKCS7_ENCRYPT *a, unsigned char **pp)
PKCS7_ENCRYPT *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -83,10 +81,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(a,pp,length) PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(PKCS7_ENCRYPT **a, unsigned char **pp,
PKCS7_ENCRYPT **a; long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_ENCRYPT *,PKCS7_ENCRYPT_new); M_ASN1_D2I_vars(a,PKCS7_ENCRYPT *,PKCS7_ENCRYPT_new);
@ -98,7 +94,7 @@ long length;
M_ASN1_D2I_Finish(a,PKCS7_ENCRYPT_free,ASN1_F_D2I_PKCS7_ENCRYPT); M_ASN1_D2I_Finish(a,PKCS7_ENCRYPT_free,ASN1_F_D2I_PKCS7_ENCRYPT);
} }
PKCS7_ENCRYPT *PKCS7_ENCRYPT_new() PKCS7_ENCRYPT *PKCS7_ENCRYPT_new(void)
{ {
PKCS7_ENCRYPT *ret=NULL; PKCS7_ENCRYPT *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -110,8 +106,7 @@ PKCS7_ENCRYPT *PKCS7_ENCRYPT_new()
M_ASN1_New_Error(ASN1_F_PKCS7_ENCRYPT_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_ENCRYPT_NEW);
} }
void PKCS7_ENCRYPT_free(a) void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a)
PKCS7_ENCRYPT *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free(a->version); ASN1_INTEGER_free(a->version);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_PKCS7_ENC_CONTENT,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_ENC_CONTENT,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_ENC_CONTENT(a,pp) int i2d_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT *a, unsigned char **pp)
PKCS7_ENC_CONTENT *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -85,10 +83,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(a,pp,length) PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT **a,
PKCS7_ENC_CONTENT **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_ENC_CONTENT *,PKCS7_ENC_CONTENT_new); M_ASN1_D2I_vars(a,PKCS7_ENC_CONTENT *,PKCS7_ENC_CONTENT_new);
@ -103,7 +99,7 @@ long length;
ASN1_F_D2I_PKCS7_ENC_CONTENT); ASN1_F_D2I_PKCS7_ENC_CONTENT);
} }
PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new() PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new(void)
{ {
PKCS7_ENC_CONTENT *ret=NULL; PKCS7_ENC_CONTENT *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -117,8 +113,7 @@ PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new()
M_ASN1_New_Error(ASN1_F_PKCS7_ENC_CONTENT_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_ENC_CONTENT_NEW);
} }
void PKCS7_ENC_CONTENT_free(a) void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a)
PKCS7_ENC_CONTENT *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_OBJECT_free(a->content_type); ASN1_OBJECT_free(a->content_type);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_PKCS7_ENVELOPE,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_ENVELOPE,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_ENVELOPE(a,pp) int i2d_PKCS7_ENVELOPE(PKCS7_ENVELOPE *a, unsigned char **pp)
PKCS7_ENVELOPE *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -85,10 +83,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(a,pp,length) PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(PKCS7_ENVELOPE **a, unsigned char **pp,
PKCS7_ENVELOPE **a; long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_ENVELOPE *,PKCS7_ENVELOPE_new); M_ASN1_D2I_vars(a,PKCS7_ENVELOPE *,PKCS7_ENVELOPE_new);
@ -102,7 +98,7 @@ long length;
M_ASN1_D2I_Finish(a,PKCS7_ENVELOPE_free,ASN1_F_D2I_PKCS7_ENVELOPE); M_ASN1_D2I_Finish(a,PKCS7_ENVELOPE_free,ASN1_F_D2I_PKCS7_ENVELOPE);
} }
PKCS7_ENVELOPE *PKCS7_ENVELOPE_new() PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void)
{ {
PKCS7_ENVELOPE *ret=NULL; PKCS7_ENVELOPE *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -115,8 +111,7 @@ PKCS7_ENVELOPE *PKCS7_ENVELOPE_new()
M_ASN1_New_Error(ASN1_F_PKCS7_ENVELOPE_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_ENVELOPE_NEW);
} }
void PKCS7_ENVELOPE_free(a) void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a)
PKCS7_ENVELOPE *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free(a->version); ASN1_INTEGER_free(a->version);

View File

@ -66,9 +66,8 @@
* ASN1err(ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_ISSUER_AND_SERIAL(a,pp) int i2d_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL *a,
PKCS7_ISSUER_AND_SERIAL *a; unsigned char **pp)
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -83,10 +82,7 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL(a,pp,length) PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL **a, unsigned char **pp, long length)
PKCS7_ISSUER_AND_SERIAL **a;
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_ISSUER_AND_SERIAL *,PKCS7_ISSUER_AND_SERIAL_new); M_ASN1_D2I_vars(a,PKCS7_ISSUER_AND_SERIAL *,PKCS7_ISSUER_AND_SERIAL_new);
@ -98,7 +94,7 @@ long length;
ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL); ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL);
} }
PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new() PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new(void)
{ {
PKCS7_ISSUER_AND_SERIAL *ret=NULL; PKCS7_ISSUER_AND_SERIAL *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -110,8 +106,7 @@ PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new()
M_ASN1_New_Error(ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW);
} }
void PKCS7_ISSUER_AND_SERIAL_free(a) void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a)
PKCS7_ISSUER_AND_SERIAL *a;
{ {
if (a == NULL) return; if (a == NULL) return;
X509_NAME_free(a->issuer); X509_NAME_free(a->issuer);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_PKCS7_NEW,ASN1_R_BAD_PKCS7_TYPE); * ASN1err(ASN1_F_PKCS7_NEW,ASN1_R_BAD_PKCS7_TYPE);
*/ */
int i2d_PKCS7(a,pp) int i2d_PKCS7(PKCS7 *a, unsigned char **pp)
PKCS7 *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -150,10 +148,7 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7 *d2i_PKCS7(a,pp,length) PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length)
PKCS7 **a;
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7 *,PKCS7_new); M_ASN1_D2I_vars(a,PKCS7 *,PKCS7_new);
@ -236,7 +231,7 @@ long length;
M_ASN1_D2I_Finish(a,PKCS7_free,ASN1_F_D2I_PKCS7); M_ASN1_D2I_Finish(a,PKCS7_free,ASN1_F_D2I_PKCS7);
} }
PKCS7 *PKCS7_new() PKCS7 *PKCS7_new(void)
{ {
PKCS7 *ret=NULL; PKCS7 *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -251,8 +246,7 @@ PKCS7 *PKCS7_new()
M_ASN1_New_Error(ASN1_F_PKCS7_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_NEW);
} }
void PKCS7_free(a) void PKCS7_free(PKCS7 *a)
PKCS7 *a;
{ {
if (a == NULL) return; if (a == NULL) return;
@ -264,8 +258,7 @@ PKCS7 *a;
Free((char *)(char *)a); Free((char *)(char *)a);
} }
void PKCS7_content_free(a) void PKCS7_content_free(PKCS7 *a)
PKCS7 *a;
{ {
if(a == NULL) if(a == NULL)
return; return;

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_PKCS7_RECIP_INFO,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_RECIP_INFO,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_RECIP_INFO(a,pp) int i2d_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO *a, unsigned char **pp)
PKCS7_RECIP_INFO *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -87,10 +85,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(a,pp,length) PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO **a,
PKCS7_RECIP_INFO **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_RECIP_INFO *,PKCS7_RECIP_INFO_new); M_ASN1_D2I_vars(a,PKCS7_RECIP_INFO *,PKCS7_RECIP_INFO_new);
@ -104,7 +100,7 @@ long length;
M_ASN1_D2I_Finish(a,PKCS7_RECIP_INFO_free,ASN1_F_D2I_PKCS7_RECIP_INFO); M_ASN1_D2I_Finish(a,PKCS7_RECIP_INFO_free,ASN1_F_D2I_PKCS7_RECIP_INFO);
} }
PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new() PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new(void)
{ {
PKCS7_RECIP_INFO *ret=NULL; PKCS7_RECIP_INFO *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -119,8 +115,7 @@ PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new()
M_ASN1_New_Error(ASN1_F_PKCS7_RECIP_INFO_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_RECIP_INFO_NEW);
} }
void PKCS7_RECIP_INFO_free(a) void PKCS7_RECIP_INFO_free(PKCS7_RECIP_INFO *a)
PKCS7_RECIP_INFO *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free(a->version); ASN1_INTEGER_free(a->version);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_PKCS7_SIGN_ENVELOPE,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_SIGN_ENVELOPE,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_SIGN_ENVELOPE(a,pp) int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, unsigned char **pp)
PKCS7_SIGN_ENVELOPE *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -93,10 +91,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(a,pp,length) PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE **a,
PKCS7_SIGN_ENVELOPE **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_SIGN_ENVELOPE *,PKCS7_SIGN_ENVELOPE_new); M_ASN1_D2I_vars(a,PKCS7_SIGN_ENVELOPE *,PKCS7_SIGN_ENVELOPE_new);
@ -116,7 +112,7 @@ long length;
ASN1_F_D2I_PKCS7_SIGN_ENVELOPE); ASN1_F_D2I_PKCS7_SIGN_ENVELOPE);
} }
PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new() PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void)
{ {
PKCS7_SIGN_ENVELOPE *ret=NULL; PKCS7_SIGN_ENVELOPE *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -133,8 +129,7 @@ PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new()
M_ASN1_New_Error(ASN1_F_PKCS7_SIGN_ENVELOPE_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_SIGN_ENVELOPE_NEW);
} }
void PKCS7_SIGN_ENVELOPE_free(a) void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a)
PKCS7_SIGN_ENVELOPE *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free(a->version); ASN1_INTEGER_free(a->version);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_PKCS7_SIGNED,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_SIGNED,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_SIGNED(a,pp) int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **pp)
PKCS7_SIGNED *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -91,10 +89,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_SIGNED *d2i_PKCS7_SIGNED(a,pp,length) PKCS7_SIGNED *d2i_PKCS7_SIGNED(PKCS7_SIGNED **a, unsigned char **pp,
PKCS7_SIGNED **a; long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_SIGNED *,PKCS7_SIGNED_new); M_ASN1_D2I_vars(a,PKCS7_SIGNED *,PKCS7_SIGNED_new);
@ -111,7 +107,7 @@ long length;
M_ASN1_D2I_Finish(a,PKCS7_SIGNED_free,ASN1_F_D2I_PKCS7_SIGNED); M_ASN1_D2I_Finish(a,PKCS7_SIGNED_free,ASN1_F_D2I_PKCS7_SIGNED);
} }
PKCS7_SIGNED *PKCS7_SIGNED_new() PKCS7_SIGNED *PKCS7_SIGNED_new(void)
{ {
PKCS7_SIGNED *ret=NULL; PKCS7_SIGNED *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -127,8 +123,7 @@ PKCS7_SIGNED *PKCS7_SIGNED_new()
M_ASN1_New_Error(ASN1_F_PKCS7_SIGNED_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_SIGNED_NEW);
} }
void PKCS7_SIGNED_free(a) void PKCS7_SIGNED_free(PKCS7_SIGNED *a)
PKCS7_SIGNED *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free(a->version); ASN1_INTEGER_free(a->version);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_D2I_PKCS7_SIGNER_INFO,ERR_R_ASN1_LENGTH_MISMATCH); * ASN1err(ASN1_F_D2I_PKCS7_SIGNER_INFO,ERR_R_ASN1_LENGTH_MISMATCH);
*/ */
int i2d_PKCS7_SIGNER_INFO(a,pp) int i2d_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO *a, unsigned char **pp)
PKCS7_SIGNER_INFO *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -93,10 +91,8 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(a,pp,length) PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO **a,
PKCS7_SIGNER_INFO **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS7_SIGNER_INFO *,PKCS7_SIGNER_INFO_new); M_ASN1_D2I_vars(a,PKCS7_SIGNER_INFO *,PKCS7_SIGNER_INFO_new);
@ -116,7 +112,7 @@ long length;
ASN1_F_D2I_PKCS7_SIGNER_INFO); ASN1_F_D2I_PKCS7_SIGNER_INFO);
} }
PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new() PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new(void)
{ {
PKCS7_SIGNER_INFO *ret=NULL; PKCS7_SIGNER_INFO *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -134,8 +130,7 @@ PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new()
M_ASN1_New_Error(ASN1_F_PKCS7_SIGNER_INFO_NEW); M_ASN1_New_Error(ASN1_F_PKCS7_SIGNER_INFO_NEW);
} }
void PKCS7_SIGNER_INFO_free(a) void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a)
PKCS7_SIGNER_INFO *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free(a->version); ASN1_INTEGER_free(a->version);

View File

@ -65,9 +65,7 @@
*ASN1err(ASN1_F_D2I_PKCS8_PRIV_KEY_INFO,ASN1_R_DECODE_ERROR) *ASN1err(ASN1_F_D2I_PKCS8_PRIV_KEY_INFO,ASN1_R_DECODE_ERROR)
*/ */
int i2d_PKCS8_PRIV_KEY_INFO (a,pp) int i2d_PKCS8_PRIV_KEY_INFO (PKCS8_PRIV_KEY_INFO *a, unsigned char **pp)
PKCS8_PRIV_KEY_INFO *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -87,7 +85,7 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new() PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void)
{ {
PKCS8_PRIV_KEY_INFO *ret=NULL; PKCS8_PRIV_KEY_INFO *ret=NULL;
ASN1_CTX c; ASN1_CTX c;
@ -101,10 +99,8 @@ PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new()
M_ASN1_New_Error(ASN1_F_PKCS8_PRIV_KEY_INFO_NEW); M_ASN1_New_Error(ASN1_F_PKCS8_PRIV_KEY_INFO_NEW);
} }
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(a,pp,length) PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a,
PKCS8_PRIV_KEY_INFO **a; unsigned char **pp, long length)
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,PKCS8_PRIV_KEY_INFO *,PKCS8_PRIV_KEY_INFO_new); M_ASN1_D2I_vars(a,PKCS8_PRIV_KEY_INFO *,PKCS8_PRIV_KEY_INFO_new);
M_ASN1_D2I_Init(); M_ASN1_D2I_Init();
@ -119,8 +115,7 @@ long length;
M_ASN1_D2I_Finish(a, PKCS8_PRIV_KEY_INFO_free, ASN1_F_D2I_PKCS8_PRIV_KEY_INFO); M_ASN1_D2I_Finish(a, PKCS8_PRIV_KEY_INFO_free, ASN1_F_D2I_PKCS8_PRIV_KEY_INFO);
} }
void PKCS8_PRIV_KEY_INFO_free (a) void PKCS8_PRIV_KEY_INFO_free (PKCS8_PRIV_KEY_INFO *a)
PKCS8_PRIV_KEY_INFO *a;
{ {
if (a == NULL) return; if (a == NULL) return;
ASN1_INTEGER_free (a->version); ASN1_INTEGER_free (a->version);

View File

@ -66,9 +66,7 @@
* ASN1err(ASN1_F_X509_KEY_NEW,ERR_R_BAD_GET_ASN1_OBJECT_CALL); * ASN1err(ASN1_F_X509_KEY_NEW,ERR_R_BAD_GET_ASN1_OBJECT_CALL);
*/ */
int i2d_X509_KEY(a,pp) int i2d_X509_KEY(X509 *a, unsigned char **pp)
X509 *a;
unsigned char **pp;
{ {
M_ASN1_I2D_vars(a); M_ASN1_I2D_vars(a);
@ -85,10 +83,7 @@ unsigned char **pp;
M_ASN1_I2D_finish(); M_ASN1_I2D_finish();
} }
X509 *d2i_X509_KEY(a,pp,length) X509 *d2i_X509_KEY(X509 **a, unsigned char **pp, long length)
X509 **a;
unsigned char **pp;
long length;
{ {
M_ASN1_D2I_vars(a,X509 *,X509_new); M_ASN1_D2I_vars(a,X509 *,X509_new);
@ -100,7 +95,7 @@ long length;
M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509); M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509);
} }
X509 *X509_KEY_new() X509 *X509_KEY_new(void)
{ {
X509_KEY *ret=NULL; X509_KEY *ret=NULL;
@ -114,8 +109,7 @@ X509 *X509_KEY_new()
M_ASN1_New_Error(ASN1_F_X509_NEW); M_ASN1_New_Error(ASN1_F_X509_NEW);
} }
void X509_KEY_free(a) void X509_KEY_free(X509 *a)
X509 *a;
{ {
int i; int i;

View File

@ -71,9 +71,7 @@ static void ext_print();
#endif #endif
#ifndef NO_FP_API #ifndef NO_FP_API
int X509_CRL_print_fp(fp,x) int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
FILE *fp;
X509_CRL *x;
{ {
BIO *b; BIO *b;
int ret; int ret;
@ -90,9 +88,7 @@ X509_CRL *x;
} }
#endif #endif
int X509_CRL_print(out, x) int X509_CRL_print(BIO *out, X509_CRL *x)
BIO *out;
X509_CRL *x;
{ {
char buf[256]; char buf[256];
unsigned char *s; unsigned char *s;
@ -157,9 +153,7 @@ X509_CRL *x;
} }
static void ext_print(out, ex) static void ext_print(BIO *out, X509_EXTENSION *ex)
BIO *out;
X509_EXTENSION *ex;
{ {
ASN1_OBJECT *obj; ASN1_OBJECT *obj;
int j; int j;

View File

@ -83,10 +83,7 @@ static int print();
#ifndef NO_RSA #ifndef NO_RSA
#ifndef NO_FP_API #ifndef NO_FP_API
int RSA_print_fp(fp,x,off) int RSA_print_fp(FILE *fp, RSA *x, int off)
FILE *fp;
RSA *x;
int off;
{ {
BIO *b; BIO *b;
int ret; int ret;
@ -103,10 +100,7 @@ int off;
} }
#endif #endif
int RSA_print(bp,x,off) int RSA_print(BIO *bp, RSA *x, int off)
BIO *bp;
RSA *x;
int off;
{ {
char str[128]; char str[128];
const char *s; const char *s;
@ -155,10 +149,7 @@ err:
#ifndef NO_DSA #ifndef NO_DSA
#ifndef NO_FP_API #ifndef NO_FP_API
int DSA_print_fp(fp,x,off) int DSA_print_fp(FILE *fp, DSA *x, int off)
FILE *fp;
DSA *x;
int off;
{ {
BIO *b; BIO *b;
int ret; int ret;
@ -175,10 +166,7 @@ int off;
} }
#endif #endif
int DSA_print(bp,x,off) int DSA_print(BIO *bp, DSA *x, int off)
BIO *bp;
DSA *x;
int off;
{ {
char str[128]; char str[128];
unsigned char *m=NULL; unsigned char *m=NULL;
@ -230,12 +218,8 @@ err:
} }
#endif /* !NO_DSA */ #endif /* !NO_DSA */
static int print(bp,number,num,buf,off) static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf,
BIO *bp; int off)
const char *number;
BIGNUM *num;
unsigned char *buf;
int off;
{ {
int n,i; int n,i;
char str[128]; char str[128];
@ -286,9 +270,7 @@ int off;
#ifndef NO_DH #ifndef NO_DH
#ifndef NO_FP_API #ifndef NO_FP_API
int DHparams_print_fp(fp,x) int DHparams_print_fp(FILE *fp, DH *x)
FILE *fp;
DH *x;
{ {
BIO *b; BIO *b;
int ret; int ret;
@ -305,9 +287,7 @@ DH *x;
} }
#endif #endif
int DHparams_print(bp,x) int DHparams_print(BIO *bp, DH *x)
BIO *bp;
DH *x;
{ {
unsigned char *m=NULL; unsigned char *m=NULL;
int reason=ERR_R_BUF_LIB,i,ret=0; int reason=ERR_R_BUF_LIB,i,ret=0;
@ -343,9 +323,7 @@ err:
#ifndef NO_DSA #ifndef NO_DSA
#ifndef NO_FP_API #ifndef NO_FP_API
int DSAparams_print_fp(fp,x) int DSAparams_print_fp(FILE *fp, DSA *x)
FILE *fp;
DSA *x;
{ {
BIO *b; BIO *b;
int ret; int ret;
@ -362,9 +340,7 @@ DSA *x;
} }
#endif #endif
int DSAparams_print(bp,x) int DSAparams_print(BIO *bp, DSA *x)
BIO *bp;
DSA *x;
{ {
unsigned char *m=NULL; unsigned char *m=NULL;
int reason=ERR_R_BUF_LIB,i,ret=0; int reason=ERR_R_BUF_LIB,i,ret=0;

Some files were not shown because too many files have changed in this diff Show More