Change functions to ANSI C.
This commit is contained in:
parent
3edd7ed15d
commit
6b691a5c85
3
CHANGES
3
CHANGES
@ -5,6 +5,9 @@
|
||||
|
||||
Changes between 0.9.2b and 0.9.3
|
||||
|
||||
*) Change functions to ANSI C.
|
||||
[Ulf Möller]
|
||||
|
||||
*) Fix typos in error codes.
|
||||
[Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller]
|
||||
|
||||
|
31
apps/apps.c
31
apps/apps.c
@ -76,10 +76,7 @@ int app_init();
|
||||
#endif
|
||||
|
||||
#ifdef undef /* never finished - probably never will be :-) */
|
||||
int args_from_file(file,argc,argv)
|
||||
char *file;
|
||||
int *argc;
|
||||
char **argv[];
|
||||
int args_from_file(char *file, int *argc, char **argv[])
|
||||
{
|
||||
FILE *fp;
|
||||
int num,i;
|
||||
@ -157,8 +154,7 @@ char **argv[];
|
||||
}
|
||||
#endif
|
||||
|
||||
int str2fmt(s)
|
||||
char *s;
|
||||
int str2fmt(char *s)
|
||||
{
|
||||
if ((*s == 'D') || (*s == 'd'))
|
||||
return(FORMAT_ASN1);
|
||||
@ -173,10 +169,7 @@ char *s;
|
||||
}
|
||||
|
||||
#if defined(MSDOS) || defined(WIN32) || defined(WIN16)
|
||||
void program_name(in,out,size)
|
||||
char *in;
|
||||
char *out;
|
||||
int size;
|
||||
void program_name(char *in, char *out, int size)
|
||||
{
|
||||
int i,n;
|
||||
char *p=NULL;
|
||||
@ -213,10 +206,7 @@ int size;
|
||||
out[n]='\0';
|
||||
}
|
||||
#else
|
||||
void program_name(in,out,size)
|
||||
char *in;
|
||||
char *out;
|
||||
int size;
|
||||
void program_name(char *in, char *out, int size)
|
||||
{
|
||||
char *p;
|
||||
|
||||
@ -231,9 +221,7 @@ int size;
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
int WIN32_rename(from,to)
|
||||
char *from;
|
||||
char *to;
|
||||
int WIN32_rename(char *from, char *to)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -242,11 +230,7 @@ char *to;
|
||||
}
|
||||
#endif
|
||||
|
||||
int chopup_args(arg,buf,argc,argv)
|
||||
ARGS *arg;
|
||||
char *buf;
|
||||
int *argc;
|
||||
char **argv[];
|
||||
int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
|
||||
{
|
||||
int num,len,i;
|
||||
char *p;
|
||||
@ -312,8 +296,7 @@ char **argv[];
|
||||
}
|
||||
|
||||
#ifndef APP_INIT
|
||||
int app_init(mesgwin)
|
||||
long mesgwin;
|
||||
int app_init(long mesgwin)
|
||||
{
|
||||
return(1);
|
||||
}
|
||||
|
@ -80,9 +80,7 @@
|
||||
#undef PROG
|
||||
#define PROG asn1parse_main
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,badops=0,offset=0,ret=1,j;
|
||||
unsigned int length=0;
|
||||
|
136
apps/ca.c
136
apps/ca.c
@ -215,9 +215,7 @@ static char *section=NULL;
|
||||
static int preserve=0;
|
||||
static int msie_hack=0;
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int total=0;
|
||||
int total_done=0;
|
||||
@ -1179,16 +1177,12 @@ err:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static void lookup_fail(name,tag)
|
||||
char *name;
|
||||
char *tag;
|
||||
static void lookup_fail(char *name, char *tag)
|
||||
{
|
||||
BIO_printf(bio_err,"variable lookup failed for %s::%s\n",name,tag);
|
||||
}
|
||||
|
||||
static int MS_CALLBACK key_callback(buf,len,verify)
|
||||
char *buf;
|
||||
int len,verify;
|
||||
static int MS_CALLBACK key_callback(char *buf, int len, int verify)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1199,8 +1193,7 @@ int len,verify;
|
||||
return(i);
|
||||
}
|
||||
|
||||
static unsigned long index_serial_hash(a)
|
||||
char **a;
|
||||
static unsigned long index_serial_hash(char **a)
|
||||
{
|
||||
char *n;
|
||||
|
||||
@ -1209,9 +1202,7 @@ char **a;
|
||||
return(lh_strhash(n));
|
||||
}
|
||||
|
||||
static int index_serial_cmp(a,b)
|
||||
char **a;
|
||||
char **b;
|
||||
static int index_serial_cmp(char **a, char **b)
|
||||
{
|
||||
char *aa,*bb;
|
||||
|
||||
@ -1220,21 +1211,17 @@ char **b;
|
||||
return(strcmp(aa,bb));
|
||||
}
|
||||
|
||||
static unsigned long index_name_hash(a)
|
||||
char **a;
|
||||
static unsigned long index_name_hash(char **a)
|
||||
{ return(lh_strhash(a[DB_name])); }
|
||||
|
||||
static int index_name_qual(a)
|
||||
char **a;
|
||||
static int index_name_qual(char **a)
|
||||
{ return(a[0][0] == 'V'); }
|
||||
|
||||
static int index_name_cmp(a,b)
|
||||
char **a;
|
||||
char **b;
|
||||
{ return(strcmp(a[DB_name],b[DB_name])); }
|
||||
static int index_name_cmp(char **a, char **b)
|
||||
{ return(strcmp(a[DB_name],
|
||||
b[DB_name])); }
|
||||
|
||||
static BIGNUM *load_serial(serialfile)
|
||||
char *serialfile;
|
||||
static BIGNUM *load_serial(char *serialfile)
|
||||
{
|
||||
BIO *in=NULL;
|
||||
BIGNUM *ret=NULL;
|
||||
@ -1272,9 +1259,7 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int save_serial(serialfile,serial)
|
||||
char *serialfile;
|
||||
BIGNUM *serial;
|
||||
static int save_serial(char *serialfile, BIGNUM *serial)
|
||||
{
|
||||
BIO *out;
|
||||
int ret=0;
|
||||
@ -1306,22 +1291,10 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int certify(xret,infile,pkey,x509,dgst,policy,db,serial,startdate,days,
|
||||
batch,ext_sect,lconf,verbose)
|
||||
X509 **xret;
|
||||
char *infile;
|
||||
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;
|
||||
static int certify(X509 **xret, char *infile, 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;
|
||||
BIO *in=NULL;
|
||||
@ -1377,22 +1350,11 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
|
||||
static int certify_cert(xret,infile,pkey,x509,dgst,policy,db,serial,startdate,
|
||||
days,batch,ext_sect,lconf,verbose)
|
||||
X509 **xret;
|
||||
char *infile;
|
||||
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;
|
||||
static int certify_cert(X509 **xret, char *infile, 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 *rreq=NULL;
|
||||
@ -1452,22 +1414,9 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
|
||||
static int do_body(xret,pkey,x509,dgst,policy,db,serial,startdate,days,
|
||||
batch,verbose,req,ext_sect,lconf)
|
||||
X509 **xret;
|
||||
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;
|
||||
static int do_body(X509 **xret, 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;
|
||||
ASN1_UTCTIME *tm,*tmptm;
|
||||
@ -1895,10 +1844,7 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
|
||||
static void write_new_certificate(bp,x, output_der)
|
||||
BIO *bp;
|
||||
X509 *x;
|
||||
int output_der;
|
||||
static void write_new_certificate(BIO *bp, X509 *x, int output_der)
|
||||
{
|
||||
char *f;
|
||||
char buf[256];
|
||||
@ -1924,21 +1870,9 @@ int output_der;
|
||||
BIO_puts(bp,"\n");
|
||||
}
|
||||
|
||||
static int certify_spkac(xret,infile,pkey,x509,dgst,policy,db,serial,
|
||||
startdate,days,ext_sect,lconf,verbose)
|
||||
X509 **xret;
|
||||
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;
|
||||
static int certify_spkac(X509 **xret, 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;
|
||||
LHASH *parms=NULL;
|
||||
@ -2094,9 +2028,7 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
|
||||
static int fix_data(nid,type)
|
||||
int nid;
|
||||
int *type;
|
||||
static int fix_data(int nid, int *type)
|
||||
{
|
||||
if (nid == NID_pkcs9_emailAddress)
|
||||
*type=V_ASN1_IA5STRING;
|
||||
@ -2111,8 +2043,7 @@ int *type;
|
||||
return(1);
|
||||
}
|
||||
|
||||
static int check_time_format(str)
|
||||
char *str;
|
||||
static int check_time_format(char *str)
|
||||
{
|
||||
ASN1_UTCTIME tm;
|
||||
|
||||
@ -2122,8 +2053,7 @@ char *str;
|
||||
return(ASN1_UTCTIME_check(&tm));
|
||||
}
|
||||
|
||||
static int add_oid_section(hconf)
|
||||
LHASH *hconf;
|
||||
static int add_oid_section(LHASH *hconf)
|
||||
{
|
||||
char *p;
|
||||
STACK *sktmp;
|
||||
@ -2145,9 +2075,7 @@ LHASH *hconf;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int do_revoke(x509,db)
|
||||
X509 *x509;
|
||||
TXT_DB *db;
|
||||
static int do_revoke(X509 *x509, TXT_DB *db)
|
||||
{
|
||||
ASN1_UTCTIME *tm=NULL;
|
||||
char *row[DB_NUMBER],**rrow,**irow;
|
||||
|
@ -77,9 +77,7 @@ static char *ciphers_usage[]={
|
||||
NULL
|
||||
};
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1,i;
|
||||
int verbose=0;
|
||||
|
@ -96,9 +96,7 @@ static X509_CRL *load_crl();
|
||||
|
||||
static BIO *bio_out=NULL;
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
X509_CRL *x=NULL;
|
||||
int ret=1,i,num,badops=0;
|
||||
@ -262,9 +260,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static X509_CRL *load_crl(infile, format)
|
||||
char *infile;
|
||||
int format;
|
||||
static X509_CRL *load_crl(char *infile, int format)
|
||||
{
|
||||
X509_CRL *x=NULL;
|
||||
BIO *in=NULL;
|
||||
|
@ -87,9 +87,7 @@ static int add_certs_from_file();
|
||||
* -out arg - output file - default stdout
|
||||
*/
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,badops=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
@ -288,9 +286,7 @@ end:
|
||||
* number of certs added if successful, -1 if not.
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
static int add_certs_from_file(stack,certfile)
|
||||
STACK_OF(X509) *stack;
|
||||
char *certfile;
|
||||
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
|
||||
{
|
||||
struct stat st;
|
||||
BIO *in=NULL;
|
||||
|
@ -79,9 +79,7 @@ void do_fp(unsigned char *buf,BIO *f,int sep);
|
||||
void do_fp();
|
||||
#endif
|
||||
|
||||
int MAIN(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
unsigned char *buf=NULL;
|
||||
int i,err=0;
|
||||
@ -203,10 +201,7 @@ end:
|
||||
EXIT(err);
|
||||
}
|
||||
|
||||
void do_fp(buf,bp,sep)
|
||||
unsigned char *buf;
|
||||
BIO *bp;
|
||||
int sep;
|
||||
void do_fp(unsigned char *buf, BIO *bp, int sep)
|
||||
{
|
||||
int len;
|
||||
int i;
|
||||
|
@ -81,9 +81,7 @@
|
||||
* -C
|
||||
*/
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
DH *dh=NULL;
|
||||
int i,badops=0,text=0;
|
||||
|
@ -82,9 +82,7 @@
|
||||
* -modulus - print the DSA public key
|
||||
*/
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1;
|
||||
DSA *dsa=NULL;
|
||||
|
@ -89,9 +89,7 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg);
|
||||
static void MS_CALLBACK dsa_cb();
|
||||
#endif
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
DSA *dsa=NULL;
|
||||
int i,badops=0,text=0;
|
||||
@ -342,10 +340,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static void MS_CALLBACK dsa_cb(p, n, arg)
|
||||
int p;
|
||||
int n;
|
||||
char *arg;
|
||||
static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
|
||||
{
|
||||
char c='*';
|
||||
|
||||
|
@ -84,9 +84,7 @@ int set_hex();
|
||||
#define BSIZE (8*1024)
|
||||
#define PROG enc_main
|
||||
|
||||
int MAIN(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char *strbuf=NULL;
|
||||
unsigned char *buff=NULL,*bufsize=NULL;
|
||||
@ -521,10 +519,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
int set_hex(in,out,size)
|
||||
char *in;
|
||||
unsigned char *out;
|
||||
int size;
|
||||
int set_hex(char *in, unsigned char *out, int size)
|
||||
{
|
||||
int i,n;
|
||||
unsigned char j;
|
||||
|
@ -68,9 +68,7 @@
|
||||
#undef PROG
|
||||
#define PROG errstr_main
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,ret=0;
|
||||
char buf[256];
|
||||
|
12
apps/gendh.c
12
apps/gendh.c
@ -81,9 +81,7 @@ static void MS_CALLBACK dh_cb();
|
||||
static long dh_load_rand();
|
||||
#endif
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char buffer[200];
|
||||
DH *dh=NULL;
|
||||
@ -191,10 +189,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static void MS_CALLBACK dh_cb(p,n,arg)
|
||||
int p;
|
||||
int n;
|
||||
char *arg;
|
||||
static void MS_CALLBACK dh_cb(int p, int n, char *arg)
|
||||
{
|
||||
char c='*';
|
||||
|
||||
@ -209,8 +204,7 @@ char *arg;
|
||||
#endif
|
||||
}
|
||||
|
||||
static long dh_load_rand(name)
|
||||
char *name;
|
||||
static long dh_load_rand(char *name)
|
||||
{
|
||||
char *p,*n;
|
||||
int last;
|
||||
|
@ -79,9 +79,7 @@ static long dsa_load_rand(char *names);
|
||||
static long dsa_load_rand();
|
||||
#endif
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char buffer[200];
|
||||
DSA *dsa=NULL;
|
||||
@ -214,8 +212,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static long dsa_load_rand(name)
|
||||
char *name;
|
||||
static long dsa_load_rand(char *name)
|
||||
{
|
||||
char *p,*n;
|
||||
int last;
|
||||
|
@ -82,9 +82,7 @@ static void MS_CALLBACK genrsa_cb();
|
||||
static long gr_load_rand();
|
||||
#endif
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1;
|
||||
char buffer[200];
|
||||
@ -234,10 +232,7 @@ err:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static void MS_CALLBACK genrsa_cb(p, n, arg)
|
||||
int p;
|
||||
int n;
|
||||
char *arg;
|
||||
static void MS_CALLBACK genrsa_cb(int p, int n, char *arg)
|
||||
{
|
||||
char c='*';
|
||||
|
||||
@ -252,8 +247,7 @@ char *arg;
|
||||
#endif
|
||||
}
|
||||
|
||||
static long gr_load_rand(name)
|
||||
char *name;
|
||||
static long gr_load_rand(char *name)
|
||||
{
|
||||
char *p,*n;
|
||||
int last;
|
||||
|
@ -70,9 +70,7 @@ static int dump_cert_text(BIO *out, X509 *x);
|
||||
static int dump_cert_text();
|
||||
#endif
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char **args, *infile = NULL, *outfile = NULL;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
@ -163,9 +161,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static int dump_cert_text(out, x)
|
||||
BIO *out;
|
||||
X509 *x;
|
||||
static int dump_cert_text(BIO *out, X509 *x)
|
||||
{
|
||||
char buf[256];
|
||||
X509_NAME_oneline(X509_get_subject_name(x),buf,256);
|
||||
|
@ -99,8 +99,7 @@ LHASH *config=NULL;
|
||||
char *default_config_file=NULL;
|
||||
|
||||
#ifdef DEBUG
|
||||
static void sig_stop(i)
|
||||
int i;
|
||||
static void sig_stop(int i)
|
||||
{
|
||||
char *a=NULL;
|
||||
|
||||
@ -113,9 +112,7 @@ int i;
|
||||
BIO *bio_err=NULL;
|
||||
#endif
|
||||
|
||||
int main(Argc,Argv)
|
||||
int Argc;
|
||||
char *Argv[];
|
||||
int main(int Argc, char *Argv[])
|
||||
{
|
||||
ARGS arg;
|
||||
#define PROG_NAME_SIZE 16
|
||||
@ -258,10 +255,7 @@ end:
|
||||
#define LIST_MESSAGE_DIGEST_COMMANDS "list-message-digest-commands"
|
||||
#define LIST_CIPHER_COMMANDS "list-cipher-commands"
|
||||
|
||||
static int do_cmd(prog,argc,argv)
|
||||
LHASH *prog;
|
||||
int argc;
|
||||
char *argv[];
|
||||
static int do_cmd(LHASH *prog, int argc, char *argv[])
|
||||
{
|
||||
FUNCTION f,*fp;
|
||||
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);
|
||||
}
|
||||
|
||||
static LHASH *prog_init()
|
||||
static LHASH *prog_init(void)
|
||||
{
|
||||
LHASH *ret;
|
||||
FUNCTION *f;
|
||||
@ -372,14 +366,12 @@ static LHASH *prog_init()
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int MS_CALLBACK cmp(a,b)
|
||||
FUNCTION *a,*b;
|
||||
static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b)
|
||||
{
|
||||
return(strncmp(a->name,b->name,8));
|
||||
}
|
||||
|
||||
static unsigned long MS_CALLBACK hash(a)
|
||||
FUNCTION *a;
|
||||
static unsigned long MS_CALLBACK hash(FUNCTION *a)
|
||||
{
|
||||
return(lh_strhash(a->name));
|
||||
}
|
||||
|
@ -87,9 +87,7 @@ typedef struct lines_St
|
||||
struct lines_st *next;
|
||||
} LINES;
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
FILE *in;
|
||||
RSA *rsa=NULL;
|
||||
|
@ -96,9 +96,7 @@ int alg_print();
|
||||
int cert_load();
|
||||
#endif
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char *infile=NULL, *outfile=NULL, *keyname = NULL;
|
||||
char *certfile=NULL;
|
||||
@ -440,9 +438,7 @@ if (export_cert) {
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
int dump_cert_text (out, x)
|
||||
BIO *out;
|
||||
X509 *x;
|
||||
int dump_cert_text (BIO *out, X509 *x)
|
||||
{
|
||||
char buf[256];
|
||||
X509_NAME_oneline(X509_get_subject_name(x),buf,256);
|
||||
@ -456,12 +452,8 @@ X509 *x;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dump_certs_keys_p12 (out, p12, pass, passlen, options)
|
||||
BIO *out;
|
||||
PKCS12 *p12;
|
||||
unsigned char *pass;
|
||||
int passlen;
|
||||
int options;
|
||||
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, unsigned char *pass,
|
||||
int passlen, int options)
|
||||
{
|
||||
STACK *asafes, *bags;
|
||||
int i, bagnid;
|
||||
@ -493,12 +485,8 @@ int options;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dump_certs_pkeys_bags (out, bags, pass, passlen, options)
|
||||
BIO *out;
|
||||
STACK *bags;
|
||||
unsigned char *pass;
|
||||
int passlen;
|
||||
int options;
|
||||
int dump_certs_pkeys_bags (BIO *out, STACK *bags, unsigned char *pass,
|
||||
int passlen, int options)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < sk_num (bags); i++) {
|
||||
@ -509,12 +497,8 @@ int options;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dump_certs_pkeys_bag (out, bag, pass, passlen, options)
|
||||
BIO *out;
|
||||
PKCS12_SAFEBAG *bag;
|
||||
unsigned char *pass;
|
||||
int passlen;
|
||||
int options;
|
||||
int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, unsigned char *pass,
|
||||
int passlen, int options)
|
||||
{
|
||||
EVP_PKEY *pkey;
|
||||
PKCS8_PRIV_KEY_INFO *p8;
|
||||
@ -584,9 +568,7 @@ int options;
|
||||
|
||||
/* Hope this is OK .... */
|
||||
|
||||
int get_cert_chain (cert, chain)
|
||||
X509 *cert;
|
||||
STACK **chain;
|
||||
int get_cert_chain (X509 *cert, STACK **chain)
|
||||
{
|
||||
X509_STORE *store;
|
||||
X509_STORE_CTX store_ctx;
|
||||
@ -614,9 +596,7 @@ err:
|
||||
return i;
|
||||
}
|
||||
|
||||
int alg_print (x, alg)
|
||||
BIO *x;
|
||||
X509_ALGOR *alg;
|
||||
int alg_print (BIO *x, X509_ALGOR *alg)
|
||||
{
|
||||
PBEPARAM *pbe;
|
||||
unsigned char *p;
|
||||
@ -630,9 +610,7 @@ X509_ALGOR *alg;
|
||||
|
||||
/* Load all certificates from a given file */
|
||||
|
||||
int cert_load(in, sk)
|
||||
BIO *in;
|
||||
STACK *sk;
|
||||
int cert_load(BIO *in, STACK *sk)
|
||||
{
|
||||
int ret;
|
||||
X509 *cert;
|
||||
@ -647,10 +625,7 @@ STACK *sk;
|
||||
|
||||
/* Generalised attribute print: handle PKCS#8 and bag attributes */
|
||||
|
||||
int print_attribs (out, attrlst, name)
|
||||
BIO *out;
|
||||
STACK *attrlst;
|
||||
char *name;
|
||||
int print_attribs (BIO *out, STACK *attrlst, char *name)
|
||||
{
|
||||
X509_ATTRIBUTE *attr;
|
||||
ASN1_TYPE *av;
|
||||
@ -705,10 +680,7 @@ char *name;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void hex_prin(out, buf, len)
|
||||
BIO *out;
|
||||
unsigned char *buf;
|
||||
int len;
|
||||
void hex_prin(BIO *out, unsigned char *buf, int len)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < len; i++) BIO_printf (out, "%02X ", buf[i]);
|
||||
|
@ -81,9 +81,7 @@
|
||||
* -print_certs
|
||||
*/
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
PKCS7 *p7=NULL;
|
||||
int i,badops=0;
|
||||
|
46
apps/req.c
46
apps/req.c
@ -137,9 +137,7 @@ static LHASH *req_conf=NULL;
|
||||
#define TYPE_DSA 2
|
||||
#define TYPE_DH 3
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef NO_DSA
|
||||
DSA *dsa_params=NULL;
|
||||
@ -825,10 +823,7 @@ end:
|
||||
EXIT(ex);
|
||||
}
|
||||
|
||||
static int make_REQ(req,pkey,attribs)
|
||||
X509_REQ *req;
|
||||
EVP_PKEY *pkey;
|
||||
int attribs;
|
||||
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
|
||||
{
|
||||
int ret=0,i;
|
||||
unsigned char *p,*q;
|
||||
@ -984,14 +979,8 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int add_DN_object(n,text,def,value,nid,min,max)
|
||||
X509_NAME *n;
|
||||
char *text;
|
||||
char *def;
|
||||
char *value;
|
||||
int nid;
|
||||
int min;
|
||||
int max;
|
||||
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
|
||||
int nid, int min, int max)
|
||||
{
|
||||
int i,j,ret=0;
|
||||
X509_NAME_ENTRY *ne=NULL;
|
||||
@ -1044,14 +1033,8 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int add_attribute_object(n,text,def,value,nid,min,max)
|
||||
STACK *n;
|
||||
char *text;
|
||||
char *def;
|
||||
char *value;
|
||||
int nid;
|
||||
int min;
|
||||
int max;
|
||||
static int add_attribute_object(STACK *n, char *text, char *def, char *value,
|
||||
int nid, int min, int max)
|
||||
{
|
||||
int i,z;
|
||||
X509_ATTRIBUTE *xa=NULL;
|
||||
@ -1135,10 +1118,7 @@ err:
|
||||
return(0);
|
||||
}
|
||||
|
||||
static void MS_CALLBACK req_cb(p,n,arg)
|
||||
int p;
|
||||
int n;
|
||||
char *arg;
|
||||
static void MS_CALLBACK req_cb(int p, int n, char *arg)
|
||||
{
|
||||
char c='*';
|
||||
|
||||
@ -1153,10 +1133,7 @@ char *arg;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int req_fix_data(nid,type,len,min,max)
|
||||
int nid;
|
||||
int *type;
|
||||
int len,min,max;
|
||||
static int req_fix_data(int nid, int *type, int len, int min, int max)
|
||||
{
|
||||
if (nid == NID_pkcs9_emailAddress)
|
||||
*type=V_ASN1_IA5STRING;
|
||||
@ -1189,9 +1166,7 @@ int len,min,max;
|
||||
}
|
||||
|
||||
/* Check if the end of a string matches 'end' */
|
||||
static int check_end(str, end)
|
||||
char *str;
|
||||
char *end;
|
||||
static int check_end(char *str, char *end)
|
||||
{
|
||||
int elen, slen;
|
||||
char *tmp;
|
||||
@ -1202,8 +1177,7 @@ char *end;
|
||||
return strcmp(tmp, end);
|
||||
}
|
||||
|
||||
static int add_oid_section(conf)
|
||||
LHASH *conf;
|
||||
static int add_oid_section(LHASH *conf)
|
||||
{
|
||||
char *p;
|
||||
STACK *sktmp;
|
||||
|
@ -82,9 +82,7 @@
|
||||
* -modulus - print the RSA key modulus
|
||||
*/
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1;
|
||||
RSA *rsa=NULL;
|
||||
|
23
apps/s_cb.c
23
apps/s_cb.c
@ -71,9 +71,7 @@
|
||||
int verify_depth=0;
|
||||
int verify_error=X509_V_OK;
|
||||
|
||||
int MS_CALLBACK verify_callback(ok, ctx)
|
||||
int ok;
|
||||
X509_STORE_CTX *ctx;
|
||||
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
|
||||
{
|
||||
char buf[256];
|
||||
X509 *err_cert;
|
||||
@ -123,10 +121,7 @@ X509_STORE_CTX *ctx;
|
||||
return(ok);
|
||||
}
|
||||
|
||||
int set_cert_stuff(ctx, cert_file, key_file)
|
||||
SSL_CTX *ctx;
|
||||
char *cert_file;
|
||||
char *key_file;
|
||||
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
|
||||
{
|
||||
if (cert_file != NULL)
|
||||
{
|
||||
@ -181,13 +176,8 @@ char *key_file;
|
||||
return(1);
|
||||
}
|
||||
|
||||
long MS_CALLBACK bio_dump_cb(bio,cmd,argp,argi,argl,ret)
|
||||
BIO *bio;
|
||||
int cmd;
|
||||
const char *argp;
|
||||
int argi;
|
||||
long argl;
|
||||
long ret;
|
||||
long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi,
|
||||
long argl, long ret)
|
||||
{
|
||||
BIO *out;
|
||||
|
||||
@ -210,10 +200,7 @@ long ret;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
void MS_CALLBACK apps_ssl_info_callback(s,where,ret)
|
||||
SSL *s;
|
||||
int where;
|
||||
int ret;
|
||||
void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret)
|
||||
{
|
||||
char *str;
|
||||
int w;
|
||||
|
@ -103,7 +103,7 @@ static void print_stuff();
|
||||
static BIO *bio_c_out=NULL;
|
||||
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,"\n");
|
||||
@ -137,9 +137,7 @@ static void sc_usage()
|
||||
|
||||
}
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int off=0;
|
||||
SSL *con=NULL,*con2=NULL;
|
||||
@ -657,10 +655,7 @@ end:
|
||||
}
|
||||
|
||||
|
||||
static void print_stuff(bio,s,full)
|
||||
BIO *bio;
|
||||
SSL *s;
|
||||
int full;
|
||||
static void print_stuff(BIO *bio, SSL *s, int full)
|
||||
{
|
||||
X509 *peer=NULL;
|
||||
char *p;
|
||||
|
@ -120,7 +120,7 @@ static unsigned char dh512_g[]={
|
||||
0x02,
|
||||
};
|
||||
|
||||
static DH *get_dh512()
|
||||
static DH *get_dh512(void)
|
||||
{
|
||||
DH *dh=NULL;
|
||||
|
||||
@ -164,7 +164,7 @@ static int s_debug=0;
|
||||
static int s_quiet=0;
|
||||
|
||||
#if 0
|
||||
static void s_server_init()
|
||||
static void s_server_init(void)
|
||||
{
|
||||
cipher=NULL;
|
||||
s_server_verify=SSL_VERIFY_NONE;
|
||||
@ -185,7 +185,7 @@ static void s_server_init()
|
||||
}
|
||||
#endif
|
||||
|
||||
static void sv_usage()
|
||||
static void sv_usage(void)
|
||||
{
|
||||
BIO_printf(bio_err,"usage: s_server [args ...]\n");
|
||||
BIO_printf(bio_err,"\n");
|
||||
@ -226,9 +226,7 @@ static int local_argc=0;
|
||||
static char **local_argv;
|
||||
static int hack=0;
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int MAIN(int argc, char *argv[])
|
||||
{
|
||||
short port=PORT;
|
||||
char *CApath=NULL,*CAfile=NULL;
|
||||
@ -533,9 +531,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static void print_stats(bio,ssl_ctx)
|
||||
BIO *bio;
|
||||
SSL_CTX *ssl_ctx;
|
||||
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
|
||||
{
|
||||
BIO_printf(bio,"%4ld items in the session cache\n",
|
||||
SSL_CTX_sess_number(ssl_ctx));
|
||||
@ -560,10 +556,7 @@ SSL_CTX *ssl_ctx;
|
||||
SSL_CTX_sess_get_cache_size(ssl_ctx));
|
||||
}
|
||||
|
||||
static int sv_body(hostname, s, context)
|
||||
char *hostname;
|
||||
int s;
|
||||
char *context;
|
||||
static int sv_body(char *hostname, int s, char *context)
|
||||
{
|
||||
char *buf=NULL;
|
||||
fd_set readfds;
|
||||
@ -779,7 +772,7 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static void close_accept_socket()
|
||||
static void close_accept_socket(void)
|
||||
{
|
||||
BIO_printf(bio_err,"shutdown accept socket\n");
|
||||
if (accept_socket >= 0)
|
||||
@ -788,8 +781,7 @@ static void close_accept_socket()
|
||||
}
|
||||
}
|
||||
|
||||
static int init_ssl_connection(con)
|
||||
SSL *con;
|
||||
static int init_ssl_connection(SSL *con)
|
||||
{
|
||||
int i;
|
||||
const char *str;
|
||||
@ -844,7 +836,7 @@ SSL *con;
|
||||
}
|
||||
|
||||
#ifndef NO_DH
|
||||
static DH *load_dh_param()
|
||||
static DH *load_dh_param(void)
|
||||
{
|
||||
DH *ret=NULL;
|
||||
BIO *bio;
|
||||
@ -859,9 +851,7 @@ err:
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static int load_CA(ctx,file)
|
||||
SSL_CTX *ctx;
|
||||
char *file;
|
||||
static int load_CA(SSL_CTX *ctx, char *file)
|
||||
{
|
||||
FILE *in;
|
||||
X509 *x=NULL;
|
||||
@ -881,10 +871,7 @@ char *file;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int www_body(hostname, s, context)
|
||||
char *hostname;
|
||||
int s;
|
||||
char *context;
|
||||
static int www_body(char *hostname, int s, char *context)
|
||||
{
|
||||
char *buf=NULL;
|
||||
int ret=1;
|
||||
@ -1226,10 +1213,7 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static RSA MS_CALLBACK *tmp_rsa_cb(s,export,keylength)
|
||||
SSL *s;
|
||||
int export;
|
||||
int keylength;
|
||||
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength)
|
||||
{
|
||||
static RSA *rsa_tmp=NULL;
|
||||
|
||||
|
@ -93,11 +93,8 @@ static FARPROC lpTopWndProc=NULL;
|
||||
static FARPROC lpTopHookProc=NULL;
|
||||
extern HINSTANCE _hInstance; /* nice global CRT provides */
|
||||
|
||||
static LONG FAR PASCAL topHookProc(hwnd,message,wParam,lParam)
|
||||
HWND hwnd;
|
||||
UINT message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
static LONG FAR PASCAL topHookProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
if (hwnd == topWnd)
|
||||
{
|
||||
@ -122,7 +119,7 @@ static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
|
||||
#endif /* WIN32 */
|
||||
#endif /* WINDOWS */
|
||||
|
||||
void sock_cleanup()
|
||||
void sock_cleanup(void)
|
||||
{
|
||||
#ifdef WINDOWS
|
||||
if (wsa_init_done)
|
||||
@ -134,7 +131,7 @@ void sock_cleanup()
|
||||
#endif
|
||||
}
|
||||
|
||||
int sock_init()
|
||||
int sock_init(void)
|
||||
{
|
||||
#ifdef WINDOWS
|
||||
if (!wsa_init_done)
|
||||
@ -165,10 +162,7 @@ int sock_init()
|
||||
return(1);
|
||||
}
|
||||
|
||||
int init_client(sock, host, port)
|
||||
int *sock;
|
||||
char *host;
|
||||
int port;
|
||||
int init_client(int *sock, char *host, int port)
|
||||
{
|
||||
unsigned char ip[4];
|
||||
short p=0;
|
||||
@ -181,10 +175,7 @@ int port;
|
||||
return(init_client_ip(sock,ip,port));
|
||||
}
|
||||
|
||||
int init_client_ip(sock, ip, port)
|
||||
int *sock;
|
||||
unsigned char ip[4];
|
||||
int port;
|
||||
int init_client_ip(int *sock, unsigned char ip[4], int port)
|
||||
{
|
||||
unsigned long addr;
|
||||
struct sockaddr_in them;
|
||||
@ -215,8 +206,7 @@ int port;
|
||||
return(1);
|
||||
}
|
||||
|
||||
int nbio_sock_error(sock)
|
||||
int sock;
|
||||
int nbio_sock_error(int sock)
|
||||
{
|
||||
int j,i,size;
|
||||
|
||||
@ -228,10 +218,7 @@ int sock;
|
||||
return(j);
|
||||
}
|
||||
|
||||
int nbio_init_client_ip(sock, ip, port)
|
||||
int *sock;
|
||||
unsigned char ip[4];
|
||||
int port;
|
||||
int nbio_init_client_ip(int *sock, unsigned char ip[4], int port)
|
||||
{
|
||||
unsigned long addr;
|
||||
struct sockaddr_in them;
|
||||
@ -280,11 +267,7 @@ int port;
|
||||
return(1);
|
||||
}
|
||||
|
||||
int do_server(port, ret, cb, context)
|
||||
int port;
|
||||
int *ret;
|
||||
int (*cb)();
|
||||
char *context;
|
||||
int do_server(int port, int *ret, int (*cb)(), char *context)
|
||||
{
|
||||
int sock;
|
||||
char *name;
|
||||
@ -316,10 +299,7 @@ char *context;
|
||||
}
|
||||
}
|
||||
|
||||
int init_server_long(sock, port, ip)
|
||||
int *sock;
|
||||
int port;
|
||||
char *ip;
|
||||
int init_server_long(int *sock, int port, char *ip)
|
||||
{
|
||||
int ret=0;
|
||||
struct sockaddr_in server;
|
||||
@ -369,17 +349,12 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int init_server(sock,port)
|
||||
int *sock;
|
||||
int port;
|
||||
int init_server(int *sock, int port)
|
||||
{
|
||||
return(init_server_long(sock, port, NULL));
|
||||
}
|
||||
|
||||
int do_accept(acc_sock, sock, host)
|
||||
int acc_sock;
|
||||
int *sock;
|
||||
char **host;
|
||||
int do_accept(int acc_sock, int *sock, char **host)
|
||||
{
|
||||
int ret,i;
|
||||
struct hostent *h1,*h2;
|
||||
@ -465,11 +440,8 @@ end:
|
||||
return(1);
|
||||
}
|
||||
|
||||
int extract_host_port(str,host_ptr,ip,port_ptr)
|
||||
char *str;
|
||||
char **host_ptr;
|
||||
unsigned char *ip;
|
||||
short *port_ptr;
|
||||
int extract_host_port(char *str, char **host_ptr, unsigned char *ip,
|
||||
short *port_ptr)
|
||||
{
|
||||
char *h,*p;
|
||||
|
||||
@ -493,9 +465,7 @@ err:
|
||||
return(0);
|
||||
}
|
||||
|
||||
int host_ip(str,ip)
|
||||
char *str;
|
||||
unsigned char ip[4];
|
||||
int host_ip(char *str, unsigned char ip[4])
|
||||
{
|
||||
unsigned int in[4];
|
||||
int i;
|
||||
@ -541,9 +511,7 @@ err:
|
||||
return(0);
|
||||
}
|
||||
|
||||
int extract_port(str,port_ptr)
|
||||
char *str;
|
||||
short *port_ptr;
|
||||
int extract_port(char *str, short *port_ptr)
|
||||
{
|
||||
int i;
|
||||
struct servent *s;
|
||||
@ -575,8 +543,7 @@ static struct ghbn_cache_st
|
||||
static unsigned long ghbn_hits=0L;
|
||||
static unsigned long ghbn_miss=0L;
|
||||
|
||||
static struct hostent *GetHostByName(name)
|
||||
char *name;
|
||||
static struct hostent *GetHostByName(char *name)
|
||||
{
|
||||
struct hostent *ret;
|
||||
int i,lowi=0;
|
||||
@ -616,11 +583,7 @@ char *name;
|
||||
}
|
||||
|
||||
#ifndef MSDOS
|
||||
int spawn(argc, argv, in, out)
|
||||
int argc;
|
||||
char **argv;
|
||||
int *in;
|
||||
int *out;
|
||||
int spawn(int argc, char **argv, int *in, int *out)
|
||||
{
|
||||
int pid;
|
||||
#define CHILD_READ p1[0]
|
||||
|
@ -190,7 +190,7 @@ static int t_nbio=0;
|
||||
static int exitNow = 0; /* Set when it's time to exit main */
|
||||
#endif
|
||||
|
||||
static void s_time_init()
|
||||
static void s_time_init(void)
|
||||
{
|
||||
host=SSL_CONNECT_NAME;
|
||||
t_cert_file=NULL;
|
||||
@ -218,7 +218,7 @@ static void s_time_init()
|
||||
/***********************************************************************
|
||||
* usage - display usage message
|
||||
*/
|
||||
static void s_time_usage()
|
||||
static void s_time_usage(void)
|
||||
{
|
||||
static char umsg[] = "\
|
||||
-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
|
||||
*/
|
||||
static int parseArgs(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
static int parseArgs(int argc, char **argv)
|
||||
{
|
||||
int badop = 0;
|
||||
|
||||
@ -377,8 +375,7 @@ bad:
|
||||
#define START 0
|
||||
#define STOP 1
|
||||
|
||||
static double tm_Time_F(s)
|
||||
int s;
|
||||
static double tm_Time_F(int s)
|
||||
{
|
||||
static double ret;
|
||||
#ifdef TIMES
|
||||
@ -412,10 +409,7 @@ int s;
|
||||
* MAIN - main processing area for client
|
||||
* real name depends on MONOLITH
|
||||
*/
|
||||
int
|
||||
MAIN(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
double totalTime = 0.0;
|
||||
int nConn = 0;
|
||||
@ -639,9 +633,7 @@ end:
|
||||
* Returns:
|
||||
* SSL * = the connection pointer.
|
||||
*/
|
||||
static SSL *
|
||||
doConnection(scon)
|
||||
SSL *scon;
|
||||
static SSL *doConnection(SSL *scon)
|
||||
{
|
||||
BIO *conn;
|
||||
SSL *serverCon;
|
||||
|
@ -110,7 +110,7 @@ static void print_stuff();
|
||||
static BIO *bio_c_out=NULL;
|
||||
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,"\n");
|
||||
@ -143,9 +143,7 @@ static void sc_usage()
|
||||
|
||||
}
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int off=0;
|
||||
SSL *con=NULL,*con2=NULL;
|
||||
|
@ -89,9 +89,7 @@ static SSL_SESSION *load_sess_id(char *file, int format);
|
||||
static SSL_SESSION *load_sess_id();
|
||||
#endif
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
SSL_SESSION *x=NULL;
|
||||
int ret=1,i,num,badops=0;
|
||||
@ -271,9 +269,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static SSL_SESSION *load_sess_id(infile, format)
|
||||
char *infile;
|
||||
int format;
|
||||
static SSL_SESSION *load_sess_id(char *infile, int format)
|
||||
{
|
||||
SSL_SESSION *x=NULL;
|
||||
BIO *in=NULL;
|
||||
|
23
apps/speed.c
23
apps/speed.c
@ -204,8 +204,7 @@ static SIGRETTYPE sig_done(int sig);
|
||||
static SIGRETTYPE sig_done();
|
||||
#endif
|
||||
|
||||
static SIGRETTYPE sig_done(sig)
|
||||
int sig;
|
||||
static SIGRETTYPE sig_done(int sig)
|
||||
{
|
||||
signal(SIGALRM,sig_done);
|
||||
run=0;
|
||||
@ -218,8 +217,7 @@ int sig;
|
||||
#define START 0
|
||||
#define STOP 1
|
||||
|
||||
static double Time_F(s)
|
||||
int s;
|
||||
static double Time_F(int s)
|
||||
{
|
||||
double ret;
|
||||
#ifdef TIMES
|
||||
@ -255,9 +253,7 @@ int s;
|
||||
#endif
|
||||
}
|
||||
|
||||
int MAIN(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
unsigned char *buf=NULL,*buf2=NULL;
|
||||
int ret=1;
|
||||
@ -1183,10 +1179,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static void print_message(s,num,length)
|
||||
char *s;
|
||||
long num;
|
||||
int length;
|
||||
static void print_message(char *s, long num, int length)
|
||||
{
|
||||
#ifdef SIGALRM
|
||||
BIO_printf(bio_err,"Doing %s for %ds on %d size blocks: ",s,SECONDS,length);
|
||||
@ -1201,12 +1194,8 @@ int length;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void pkey_print_message(str,str2,num,bits,tm)
|
||||
char *str;
|
||||
char *str2;
|
||||
long num;
|
||||
int bits;
|
||||
int tm;
|
||||
static void pkey_print_message(char *str, char *str2, long num, int bits,
|
||||
int tm)
|
||||
{
|
||||
#ifdef SIGALRM
|
||||
BIO_printf(bio_err,"Doing %d bit %s %s's for %ds: ",bits,str,str2,tm);
|
||||
|
@ -78,9 +78,7 @@ static int check();
|
||||
|
||||
static int v_verbose=0;
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,ret=1;
|
||||
char *CApath=NULL,*CAfile=NULL;
|
||||
@ -154,9 +152,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static int check(ctx,file)
|
||||
X509_STORE *ctx;
|
||||
char *file;
|
||||
static int check(X509_STORE *ctx, char *file)
|
||||
{
|
||||
X509 *x=NULL;
|
||||
BIO *in=NULL;
|
||||
@ -210,9 +206,7 @@ end:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int MS_CALLBACK cb(ok,ctx)
|
||||
int ok;
|
||||
X509_STORE_CTX *ctx;
|
||||
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
|
@ -66,9 +66,7 @@
|
||||
#undef PROG
|
||||
#define PROG version_main
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,ret=0;
|
||||
int cflags=0,version=0,date=0,options=0,platform=0;
|
||||
|
35
apps/x509.c
35
apps/x509.c
@ -135,9 +135,7 @@ static int x509_certify ();
|
||||
|
||||
static int reqfile=0;
|
||||
|
||||
int MAIN(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1;
|
||||
X509_REQ *req=NULL;
|
||||
@ -704,16 +702,9 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static int x509_certify(ctx,CAfile,digest,x,xca,pkey,serialfile,create,days)
|
||||
X509_STORE *ctx;
|
||||
char *CAfile;
|
||||
const EVP_MD *digest;
|
||||
X509 *x;
|
||||
X509 *xca;
|
||||
EVP_PKEY *pkey;
|
||||
char *serialfile;
|
||||
int create;
|
||||
int days;
|
||||
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create,
|
||||
int days)
|
||||
{
|
||||
int ret=0;
|
||||
BIO *io=NULL;
|
||||
@ -859,9 +850,7 @@ end:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int MS_CALLBACK callb(ok, ctx)
|
||||
int ok;
|
||||
X509_STORE_CTX *ctx;
|
||||
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
|
||||
{
|
||||
char buf[256];
|
||||
int err;
|
||||
@ -894,9 +883,7 @@ X509_STORE_CTX *ctx;
|
||||
}
|
||||
}
|
||||
|
||||
static EVP_PKEY *load_key(file, format)
|
||||
char *file;
|
||||
int format;
|
||||
static EVP_PKEY *load_key(char *file, int format)
|
||||
{
|
||||
BIO *key=NULL;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
@ -949,9 +936,7 @@ end:
|
||||
return(pkey);
|
||||
}
|
||||
|
||||
static X509 *load_cert(file, format)
|
||||
char *file;
|
||||
int format;
|
||||
static X509 *load_cert(char *file, int format)
|
||||
{
|
||||
ASN1_HEADER *ah=NULL;
|
||||
BUF_MEM *buf=NULL;
|
||||
@ -1038,11 +1023,7 @@ end:
|
||||
}
|
||||
|
||||
/* self sign */
|
||||
static int sign(x, pkey, days, digest)
|
||||
X509 *x;
|
||||
EVP_PKEY *pkey;
|
||||
int days;
|
||||
const EVP_MD *digest;
|
||||
static int sign(X509 *x, EVP_PKEY *pkey, int days, const EVP_MD *digest)
|
||||
{
|
||||
|
||||
EVP_PKEY *pktmp;
|
||||
|
@ -64,9 +64,7 @@
|
||||
* ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,ASN1_R_EXPECTING_A_BIT_STRING);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_BIT_STRING(a,pp)
|
||||
ASN1_BIT_STRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
|
||||
{
|
||||
int ret,j,r,bits,len;
|
||||
unsigned char *p,*d;
|
||||
@ -116,10 +114,8 @@ unsigned char **pp;
|
||||
return(r);
|
||||
}
|
||||
|
||||
ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(a, pp, length)
|
||||
ASN1_BIT_STRING **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
ASN1_BIT_STRING *ret=NULL;
|
||||
unsigned char *p,*s;
|
||||
@ -187,10 +183,7 @@ err:
|
||||
|
||||
/* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de>
|
||||
*/
|
||||
int ASN1_BIT_STRING_set_bit(a,n,value)
|
||||
ASN1_BIT_STRING *a;
|
||||
int n;
|
||||
int value;
|
||||
int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
|
||||
{
|
||||
int w,v,iv;
|
||||
unsigned char *c;
|
||||
@ -220,9 +213,7 @@ int value;
|
||||
return(1);
|
||||
}
|
||||
|
||||
int ASN1_BIT_STRING_get_bit(a,n)
|
||||
ASN1_BIT_STRING *a;
|
||||
int n;
|
||||
int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n)
|
||||
{
|
||||
int w,v;
|
||||
|
||||
|
@ -63,18 +63,14 @@
|
||||
/* ASN1err(ASN1_F_D2I_ASN1_BMPSTRING,ASN1_R_EXPECTING_AN_INTEGER);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_BMPSTRING(a, pp)
|
||||
ASN1_BMPSTRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp)
|
||||
{
|
||||
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
|
||||
V_ASN1_BMPSTRING,V_ASN1_UNIVERSAL));
|
||||
}
|
||||
|
||||
ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(a, pp, length)
|
||||
ASN1_BMPSTRING **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
ASN1_BMPSTRING *ret=NULL;
|
||||
|
||||
|
@ -64,9 +64,7 @@
|
||||
* ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_BOOLEAN(a,pp)
|
||||
int a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_BOOLEAN(int a, unsigned char **pp)
|
||||
{
|
||||
int r;
|
||||
unsigned char *p;
|
||||
@ -81,10 +79,7 @@ unsigned char **pp;
|
||||
return(r);
|
||||
}
|
||||
|
||||
int d2i_ASN1_BOOLEAN(a, pp, length)
|
||||
int *a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
int d2i_ASN1_BOOLEAN(int *a, unsigned char **pp, long length)
|
||||
{
|
||||
int ret= -1;
|
||||
unsigned char *p;
|
||||
|
@ -83,11 +83,8 @@ static int asn1_collate_primative();
|
||||
|
||||
/* type is a 'bitmap' of acceptable string types.
|
||||
*/
|
||||
ASN1_STRING *d2i_ASN1_type_bytes(a, pp, length, type)
|
||||
ASN1_STRING **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
int type;
|
||||
ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp,
|
||||
long length, int type)
|
||||
{
|
||||
ASN1_STRING *ret=NULL;
|
||||
unsigned char *p,*s;
|
||||
@ -150,11 +147,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
int i2d_ASN1_bytes(a, pp, tag, xclass)
|
||||
ASN1_STRING *a;
|
||||
unsigned char **pp;
|
||||
int tag;
|
||||
int xclass;
|
||||
int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass)
|
||||
{
|
||||
int ret,r,constructed;
|
||||
unsigned char *p;
|
||||
@ -180,12 +173,8 @@ int xclass;
|
||||
return(r);
|
||||
}
|
||||
|
||||
ASN1_STRING *d2i_ASN1_bytes(a, pp, length, Ptag, Pclass)
|
||||
ASN1_STRING **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
int Ptag;
|
||||
int Pclass;
|
||||
ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
|
||||
int Ptag, int Pclass)
|
||||
{
|
||||
ASN1_STRING *ret=NULL;
|
||||
unsigned char *p,*s;
|
||||
@ -277,9 +266,7 @@ err:
|
||||
* them into the one struture that is then returned */
|
||||
/* There have been a few bug fixes for this function from
|
||||
* Paul Keogh <paul.keogh@sse.ie>, many thanks to him */
|
||||
static int asn1_collate_primative(a,c)
|
||||
ASN1_STRING *a;
|
||||
ASN1_CTX *c;
|
||||
static int asn1_collate_primative(ASN1_STRING *a, ASN1_CTX *c)
|
||||
{
|
||||
ASN1_STRING *os=NULL;
|
||||
BUF_MEM b;
|
||||
|
@ -64,11 +64,8 @@
|
||||
#define HEADER_SIZE 8
|
||||
|
||||
#ifndef NO_FP_API
|
||||
char *ASN1_d2i_fp(xnew,d2i,in,x)
|
||||
char *(*xnew)();
|
||||
char *(*d2i)();
|
||||
FILE *in;
|
||||
unsigned char **x;
|
||||
char *ASN1_d2i_fp(char *(*xnew)(), char *(*d2i)(), FILE *in,
|
||||
unsigned char **x)
|
||||
{
|
||||
BIO *b;
|
||||
char *ret;
|
||||
@ -85,11 +82,8 @@ unsigned char **x;
|
||||
}
|
||||
#endif
|
||||
|
||||
char *ASN1_d2i_bio(xnew,d2i,in,x)
|
||||
char *(*xnew)();
|
||||
char *(*d2i)();
|
||||
BIO *in;
|
||||
unsigned char **x;
|
||||
char *ASN1_d2i_bio(char *(*xnew)(), char *(*d2i)(), BIO *in,
|
||||
unsigned char **x)
|
||||
{
|
||||
BUF_MEM *b;
|
||||
unsigned char *p;
|
||||
|
@ -66,12 +66,8 @@
|
||||
#include "x509.h"
|
||||
#include "buffer.h"
|
||||
|
||||
int ASN1_digest(i2d,type,data,md,len)
|
||||
int (*i2d)();
|
||||
EVP_MD *type;
|
||||
char *data;
|
||||
unsigned char *md;
|
||||
unsigned int *len;
|
||||
int ASN1_digest(int (*i2d)(), EVP_MD *type, char *data, unsigned char *md,
|
||||
unsigned int *len)
|
||||
{
|
||||
EVP_MD_CTX ctx;
|
||||
int i;
|
||||
|
@ -62,10 +62,7 @@
|
||||
|
||||
#define READ_CHUNK 2048
|
||||
|
||||
char *ASN1_dup(i2d,d2i,x)
|
||||
int (*i2d)();
|
||||
char *(*d2i)();
|
||||
char *x;
|
||||
char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x)
|
||||
{
|
||||
unsigned char *b,*p;
|
||||
long i;
|
||||
|
@ -65,9 +65,7 @@
|
||||
/* ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,ASN1_R_EXPECTING_AN_ENUMERATED);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_ENUMERATED(a,pp)
|
||||
ASN1_ENUMERATED *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp)
|
||||
{
|
||||
int pad=0,ret,r,i,t;
|
||||
unsigned char *p,*pt,*n,pb=0;
|
||||
@ -118,10 +116,8 @@ unsigned char **pp;
|
||||
return(r);
|
||||
}
|
||||
|
||||
ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(a, pp, length)
|
||||
ASN1_ENUMERATED **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
ASN1_ENUMERATED *ret=NULL;
|
||||
unsigned char *p,*to,*s;
|
||||
@ -196,9 +192,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
int ASN1_ENUMERATED_set(a,v)
|
||||
ASN1_ENUMERATED *a;
|
||||
long v;
|
||||
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
|
||||
{
|
||||
int i,j,k;
|
||||
unsigned char buf[sizeof(long)+1];
|
||||
@ -238,8 +232,7 @@ long v;
|
||||
return(1);
|
||||
}
|
||||
|
||||
long ASN1_ENUMERATED_get(a)
|
||||
ASN1_ENUMERATED *a;
|
||||
long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a)
|
||||
{
|
||||
int neg=0,i;
|
||||
long r=0;
|
||||
@ -268,9 +261,7 @@ ASN1_ENUMERATED *a;
|
||||
return(r);
|
||||
}
|
||||
|
||||
ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(bn,ai)
|
||||
BIGNUM *bn;
|
||||
ASN1_ENUMERATED *ai;
|
||||
ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
|
||||
{
|
||||
ASN1_ENUMERATED *ret;
|
||||
int len,j;
|
||||
@ -295,9 +286,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
BIGNUM *ASN1_ENUMERATED_to_BN(ai,bn)
|
||||
ASN1_ENUMERATED *ai;
|
||||
BIGNUM *bn;
|
||||
BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn)
|
||||
{
|
||||
BIGNUM *ret;
|
||||
|
||||
|
@ -67,19 +67,15 @@
|
||||
* ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME,ASN1_R_EXPECTING_A_GENERALIZEDTIME);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_GENERALIZEDTIME(a,pp)
|
||||
ASN1_GENERALIZEDTIME *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp)
|
||||
{
|
||||
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
|
||||
V_ASN1_GENERALIZEDTIME,V_ASN1_UNIVERSAL));
|
||||
}
|
||||
|
||||
|
||||
ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(a, pp, length)
|
||||
ASN1_GENERALIZEDTIME **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
ASN1_GENERALIZEDTIME *ret=NULL;
|
||||
|
||||
@ -103,8 +99,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
int ASN1_GENERALIZEDTIME_check(d)
|
||||
ASN1_GENERALIZEDTIME *d;
|
||||
int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d)
|
||||
{
|
||||
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};
|
||||
@ -157,9 +152,7 @@ err:
|
||||
return(0);
|
||||
}
|
||||
|
||||
int ASN1_GENERALIZEDTIME_set_string(s,str)
|
||||
ASN1_GENERALIZEDTIME *s;
|
||||
char *str;
|
||||
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str)
|
||||
{
|
||||
ASN1_GENERALIZEDTIME t;
|
||||
|
||||
@ -179,9 +172,8 @@ char *str;
|
||||
return(0);
|
||||
}
|
||||
|
||||
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(s, t)
|
||||
ASN1_GENERALIZEDTIME *s;
|
||||
time_t t;
|
||||
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
time_t t)
|
||||
{
|
||||
char *p;
|
||||
struct tm *ts;
|
||||
|
@ -68,9 +68,7 @@
|
||||
* ASN1err(ASN1_F_ASN1_HEADER_NEW,ERR_R_BAD_GET_ASN1_OBJECT_CALL);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_HEADER(a,pp)
|
||||
ASN1_HEADER *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_HEADER(ASN1_HEADER *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -85,10 +83,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
ASN1_HEADER *d2i_ASN1_HEADER(a,pp,length)
|
||||
ASN1_HEADER **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
ASN1_HEADER *ASN1_HEADER_new()
|
||||
ASN1_HEADER *ASN1_HEADER_new(void)
|
||||
{
|
||||
ASN1_HEADER *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -120,8 +116,7 @@ ASN1_HEADER *ASN1_HEADER_new()
|
||||
M_ASN1_New_Error(ASN1_F_ASN1_HEADER_NEW);
|
||||
}
|
||||
|
||||
void ASN1_HEADER_free(a)
|
||||
ASN1_HEADER *a;
|
||||
void ASN1_HEADER_free(ASN1_HEADER *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_OCTET_STRING_free(a->header);
|
||||
|
@ -62,10 +62,7 @@
|
||||
#include "asn1_mac.h"
|
||||
|
||||
#ifndef NO_FP_API
|
||||
int ASN1_i2d_fp(i2d,out,x)
|
||||
int (*i2d)();
|
||||
FILE *out;
|
||||
unsigned char *x;
|
||||
int ASN1_i2d_fp(int (*i2d)(), FILE *out, unsigned char *x)
|
||||
{
|
||||
BIO *b;
|
||||
int ret;
|
||||
@ -82,10 +79,7 @@ unsigned char *x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int ASN1_i2d_bio(i2d,out,x)
|
||||
int (*i2d)();
|
||||
BIO *out;
|
||||
unsigned char *x;
|
||||
int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x)
|
||||
{
|
||||
char *b;
|
||||
unsigned char *p;
|
||||
|
@ -63,9 +63,7 @@
|
||||
/* ASN1err(ASN1_F_D2I_ASN1_INTEGER,ASN1_R_EXPECTING_AN_INTEGER);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_INTEGER(a,pp)
|
||||
ASN1_INTEGER *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
|
||||
{
|
||||
int pad=0,ret,r,i,t;
|
||||
unsigned char *p,*pt,*n,pb=0;
|
||||
@ -116,10 +114,8 @@ unsigned char **pp;
|
||||
return(r);
|
||||
}
|
||||
|
||||
ASN1_INTEGER *d2i_ASN1_INTEGER(a, pp, length)
|
||||
ASN1_INTEGER **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
ASN1_INTEGER *ret=NULL;
|
||||
unsigned char *p,*to,*s;
|
||||
@ -194,9 +190,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
int ASN1_INTEGER_set(a,v)
|
||||
ASN1_INTEGER *a;
|
||||
long v;
|
||||
int ASN1_INTEGER_set(ASN1_INTEGER *a, long v)
|
||||
{
|
||||
int i,j,k;
|
||||
unsigned char buf[sizeof(long)+1];
|
||||
@ -236,8 +230,7 @@ long v;
|
||||
return(1);
|
||||
}
|
||||
|
||||
long ASN1_INTEGER_get(a)
|
||||
ASN1_INTEGER *a;
|
||||
long ASN1_INTEGER_get(ASN1_INTEGER *a)
|
||||
{
|
||||
int neg=0,i;
|
||||
long r=0;
|
||||
@ -266,9 +259,7 @@ ASN1_INTEGER *a;
|
||||
return(r);
|
||||
}
|
||||
|
||||
ASN1_INTEGER *BN_to_ASN1_INTEGER(bn,ai)
|
||||
BIGNUM *bn;
|
||||
ASN1_INTEGER *ai;
|
||||
ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
|
||||
{
|
||||
ASN1_INTEGER *ret;
|
||||
int len,j;
|
||||
@ -293,9 +284,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
BIGNUM *ASN1_INTEGER_to_BN(ai,bn)
|
||||
ASN1_INTEGER *ai;
|
||||
BIGNUM *bn;
|
||||
BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai, BIGNUM *bn)
|
||||
{
|
||||
BIGNUM *ret;
|
||||
|
||||
|
@ -73,12 +73,12 @@ static ASN1_METHOD bit_string_meth={
|
||||
(char *(*)()) ASN1_STRING_new,
|
||||
(void (*)()) ASN1_STRING_free};
|
||||
|
||||
ASN1_METHOD *ASN1_IA5STRING_asn1_meth()
|
||||
ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void)
|
||||
{
|
||||
return(&ia5string_meth);
|
||||
}
|
||||
|
||||
ASN1_METHOD *ASN1_BIT_STRING_asn1_meth()
|
||||
ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void)
|
||||
{
|
||||
return(&bit_string_meth);
|
||||
}
|
||||
|
@ -67,9 +67,7 @@
|
||||
* ASN1err(ASN1_F_I2T_ASN1_OBJECT,ASN1_R_BAD_OBJECT_HEADER);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_OBJECT(a, pp)
|
||||
ASN1_OBJECT *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
|
||||
{
|
||||
unsigned char *p;
|
||||
|
||||
@ -87,11 +85,7 @@ unsigned char **pp;
|
||||
return(a->length);
|
||||
}
|
||||
|
||||
int a2d_ASN1_OBJECT(out,olen,buf,num)
|
||||
unsigned char *out;
|
||||
int olen;
|
||||
const char *buf;
|
||||
int num;
|
||||
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
|
||||
{
|
||||
int i,first,len=0,c;
|
||||
char tmp[24];
|
||||
@ -181,10 +175,7 @@ err:
|
||||
return(0);
|
||||
}
|
||||
|
||||
int i2t_ASN1_OBJECT(buf,buf_len,a)
|
||||
char *buf;
|
||||
int buf_len;
|
||||
ASN1_OBJECT *a;
|
||||
int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a)
|
||||
{
|
||||
int i,idx=0,n=0,len,nid;
|
||||
unsigned long l;
|
||||
@ -257,9 +248,7 @@ ASN1_OBJECT *a;
|
||||
return(n);
|
||||
}
|
||||
|
||||
int i2a_ASN1_OBJECT(bp,a)
|
||||
BIO *bp;
|
||||
ASN1_OBJECT *a;
|
||||
int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)
|
||||
{
|
||||
char buf[80];
|
||||
int i;
|
||||
@ -272,10 +261,8 @@ ASN1_OBJECT *a;
|
||||
return(i);
|
||||
}
|
||||
|
||||
ASN1_OBJECT *d2i_ASN1_OBJECT(a, pp, length)
|
||||
ASN1_OBJECT **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
ASN1_OBJECT *ret=NULL;
|
||||
unsigned char *p;
|
||||
@ -331,7 +318,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
ASN1_OBJECT *ASN1_OBJECT_new()
|
||||
ASN1_OBJECT *ASN1_OBJECT_new(void)
|
||||
{
|
||||
ASN1_OBJECT *ret;
|
||||
|
||||
@ -350,8 +337,7 @@ ASN1_OBJECT *ASN1_OBJECT_new()
|
||||
return(ret);
|
||||
}
|
||||
|
||||
void ASN1_OBJECT_free(a)
|
||||
ASN1_OBJECT *a;
|
||||
void ASN1_OBJECT_free(ASN1_OBJECT *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS)
|
||||
@ -372,11 +358,8 @@ ASN1_OBJECT *a;
|
||||
Free(a);
|
||||
}
|
||||
|
||||
ASN1_OBJECT *ASN1_OBJECT_create(nid,data,len,sn,ln)
|
||||
int nid;
|
||||
unsigned char *data;
|
||||
int len;
|
||||
char *sn,*ln;
|
||||
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
|
||||
char *sn, char *ln)
|
||||
{
|
||||
ASN1_OBJECT o;
|
||||
|
||||
|
@ -63,18 +63,14 @@
|
||||
/* ASN1err(ASN1_F_D2I_ASN1_OCTET_STRING,ASN1_R_EXPECTING_AN_OCTET_STRING);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_OCTET_STRING(a, pp)
|
||||
ASN1_OCTET_STRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **pp)
|
||||
{
|
||||
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
|
||||
V_ASN1_OCTET_STRING,V_ASN1_UNIVERSAL));
|
||||
}
|
||||
|
||||
ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(a, pp, length)
|
||||
ASN1_OCTET_STRING **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
ASN1_OCTET_STRING *ret=NULL;
|
||||
|
||||
|
@ -64,43 +64,30 @@
|
||||
* ASN1err(ASN1_F_D2I_ASN1_PRINT_TYPE,ASN1_R_TAG_VALUE_TOO_HIGH);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_IA5STRING(a,pp)
|
||||
ASN1_IA5STRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_ASN1_IA5STRING(a,pp)); }
|
||||
|
||||
ASN1_IA5STRING *d2i_ASN1_IA5STRING(a,pp,l)
|
||||
ASN1_IA5STRING **a;
|
||||
unsigned char **pp;
|
||||
long l;
|
||||
ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, unsigned char **pp,
|
||||
long l)
|
||||
{ return(M_d2i_ASN1_IA5STRING(a,pp,l)); }
|
||||
|
||||
ASN1_T61STRING *d2i_ASN1_T61STRING(a,pp,l)
|
||||
ASN1_T61STRING **a;
|
||||
unsigned char **pp;
|
||||
long l;
|
||||
ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, unsigned char **pp,
|
||||
long l)
|
||||
{ return(M_d2i_ASN1_T61STRING(a,pp,l)); }
|
||||
|
||||
ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(a,pp,l)
|
||||
ASN1_PRINTABLESTRING **a;
|
||||
unsigned char **pp;
|
||||
long l;
|
||||
{ return(M_d2i_ASN1_PRINTABLESTRING(a,pp,l)); }
|
||||
ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a,
|
||||
unsigned char **pp, long l)
|
||||
{ return(M_d2i_ASN1_PRINTABLESTRING(a,pp,
|
||||
l)); }
|
||||
|
||||
int i2d_ASN1_PRINTABLE(a,pp)
|
||||
ASN1_STRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_ASN1_PRINTABLE(a,pp)); }
|
||||
|
||||
ASN1_STRING *d2i_ASN1_PRINTABLE(a,pp,l)
|
||||
ASN1_STRING **a;
|
||||
unsigned char **pp;
|
||||
long l;
|
||||
ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a, unsigned char **pp,
|
||||
long l)
|
||||
{ return(M_d2i_ASN1_PRINTABLE(a,pp,l)); }
|
||||
|
||||
int ASN1_PRINTABLE_type(s,len)
|
||||
unsigned char *s;
|
||||
int len;
|
||||
int ASN1_PRINTABLE_type(unsigned char *s, int len)
|
||||
{
|
||||
int c;
|
||||
int ia5=0;
|
||||
@ -131,8 +118,7 @@ int len;
|
||||
return(V_ASN1_PRINTABLESTRING);
|
||||
}
|
||||
|
||||
int ASN1_UNIVERSALSTRING_to_string(s)
|
||||
ASN1_UNIVERSALSTRING *s;
|
||||
int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
|
||||
{
|
||||
int i;
|
||||
unsigned char *p;
|
||||
@ -160,24 +146,16 @@ ASN1_UNIVERSALSTRING *s;
|
||||
}
|
||||
|
||||
|
||||
int i2d_DIRECTORYSTRING(a,pp)
|
||||
ASN1_STRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_DIRECTORYSTRING(a,pp)); }
|
||||
|
||||
ASN1_STRING *d2i_DIRECTORYSTRING(a,pp,l)
|
||||
ASN1_STRING **a;
|
||||
unsigned char **pp;
|
||||
long l;
|
||||
ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp,
|
||||
long l)
|
||||
{ return(M_d2i_DIRECTORYSTRING(a,pp,l)); }
|
||||
|
||||
int i2d_DISPLAYTEXT(a,pp)
|
||||
ASN1_STRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_DISPLAYTEXT(a,pp)); }
|
||||
|
||||
ASN1_STRING *d2i_DISPLAYTEXT(a,pp,l)
|
||||
ASN1_STRING **a;
|
||||
unsigned char **pp;
|
||||
long l;
|
||||
ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, unsigned char **pp,
|
||||
long l)
|
||||
{ return(M_d2i_DISPLAYTEXT(a,pp,l)); }
|
||||
|
@ -84,14 +84,9 @@ static int SetBlobCmp(const void *elem1, const void *elem2 )
|
||||
return b1->cbData-b2->cbData;
|
||||
}
|
||||
|
||||
int i2d_ASN1_SET(a,pp,func,ex_tag,ex_class,is_set)
|
||||
STACK *a;
|
||||
unsigned char **pp;
|
||||
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 is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */
|
||||
int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
|
||||
int ex_class, int is_set)
|
||||
{
|
||||
int ret=0,r;
|
||||
int i;
|
||||
@ -158,14 +153,8 @@ SetBlob
|
||||
return(r);
|
||||
}
|
||||
|
||||
STACK *d2i_ASN1_SET(a,pp,length,func,free_func,ex_tag,ex_class)
|
||||
STACK **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
char *(*func)();
|
||||
void (*free_func)();
|
||||
int ex_tag;
|
||||
int ex_class;
|
||||
STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
|
||||
char *(*func)(), void (*free_func)(), int ex_tag, int ex_class)
|
||||
{
|
||||
ASN1_CTX c;
|
||||
STACK *ret=NULL;
|
||||
|
@ -68,14 +68,9 @@
|
||||
#include "objects.h"
|
||||
#include "buffer.h"
|
||||
|
||||
int ASN1_sign(i2d,algor1,algor2,signature,data,pkey,type)
|
||||
int (*i2d)();
|
||||
X509_ALGOR *algor1;
|
||||
X509_ALGOR *algor2;
|
||||
ASN1_BIT_STRING *signature;
|
||||
char *data;
|
||||
EVP_PKEY *pkey;
|
||||
const EVP_MD *type;
|
||||
int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey,
|
||||
const EVP_MD *type)
|
||||
{
|
||||
EVP_MD_CTX ctx;
|
||||
unsigned char *p,*buf_in=NULL,*buf_out=NULL;
|
||||
|
@ -66,9 +66,7 @@
|
||||
#include "cryptlib.h"
|
||||
#include "asn1.h"
|
||||
|
||||
int i2d_ASN1_TIME(a,pp)
|
||||
ASN1_TIME *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp)
|
||||
{
|
||||
if(a->type == V_ASN1_UTCTIME || a->type == V_ASN1_GENERALIZEDTIME)
|
||||
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 **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, unsigned char **pp, long length)
|
||||
{
|
||||
unsigned char tag;
|
||||
tag = **pp & ~V_ASN1_CONSTRUCTED;
|
||||
@ -94,9 +89,7 @@ long length;
|
||||
}
|
||||
|
||||
|
||||
ASN1_TIME *ASN1_TIME_set(s, t)
|
||||
ASN1_TIME *s;
|
||||
time_t t;
|
||||
ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
|
||||
{
|
||||
struct tm *ts;
|
||||
#if defined(THREADS) && !defined(WIN32)
|
||||
|
@ -70,9 +70,7 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a);
|
||||
static void ASN1_TYPE_component_free();
|
||||
#endif
|
||||
|
||||
int i2d_ASN1_TYPE(a,pp)
|
||||
ASN1_TYPE *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **pp)
|
||||
{
|
||||
int r=0;
|
||||
|
||||
@ -150,10 +148,7 @@ unsigned char **pp;
|
||||
return(r);
|
||||
}
|
||||
|
||||
ASN1_TYPE *d2i_ASN1_TYPE(a,pp,length)
|
||||
ASN1_TYPE **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length)
|
||||
{
|
||||
ASN1_TYPE *ret=NULL;
|
||||
unsigned char *q,*p,*max;
|
||||
@ -280,7 +275,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
ASN1_TYPE *ASN1_TYPE_new()
|
||||
ASN1_TYPE *ASN1_TYPE_new(void)
|
||||
{
|
||||
ASN1_TYPE *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -292,16 +287,14 @@ ASN1_TYPE *ASN1_TYPE_new()
|
||||
M_ASN1_New_Error(ASN1_F_ASN1_TYPE_NEW);
|
||||
}
|
||||
|
||||
void ASN1_TYPE_free(a)
|
||||
ASN1_TYPE *a;
|
||||
void ASN1_TYPE_free(ASN1_TYPE *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_TYPE_component_free(a);
|
||||
Free((char *)(char *)a);
|
||||
}
|
||||
|
||||
int ASN1_TYPE_get(a)
|
||||
ASN1_TYPE *a;
|
||||
int ASN1_TYPE_get(ASN1_TYPE *a)
|
||||
{
|
||||
if (a->value.ptr != NULL)
|
||||
return(a->type);
|
||||
@ -309,10 +302,7 @@ ASN1_TYPE *a;
|
||||
return(0);
|
||||
}
|
||||
|
||||
void ASN1_TYPE_set(a,type,value)
|
||||
ASN1_TYPE *a;
|
||||
int type;
|
||||
char *value;
|
||||
void ASN1_TYPE_set(ASN1_TYPE *a, int type, char *value)
|
||||
{
|
||||
if (a->value.ptr != NULL)
|
||||
ASN1_TYPE_component_free(a);
|
||||
@ -320,8 +310,7 @@ char *value;
|
||||
a->value.ptr=value;
|
||||
}
|
||||
|
||||
static void ASN1_TYPE_component_free(a)
|
||||
ASN1_TYPE *a;
|
||||
static void ASN1_TYPE_component_free(ASN1_TYPE *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
|
||||
|
@ -65,19 +65,15 @@
|
||||
* ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ASN1_R_EXPECTING_A_UTCTIME);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_UTCTIME(a,pp)
|
||||
ASN1_UTCTIME *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp)
|
||||
{
|
||||
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
|
||||
V_ASN1_UTCTIME,V_ASN1_UNIVERSAL));
|
||||
}
|
||||
|
||||
|
||||
ASN1_UTCTIME *d2i_ASN1_UTCTIME(a, pp, length)
|
||||
ASN1_UTCTIME **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
ASN1_UTCTIME *ret=NULL;
|
||||
|
||||
@ -101,8 +97,7 @@ err:
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
int ASN1_UTCTIME_check(d)
|
||||
ASN1_UTCTIME *d;
|
||||
int ASN1_UTCTIME_check(ASN1_UTCTIME *d)
|
||||
{
|
||||
static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0};
|
||||
static int max[8]={99,12,31,23,59,59,12,59};
|
||||
@ -152,9 +147,7 @@ err:
|
||||
return(0);
|
||||
}
|
||||
|
||||
int ASN1_UTCTIME_set_string(s,str)
|
||||
ASN1_UTCTIME *s;
|
||||
char *str;
|
||||
int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str)
|
||||
{
|
||||
ASN1_UTCTIME t;
|
||||
|
||||
@ -174,9 +167,7 @@ char *str;
|
||||
return(0);
|
||||
}
|
||||
|
||||
ASN1_UTCTIME *ASN1_UTCTIME_set(s, t)
|
||||
ASN1_UTCTIME *s;
|
||||
time_t t;
|
||||
ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
|
||||
{
|
||||
char *p;
|
||||
struct tm *ts;
|
||||
|
@ -63,18 +63,14 @@
|
||||
/* ASN1err(ASN1_F_D2I_ASN1_UTF8STRING,ERR_R_MALLOC_FAILURE);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_UTF8STRING(a, pp)
|
||||
ASN1_UTF8STRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **pp)
|
||||
{
|
||||
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
|
||||
V_ASN1_UTF8STRING,V_ASN1_UNIVERSAL));
|
||||
}
|
||||
|
||||
ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(a, pp, length)
|
||||
ASN1_UTF8STRING **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
ASN1_UTF8STRING *ret=NULL;
|
||||
|
||||
|
@ -68,12 +68,8 @@
|
||||
#include "buffer.h"
|
||||
#include "evp.h"
|
||||
|
||||
int ASN1_verify(i2d,a,signature,data,pkey)
|
||||
int (*i2d)();
|
||||
X509_ALGOR *a;
|
||||
ASN1_BIT_STRING *signature;
|
||||
char *data;
|
||||
EVP_PKEY *pkey;
|
||||
int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature,
|
||||
char *data, EVP_PKEY *pkey)
|
||||
{
|
||||
EVP_MD_CTX ctx;
|
||||
const EVP_MD *type;
|
||||
|
@ -63,18 +63,14 @@
|
||||
/* ASN1err(ASN1_F_D2I_ASN1_VISIBLESTRING,ERR_R_MALLOC_FAILURE);
|
||||
*/
|
||||
|
||||
int i2d_ASN1_VISIBLESTRING(a, pp)
|
||||
ASN1_VISIBLESTRING *a;
|
||||
unsigned char **pp;
|
||||
int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **pp)
|
||||
{
|
||||
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
|
||||
V_ASN1_VISIBLESTRING,V_ASN1_UNIVERSAL));
|
||||
}
|
||||
|
||||
ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(a, pp, length)
|
||||
ASN1_VISIBLESTRING **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
ASN1_VISIBLESTRING *ret=NULL;
|
||||
|
||||
|
@ -306,7 +306,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
|
||||
|
||||
#endif
|
||||
|
||||
void ERR_load_ASN1_strings()
|
||||
void ERR_load_ASN1_strings(void)
|
||||
{
|
||||
static int init=1;
|
||||
|
||||
|
@ -71,9 +71,7 @@ static void asn1_put_length();
|
||||
|
||||
const char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT;
|
||||
|
||||
int ASN1_check_infinite_end(p,len)
|
||||
unsigned char **p;
|
||||
long len;
|
||||
int ASN1_check_infinite_end(unsigned char **p, long len)
|
||||
{
|
||||
/* If there is 0 or 1 byte left, the length check should pick
|
||||
* things up */
|
||||
@ -88,12 +86,8 @@ long len;
|
||||
}
|
||||
|
||||
|
||||
int ASN1_get_object(pp, plength, ptag, pclass, omax)
|
||||
unsigned char **pp;
|
||||
long *plength;
|
||||
int *ptag;
|
||||
int *pclass;
|
||||
long omax;
|
||||
int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
|
||||
long omax)
|
||||
{
|
||||
int i,ret;
|
||||
long l;
|
||||
@ -152,11 +146,7 @@ err:
|
||||
return(0x80);
|
||||
}
|
||||
|
||||
static int asn1_get_length(pp,inf,rl,max)
|
||||
unsigned char **pp;
|
||||
int *inf;
|
||||
long *rl;
|
||||
int max;
|
||||
static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
|
||||
{
|
||||
unsigned char *p= *pp;
|
||||
long ret=0;
|
||||
@ -193,12 +183,8 @@ int max;
|
||||
|
||||
/* class 0 is constructed
|
||||
* constructed == 2 for indefinitle length constructed */
|
||||
void ASN1_put_object(pp,constructed,length,tag,xclass)
|
||||
unsigned char **pp;
|
||||
int constructed;
|
||||
int length;
|
||||
int tag;
|
||||
int xclass;
|
||||
void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
|
||||
int xclass)
|
||||
{
|
||||
unsigned char *p= *pp;
|
||||
int i;
|
||||
@ -224,9 +210,7 @@ int xclass;
|
||||
*pp=p;
|
||||
}
|
||||
|
||||
static void asn1_put_length(pp, length)
|
||||
unsigned char **pp;
|
||||
int length;
|
||||
static void asn1_put_length(unsigned char **pp, int length)
|
||||
{
|
||||
unsigned char *p= *pp;
|
||||
int i,l;
|
||||
@ -249,10 +233,7 @@ int length;
|
||||
*pp=p;
|
||||
}
|
||||
|
||||
int ASN1_object_size(constructed, length, tag)
|
||||
int constructed;
|
||||
int length;
|
||||
int tag;
|
||||
int ASN1_object_size(int constructed, int length, int tag)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -280,8 +261,7 @@ int tag;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int asn1_Finish(c)
|
||||
ASN1_CTX *c;
|
||||
int asn1_Finish(ASN1_CTX *c)
|
||||
{
|
||||
if ((c->inf == (1|V_ASN1_CONSTRUCTED)) && (!c->eos))
|
||||
{
|
||||
@ -300,9 +280,7 @@ ASN1_CTX *c;
|
||||
return(1);
|
||||
}
|
||||
|
||||
int asn1_GetSequence(c,length)
|
||||
ASN1_CTX *c;
|
||||
long *length;
|
||||
int asn1_GetSequence(ASN1_CTX *c, long *length)
|
||||
{
|
||||
unsigned char *q;
|
||||
|
||||
@ -331,8 +309,7 @@ long *length;
|
||||
return(1);
|
||||
}
|
||||
|
||||
ASN1_STRING *ASN1_STRING_dup(str)
|
||||
ASN1_STRING *str;
|
||||
ASN1_STRING *ASN1_STRING_dup(ASN1_STRING *str)
|
||||
{
|
||||
ASN1_STRING *ret;
|
||||
|
||||
@ -347,10 +324,7 @@ ASN1_STRING *str;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int ASN1_STRING_set(str,data,len)
|
||||
ASN1_STRING *str;
|
||||
unsigned char *data;
|
||||
int len;
|
||||
int ASN1_STRING_set(ASN1_STRING *str, unsigned char *data, int len)
|
||||
{
|
||||
char *c;
|
||||
|
||||
@ -385,14 +359,13 @@ int len;
|
||||
return(1);
|
||||
}
|
||||
|
||||
ASN1_STRING *ASN1_STRING_new()
|
||||
ASN1_STRING *ASN1_STRING_new(void)
|
||||
{
|
||||
return(ASN1_STRING_type_new(V_ASN1_OCTET_STRING));
|
||||
}
|
||||
|
||||
|
||||
ASN1_STRING *ASN1_STRING_type_new(type)
|
||||
int type;
|
||||
ASN1_STRING *ASN1_STRING_type_new(int type)
|
||||
{
|
||||
ASN1_STRING *ret;
|
||||
|
||||
@ -409,16 +382,14 @@ int type;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
void ASN1_STRING_free(a)
|
||||
ASN1_STRING *a;
|
||||
void ASN1_STRING_free(ASN1_STRING *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
if (a->data != NULL) Free((char *)a->data);
|
||||
Free((char *)a);
|
||||
}
|
||||
|
||||
int ASN1_STRING_cmp(a,b)
|
||||
ASN1_STRING *a,*b;
|
||||
int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -435,9 +406,7 @@ ASN1_STRING *a,*b;
|
||||
return(i);
|
||||
}
|
||||
|
||||
void asn1_add_error(address,offset)
|
||||
unsigned char *address;
|
||||
int offset;
|
||||
void asn1_add_error(unsigned char *address, int offset)
|
||||
{
|
||||
char buf1[16],buf2[16];
|
||||
|
||||
|
@ -72,12 +72,8 @@ static int asn1_print_info();
|
||||
static int asn1_parse2();
|
||||
#endif
|
||||
|
||||
static int asn1_print_info(bp, tag, xclass, constructed,indent)
|
||||
BIO *bp;
|
||||
int tag;
|
||||
int xclass;
|
||||
int constructed;
|
||||
int indent;
|
||||
static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
|
||||
int indent)
|
||||
{
|
||||
static const char fmt[]="%-18s";
|
||||
static const char fmt2[]="%2d %-15s";
|
||||
@ -165,22 +161,13 @@ err:
|
||||
return(0);
|
||||
}
|
||||
|
||||
int ASN1_parse(bp, pp, len, indent)
|
||||
BIO *bp;
|
||||
unsigned char *pp;
|
||||
long len;
|
||||
int indent;
|
||||
int ASN1_parse(BIO *bp, unsigned char *pp, long len, int indent)
|
||||
{
|
||||
return(asn1_parse2(bp,&pp,len,0,0,indent));
|
||||
}
|
||||
|
||||
static int asn1_parse2(bp, pp, length, offset, depth, indent)
|
||||
BIO *bp;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
int offset;
|
||||
int depth;
|
||||
int indent;
|
||||
static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
|
||||
int depth, int indent)
|
||||
{
|
||||
unsigned char *p,*ep,*tot,*op,*opp;
|
||||
long len;
|
||||
|
@ -64,11 +64,8 @@
|
||||
|
||||
/* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */
|
||||
|
||||
STACK *ASN1_seq_unpack(buf, len, d2i, free_func)
|
||||
unsigned char *buf;
|
||||
int len;
|
||||
char *(*d2i)();
|
||||
void (*free_func)();
|
||||
STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
|
||||
void (*free_func)())
|
||||
{
|
||||
STACK *sk;
|
||||
unsigned char *pbuf;
|
||||
@ -83,11 +80,8 @@ void (*free_func)();
|
||||
* Malloc'ed buffer
|
||||
*/
|
||||
|
||||
unsigned char *ASN1_seq_pack(safes, i2d, buf, len)
|
||||
STACK *safes;
|
||||
int (*i2d)();
|
||||
unsigned char **buf;
|
||||
int *len;
|
||||
unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
|
||||
int *len)
|
||||
{
|
||||
int safelen;
|
||||
unsigned char *safe, *p;
|
||||
@ -110,9 +104,7 @@ int *len;
|
||||
|
||||
/* Extract an ASN1 object from an ASN1_STRING */
|
||||
|
||||
char *ASN1_unpack_string (oct, d2i)
|
||||
ASN1_STRING *oct;
|
||||
char *(*d2i)();
|
||||
char *ASN1_unpack_string (ASN1_STRING *oct, char *(*d2i)())
|
||||
{
|
||||
unsigned char *p;
|
||||
char *ret;
|
||||
@ -125,10 +117,7 @@ char *(*d2i)();
|
||||
|
||||
/* Pack an ASN1 object into an ASN1_STRING */
|
||||
|
||||
ASN1_STRING *ASN1_pack_string (obj, i2d, oct)
|
||||
char *obj;
|
||||
int (*i2d)();
|
||||
ASN1_STRING **oct;
|
||||
ASN1_STRING *ASN1_pack_string (char *obj, int (*i2d)(), ASN1_STRING **oct)
|
||||
{
|
||||
unsigned char *p;
|
||||
ASN1_STRING *octmp;
|
||||
|
@ -68,10 +68,7 @@
|
||||
* ASN1err(ASN1_F_I2D_DHPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
|
||||
*/
|
||||
|
||||
DH *d2i_DHparams(a,pp,length)
|
||||
DH **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
DH *d2i_DHparams(DH **a, unsigned char **pp, long length)
|
||||
{
|
||||
int i=ERR_R_NESTED_ASN1_ERROR;
|
||||
ASN1_INTEGER *bs=NULL;
|
||||
|
@ -68,10 +68,7 @@
|
||||
* ASN1err(ASN1_F_I2D_DSAPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
|
||||
*/
|
||||
|
||||
DSA *d2i_DSAparams(a,pp,length)
|
||||
DSA **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
DSA *d2i_DSAparams(DSA **a, unsigned char **pp, long length)
|
||||
{
|
||||
int i=ERR_R_NESTED_ASN1_ERROR;
|
||||
ASN1_INTEGER *bs=NULL;
|
||||
|
@ -63,11 +63,8 @@
|
||||
#include "objects.h"
|
||||
#include "x509.h"
|
||||
|
||||
EVP_PKEY *d2i_PrivateKey(type,a,pp,length)
|
||||
int type;
|
||||
EVP_PKEY **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
EVP_PKEY *ret;
|
||||
|
||||
|
@ -63,11 +63,8 @@
|
||||
#include "objects.h"
|
||||
#include "x509.h"
|
||||
|
||||
EVP_PKEY *d2i_PublicKey(type,a,pp,length)
|
||||
int type;
|
||||
EVP_PKEY **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
EVP_PKEY *ret;
|
||||
|
||||
|
@ -75,15 +75,12 @@ static ASN1_METHOD method={
|
||||
(char *(*)())RSA_new,
|
||||
(void (*)()) RSA_free};
|
||||
|
||||
ASN1_METHOD *RSAPrivateKey_asn1_meth()
|
||||
ASN1_METHOD *RSAPrivateKey_asn1_meth(void)
|
||||
{
|
||||
return(&method);
|
||||
}
|
||||
|
||||
RSA *d2i_RSAPrivateKey(a,pp,length)
|
||||
RSA **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length)
|
||||
{
|
||||
int i=ASN1_R_PARSING;
|
||||
ASN1_INTEGER *bs=NULL;
|
||||
|
@ -68,10 +68,7 @@
|
||||
* ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
|
||||
*/
|
||||
|
||||
RSA *d2i_RSAPublicKey(a,pp,length)
|
||||
RSA **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
RSA *d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length)
|
||||
{
|
||||
int i=ASN1_R_PARSING;
|
||||
ASN1_INTEGER *bs=NULL;
|
||||
|
@ -71,10 +71,7 @@
|
||||
* ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ASN1_R_PARSING);
|
||||
*/
|
||||
|
||||
DSA *d2i_DSAPrivateKey(a,pp,length)
|
||||
DSA **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
DSA *d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length)
|
||||
{
|
||||
int i=ASN1_R_PARSING;
|
||||
ASN1_INTEGER *bs=NULL;
|
||||
|
@ -70,10 +70,7 @@
|
||||
* ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
|
||||
*/
|
||||
|
||||
DSA *d2i_DSAPublicKey(a,pp,length)
|
||||
DSA **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
DSA *d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length)
|
||||
{
|
||||
int i=ASN1_R_PARSING;
|
||||
ASN1_INTEGER *bs=NULL;
|
||||
|
@ -61,10 +61,7 @@
|
||||
#include "asn1.h"
|
||||
#include "asn1_mac.h"
|
||||
|
||||
int ASN1_TYPE_set_octetstring(a,data,len)
|
||||
ASN1_TYPE *a;
|
||||
unsigned char *data;
|
||||
int len;
|
||||
int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
|
||||
{
|
||||
ASN1_STRING *os;
|
||||
|
||||
@ -74,10 +71,9 @@ int len;
|
||||
return(1);
|
||||
}
|
||||
|
||||
int ASN1_TYPE_get_octetstring(a,data,max_len)
|
||||
ASN1_TYPE *a;
|
||||
unsigned char *data;
|
||||
int max_len; /* for returned value */
|
||||
/* int max_len: for returned value */
|
||||
int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data,
|
||||
int max_len)
|
||||
{
|
||||
int ret,num;
|
||||
unsigned char *p;
|
||||
@ -97,11 +93,8 @@ int max_len; /* for returned value */
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int ASN1_TYPE_set_int_octetstring(a,num,data,len)
|
||||
ASN1_TYPE *a;
|
||||
long num;
|
||||
unsigned char *data;
|
||||
int len;
|
||||
int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data,
|
||||
int len)
|
||||
{
|
||||
int n,size;
|
||||
ASN1_OCTET_STRING os,*osp;
|
||||
@ -137,11 +130,9 @@ int len;
|
||||
|
||||
/* we return the actual length..., num may be missing, in which
|
||||
* case, set it to zero */
|
||||
int ASN1_TYPE_get_int_octetstring(a,num,data,max_len)
|
||||
ASN1_TYPE *a;
|
||||
long *num;
|
||||
unsigned char *data;
|
||||
int max_len; /* for returned value */
|
||||
/* int max_len: for returned value */
|
||||
int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data,
|
||||
int max_len)
|
||||
{
|
||||
int ret= -1,n;
|
||||
ASN1_INTEGER *ai=NULL;
|
||||
|
@ -63,9 +63,7 @@
|
||||
|
||||
/* Based on a_int.c: equivalent ENUMERATED functions */
|
||||
|
||||
int i2a_ASN1_ENUMERATED(bp, a)
|
||||
BIO *bp;
|
||||
ASN1_ENUMERATED *a;
|
||||
int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a)
|
||||
{
|
||||
int i,n=0;
|
||||
static const char *h="0123456789ABCDEF";
|
||||
@ -98,11 +96,7 @@ err:
|
||||
return(-1);
|
||||
}
|
||||
|
||||
int a2i_ASN1_ENUMERATED(bp,bs,buf,size)
|
||||
BIO *bp;
|
||||
ASN1_ENUMERATED *bs;
|
||||
char *buf;
|
||||
int size;
|
||||
int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
|
||||
{
|
||||
int ret=0;
|
||||
int i,j,k,m,n,again,bufsize;
|
||||
|
@ -61,9 +61,7 @@
|
||||
#include "buffer.h"
|
||||
#include "x509.h"
|
||||
|
||||
int i2a_ASN1_INTEGER(bp, a)
|
||||
BIO *bp;
|
||||
ASN1_INTEGER *a;
|
||||
int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a)
|
||||
{
|
||||
int i,n=0;
|
||||
static const char *h="0123456789ABCDEF";
|
||||
@ -96,11 +94,7 @@ err:
|
||||
return(-1);
|
||||
}
|
||||
|
||||
int a2i_ASN1_INTEGER(bp,bs,buf,size)
|
||||
BIO *bp;
|
||||
ASN1_INTEGER *bs;
|
||||
char *buf;
|
||||
int size;
|
||||
int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
|
||||
{
|
||||
int ret=0;
|
||||
int i,j,k,m,n,again,bufsize;
|
||||
|
@ -61,10 +61,7 @@
|
||||
#include "buffer.h"
|
||||
#include "x509.h"
|
||||
|
||||
int i2a_ASN1_STRING(bp, a, type)
|
||||
BIO *bp;
|
||||
ASN1_STRING *a;
|
||||
int type;
|
||||
int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type)
|
||||
{
|
||||
int i,n=0;
|
||||
static const char *h="0123456789ABCDEF";
|
||||
@ -97,11 +94,7 @@ err:
|
||||
return(-1);
|
||||
}
|
||||
|
||||
int a2i_ASN1_STRING(bp,bs,buf,size)
|
||||
BIO *bp;
|
||||
ASN1_STRING *bs;
|
||||
char *buf;
|
||||
int size;
|
||||
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
|
||||
{
|
||||
int ret=0;
|
||||
int i,j,k,m,n,again,bufsize;
|
||||
|
@ -67,9 +67,7 @@
|
||||
* ASN1err(ASN1_F_X509_DHPARAMS_NEW,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_DHparams(a,pp)
|
||||
DH *a;
|
||||
unsigned char **pp;
|
||||
int i2d_DHparams(DH *a, unsigned char **pp)
|
||||
{
|
||||
BIGNUM *num[3];
|
||||
ASN1_INTEGER bs;
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_DSAPARAMS,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_DSAparams(a,pp)
|
||||
DSA *a;
|
||||
unsigned char **pp;
|
||||
int i2d_DSAparams(DSA *a, unsigned char **pp)
|
||||
{
|
||||
BIGNUM *num[3];
|
||||
ASN1_INTEGER bs;
|
||||
|
@ -62,9 +62,7 @@
|
||||
#include "evp.h"
|
||||
#include "objects.h"
|
||||
|
||||
int i2d_PrivateKey(a,pp)
|
||||
EVP_PKEY *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
|
||||
{
|
||||
#ifndef NO_RSA
|
||||
if (a->type == EVP_PKEY_RSA)
|
||||
|
@ -62,9 +62,7 @@
|
||||
#include "evp.h"
|
||||
#include "objects.h"
|
||||
|
||||
int i2d_PublicKey(a,pp)
|
||||
EVP_PKEY *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp)
|
||||
{
|
||||
switch (a->type)
|
||||
{
|
||||
|
@ -68,9 +68,7 @@
|
||||
* ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
|
||||
*/
|
||||
|
||||
int i2d_RSAPrivateKey(a,pp)
|
||||
RSA *a;
|
||||
unsigned char **pp;
|
||||
int i2d_RSAPrivateKey(RSA *a, unsigned char **pp)
|
||||
{
|
||||
BIGNUM *num[9];
|
||||
unsigned char data[1];
|
||||
|
@ -68,9 +68,7 @@
|
||||
* ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
|
||||
*/
|
||||
|
||||
int i2d_RSAPublicKey(a,pp)
|
||||
RSA *a;
|
||||
unsigned char **pp;
|
||||
int i2d_RSAPublicKey(RSA *a, unsigned char **pp)
|
||||
{
|
||||
BIGNUM *num[2];
|
||||
ASN1_INTEGER bs;
|
||||
|
@ -67,9 +67,7 @@
|
||||
* ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
|
||||
*/
|
||||
|
||||
int i2d_DSAPrivateKey(a,pp)
|
||||
DSA *a;
|
||||
unsigned char **pp;
|
||||
int i2d_DSAPrivateKey(DSA *a, unsigned char **pp)
|
||||
{
|
||||
BIGNUM *num[6];
|
||||
unsigned char data[1];
|
||||
|
@ -67,9 +67,7 @@
|
||||
* ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE);
|
||||
*/
|
||||
|
||||
int i2d_DSAPublicKey(a,pp)
|
||||
DSA *a;
|
||||
unsigned char **pp;
|
||||
int i2d_DSAPublicKey(DSA *a, unsigned char **pp)
|
||||
{
|
||||
BIGNUM *num[4];
|
||||
ASN1_INTEGER bs;
|
||||
|
@ -92,10 +92,7 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new();
|
||||
static void NETSCAPE_PKEY_free();
|
||||
#endif
|
||||
|
||||
int i2d_Netscape_RSA(a,pp,cb)
|
||||
RSA *a;
|
||||
unsigned char **pp;
|
||||
int (*cb)();
|
||||
int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
|
||||
{
|
||||
int i,j,l[6];
|
||||
NETSCAPE_PKEY *pkey;
|
||||
@ -204,11 +201,7 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
RSA *d2i_Netscape_RSA(a,pp,length,cb)
|
||||
RSA **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
int (*cb)();
|
||||
RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)())
|
||||
{
|
||||
RSA *ret=NULL;
|
||||
ASN1_OCTET_STRING *os=NULL;
|
||||
@ -235,11 +228,8 @@ int (*cb)();
|
||||
M_ASN1_D2I_Finish(a,RSA_free,ASN1_F_D2I_NETSCAPE_RSA);
|
||||
}
|
||||
|
||||
RSA *d2i_Netscape_RSA_2(a,pp,length,cb)
|
||||
RSA **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
int (*cb)();
|
||||
RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length,
|
||||
int (*cb)())
|
||||
{
|
||||
NETSCAPE_PKEY *pkey=NULL;
|
||||
RSA *ret=NULL;
|
||||
@ -306,9 +296,7 @@ err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int i2d_NETSCAPE_PKEY(a,pp)
|
||||
NETSCAPE_PKEY *a;
|
||||
unsigned char **pp;
|
||||
static int i2d_NETSCAPE_PKEY(NETSCAPE_PKEY *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -326,10 +314,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(a,pp,length)
|
||||
NETSCAPE_PKEY **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(NETSCAPE_PKEY **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
static NETSCAPE_PKEY *NETSCAPE_PKEY_new()
|
||||
static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void)
|
||||
{
|
||||
NETSCAPE_PKEY *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -354,8 +340,7 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new()
|
||||
M_ASN1_New_Error(ASN1_F_NETSCAPE_PKEY_NEW);
|
||||
}
|
||||
|
||||
static void NETSCAPE_PKEY_free(a)
|
||||
NETSCAPE_PKEY *a;
|
||||
static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free(a->version);
|
||||
|
@ -70,9 +70,7 @@
|
||||
* ASN1err(ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE,ERR_R_MALLOC_FAILURE);
|
||||
*/
|
||||
|
||||
int i2d_NETSCAPE_CERT_SEQUENCE(a,pp)
|
||||
NETSCAPE_CERT_SEQUENCE *a;
|
||||
unsigned char **pp;
|
||||
int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **pp)
|
||||
{
|
||||
int v = 0;
|
||||
M_ASN1_I2D_vars(a);
|
||||
@ -89,7 +87,7 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new()
|
||||
NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void)
|
||||
{
|
||||
NETSCAPE_CERT_SEQUENCE *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -101,10 +99,8 @@ NETSCAPE_CERT_SEQUENCE *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 **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
M_ASN1_D2I_vars(a,NETSCAPE_CERT_SEQUENCE *,
|
||||
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);
|
||||
}
|
||||
|
||||
void NETSCAPE_CERT_SEQUENCE_free (a)
|
||||
NETSCAPE_CERT_SEQUENCE *a;
|
||||
void NETSCAPE_CERT_SEQUENCE_free (NETSCAPE_CERT_SEQUENCE *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_OBJECT_free(a->type);
|
||||
|
@ -70,9 +70,7 @@
|
||||
*ASN1err(ASN1_F_D2I_PBEPARAM,ASN1_R_DECODE_ERROR)
|
||||
*/
|
||||
|
||||
int i2d_PBEPARAM(a, pp)
|
||||
PBEPARAM *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING);
|
||||
@ -85,7 +83,7 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PBEPARAM *PBEPARAM_new()
|
||||
PBEPARAM *PBEPARAM_new(void)
|
||||
{
|
||||
PBEPARAM *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -96,10 +94,7 @@ PBEPARAM *PBEPARAM_new()
|
||||
M_ASN1_New_Error(ASN1_F_PBEPARAM_NEW);
|
||||
}
|
||||
|
||||
PBEPARAM *d2i_PBEPARAM(a,pp,length)
|
||||
PBEPARAM **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length)
|
||||
{
|
||||
M_ASN1_D2I_vars(a,PBEPARAM *,PBEPARAM_new);
|
||||
M_ASN1_D2I_Init();
|
||||
@ -109,8 +104,7 @@ long length;
|
||||
M_ASN1_D2I_Finish(a, PBEPARAM_free, ASN1_F_D2I_PBEPARAM);
|
||||
}
|
||||
|
||||
void PBEPARAM_free (a)
|
||||
PBEPARAM *a;
|
||||
void PBEPARAM_free (PBEPARAM *a)
|
||||
{
|
||||
if(a==NULL) return;
|
||||
ASN1_OCTET_STRING_free(a->salt);
|
||||
@ -120,11 +114,8 @@ PBEPARAM *a;
|
||||
|
||||
/* Return an algorithm identifier for a PKCS#5 PBE algorithm */
|
||||
|
||||
X509_ALGOR *PKCS5_pbe_set(alg, iter, salt, saltlen)
|
||||
int alg;
|
||||
int iter;
|
||||
unsigned char *salt;
|
||||
int saltlen;
|
||||
X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt,
|
||||
int saltlen)
|
||||
{
|
||||
unsigned char *pdata, *ptmp;
|
||||
int plen;
|
||||
|
@ -70,9 +70,7 @@
|
||||
*ASN1err(ASN1_F_D2I_PBKDF2PARAM,ASN1_R_DECODE_ERROR)
|
||||
*/
|
||||
|
||||
int i2d_PBE2PARAM(a, pp)
|
||||
PBE2PARAM *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
M_ASN1_I2D_len (a->keyfunc, i2d_X509_ALGOR);
|
||||
@ -86,7 +84,7 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PBE2PARAM *PBE2PARAM_new()
|
||||
PBE2PARAM *PBE2PARAM_new(void)
|
||||
{
|
||||
PBE2PARAM *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -97,10 +95,7 @@ PBE2PARAM *PBE2PARAM_new()
|
||||
M_ASN1_New_Error(ASN1_F_PBE2PARAM_NEW);
|
||||
}
|
||||
|
||||
PBE2PARAM *d2i_PBE2PARAM(a,pp,length)
|
||||
PBE2PARAM **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, unsigned char **pp, long length)
|
||||
{
|
||||
M_ASN1_D2I_vars(a,PBE2PARAM *,PBE2PARAM_new);
|
||||
M_ASN1_D2I_Init();
|
||||
@ -110,8 +105,7 @@ long length;
|
||||
M_ASN1_D2I_Finish(a, PBE2PARAM_free, ASN1_F_D2I_PBE2PARAM);
|
||||
}
|
||||
|
||||
void PBE2PARAM_free (a)
|
||||
PBE2PARAM *a;
|
||||
void PBE2PARAM_free (PBE2PARAM *a)
|
||||
{
|
||||
if(a==NULL) return;
|
||||
X509_ALGOR_free(a->keyfunc);
|
||||
@ -119,9 +113,7 @@ PBE2PARAM *a;
|
||||
Free ((char *)a);
|
||||
}
|
||||
|
||||
int i2d_PBKDF2PARAM(a, pp)
|
||||
PBKDF2PARAM *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING);
|
||||
@ -139,7 +131,7 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PBKDF2PARAM *PBKDF2PARAM_new()
|
||||
PBKDF2PARAM *PBKDF2PARAM_new(void)
|
||||
{
|
||||
PBKDF2PARAM *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -152,10 +144,8 @@ PBKDF2PARAM *PBKDF2PARAM_new()
|
||||
M_ASN1_New_Error(ASN1_F_PBKDF2PARAM_NEW);
|
||||
}
|
||||
|
||||
PBKDF2PARAM *d2i_PBKDF2PARAM(a,pp,length)
|
||||
PBKDF2PARAM **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
M_ASN1_D2I_vars(a,PBKDF2PARAM *,PBKDF2PARAM_new);
|
||||
M_ASN1_D2I_Init();
|
||||
@ -167,8 +157,7 @@ long length;
|
||||
M_ASN1_D2I_Finish(a, PBKDF2PARAM_free, ASN1_F_D2I_PBKDF2PARAM);
|
||||
}
|
||||
|
||||
void PBKDF2PARAM_free (a)
|
||||
PBKDF2PARAM *a;
|
||||
void PBKDF2PARAM_free (PBKDF2PARAM *a)
|
||||
{
|
||||
if(a==NULL) return;
|
||||
ASN1_OCTET_STRING_free(a->salt);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_DIGEST,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_DIGEST(a,pp)
|
||||
PKCS7_DIGEST *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_DIGEST(PKCS7_DIGEST *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -87,10 +85,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_DIGEST *d2i_PKCS7_DIGEST(a,pp,length)
|
||||
PKCS7_DIGEST **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_DIGEST *d2i_PKCS7_DIGEST(PKCS7_DIGEST **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
PKCS7_DIGEST *PKCS7_DIGEST_new()
|
||||
PKCS7_DIGEST *PKCS7_DIGEST_new(void)
|
||||
{
|
||||
PKCS7_DIGEST *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -118,8 +114,7 @@ PKCS7_DIGEST *PKCS7_DIGEST_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_DIGEST_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_DIGEST_free(a)
|
||||
PKCS7_DIGEST *a;
|
||||
void PKCS7_DIGEST_free(PKCS7_DIGEST *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free(a->version);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_ENCRYPT,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_ENCRYPT(a,pp)
|
||||
PKCS7_ENCRYPT *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_ENCRYPT(PKCS7_ENCRYPT *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -83,10 +81,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(a,pp,length)
|
||||
PKCS7_ENCRYPT **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(PKCS7_ENCRYPT **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
PKCS7_ENCRYPT *PKCS7_ENCRYPT_new()
|
||||
PKCS7_ENCRYPT *PKCS7_ENCRYPT_new(void)
|
||||
{
|
||||
PKCS7_ENCRYPT *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -110,8 +106,7 @@ PKCS7_ENCRYPT *PKCS7_ENCRYPT_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_ENCRYPT_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_ENCRYPT_free(a)
|
||||
PKCS7_ENCRYPT *a;
|
||||
void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free(a->version);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_ENC_CONTENT,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_ENC_CONTENT(a,pp)
|
||||
PKCS7_ENC_CONTENT *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -85,10 +83,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(a,pp,length)
|
||||
PKCS7_ENC_CONTENT **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
M_ASN1_D2I_vars(a,PKCS7_ENC_CONTENT *,PKCS7_ENC_CONTENT_new);
|
||||
|
||||
@ -103,7 +99,7 @@ long length;
|
||||
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;
|
||||
ASN1_CTX c;
|
||||
@ -117,8 +113,7 @@ PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_ENC_CONTENT_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_ENC_CONTENT_free(a)
|
||||
PKCS7_ENC_CONTENT *a;
|
||||
void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_OBJECT_free(a->content_type);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_ENVELOPE,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_ENVELOPE(a,pp)
|
||||
PKCS7_ENVELOPE *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_ENVELOPE(PKCS7_ENVELOPE *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -85,10 +83,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(a,pp,length)
|
||||
PKCS7_ENVELOPE **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(PKCS7_ENVELOPE **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
PKCS7_ENVELOPE *PKCS7_ENVELOPE_new()
|
||||
PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void)
|
||||
{
|
||||
PKCS7_ENVELOPE *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -115,8 +111,7 @@ PKCS7_ENVELOPE *PKCS7_ENVELOPE_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_ENVELOPE_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_ENVELOPE_free(a)
|
||||
PKCS7_ENVELOPE *a;
|
||||
void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free(a->version);
|
||||
|
@ -66,9 +66,8 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_ISSUER_AND_SERIAL(a,pp)
|
||||
PKCS7_ISSUER_AND_SERIAL *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL *a,
|
||||
unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -83,10 +82,7 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL(a,pp,length)
|
||||
PKCS7_ISSUER_AND_SERIAL **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL **a, unsigned char **pp, long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
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);
|
||||
}
|
||||
|
||||
void PKCS7_ISSUER_AND_SERIAL_free(a)
|
||||
PKCS7_ISSUER_AND_SERIAL *a;
|
||||
void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
X509_NAME_free(a->issuer);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_PKCS7_NEW,ASN1_R_BAD_PKCS7_TYPE);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7(a,pp)
|
||||
PKCS7 *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7(PKCS7 *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -150,10 +148,7 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7 *d2i_PKCS7(a,pp,length)
|
||||
PKCS7 **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
PKCS7 *PKCS7_new()
|
||||
PKCS7 *PKCS7_new(void)
|
||||
{
|
||||
PKCS7 *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -251,8 +246,7 @@ PKCS7 *PKCS7_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_free(a)
|
||||
PKCS7 *a;
|
||||
void PKCS7_free(PKCS7 *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
|
||||
@ -264,8 +258,7 @@ PKCS7 *a;
|
||||
Free((char *)(char *)a);
|
||||
}
|
||||
|
||||
void PKCS7_content_free(a)
|
||||
PKCS7 *a;
|
||||
void PKCS7_content_free(PKCS7 *a)
|
||||
{
|
||||
if(a == NULL)
|
||||
return;
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_RECIP_INFO,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_RECIP_INFO(a,pp)
|
||||
PKCS7_RECIP_INFO *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -87,10 +85,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(a,pp,length)
|
||||
PKCS7_RECIP_INFO **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new()
|
||||
PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new(void)
|
||||
{
|
||||
PKCS7_RECIP_INFO *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -119,8 +115,7 @@ PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_RECIP_INFO_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_RECIP_INFO_free(a)
|
||||
PKCS7_RECIP_INFO *a;
|
||||
void PKCS7_RECIP_INFO_free(PKCS7_RECIP_INFO *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free(a->version);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_SIGN_ENVELOPE,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_SIGN_ENVELOPE(a,pp)
|
||||
PKCS7_SIGN_ENVELOPE *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -93,10 +91,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(a,pp,length)
|
||||
PKCS7_SIGN_ENVELOPE **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
M_ASN1_D2I_vars(a,PKCS7_SIGN_ENVELOPE *,PKCS7_SIGN_ENVELOPE_new);
|
||||
|
||||
@ -116,7 +112,7 @@ long length;
|
||||
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;
|
||||
ASN1_CTX c;
|
||||
@ -133,8 +129,7 @@ PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_SIGN_ENVELOPE_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_SIGN_ENVELOPE_free(a)
|
||||
PKCS7_SIGN_ENVELOPE *a;
|
||||
void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free(a->version);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_SIGNED,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_SIGNED(a,pp)
|
||||
PKCS7_SIGNED *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -91,10 +89,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_SIGNED *d2i_PKCS7_SIGNED(a,pp,length)
|
||||
PKCS7_SIGNED **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_SIGNED *d2i_PKCS7_SIGNED(PKCS7_SIGNED **a, unsigned char **pp,
|
||||
long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
PKCS7_SIGNED *PKCS7_SIGNED_new()
|
||||
PKCS7_SIGNED *PKCS7_SIGNED_new(void)
|
||||
{
|
||||
PKCS7_SIGNED *ret=NULL;
|
||||
ASN1_CTX c;
|
||||
@ -127,8 +123,7 @@ PKCS7_SIGNED *PKCS7_SIGNED_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_SIGNED_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_SIGNED_free(a)
|
||||
PKCS7_SIGNED *a;
|
||||
void PKCS7_SIGNED_free(PKCS7_SIGNED *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free(a->version);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_D2I_PKCS7_SIGNER_INFO,ERR_R_ASN1_LENGTH_MISMATCH);
|
||||
*/
|
||||
|
||||
int i2d_PKCS7_SIGNER_INFO(a,pp)
|
||||
PKCS7_SIGNER_INFO *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -93,10 +91,8 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(a,pp,length)
|
||||
PKCS7_SIGNER_INFO **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
M_ASN1_D2I_vars(a,PKCS7_SIGNER_INFO *,PKCS7_SIGNER_INFO_new);
|
||||
|
||||
@ -116,7 +112,7 @@ long length;
|
||||
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;
|
||||
ASN1_CTX c;
|
||||
@ -134,8 +130,7 @@ PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new()
|
||||
M_ASN1_New_Error(ASN1_F_PKCS7_SIGNER_INFO_NEW);
|
||||
}
|
||||
|
||||
void PKCS7_SIGNER_INFO_free(a)
|
||||
PKCS7_SIGNER_INFO *a;
|
||||
void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free(a->version);
|
||||
|
@ -65,9 +65,7 @@
|
||||
*ASN1err(ASN1_F_D2I_PKCS8_PRIV_KEY_INFO,ASN1_R_DECODE_ERROR)
|
||||
*/
|
||||
|
||||
int i2d_PKCS8_PRIV_KEY_INFO (a,pp)
|
||||
PKCS8_PRIV_KEY_INFO *a;
|
||||
unsigned char **pp;
|
||||
int i2d_PKCS8_PRIV_KEY_INFO (PKCS8_PRIV_KEY_INFO *a, unsigned char **pp)
|
||||
{
|
||||
|
||||
M_ASN1_I2D_vars(a);
|
||||
@ -87,7 +85,7 @@ unsigned char **pp;
|
||||
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;
|
||||
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);
|
||||
}
|
||||
|
||||
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(a,pp,length)
|
||||
PKCS8_PRIV_KEY_INFO **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a,
|
||||
unsigned char **pp, long length)
|
||||
{
|
||||
M_ASN1_D2I_vars(a,PKCS8_PRIV_KEY_INFO *,PKCS8_PRIV_KEY_INFO_new);
|
||||
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);
|
||||
}
|
||||
|
||||
void PKCS8_PRIV_KEY_INFO_free (a)
|
||||
PKCS8_PRIV_KEY_INFO *a;
|
||||
void PKCS8_PRIV_KEY_INFO_free (PKCS8_PRIV_KEY_INFO *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_INTEGER_free (a->version);
|
||||
|
@ -66,9 +66,7 @@
|
||||
* ASN1err(ASN1_F_X509_KEY_NEW,ERR_R_BAD_GET_ASN1_OBJECT_CALL);
|
||||
*/
|
||||
|
||||
int i2d_X509_KEY(a,pp)
|
||||
X509 *a;
|
||||
unsigned char **pp;
|
||||
int i2d_X509_KEY(X509 *a, unsigned char **pp)
|
||||
{
|
||||
M_ASN1_I2D_vars(a);
|
||||
|
||||
@ -85,10 +83,7 @@ unsigned char **pp;
|
||||
M_ASN1_I2D_finish();
|
||||
}
|
||||
|
||||
X509 *d2i_X509_KEY(a,pp,length)
|
||||
X509 **a;
|
||||
unsigned char **pp;
|
||||
long length;
|
||||
X509 *d2i_X509_KEY(X509 **a, unsigned char **pp, long length)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
X509 *X509_KEY_new()
|
||||
X509 *X509_KEY_new(void)
|
||||
{
|
||||
X509_KEY *ret=NULL;
|
||||
|
||||
@ -114,8 +109,7 @@ X509 *X509_KEY_new()
|
||||
M_ASN1_New_Error(ASN1_F_X509_NEW);
|
||||
}
|
||||
|
||||
void X509_KEY_free(a)
|
||||
X509 *a;
|
||||
void X509_KEY_free(X509 *a)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -71,9 +71,7 @@ static void ext_print();
|
||||
#endif
|
||||
|
||||
#ifndef NO_FP_API
|
||||
int X509_CRL_print_fp(fp,x)
|
||||
FILE *fp;
|
||||
X509_CRL *x;
|
||||
int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
|
||||
{
|
||||
BIO *b;
|
||||
int ret;
|
||||
@ -90,9 +88,7 @@ X509_CRL *x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int X509_CRL_print(out, x)
|
||||
BIO *out;
|
||||
X509_CRL *x;
|
||||
int X509_CRL_print(BIO *out, X509_CRL *x)
|
||||
{
|
||||
char buf[256];
|
||||
unsigned char *s;
|
||||
@ -157,9 +153,7 @@ X509_CRL *x;
|
||||
|
||||
}
|
||||
|
||||
static void ext_print(out, ex)
|
||||
BIO *out;
|
||||
X509_EXTENSION *ex;
|
||||
static void ext_print(BIO *out, X509_EXTENSION *ex)
|
||||
{
|
||||
ASN1_OBJECT *obj;
|
||||
int j;
|
||||
|
@ -83,10 +83,7 @@ static int print();
|
||||
|
||||
#ifndef NO_RSA
|
||||
#ifndef NO_FP_API
|
||||
int RSA_print_fp(fp,x,off)
|
||||
FILE *fp;
|
||||
RSA *x;
|
||||
int off;
|
||||
int RSA_print_fp(FILE *fp, RSA *x, int off)
|
||||
{
|
||||
BIO *b;
|
||||
int ret;
|
||||
@ -103,10 +100,7 @@ int off;
|
||||
}
|
||||
#endif
|
||||
|
||||
int RSA_print(bp,x,off)
|
||||
BIO *bp;
|
||||
RSA *x;
|
||||
int off;
|
||||
int RSA_print(BIO *bp, RSA *x, int off)
|
||||
{
|
||||
char str[128];
|
||||
const char *s;
|
||||
@ -155,10 +149,7 @@ err:
|
||||
|
||||
#ifndef NO_DSA
|
||||
#ifndef NO_FP_API
|
||||
int DSA_print_fp(fp,x,off)
|
||||
FILE *fp;
|
||||
DSA *x;
|
||||
int off;
|
||||
int DSA_print_fp(FILE *fp, DSA *x, int off)
|
||||
{
|
||||
BIO *b;
|
||||
int ret;
|
||||
@ -175,10 +166,7 @@ int off;
|
||||
}
|
||||
#endif
|
||||
|
||||
int DSA_print(bp,x,off)
|
||||
BIO *bp;
|
||||
DSA *x;
|
||||
int off;
|
||||
int DSA_print(BIO *bp, DSA *x, int off)
|
||||
{
|
||||
char str[128];
|
||||
unsigned char *m=NULL;
|
||||
@ -230,12 +218,8 @@ err:
|
||||
}
|
||||
#endif /* !NO_DSA */
|
||||
|
||||
static int print(bp,number,num,buf,off)
|
||||
BIO *bp;
|
||||
const char *number;
|
||||
BIGNUM *num;
|
||||
unsigned char *buf;
|
||||
int off;
|
||||
static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf,
|
||||
int off)
|
||||
{
|
||||
int n,i;
|
||||
char str[128];
|
||||
@ -286,9 +270,7 @@ int off;
|
||||
|
||||
#ifndef NO_DH
|
||||
#ifndef NO_FP_API
|
||||
int DHparams_print_fp(fp,x)
|
||||
FILE *fp;
|
||||
DH *x;
|
||||
int DHparams_print_fp(FILE *fp, DH *x)
|
||||
{
|
||||
BIO *b;
|
||||
int ret;
|
||||
@ -305,9 +287,7 @@ DH *x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int DHparams_print(bp,x)
|
||||
BIO *bp;
|
||||
DH *x;
|
||||
int DHparams_print(BIO *bp, DH *x)
|
||||
{
|
||||
unsigned char *m=NULL;
|
||||
int reason=ERR_R_BUF_LIB,i,ret=0;
|
||||
@ -343,9 +323,7 @@ err:
|
||||
|
||||
#ifndef NO_DSA
|
||||
#ifndef NO_FP_API
|
||||
int DSAparams_print_fp(fp,x)
|
||||
FILE *fp;
|
||||
DSA *x;
|
||||
int DSAparams_print_fp(FILE *fp, DSA *x)
|
||||
{
|
||||
BIO *b;
|
||||
int ret;
|
||||
@ -362,9 +340,7 @@ DSA *x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int DSAparams_print(bp,x)
|
||||
BIO *bp;
|
||||
DSA *x;
|
||||
int DSAparams_print(BIO *bp, DSA *x)
|
||||
{
|
||||
unsigned char *m=NULL;
|
||||
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
Loading…
x
Reference in New Issue
Block a user