Massive constification.

This commit is contained in:
Ben Laurie 1999-04-17 21:25:43 +00:00
parent d77b3054cd
commit e778802f53
124 changed files with 496 additions and 448 deletions

View File

@ -5,6 +5,10 @@
Changes between 0.9.2b and 0.9.3 Changes between 0.9.2b and 0.9.3
*) A lot of constification, and fix a bug in X509_NAME_oneline() that could
return a const string when you are expecting an allocated buffer.
[Ben Laurie]
*) Add support for ASN1 types UTF8String and VISIBLESTRING. *) Add support for ASN1 types UTF8String and VISIBLESTRING.
[Steve Henson] [Steve Henson]

View File

@ -83,7 +83,7 @@ my %table=(
"purify", "purify gcc:-g -DPURIFY -Wall:-lsocket -lnsl::::", "purify", "purify gcc:-g -DPURIFY -Wall:-lsocket -lnsl::::",
"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:-lefence::::", "debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:-lefence::::",
"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -O2 -Wall -Wshadow -Werror -pipe:::::", "debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -O2 -Wall -Wshadow -Werror -pipe:::::",
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe:::::", "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe:::::",
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm", "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
"dist", "cc:-O -DNOPROTO::::", "dist", "cc:-O -DNOPROTO::::",

View File

@ -168,17 +168,20 @@ static int index_name_cmp(char **a,char **b);
static BIGNUM *load_serial(char *serialfile); static BIGNUM *load_serial(char *serialfile);
static int save_serial(char *serialfile, BIGNUM *serial); static int save_serial(char *serialfile, BIGNUM *serial);
static int certify(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, static int certify(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
EVP_MD *dgst,STACK *policy,TXT_DB *db,BIGNUM *serial,char *startdate, const EVP_MD *dgst,STACK *policy,TXT_DB *db,BIGNUM *serial,
int days, int batch, char *ext_sect, LHASH *conf,int verbose); char *startdate,int days,int batch,char *ext_sect,
LHASH *conf,int verbose);
static int certify_cert(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, static int certify_cert(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
EVP_MD *dgst,STACK *policy,TXT_DB *db,BIGNUM *serial,char *startdate, const EVP_MD *dgst,STACK *policy,TXT_DB *db,
int days,int batch,char *ext_sect, LHASH *conf,int verbose); BIGNUM *serial,char *startdate,int days,int batch,
char *ext_sect, LHASH *conf,int verbose);
static int certify_spkac(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, static int certify_spkac(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
EVP_MD *dgst,STACK *policy,TXT_DB *db,BIGNUM *serial,char *startdate, const EVP_MD *dgst,STACK *policy,TXT_DB *db,
int days,char *ext_sect,LHASH *conf,int verbose); BIGNUM *serial,char *startdate,int days,
char *ext_sect,LHASH *conf,int verbose);
static int fix_data(int nid, int *type); static int fix_data(int nid, int *type);
static void write_new_certificate(BIO *bp, X509 *x, int output_der); static void write_new_certificate(BIO *bp, X509 *x, int output_der);
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, EVP_MD *dgst, static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
STACK *policy, TXT_DB *db, BIGNUM *serial, char *startdate, STACK *policy, TXT_DB *db, BIGNUM *serial, char *startdate,
int days, int batch, int verbose, X509_REQ *req, char *ext_sect, int days, int batch, int verbose, X509_REQ *req, char *ext_sect,
LHASH *conf); LHASH *conf);
@ -257,7 +260,7 @@ char **argv;
char **pp,*p,*f; char **pp,*p,*f;
int i,j; int i,j;
long l; long l;
EVP_MD *dgst=NULL; const EVP_MD *dgst=NULL;
STACK *attribs=NULL; STACK *attribs=NULL;
STACK *cert_sk=NULL; STACK *cert_sk=NULL;
BIO *hex=NULL; BIO *hex=NULL;
@ -1303,7 +1306,7 @@ X509 **xret;
char *infile; char *infile;
EVP_PKEY *pkey; EVP_PKEY *pkey;
X509 *x509; X509 *x509;
EVP_MD *dgst; const EVP_MD *dgst;
STACK *policy; STACK *policy;
TXT_DB *db; TXT_DB *db;
BIGNUM *serial; BIGNUM *serial;
@ -1374,7 +1377,7 @@ X509 **xret;
char *infile; char *infile;
EVP_PKEY *pkey; EVP_PKEY *pkey;
X509 *x509; X509 *x509;
EVP_MD *dgst; const EVP_MD *dgst;
STACK *policy; STACK *policy;
TXT_DB *db; TXT_DB *db;
BIGNUM *serial; BIGNUM *serial;
@ -1448,7 +1451,7 @@ static int do_body(xret,pkey,x509,dgst,policy,db,serial,startdate,days,
X509 **xret; X509 **xret;
EVP_PKEY *pkey; EVP_PKEY *pkey;
X509 *x509; X509 *x509;
EVP_MD *dgst; const EVP_MD *dgst;
STACK *policy; STACK *policy;
TXT_DB *db; TXT_DB *db;
BIGNUM *serial; BIGNUM *serial;
@ -1921,7 +1924,7 @@ X509 **xret;
char *infile; char *infile;
EVP_PKEY *pkey; EVP_PKEY *pkey;
X509 *x509; X509 *x509;
EVP_MD *dgst; const EVP_MD *dgst;
STACK *policy; STACK *policy;
TXT_DB *db; TXT_DB *db;
BIGNUM *serial; BIGNUM *serial;

View File

@ -83,7 +83,8 @@ char **argv;
{ {
int ret=1,i; int ret=1,i;
int verbose=0; int verbose=0;
char **pp,*p; char **pp;
const char *p;
int badops=0; int badops=0;
SSL_CTX *ctx=NULL; SSL_CTX *ctx=NULL;
SSL *ssl=NULL; SSL *ssl=NULL;

View File

@ -85,10 +85,10 @@ char **argv;
{ {
unsigned char *buf=NULL; unsigned char *buf=NULL;
int i,err=0; int i,err=0;
EVP_MD *md=NULL,*m; const EVP_MD *md=NULL,*m;
BIO *in=NULL,*inp; BIO *in=NULL,*inp;
BIO *bmd=NULL; BIO *bmd=NULL;
char *name; const char *name;
#define PROG_NAME_SIZE 16 #define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE]; char pname[PROG_NAME_SIZE];
int separator=0; int separator=0;

View File

@ -89,7 +89,7 @@ char **argv;
int ret=1; int ret=1;
DSA *dsa=NULL; DSA *dsa=NULL;
int i,badops=0; int i,badops=0;
EVP_CIPHER *enc=NULL; const EVP_CIPHER *enc=NULL;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
int informat,outformat,text=0,noout=0; int informat,outformat,text=0,noout=0;
char *infile,*outfile,*prog; char *infile,*outfile,*prog;

View File

@ -97,7 +97,7 @@ char **argv;
char *hkey=NULL,*hiv=NULL; char *hkey=NULL,*hiv=NULL;
int enc=1,printkey=0,i,base64=0; int enc=1,printkey=0,i,base64=0;
int debug=0,olb64=0; int debug=0,olb64=0;
EVP_CIPHER *cipher=NULL,*c; const EVP_CIPHER *cipher=NULL,*c;
char *inf=NULL,*outf=NULL; char *inf=NULL,*outf=NULL;
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL; BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
#define PROG_NAME_SIZE 16 #define PROG_NAME_SIZE 16

View File

@ -157,7 +157,7 @@ char **argv;
EVP_CIPHER *cipher=NULL; EVP_CIPHER *cipher=NULL;
int modulus=0; int modulus=0;
char *p; char *p;
EVP_MD *md_alg=NULL,*digest=EVP_md5(); const EVP_MD *md_alg=NULL,*digest=EVP_md5();
#ifndef MONOLITH #ifndef MONOLITH
MS_STATIC char config_name[256]; MS_STATIC char config_name[256];
#endif #endif

View File

@ -89,7 +89,7 @@ char **argv;
int ret=1; int ret=1;
RSA *rsa=NULL; RSA *rsa=NULL;
int i,badops=0; int i,badops=0;
EVP_CIPHER *enc=NULL; const EVP_CIPHER *enc=NULL;
BIO *in=NULL,*out=NULL; BIO *in=NULL,*out=NULL;
int informat,outformat,text=0,noout=0; int informat,outformat,text=0,noout=0;
char *infile,*outfile,*prog; char *infile,*outfile,*prog;

View File

@ -86,7 +86,7 @@ int extract_port(char *str, short *port_ptr);
int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p); int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p);
int host_ip(char *str, unsigned char ip[4]); int host_ip(char *str, unsigned char ip[4]);
long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, char *argp, long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp,
int argi, long argl, long ret); int argi, long argl, long ret);
#ifdef HEADER_SSL_H #ifdef HEADER_SSL_H

View File

@ -184,7 +184,7 @@ char *key_file;
long MS_CALLBACK bio_dump_cb(bio,cmd,argp,argi,argl,ret) long MS_CALLBACK bio_dump_cb(bio,cmd,argp,argi,argl,ret)
BIO *bio; BIO *bio;
int cmd; int cmd;
char *argp; const char *argp;
int argi; int argi;
long argl; long argl;
long ret; long ret;

View File

@ -792,7 +792,7 @@ static int init_ssl_connection(con)
SSL *con; SSL *con;
{ {
int i; int i;
char *str; const char *str;
X509 *peer; X509 *peer;
long verify_error; long verify_error;
MS_STATIC char buf[BUFSIZ]; MS_STATIC char buf[BUFSIZ];

View File

@ -121,9 +121,10 @@ NULL
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx); static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx);
static EVP_PKEY *load_key(char *file, int format); static EVP_PKEY *load_key(char *file, int format);
static X509 *load_cert(char *file, int format); static X509 *load_cert(char *file, int format);
static int sign (X509 *x, EVP_PKEY *pkey,int days,EVP_MD *digest); static int sign (X509 *x, EVP_PKEY *pkey,int days,const EVP_MD *digest);
static int x509_certify (X509_STORE *ctx,char *CAfile, EVP_MD *digest,X509 *x, static int x509_certify (X509_STORE *ctx,char *CAfile,const EVP_MD *digest,
X509 *xca, EVP_PKEY *pkey,char *serial, int create, int days); X509 *x,X509 *xca,EVP_PKEY *pkey,char *serial,
int create,int days);
#else #else
static int MS_CALLBACK callb(); static int MS_CALLBACK callb();
static EVP_PKEY *load_key(); static EVP_PKEY *load_key();
@ -157,7 +158,7 @@ char **argv;
X509_REQ *rq=NULL; X509_REQ *rq=NULL;
int fingerprint=0; int fingerprint=0;
char buf[256]; char buf[256];
EVP_MD *md_alg,*digest=EVP_md5(); const EVP_MD *md_alg,*digest=EVP_md5();
reqfile=0; reqfile=0;
@ -706,7 +707,7 @@ end:
static int x509_certify(ctx,CAfile,digest,x,xca,pkey,serialfile,create,days) static int x509_certify(ctx,CAfile,digest,x,xca,pkey,serialfile,create,days)
X509_STORE *ctx; X509_STORE *ctx;
char *CAfile; char *CAfile;
EVP_MD *digest; const EVP_MD *digest;
X509 *x; X509 *x;
X509 *xca; X509 *xca;
EVP_PKEY *pkey; EVP_PKEY *pkey;
@ -1041,7 +1042,7 @@ static int sign(x, pkey, days, digest)
X509 *x; X509 *x;
EVP_PKEY *pkey; EVP_PKEY *pkey;
int days; int days;
EVP_MD *digest; const EVP_MD *digest;
{ {
EVP_PKEY *pktmp; EVP_PKEY *pktmp;

View File

@ -90,11 +90,12 @@ unsigned char **pp;
int a2d_ASN1_OBJECT(out,olen,buf,num) int a2d_ASN1_OBJECT(out,olen,buf,num)
unsigned char *out; unsigned char *out;
int olen; int olen;
char *buf; const char *buf;
int num; int num;
{ {
int i,first,len=0,c; int i,first,len=0,c;
char tmp[24],*p; char tmp[24];
const char *p;
unsigned long l; unsigned long l;
if (num == 0) if (num == 0)
@ -188,7 +189,7 @@ ASN1_OBJECT *a;
int i,idx=0,n=0,len,nid; int i,idx=0,n=0,len,nid;
unsigned long l; unsigned long l;
unsigned char *p; unsigned char *p;
char *s; const char *s;
char tbuf[32]; char tbuf[32];
if (buf_len <= 0) return(0); if (buf_len <= 0) return(0);
@ -246,9 +247,9 @@ ASN1_OBJECT *a;
} }
else else
{ {
s=(char *)OBJ_nid2ln(nid); s=OBJ_nid2ln(nid);
if (s == NULL) if (s == NULL)
s=(char *)OBJ_nid2sn(nid); s=OBJ_nid2sn(nid);
strncpy(buf,s,buf_len); strncpy(buf,s,buf_len);
n=strlen(s); n=strlen(s);
} }
@ -355,8 +356,10 @@ ASN1_OBJECT *a;
if (a == NULL) return; if (a == NULL) return;
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS)
{ {
if (a->sn != NULL) Free(a->sn); #ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause mempory leaks */
if (a->ln != NULL) Free(a->ln); if (a->sn != NULL) Free((void *)a->sn);
if (a->ln != NULL) Free((void *)a->ln);
#endif
a->sn=a->ln=NULL; a->sn=a->ln=NULL;
} }
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA)
@ -366,7 +369,7 @@ ASN1_OBJECT *a;
a->length=0; a->length=0;
} }
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC) if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
Free((char *)a); Free(a);
} }
ASN1_OBJECT *ASN1_OBJECT_create(nid,data,len,sn,ln) ASN1_OBJECT *ASN1_OBJECT_create(nid,data,len,sn,ln)

View File

@ -73,8 +73,8 @@ typedef struct
*/ */
static int SetBlobCmp(const void *elem1, const void *elem2 ) static int SetBlobCmp(const void *elem1, const void *elem2 )
{ {
MYBLOB *b1 = (MYBLOB *)elem1; const MYBLOB *b1 = (const MYBLOB *)elem1;
MYBLOB *b2 = (MYBLOB *)elem2; const MYBLOB *b2 = (const MYBLOB *)elem2;
int r; int r;
r = memcmp(b1->pbData, b2->pbData, r = memcmp(b1->pbData, b2->pbData,

View File

@ -75,7 +75,7 @@ X509_ALGOR *algor2;
ASN1_BIT_STRING *signature; ASN1_BIT_STRING *signature;
char *data; char *data;
EVP_PKEY *pkey; EVP_PKEY *pkey;
EVP_MD *type; const EVP_MD *type;
{ {
EVP_MD_CTX ctx; EVP_MD_CTX ctx;
unsigned char *p,*buf_in=NULL,*buf_out=NULL; unsigned char *p,*buf_in=NULL,*buf_out=NULL;

View File

@ -76,7 +76,7 @@ char *data;
EVP_PKEY *pkey; EVP_PKEY *pkey;
{ {
EVP_MD_CTX ctx; EVP_MD_CTX ctx;
EVP_MD *type; const EVP_MD *type;
unsigned char *p,*buf_in=NULL; unsigned char *p,*buf_in=NULL;
int ret= -1,i,inl; int ret= -1,i,inl;
@ -89,7 +89,7 @@ EVP_PKEY *pkey;
} }
inl=i2d(data,NULL); inl=i2d(data,NULL);
buf_in=(unsigned char *)Malloc((unsigned int)inl); buf_in=Malloc((unsigned int)inl);
if (buf_in == NULL) if (buf_in == NULL)
{ {
ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE); ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE);

View File

@ -150,7 +150,7 @@ typedef struct asn1_ctx_st
#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */ #define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
typedef struct asn1_object_st typedef struct asn1_object_st
{ {
char *sn,*ln; const char *sn,*ln;
int nid; int nid;
int length; int length;
unsigned char *data; unsigned char *data;
@ -561,7 +561,7 @@ int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type);
#endif #endif
int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a); int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a);
int a2d_ASN1_OBJECT(unsigned char *out,int olen, char *buf, int num); int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num);
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len,
char *sn, char *ln); char *sn, char *ln);

View File

@ -69,7 +69,7 @@ static int asn1_get_length();
static void asn1_put_length(); static void asn1_put_length();
#endif #endif
char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT; const char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT;
int ASN1_check_infinite_end(p,len) int ASN1_check_infinite_end(p,len)
unsigned char **p; unsigned char **p;

View File

@ -79,9 +79,10 @@ int xclass;
int constructed; int constructed;
int indent; int indent;
{ {
static char *fmt="%-18s"; static const char fmt[]="%-18s";
static char *fmt2="%2d %-15s"; static const char fmt2[]="%2d %-15s";
char *p,str[128],*p2=NULL; char str[128];
const char *p,*p2=NULL;
if (constructed & V_ASN1_CONSTRUCTED) if (constructed & V_ASN1_CONSTRUCTED)
p="cons: "; p="cons: ";

View File

@ -68,7 +68,7 @@ BIO *bp;
ASN1_ENUMERATED *a; ASN1_ENUMERATED *a;
{ {
int i,n=0; int i,n=0;
static char *h="0123456789ABCDEF"; static const char *h="0123456789ABCDEF";
char buf[2]; char buf[2];
if (a == NULL) return(0); if (a == NULL) return(0);

View File

@ -66,7 +66,7 @@ BIO *bp;
ASN1_INTEGER *a; ASN1_INTEGER *a;
{ {
int i,n=0; int i,n=0;
static char *h="0123456789ABCDEF"; static const char *h="0123456789ABCDEF";
char buf[2]; char buf[2];
if (a == NULL) return(0); if (a == NULL) return(0);

View File

@ -67,7 +67,7 @@ ASN1_STRING *a;
int type; int type;
{ {
int i,n=0; int i,n=0;
static char *h="0123456789ABCDEF"; static const char *h="0123456789ABCDEF";
char buf[2]; char buf[2];
if (a == NULL) return(0); if (a == NULL) return(0);

View File

@ -138,7 +138,9 @@ int (*cb)();
l[2]=i2d_X509_ALGOR(alg,NULL); l[2]=i2d_X509_ALGOR(alg,NULL);
l[3]=ASN1_object_size(1,l[2]+l[1],V_ASN1_SEQUENCE); l[3]=ASN1_object_size(1,l[2]+l[1],V_ASN1_SEQUENCE);
#ifndef CONST_STRICT
os.data=(unsigned char *)"private-key"; os.data=(unsigned char *)"private-key";
#endif
os.length=11; os.length=11;
l[4]=i2d_ASN1_OCTET_STRING(&os,NULL); l[4]=i2d_ASN1_OCTET_STRING(&os,NULL);
@ -195,7 +197,7 @@ int (*cb)();
i2d_ASN1_OCTET_STRING(&os2,&p); i2d_ASN1_OCTET_STRING(&os2,&p);
ret=l[5]; ret=l[5];
err: err:
if (os2.data != NULL) Free((char *)os2.data); if (os2.data != NULL) Free(os2.data);
if (alg != NULL) X509_ALGOR_free(alg); if (alg != NULL) X509_ALGOR_free(alg);
if (pkey != NULL) NETSCAPE_PKEY_free(pkey); if (pkey != NULL) NETSCAPE_PKEY_free(pkey);
r=r; r=r;

View File

@ -75,7 +75,7 @@
*/ */
#ifndef NOPROTO #ifndef NOPROTO
static int print(BIO *fp,char *str,BIGNUM *num, static int print(BIO *fp,const char *str,BIGNUM *num,
unsigned char *buf,int off); unsigned char *buf,int off);
#else #else
static int print(); static int print();
@ -108,7 +108,8 @@ BIO *bp;
RSA *x; RSA *x;
int off; int off;
{ {
char str[128],*s; char str[128];
const char *s;
unsigned char *m=NULL; unsigned char *m=NULL;
int i,ret=0; int i,ret=0;
@ -231,13 +232,14 @@ err:
static int print(bp,number,num,buf,off) static int print(bp,number,num,buf,off)
BIO *bp; BIO *bp;
char *number; const char *number;
BIGNUM *num; BIGNUM *num;
unsigned char *buf; unsigned char *buf;
int off; int off;
{ {
int n,i; int n,i;
char str[128],*neg; char str[128];
const char *neg;
if (num == NULL) return(1); if (num == NULL) return(1);
neg=(num->neg)?"-":""; neg=(num->neg)?"-":"";

View File

@ -89,7 +89,8 @@ X509_REQ *x;
{ {
unsigned long l; unsigned long l;
int i,n; int i,n;
char *s,*neg; char *s;
const char *neg;
X509_REQ_INFO *ri; X509_REQ_INFO *ri;
EVP_PKEY *pkey; EVP_PKEY *pkey;
STACK *sk; STACK *sk;

View File

@ -100,7 +100,7 @@ X509 *x;
X509_CINF *ci; X509_CINF *ci;
ASN1_INTEGER *bs; ASN1_INTEGER *bs;
EVP_PKEY *pkey=NULL; EVP_PKEY *pkey=NULL;
char *neg; const char *neg;
X509_EXTENSION *ex; X509_EXTENSION *ex;
ASN1_STRING *str=NULL; ASN1_STRING *str=NULL;
@ -275,6 +275,11 @@ ASN1_TIME *tm;
return(0); return(0);
} }
static const char *mon[12]=
{
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"
};
int ASN1_GENERALIZEDTIME_print(bp,tm) int ASN1_GENERALIZEDTIME_print(bp,tm)
BIO *bp; BIO *bp;
@ -282,9 +287,6 @@ ASN1_GENERALIZEDTIME *tm;
{ {
char *v; char *v;
int gmt=0; int gmt=0;
static char *mon[12]={
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"};
int i; int i;
int y=0,M=0,d=0,h=0,m=0,s=0; int y=0,M=0,d=0,h=0,m=0,s=0;
@ -321,9 +323,6 @@ ASN1_UTCTIME *tm;
{ {
char *v; char *v;
int gmt=0; int gmt=0;
static char *mon[12]={
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"};
int i; int i;
int y=0,M=0,d=0,h=0,m=0,s=0; int y=0,M=0,d=0,h=0,m=0,s=0;

View File

@ -65,9 +65,9 @@
* CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993) * CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993)
*/ */
char *BF_version="BlowFish" OPENSSL_VERSION_PTEXT; const char *BF_version="BlowFish" OPENSSL_VERSION_PTEXT;
char *BF_options() const char *BF_options()
{ {
#ifdef BF_PTR #ifdef BF_PTR
return("blowfish(ptr)"); return("blowfish(ptr)");

View File

@ -102,7 +102,7 @@ void BF_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
BF_KEY *schedule, unsigned char *ivec, int *num, int enc); BF_KEY *schedule, unsigned char *ivec, int *num, int enc);
void BF_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, void BF_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
BF_KEY *schedule, unsigned char *ivec, int *num); BF_KEY *schedule, unsigned char *ivec, int *num);
char *BF_options(void); const char *BF_options(void);
#else #else
@ -113,7 +113,7 @@ void BF_decrypt();
void BF_cbc_encrypt(); void BF_cbc_encrypt();
void BF_cfb64_encrypt(); void BF_cfb64_encrypt();
void BF_ofb64_encrypt(); void BF_ofb64_encrypt();
char *BF_options(); const char *BF_options();
#endif #endif

View File

@ -69,7 +69,7 @@
int BIO_dump(bio,s,len) int BIO_dump(bio,s,len)
BIO *bio; BIO *bio;
char *s; const char *s;
int len; int len;
{ {
int ret=0; int ret=0;

View File

@ -97,7 +97,7 @@ static struct ghbn_cache_st
} ghbn_cache[GHBN_NUM]; } ghbn_cache[GHBN_NUM];
#ifndef NOPROTO #ifndef NOPROTO
static int get_ip(char *str,unsigned char *ip); static int get_ip(const char *str,unsigned char *ip);
static void ghbn_free(struct hostent *a); static void ghbn_free(struct hostent *a);
static struct hostent *ghbn_dup(struct hostent *a); static struct hostent *ghbn_dup(struct hostent *a);
#else #else
@ -107,7 +107,7 @@ static struct hostent *ghbn_dup();
#endif #endif
int BIO_get_host_ip(str,ip) int BIO_get_host_ip(str,ip)
char *str; const char *str;
unsigned char *ip; unsigned char *ip;
{ {
int i; int i;
@ -147,7 +147,7 @@ unsigned char *ip;
} }
int BIO_get_port(str,port_ptr) int BIO_get_port(str,port_ptr)
char *str; const char *str;
unsigned short *port_ptr; unsigned short *port_ptr;
{ {
int i; int i;
@ -330,7 +330,7 @@ struct hostent *a;
} }
struct hostent *BIO_gethostbyname(name) struct hostent *BIO_gethostbyname(name)
char *name; const char *name;
{ {
struct hostent *ret; struct hostent *ret;
int i,lowi=0,j; int i,lowi=0,j;
@ -439,7 +439,7 @@ unsigned long *arg;
/* The reason I have implemented this instead of using sscanf is because /* The reason I have implemented this instead of using sscanf is because
* Visual C 1.52c gives an unresolved external when linking a DLL :-( */ * Visual C 1.52c gives an unresolved external when linking a DLL :-( */
static int get_ip(str,ip) static int get_ip(str,ip)
char *str; const char *str;
unsigned char ip[4]; unsigned char ip[4];
{ {
unsigned int tmp[4]; unsigned int tmp[4];
@ -484,7 +484,8 @@ int bind_mode;
int s= -1,cs; int s= -1,cs;
unsigned char ip[4]; unsigned char ip[4];
unsigned short port; unsigned short port;
char *str,*h,*p,*e; char *str,*e;
const char *h,*p;
unsigned long l; unsigned long l;
int err_num; int err_num;

View File

@ -203,7 +203,7 @@ extern "C" {
typedef struct bio_method_st typedef struct bio_method_st
{ {
int type; int type;
char *name; const char *name;
int (*bwrite)(); int (*bwrite)();
int (*bread)(); int (*bread)();
int (*bputs)(); int (*bputs)();
@ -216,7 +216,7 @@ typedef struct bio_method_st
typedef struct bio_method_st typedef struct bio_method_st
{ {
int type; int type;
char *name; const char *name;
int (_far *bwrite)(); int (_far *bwrite)();
int (_far *bread)(); int (_far *bread)();
int (_far *bputs)(); int (_far *bputs)();
@ -232,7 +232,7 @@ typedef struct bio_st
BIO_METHOD *method; BIO_METHOD *method;
#ifndef NOPROTO #ifndef NOPROTO
/* bio, mode, argp, argi, argl, ret */ /* bio, mode, argp, argi, argl, ret */
long (*callback)(struct bio_st *,int,char *,int, long,long); long (*callback)(struct bio_st *,int,const char *,int, long,long);
#else #else
long (*callback)(); long (*callback)();
#endif #endif
@ -378,8 +378,15 @@ typedef struct bio_f_buffer_ctx_struct
/* name is cast to lose const, but might be better to route through a function /* name is cast to lose const, but might be better to route through a function
so we can do it safely */ so we can do it safely */
#ifdef CONST_STRICT
/* If you are wondering why this isn't defined, its because CONST_STRICT is
* purely a compile-time kludge to allow const to be checked.
*/
int BIO_read_filename(BIO *b,const char *name);
#else
#define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ #define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_READ,(char *)name) BIO_CLOSE|BIO_FP_READ,(char *)name)
#endif
#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ #define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_WRITE,name) BIO_CLOSE|BIO_FP_WRITE,name)
#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ #define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
@ -493,8 +500,8 @@ int BIO_set(BIO *a,BIO_METHOD *type);
int BIO_free(BIO *a); int BIO_free(BIO *a);
int BIO_read(BIO *b, char *data, int len); int BIO_read(BIO *b, char *data, int len);
int BIO_gets(BIO *bp,char *buf, int size); int BIO_gets(BIO *bp,char *buf, int size);
int BIO_write(BIO *b, char *data, int len); int BIO_write(BIO *b, const char *data, int len);
int BIO_puts(BIO *bp,char *buf); int BIO_puts(BIO *bp,const char *buf);
long BIO_ctrl(BIO *bp,int cmd,long larg,char *parg); long BIO_ctrl(BIO *bp,int cmd,long larg,char *parg);
char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
@ -507,10 +514,10 @@ int BIO_get_retry_reason(BIO *bio);
BIO * BIO_dup_chain(BIO *in); BIO * BIO_dup_chain(BIO *in);
#ifndef WIN16 #ifndef WIN16
long BIO_debug_callback(BIO *bio,int cmd,char *argp,int argi, long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
long argl,long ret); long argl,long ret);
#else #else
long _far _loadds BIO_debug_callback(BIO *bio,int cmd,char *argp,int argi, long _far _loadds BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
long argl,long ret); long argl,long ret);
#endif #endif
@ -530,14 +537,14 @@ int BIO_sock_should_retry(int i);
int BIO_sock_non_fatal_error(int error); int BIO_sock_non_fatal_error(int error);
int BIO_fd_should_retry(int i); int BIO_fd_should_retry(int i);
int BIO_fd_non_fatal_error(int error); int BIO_fd_non_fatal_error(int error);
int BIO_dump(BIO *b,char *bytes,int len); int BIO_dump(BIO *b,const char *bytes,int len);
struct hostent *BIO_gethostbyname(char *name); struct hostent *BIO_gethostbyname(const char *name);
int BIO_sock_error(int sock); int BIO_sock_error(int sock);
int BIO_socket_ioctl(int fd, long type, unsigned long *arg); int BIO_socket_ioctl(int fd, long type, unsigned long *arg);
int BIO_socket_nbio(int fd,int mode); int BIO_socket_nbio(int fd,int mode);
int BIO_get_port(char *str, unsigned short *port_ptr); int BIO_get_port(const char *str, unsigned short *port_ptr);
int BIO_get_host_ip(char *str, unsigned char *ip); int BIO_get_host_ip(const char *str, unsigned char *ip);
int BIO_get_accept_socket(char *host_port,int mode); int BIO_get_accept_socket(char *host_port,int mode);
int BIO_accept(int sock,char **ip_port); int BIO_accept(int sock,char **ip_port);
int BIO_sock_init(void ); int BIO_sock_init(void );

View File

@ -66,7 +66,7 @@
long MS_CALLBACK BIO_debug_callback(bio,cmd,argp,argi,argl,ret) long MS_CALLBACK BIO_debug_callback(bio,cmd,argp,argi,argl,ret)
BIO *bio; BIO *bio;
int cmd; int cmd;
char *argp; const char *argp;
int argi; int argi;
long argl; long argl;
long ret; long ret;

View File

@ -178,7 +178,7 @@ int outl;
int BIO_write(b,in,inl) int BIO_write(b,in,inl)
BIO *b; BIO *b;
char *in; const char *in;
int inl; int inl;
{ {
int i; int i;
@ -222,7 +222,7 @@ int inl;
int BIO_puts(b,in) int BIO_puts(b,in)
BIO *b; BIO *b;
char *in; const char *in;
{ {
int i; int i;
long (*cb)(); long (*cb)();

View File

@ -483,7 +483,7 @@ char *ptr;
{ {
BIO *dbio; BIO *dbio;
int *ip; int *ip;
char **pptr; const char **pptr;
long ret=1; long ret=1;
BIO_CONNECT *data; BIO_CONNECT *data;
@ -507,7 +507,7 @@ char *ptr;
case BIO_C_GET_CONNECT: case BIO_C_GET_CONNECT:
if (ptr != NULL) if (ptr != NULL)
{ {
pptr=(char **)ptr; pptr=(const char **)ptr;
if (num == 0) if (num == 0)
{ {
*pptr=data->param_hostname; *pptr=data->param_hostname;

View File

@ -90,7 +90,7 @@ static int MS_CALLBACK slg_new();
static int MS_CALLBACK slg_free(); static int MS_CALLBACK slg_free();
#endif #endif
static int xopenlog(BIO* bp, char* name, int level); static int xopenlog(BIO* bp, const char* name, int level);
static int xcloselog(BIO* bp); static int xcloselog(BIO* bp);
static BIO_METHOD methods_slg= static BIO_METHOD methods_slg=
@ -221,7 +221,7 @@ char *str;
return(ret); return(ret);
} }
static int xopenlog(BIO* bp, char* name, int level) static int xopenlog(BIO* bp, const char* name, int level)
{ {
#if defined(WIN32) #if defined(WIN32)
if((bp->ptr= (char *)RegisterEventSource(NULL, name)) == NULL){ if((bp->ptr= (char *)RegisterEventSource(NULL, name)) == NULL){

View File

@ -60,7 +60,7 @@
#include "cryptlib.h" #include "cryptlib.h"
#include "bn_lcl.h" #include "bn_lcl.h"
char *BN_version="Big Number" OPENSSL_VERSION_PTEXT; const char *BN_version="Big Number" OPENSSL_VERSION_PTEXT;
/* For a 32 bit machine /* For a 32 bit machine
* 2 - 4 == 128 * 2 - 4 == 128

View File

@ -62,7 +62,7 @@
#include "buffer.h" #include "buffer.h"
#include "bn_lcl.h" #include "bn_lcl.h"
static char *Hex="0123456789ABCDEF"; const static char *Hex="0123456789ABCDEF";
/* Must 'Free' the returned data */ /* Must 'Free' the returned data */
char *BN_bn2hex(a) char *BN_bn2hex(a)

View File

@ -128,7 +128,7 @@ int len;
} }
char *BUF_strdup(str) char *BUF_strdup(str)
char *str; const char *str;
{ {
char *ret; char *ret;
int n; int n;

View File

@ -74,7 +74,7 @@ typedef struct buf_mem_st
BUF_MEM *BUF_MEM_new(void); BUF_MEM *BUF_MEM_new(void);
void BUF_MEM_free(BUF_MEM *a); void BUF_MEM_free(BUF_MEM *a);
int BUF_MEM_grow(BUF_MEM *str, int len); int BUF_MEM_grow(BUF_MEM *str, int len);
char * BUF_strdup(char *str); char * BUF_strdup(const char *str);
void ERR_load_BUF_strings(void ); void ERR_load_BUF_strings(void );

View File

@ -11,7 +11,7 @@ extern "C" {
typedef struct comp_method_st typedef struct comp_method_st
{ {
int type; /* NID for compression library */ int type; /* NID for compression library */
char *name; /* A text string to identify the library */ const char *name; /* A text string to identify the library */
int (*init)(); int (*init)();
void (*finish)(); void (*finish)();
int (*compress)(); int (*compress)();

View File

@ -95,7 +95,7 @@ static CONF_VALUE *get_section();
#define scan_esc(p) ((((p)[1] == '\0')?(p++):(p+=2)),p) #define scan_esc(p) ((((p)[1] == '\0')?(p++):(p+=2)),p)
char *CONF_version="CONF" OPENSSL_VERSION_PTEXT; const char *CONF_version="CONF" OPENSSL_VERSION_PTEXT;
LHASH *CONF_load(h,file,line) LHASH *CONF_load(h,file,line)
LHASH *h; LHASH *h;
@ -375,7 +375,7 @@ char *name;
if (p != NULL) return(p); if (p != NULL) return(p);
} }
} }
vv.section="default"; vv.section=BUF_strdup("default");
vv.name=name; vv.name=name;
v=(CONF_VALUE *)lh_retrieve(conf,(char *)&vv); v=(CONF_VALUE *)lh_retrieve(conf,(char *)&vv);
if (v != NULL) if (v != NULL)

View File

@ -67,7 +67,7 @@ static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
#endif #endif
/* real #defines in crypto.h, keep these upto date */ /* real #defines in crypto.h, keep these upto date */
static char* lock_names[CRYPTO_NUM_LOCKS] = static const char* lock_names[CRYPTO_NUM_LOCKS] =
{ {
"<<ERROR>>", "<<ERROR>>",
"err", "err",
@ -96,9 +96,9 @@ static STACK *app_locks=NULL;
#ifndef NOPROTO #ifndef NOPROTO
static void (MS_FAR *locking_callback)(int mode,int type, static void (MS_FAR *locking_callback)(int mode,int type,
char *file,int line)=NULL; const char *file,int line)=NULL;
static int (MS_FAR *add_lock_callback)(int *pointer,int amount, static int (MS_FAR *add_lock_callback)(int *pointer,int amount,
int type,char *file,int line)=NULL; int type,const char *file,int line)=NULL;
static unsigned long (MS_FAR *id_callback)(void)=NULL; static unsigned long (MS_FAR *id_callback)(void)=NULL;
#else #else
static void (MS_FAR *locking_callback)()=NULL; static void (MS_FAR *locking_callback)()=NULL;
@ -135,24 +135,26 @@ char *name;
return(i); return(i);
} }
void (*CRYPTO_get_locking_callback(P_V))(P_I_I_P_I) void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file,
int line)
{ {
return(locking_callback); return(locking_callback);
} }
int (*CRYPTO_get_add_lock_callback(P_V))(P_IP_I_I_P_I) int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type,
const char *file,int line)
{ {
return(add_lock_callback); return(add_lock_callback);
} }
void CRYPTO_set_locking_callback(func) void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
void (*func)(P_I_I_P_I); const char *file,int line))
{ {
locking_callback=func; locking_callback=func;
} }
void CRYPTO_set_add_lock_callback(func) void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type,
int (*func)(P_IP_I_I_P_I); const char *file,int line))
{ {
add_lock_callback=func; add_lock_callback=func;
} }
@ -192,7 +194,7 @@ unsigned long CRYPTO_thread_id()
void CRYPTO_lock(mode,type,file,line) void CRYPTO_lock(mode,type,file,line)
int mode; int mode;
int type; int type;
char *file; const char *file;
int line; int line;
{ {
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
@ -226,7 +228,7 @@ int CRYPTO_add_lock(pointer,amount,type,file,line)
int *pointer; int *pointer;
int amount; int amount;
int type; int type;
char *file; const char *file;
int line; int line;
{ {
int ret; int ret;
@ -265,7 +267,7 @@ int line;
return(ret); return(ret);
} }
char *CRYPTO_get_lock_name(type) const char *CRYPTO_get_lock_name(type)
int type; int type;
{ {
if (type < 0) if (type < 0)

View File

@ -233,7 +233,7 @@ typedef struct crypto_ex_data_func_st
#ifndef NOPROTO #ifndef NOPROTO
char *SSLeay_version(int type); const char *SSLeay_version(int type);
unsigned long SSLeay(void); unsigned long SSLeay(void);
int CRYPTO_get_ex_new_index(int idx,STACK **sk,long argl,char *argp, int CRYPTO_get_ex_new_index(int idx,STACK **sk,long argl,char *argp,
@ -246,20 +246,21 @@ void CRYPTO_new_ex_data(STACK *meth, char *obj, CRYPTO_EX_DATA *ad);
int CRYPTO_mem_ctrl(int mode); int CRYPTO_mem_ctrl(int mode);
int CRYPTO_get_new_lockid(char *name); int CRYPTO_get_new_lockid(char *name);
void CRYPTO_lock(int mode, int type,char *file,int line); void CRYPTO_lock(int mode, int type,const char *file,int line);
void CRYPTO_set_locking_callback(void (*func)(int mode,int type,char *file, void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
int line)); const char *file,int line));
void (*CRYPTO_get_locking_callback(void))(int mode,int type,char *file, void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file,
int line); int line);
void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount, void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type,
int type,char *file, int line)); const char *file, int line));
int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount, int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type,
int type,char *file,int line); const char *file,int line);
void CRYPTO_set_id_callback(unsigned long (*func)(void)); void CRYPTO_set_id_callback(unsigned long (*func)(void));
unsigned long (*CRYPTO_get_id_callback(void))(void); unsigned long (*CRYPTO_get_id_callback(void))(void);
unsigned long CRYPTO_thread_id(void); unsigned long CRYPTO_thread_id(void);
char *CRYPTO_get_lock_name(int type); const char *CRYPTO_get_lock_name(int type);
int CRYPTO_add_lock(int *pointer,int amount,int type, char *file,int line); int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file,
int line);
void CRYPTO_set_mem_functions(char *(*m)(),char *(*r)(), void (*free_func)()); void CRYPTO_set_mem_functions(char *(*m)(),char *(*r)(), void (*free_func)());
void CRYPTO_get_mem_functions(char *(**m)(),char *(**r)(), void (**f)()); void CRYPTO_get_mem_functions(char *(**m)(),char *(**r)(), void (**f)());
@ -273,10 +274,10 @@ void CRYPTO_free(void *);
void *CRYPTO_realloc(void *addr,int num); void *CRYPTO_realloc(void *addr,int num);
void *CRYPTO_remalloc(void *addr,int num); void *CRYPTO_remalloc(void *addr,int num);
void *CRYPTO_dbg_malloc(int num,char *file,int line); void *CRYPTO_dbg_malloc(int num,const char *file,int line);
void *CRYPTO_dbg_realloc(void *addr,int num,char *file,int line); void *CRYPTO_dbg_realloc(void *addr,int num,const char *file,int line);
void CRYPTO_dbg_free(void *); void CRYPTO_dbg_free(void *);
void *CRYPTO_dbg_remalloc(void *addr,int num,char *file,int line); void *CRYPTO_dbg_remalloc(void *addr,int num,const char *file,int line);
#ifndef NO_FP_API #ifndef NO_FP_API
void CRYPTO_mem_leaks_fp(FILE *); void CRYPTO_mem_leaks_fp(FILE *);
#endif #endif
@ -308,7 +309,7 @@ int (*CRYPTO_get_add_lock_callback())();
void CRYPTO_set_id_callback(); void CRYPTO_set_id_callback();
unsigned long (*CRYPTO_get_id_callback())(); unsigned long (*CRYPTO_get_id_callback())();
unsigned long CRYPTO_thread_id(); unsigned long CRYPTO_thread_id();
char *CRYPTO_get_lock_name(); const char *CRYPTO_get_lock_name();
int CRYPTO_add_lock(); int CRYPTO_add_lock();
void CRYPTO_set_mem_functions(); void CRYPTO_set_mem_functions();

View File

@ -62,7 +62,7 @@
#include "crypto.h" #include "crypto.h"
#include "date.h" #include "date.h"
char *SSLeay_version(t) const char *SSLeay_version(t)
int t; int t;
{ {
if (t == SSLEAY_VERSION) if (t == SSLEAY_VERSION)

View File

@ -152,7 +152,7 @@ extern int des_set_weak_key_flag; /* set the weak key flag */
#undef NOPROTO #undef NOPROTO
#endif #endif
#ifndef NOPROTO #ifndef NOPROTO
char *des_options(void); const char *des_options(void);
void des_ecb3_encrypt(const unsigned char *input,unsigned char *output, void des_ecb3_encrypt(const unsigned char *input,unsigned char *output,
des_key_schedule ks1,des_key_schedule ks2, des_key_schedule ks1,des_key_schedule ks2,
des_key_schedule ks3, int enc); des_key_schedule ks3, int enc);

View File

@ -65,7 +65,7 @@ int enc;
{ {
register DES_LONG l,r,t,u; register DES_LONG l,r,t,u;
#ifdef DES_PTR #ifdef DES_PTR
register unsigned char *des_SP=(unsigned char *)des_SPtrans; register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
#endif #endif
#ifndef DES_UNROLL #ifndef DES_UNROLL
register int i; register int i;
@ -166,7 +166,7 @@ int enc;
{ {
register DES_LONG l,r,t,u; register DES_LONG l,r,t,u;
#ifdef DES_PTR #ifdef DES_PTR
register unsigned char *des_SP=(unsigned char *)des_SPtrans; register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
#endif #endif
#ifndef DES_UNROLL #ifndef DES_UNROLL
register int i; register int i;
@ -392,14 +392,15 @@ int enc;
{ {
register DES_LONG tin0,tin1; register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1; register DES_LONG tout0,tout1,xor0,xor1;
register unsigned char *in,*out; register const unsigned char *in;
unsigned char *out;
register long l=length; register long l=length;
DES_LONG tin[2]; DES_LONG tin[2];
unsigned char *iv; unsigned char *iv;
in=(unsigned char *)input; in=input;
out=(unsigned char *)output; out=output;
iv=(unsigned char *)ivec; iv=ivec;
if (enc) if (enc)
{ {
@ -436,7 +437,7 @@ int enc;
l2c(tout0,out); l2c(tout0,out);
l2c(tout1,out); l2c(tout1,out);
} }
iv=(unsigned char *)ivec; iv=ivec;
l2c(tout0,iv); l2c(tout0,iv);
l2c(tout1,iv); l2c(tout1,iv);
} }
@ -488,7 +489,7 @@ int enc;
xor1=t1; xor1=t1;
} }
iv=(unsigned char *)ivec; iv=ivec;
l2c(xor0,iv); l2c(xor0,iv);
l2c(xor1,iv); l2c(xor1,iv);
} }

View File

@ -302,24 +302,24 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
u2&=0xfc; \ u2&=0xfc; \
t=ROTATE(t,4); \ t=ROTATE(t,4); \
u>>=16L; \ u>>=16L; \
LL^= *(DES_LONG *)((unsigned char *)des_SP +u1); \ LL^= *(const DES_LONG *)(des_SP +u1); \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x200+u2); \ LL^= *(const DES_LONG *)(des_SP+0x200+u2); \
u3=(int)(u>>8L); \ u3=(int)(u>>8L); \
u1=(int)u&0xfc; \ u1=(int)u&0xfc; \
u3&=0xfc; \ u3&=0xfc; \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x400+u1); \ LL^= *(const DES_LONG *)(des_SP+0x400+u1); \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x600+u3); \ LL^= *(const DES_LONG *)(des_SP+0x600+u3); \
u2=(int)t>>8L; \ u2=(int)t>>8L; \
u1=(int)t&0xfc; \ u1=(int)t&0xfc; \
u2&=0xfc; \ u2&=0xfc; \
t>>=16L; \ t>>=16L; \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x100+u1); \ LL^= *(const DES_LONG *)(des_SP+0x100+u1); \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x300+u2); \ LL^= *(const DES_LONG *)(des_SP+0x300+u2); \
u3=(int)t>>8L; \ u3=(int)t>>8L; \
u1=(int)t&0xfc; \ u1=(int)t&0xfc; \
u3&=0xfc; \ u3&=0xfc; \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x500+u1); \ LL^= *(const DES_LONG *)(des_SP+0x500+u1); \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x700+u3); } LL^= *(const DES_LONG *)(des_SP+0x700+u3); }
#endif #endif
#ifdef DES_RISC2 #ifdef DES_RISC2
#define D_ENCRYPT(LL,R,S) { \ #define D_ENCRYPT(LL,R,S) { \
@ -329,39 +329,39 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
u1=(int)u&0xfc; \ u1=(int)u&0xfc; \
u2&=0xfc; \ u2&=0xfc; \
t=ROTATE(t,4); \ t=ROTATE(t,4); \
LL^= *(DES_LONG *)((unsigned char *)des_SP +u1); \ LL^= *(const DES_LONG *)(des_SP +u1); \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x200+u2); \ LL^= *(const DES_LONG *)(des_SP+0x200+u2); \
s1=(int)(u>>16L); \ s1=(int)(u>>16L); \
s2=(int)(u>>24L); \ s2=(int)(u>>24L); \
s1&=0xfc; \ s1&=0xfc; \
s2&=0xfc; \ s2&=0xfc; \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x400+s1); \ LL^= *(const DES_LONG *)(des_SP+0x400+s1); \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x600+s2); \ LL^= *(const DES_LONG *)(des_SP+0x600+s2); \
u2=(int)t>>8L; \ u2=(int)t>>8L; \
u1=(int)t&0xfc; \ u1=(int)t&0xfc; \
u2&=0xfc; \ u2&=0xfc; \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x100+u1); \ LL^= *(const DES_LONG *)(des_SP+0x100+u1); \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x300+u2); \ LL^= *(const DES_LONG *)(des_SP+0x300+u2); \
s1=(int)(t>>16L); \ s1=(int)(t>>16L); \
s2=(int)(t>>24L); \ s2=(int)(t>>24L); \
s1&=0xfc; \ s1&=0xfc; \
s2&=0xfc; \ s2&=0xfc; \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x500+s1); \ LL^= *(const DES_LONG *)(des_SP+0x500+s1); \
LL^= *(DES_LONG *)((unsigned char *)des_SP+0x700+s2); } LL^= *(const DES_LONG *)(des_SP+0x700+s2); }
#endif #endif
#else #else
#define D_ENCRYPT(LL,R,S) { \ #define D_ENCRYPT(LL,R,S) { \
LOAD_DATA_tmp(R,S,u,t,E0,E1); \ LOAD_DATA_tmp(R,S,u,t,E0,E1); \
t=ROTATE(t,4); \ t=ROTATE(t,4); \
LL^= \ LL^= \
*(DES_LONG *)((unsigned char *)des_SP +((u )&0xfc))^ \ *(const DES_LONG *)(des_SP +((u )&0xfc))^ \
*(DES_LONG *)((unsigned char *)des_SP+0x200+((u>> 8L)&0xfc))^ \ *(const DES_LONG *)(des_SP+0x200+((u>> 8L)&0xfc))^ \
*(DES_LONG *)((unsigned char *)des_SP+0x400+((u>>16L)&0xfc))^ \ *(const DES_LONG *)(des_SP+0x400+((u>>16L)&0xfc))^ \
*(DES_LONG *)((unsigned char *)des_SP+0x600+((u>>24L)&0xfc))^ \ *(const DES_LONG *)(des_SP+0x600+((u>>24L)&0xfc))^ \
*(DES_LONG *)((unsigned char *)des_SP+0x100+((t )&0xfc))^ \ *(const DES_LONG *)(des_SP+0x100+((t )&0xfc))^ \
*(DES_LONG *)((unsigned char *)des_SP+0x300+((t>> 8L)&0xfc))^ \ *(const DES_LONG *)(des_SP+0x300+((t>> 8L)&0xfc))^ \
*(DES_LONG *)((unsigned char *)des_SP+0x500+((t>>16L)&0xfc))^ \ *(const DES_LONG *)(des_SP+0x500+((t>>16L)&0xfc))^ \
*(DES_LONG *)((unsigned char *)des_SP+0x700+((t>>24L)&0xfc)); } *(const DES_LONG *)(des_SP+0x700+((t>>24L)&0xfc)); }
#endif #endif
#else /* original version */ #else /* original version */

View File

@ -60,17 +60,17 @@
#include "spr.h" #include "spr.h"
#include "opensslv.h" #include "opensslv.h"
char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay"; const char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay";
char *DES_version="DES" OPENSSL_VERSION_PTEXT; const char *DES_version="DES" OPENSSL_VERSION_PTEXT;
char *des_options() const char *des_options(void)
{ {
static int init=1; static int init=1;
static char buf[32]; static char buf[32];
if (init) if (init)
{ {
char *ptr,*unroll,*risc,*size; const char *ptr,*unroll,*risc,*size;
init=0; init=0;
#ifdef DES_PTR #ifdef DES_PTR

View File

@ -85,7 +85,7 @@ DES_LONG Eswap1;
{ {
register DES_LONG l,r,t,u; register DES_LONG l,r,t,u;
#ifdef DES_PTR #ifdef DES_PTR
register unsigned char *des_SP=(unsigned char *)des_SPtrans; register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
#endif #endif
register DES_LONG *s; register DES_LONG *s;
register int j; register int j;

View File

@ -68,11 +68,12 @@ int enc;
{ {
register DES_LONG sin0,sin1,xor0,xor1,tout0,tout1; register DES_LONG sin0,sin1,xor0,xor1,tout0,tout1;
DES_LONG tin[2]; DES_LONG tin[2];
unsigned char *in,*out,*iv; const unsigned char *in;
unsigned char *out,*iv;
in=(unsigned char *)input; in=input;
out=(unsigned char *)output; out=output;
iv=(unsigned char *)ivec; iv=ivec;
if (enc) if (enc)
{ {

View File

@ -83,7 +83,7 @@ des_cblock seed;
DES_LONG z0,z1,t0,t1; DES_LONG z0,z1,t0,t1;
int i; int i;
long l; long l;
unsigned char *cp; const unsigned char *cp;
unsigned char *lp; unsigned char *lp;
if (out_count < 1) out_count=1; if (out_count < 1) out_count=1;
@ -94,7 +94,7 @@ des_cblock seed;
for (i=0; ((i<4)&&(i<out_count)); i++) for (i=0; ((i<4)&&(i<out_count)); i++)
{ {
cp=(unsigned char *)input; cp=input;
l=length; l=length;
while (l > 0) while (l > 0)
{ {

View File

@ -163,7 +163,7 @@ des_key_schedule schedule;
{ {
static int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0}; static int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
register DES_LONG c,d,t,s,t2; register DES_LONG c,d,t,s,t2;
register unsigned char *in; register const unsigned char *in;
register DES_LONG *k; register DES_LONG *k;
register int i; register int i;
@ -177,7 +177,7 @@ des_key_schedule schedule;
} }
k=(DES_LONG *)schedule; k=(DES_LONG *)schedule;
in=(unsigned char *)key; in=key;
c2l(in,c); c2l(in,c);
c2l(in,d); c2l(in,d);

View File

@ -87,7 +87,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: supp.c,v 1.2 1999/02/13 18:52:21 ben Exp $ * $Id: supp.c,v 1.3 1999/04/17 21:25:00 ben Exp $
*/ */
#include <stdio.h> #include <stdio.h>
@ -98,7 +98,7 @@ void des_cblock_print_file(cb, fp)
FILE *fp; FILE *fp;
{ {
int i; int i;
unsigned int *p = (unsigned int *)cb; const unsigned int *p = (const unsigned int *)cb;
fprintf(fp, " 0x { "); fprintf(fp, " 0x { ");
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {

View File

@ -61,7 +61,7 @@
#include "bn.h" #include "bn.h"
#include "dh.h" #include "dh.h"
char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT; const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
DH *DH_new() DH *DH_new()
{ {

View File

@ -64,7 +64,7 @@
#include "dsa.h" #include "dsa.h"
#include "asn1.h" #include "asn1.h"
char *DSA_version="DSA" OPENSSL_VERSION_PTEXT; const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
DSA *DSA_new() DSA *DSA_new()
{ {

View File

@ -73,8 +73,8 @@ static unsigned long err_hash(ERR_STRING_DATA *a);
static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b); static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b);
static unsigned long pid_hash(ERR_STATE *pid); static unsigned long pid_hash(ERR_STATE *pid);
static int pid_cmp(ERR_STATE *a,ERR_STATE *pid); static int pid_cmp(ERR_STATE *a,ERR_STATE *pid);
static unsigned long get_error_values(int inc,char **file,int *line, static unsigned long get_error_values(int inc,const char **file,int *line,
char **data,int *flags); const char **data,int *flags);
static void ERR_STATE_free(ERR_STATE *s); static void ERR_STATE_free(ERR_STATE *s);
#else #else
static unsigned long err_hash(); static unsigned long err_hash();
@ -256,7 +256,7 @@ void ERR_free_strings()
void ERR_put_error(lib,func,reason,file,line) void ERR_put_error(lib,func,reason,file,line)
int lib,func,reason; int lib,func,reason;
char *file; const char *file;
int line; int line;
{ {
ERR_STATE *es; ERR_STATE *es;
@ -296,14 +296,14 @@ unsigned long ERR_get_error()
{ return(get_error_values(1,NULL,NULL,NULL,NULL)); } { return(get_error_values(1,NULL,NULL,NULL,NULL)); }
unsigned long ERR_get_error_line(file,line) unsigned long ERR_get_error_line(file,line)
char **file; const char **file;
int *line; int *line;
{ return(get_error_values(1,file,line,NULL,NULL)); } { return(get_error_values(1,file,line,NULL,NULL)); }
unsigned long ERR_get_error_line_data(file,line,data,flags) unsigned long ERR_get_error_line_data(file,line,data,flags)
char **file; const char **file;
int *line; int *line;
char **data; const char **data;
int *flags; int *flags;
{ return(get_error_values(1,file,line,data,flags)); } { return(get_error_values(1,file,line,data,flags)); }
@ -311,22 +311,22 @@ unsigned long ERR_peek_error()
{ return(get_error_values(0,NULL,NULL,NULL,NULL)); } { return(get_error_values(0,NULL,NULL,NULL,NULL)); }
unsigned long ERR_peek_error_line(file,line) unsigned long ERR_peek_error_line(file,line)
char **file; const char **file;
int *line; int *line;
{ return(get_error_values(0,file,line,NULL,NULL)); } { return(get_error_values(0,file,line,NULL,NULL)); }
unsigned long ERR_peek_error_line_data(file,line,data,flags) unsigned long ERR_peek_error_line_data(file,line,data,flags)
char **file; const char **file;
int *line; int *line;
char **data; const char **data;
int *flags; int *flags;
{ return(get_error_values(0,file,line,data,flags)); } { return(get_error_values(0,file,line,data,flags)); }
static unsigned long get_error_values(inc,file,line,data,flags) static unsigned long get_error_values(inc,file,line,data,flags)
int inc; int inc;
char **file; const char **file;
int *line; int *line;
char **data; const char **data;
int *flags; int *flags;
{ {
int i=0; int i=0;
@ -381,7 +381,7 @@ unsigned long e;
char *ret; char *ret;
{ {
static char buf[256]; static char buf[256];
char *ls,*fs,*rs; const char *ls,*fs,*rs;
unsigned long l,f,r; unsigned long l,f,r;
int i; int i;
@ -422,7 +422,7 @@ LHASH *ERR_get_err_state_table()
return(thread_hash); return(thread_hash);
} }
char *ERR_lib_error_string(e) const char *ERR_lib_error_string(e)
unsigned long e; unsigned long e;
{ {
ERR_STRING_DATA d,*p=NULL; ERR_STRING_DATA d,*p=NULL;
@ -443,7 +443,7 @@ unsigned long e;
return((p == NULL)?NULL:p->string); return((p == NULL)?NULL:p->string);
} }
char *ERR_func_error_string(e) const char *ERR_func_error_string(e)
unsigned long e; unsigned long e;
{ {
ERR_STRING_DATA d,*p=NULL; ERR_STRING_DATA d,*p=NULL;
@ -465,7 +465,7 @@ unsigned long e;
return((p == NULL)?NULL:p->string); return((p == NULL)?NULL:p->string);
} }
char *ERR_reason_error_string(e) const char *ERR_reason_error_string(e)
unsigned long e; unsigned long e;
{ {
ERR_STRING_DATA d,*p=NULL; ERR_STRING_DATA d,*p=NULL;

View File

@ -87,7 +87,7 @@ typedef struct err_state_st
unsigned long err_buffer[ERR_NUM_ERRORS]; unsigned long err_buffer[ERR_NUM_ERRORS];
char *err_data[ERR_NUM_ERRORS]; char *err_data[ERR_NUM_ERRORS];
int err_data_flags[ERR_NUM_ERRORS]; int err_data_flags[ERR_NUM_ERRORS];
char *err_file[ERR_NUM_ERRORS]; const char *err_file[ERR_NUM_ERRORS];
int err_line[ERR_NUM_ERRORS]; int err_line[ERR_NUM_ERRORS];
int top,bottom; int top,bottom;
} ERR_STATE; } ERR_STATE;
@ -207,26 +207,26 @@ typedef struct err_state_st
typedef struct ERR_string_data_st typedef struct ERR_string_data_st
{ {
unsigned long error; unsigned long error;
char *string; const char *string;
} ERR_STRING_DATA; } ERR_STRING_DATA;
#ifndef NOPROTO #ifndef NOPROTO
void ERR_put_error(int lib, int func,int reason,char *file,int line); void ERR_put_error(int lib, int func,int reason,const char *file,int line);
void ERR_set_error_data(char *data,int flags); void ERR_set_error_data(char *data,int flags);
unsigned long ERR_get_error(void ); unsigned long ERR_get_error(void );
unsigned long ERR_get_error_line(char **file,int *line); unsigned long ERR_get_error_line(const char **file,int *line);
unsigned long ERR_get_error_line_data(char **file,int *line, unsigned long ERR_get_error_line_data(const char **file,int *line,
char **data, int *flags); const char **data, int *flags);
unsigned long ERR_peek_error(void ); unsigned long ERR_peek_error(void );
unsigned long ERR_peek_error_line(char **file,int *line); unsigned long ERR_peek_error_line(const char **file,int *line);
unsigned long ERR_peek_error_line_data(char **file,int *line, unsigned long ERR_peek_error_line_data(const char **file,int *line,
char **data,int *flags); const char **data,int *flags);
void ERR_clear_error(void ); void ERR_clear_error(void );
char *ERR_error_string(unsigned long e,char *buf); char *ERR_error_string(unsigned long e,char *buf);
char *ERR_lib_error_string(unsigned long e); const char *ERR_lib_error_string(unsigned long e);
char *ERR_func_error_string(unsigned long e); const char *ERR_func_error_string(unsigned long e);
char *ERR_reason_error_string(unsigned long e); const char *ERR_reason_error_string(unsigned long e);
#ifndef NO_FP_API #ifndef NO_FP_API
void ERR_print_errors_fp(FILE *fp); void ERR_print_errors_fp(FILE *fp);
#endif #endif

View File

@ -70,7 +70,7 @@ FILE *fp;
{ {
unsigned long l; unsigned long l;
char buf[200]; char buf[200];
char *file,*data; const char *file,*data;
int line,flags; int line,flags;
unsigned long es; unsigned long es;
@ -89,7 +89,7 @@ BIO *bp;
unsigned long l; unsigned long l;
char buf[256]; char buf[256];
char buf2[256]; char buf2[256];
char *file,*data; const char *file,*data;
int line,flags; int line,flags;
unsigned long es; unsigned long es;

View File

@ -405,7 +405,7 @@ EVP_CIPHER_ctx *c;
void BIO_set_cipher(b,c,k,i,e) void BIO_set_cipher(b,c,k,i,e)
BIO *b; BIO *b;
EVP_CIPHER *c; const EVP_CIPHER *c;
unsigned char *k; unsigned char *k;
unsigned char *i; unsigned char *i;
int e; int e;
@ -415,7 +415,7 @@ int e;
if (b == NULL) return; if (b == NULL) return;
if ((b->callback != NULL) && if ((b->callback != NULL) &&
(b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,0L) <= 0)) (b->callback(b,BIO_CB_CTRL,(const char *)c,BIO_CTRL_SET,e,0L) <= 0))
return; return;
b->init=1; b->init=1;
@ -423,6 +423,6 @@ int e;
EVP_CipherInit(&(ctx->cipher),c,k,i,e); EVP_CipherInit(&(ctx->cipher),c,k,i,e);
if (b->callback != NULL) if (b->callback != NULL)
b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,1L); b->callback(b,BIO_CB_CTRL,(const char *)c,BIO_CTRL_SET,e,1L);
} }

View File

@ -185,7 +185,7 @@ long num;
char *ptr; char *ptr;
{ {
EVP_MD_CTX *ctx,*dctx,**pctx; EVP_MD_CTX *ctx,*dctx,**pctx;
EVP_MD **ppmd; const EVP_MD **ppmd;
EVP_MD *md; EVP_MD *md;
long ret=1; long ret=1;
BIO *dbio; BIO *dbio;
@ -204,7 +204,7 @@ char *ptr;
case BIO_C_GET_MD: case BIO_C_GET_MD:
if (b->init) if (b->init)
{ {
ppmd=(EVP_MD **)ptr; ppmd=(const EVP_MD **)ptr;
*ppmd=ctx->digest; *ppmd=ctx->digest;
} }
else else

View File

@ -371,7 +371,7 @@ char *ptr;
{ {
BIO_OK_CTX *ctx; BIO_OK_CTX *ctx;
EVP_MD *md; EVP_MD *md;
EVP_MD **ppmd; const EVP_MD **ppmd;
long ret=1; long ret=1;
int i; int i;
@ -440,7 +440,7 @@ char *ptr;
case BIO_C_GET_MD: case BIO_C_GET_MD:
if (b->init) if (b->init)
{ {
ppmd=(EVP_MD **)ptr; ppmd=(const EVP_MD **)ptr;
*ppmd=ctx->md.digest; *ppmd=ctx->md.digest;
} }
else else

View File

@ -63,7 +63,7 @@
void EVP_DigestInit(ctx,type) void EVP_DigestInit(ctx,type)
EVP_MD_CTX *ctx; EVP_MD_CTX *ctx;
EVP_MD *type; const EVP_MD *type;
{ {
ctx->digest=type; ctx->digest=type;
type->init(&(ctx->md)); type->init(&(ctx->md));
@ -71,7 +71,7 @@ EVP_MD *type;
void EVP_DigestUpdate(ctx,data,count) void EVP_DigestUpdate(ctx,data,count)
EVP_MD_CTX *ctx; EVP_MD_CTX *ctx;
unsigned char *data; const unsigned char *data;
unsigned int count; unsigned int count;
{ {
ctx->digest->update(&(ctx->md.base[0]),data,(unsigned long)count); ctx->digest->update(&(ctx->md.base[0]),data,(unsigned long)count);

View File

@ -68,7 +68,7 @@ static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc); unsigned char *iv,int enc);
static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl); unsigned char *in, unsigned int inl);
static int rc2_meth_to_magic(EVP_CIPHER *e); static int rc2_meth_to_magic(const EVP_CIPHER *e);
static EVP_CIPHER *rc2_magic_to_meth(int i); static EVP_CIPHER *rc2_magic_to_meth(int i);
static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
@ -168,7 +168,7 @@ unsigned int inl;
} }
static int rc2_meth_to_magic(e) static int rc2_meth_to_magic(e)
EVP_CIPHER *e; const EVP_CIPHER *e;
{ {
int i; int i;

View File

@ -285,7 +285,7 @@ typedef struct env_md_st
typedef struct env_md_ctx_st typedef struct env_md_ctx_st
{ {
EVP_MD *digest; const EVP_MD *digest;
union { union {
unsigned char base[4]; unsigned char base[4];
#ifndef NO_MD2 #ifndef NO_MD2
@ -324,13 +324,13 @@ typedef struct evp_cipher_st
typedef struct evp_cipher_info_st typedef struct evp_cipher_info_st
{ {
EVP_CIPHER *cipher; const EVP_CIPHER *cipher;
unsigned char iv[EVP_MAX_IV_LENGTH]; unsigned char iv[EVP_MAX_IV_LENGTH];
} EVP_CIPHER_INFO; } EVP_CIPHER_INFO;
typedef struct evp_cipher_ctx_st typedef struct evp_cipher_ctx_st
{ {
EVP_CIPHER *cipher; const EVP_CIPHER *cipher;
int encrypt; /* encrypt or decrypt */ int encrypt; /* encrypt or decrypt */
int buf_len; /* number we have left */ int buf_len; /* number we have left */
@ -444,7 +444,11 @@ typedef int (EVP_PBE_KEYGEN)(unsigned char *pass, int passlen,
#define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) #define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e)
#define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) #define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e)
#ifdef CONST_STRICT
void BIO_set_md(BIO *,const EVP_MD *md);
#else
# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md) # define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
#endif
#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) #define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) #define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) #define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
@ -464,34 +468,33 @@ typedef int (EVP_PBE_KEYGEN)(unsigned char *pass, int passlen,
#ifndef NOPROTO #ifndef NOPROTO
int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in); int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in);
void EVP_DigestInit(EVP_MD_CTX *ctx, EVP_MD *type); void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
void EVP_DigestUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt); void EVP_DigestUpdate(EVP_MD_CTX *ctx,const unsigned char *d,
unsigned int cnt);
void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
int EVP_read_pw_string(char *buf,int length,char *prompt,int verify); int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify);
void EVP_set_pw_prompt(char *prompt); void EVP_set_pw_prompt(char *prompt);
char * EVP_get_pw_prompt(void); char * EVP_get_pw_prompt(void);
int EVP_BytesToKey(EVP_CIPHER *type,EVP_MD *md,unsigned char *salt, int EVP_BytesToKey(const EVP_CIPHER *type,EVP_MD *md,unsigned char *salt,
unsigned char *data, int datal, int count, unsigned char *data, int datal, int count,
unsigned char *key,unsigned char *iv); unsigned char *key,unsigned char *iv);
EVP_CIPHER *EVP_get_cipherbyname(char *name); void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,
unsigned char *key, unsigned char *iv); unsigned char *key, unsigned char *iv);
void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
int *outl, unsigned char *in, int inl); int *outl, unsigned char *in, int inl);
void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
void EVP_DecryptInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type, void EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
unsigned char *key, unsigned char *iv); unsigned char *key, unsigned char *iv);
void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
int *outl, unsigned char *in, int inl); int *outl, unsigned char *in, int inl);
int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
void EVP_CipherInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type, unsigned char *key, void EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
unsigned char *iv,int enc); unsigned char *key,unsigned char *iv,int enc);
void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
int *outl, unsigned char *in, int inl); int *outl, unsigned char *in, int inl);
int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
@ -534,7 +537,7 @@ BIO_METHOD *BIO_f_md(void);
BIO_METHOD *BIO_f_base64(void); BIO_METHOD *BIO_f_base64(void);
BIO_METHOD *BIO_f_cipher(void); BIO_METHOD *BIO_f_cipher(void);
BIO_METHOD *BIO_f_reliable(void); BIO_METHOD *BIO_f_reliable(void);
void BIO_set_cipher(BIO *b,EVP_CIPHER *c,unsigned char *k, void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,unsigned char *k,
unsigned char *i, int enc); unsigned char *i, int enc);
#endif #endif
@ -594,8 +597,8 @@ void SSLeay_add_all_digests(void);
int EVP_add_cipher(EVP_CIPHER *cipher); int EVP_add_cipher(EVP_CIPHER *cipher);
int EVP_add_digest(EVP_MD *digest); int EVP_add_digest(EVP_MD *digest);
EVP_CIPHER *EVP_get_cipherbyname(char *name); const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
EVP_MD *EVP_get_digestbyname(char *name); const EVP_MD *EVP_get_digestbyname(const char *name);
void EVP_cleanup(void); void EVP_cleanup(void);
int EVP_PKEY_decrypt(unsigned char *dec_key,unsigned char *enc_key, int EVP_PKEY_decrypt(unsigned char *dec_key,unsigned char *enc_key,

View File

@ -60,7 +60,7 @@
#include "cryptlib.h" #include "cryptlib.h"
#include "evp.h" #include "evp.h"
char *EVP_version="EVP" OPENSSL_VERSION_PTEXT; const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT;
void EVP_CIPHER_CTX_init(ctx) void EVP_CIPHER_CTX_init(ctx)
EVP_CIPHER_CTX *ctx; EVP_CIPHER_CTX *ctx;
@ -71,7 +71,7 @@ EVP_CIPHER_CTX *ctx;
void EVP_CipherInit(ctx,data,key,iv,enc) void EVP_CipherInit(ctx,data,key,iv,enc)
EVP_CIPHER_CTX *ctx; EVP_CIPHER_CTX *ctx;
EVP_CIPHER *data; const EVP_CIPHER *data;
unsigned char *key; unsigned char *key;
unsigned char *iv; unsigned char *iv;
int enc; int enc;
@ -109,7 +109,7 @@ int *outl;
void EVP_EncryptInit(ctx,cipher,key,iv) void EVP_EncryptInit(ctx,cipher,key,iv)
EVP_CIPHER_CTX *ctx; EVP_CIPHER_CTX *ctx;
EVP_CIPHER *cipher; const EVP_CIPHER *cipher;
unsigned char *key; unsigned char *key;
unsigned char *iv; unsigned char *iv;
{ {
@ -122,7 +122,7 @@ unsigned char *iv;
void EVP_DecryptInit(ctx,cipher,key,iv) void EVP_DecryptInit(ctx,cipher,key,iv)
EVP_CIPHER_CTX *ctx; EVP_CIPHER_CTX *ctx;
EVP_CIPHER *cipher; const EVP_CIPHER *cipher;
unsigned char *key; unsigned char *key;
unsigned char *iv; unsigned char *iv;
{ {

View File

@ -89,7 +89,7 @@ int des_read_pw_string(char *buf,int len,char *prompt,int verify);
int EVP_read_pw_string(buf,len,prompt,verify) int EVP_read_pw_string(buf,len,prompt,verify)
char *buf; char *buf;
int len; int len;
char *prompt; const char *prompt;
int verify; int verify;
{ {
if ((prompt == NULL) && (prompt_string[0] != '\0')) if ((prompt == NULL) && (prompt_string[0] != '\0'))
@ -98,7 +98,7 @@ int verify;
} }
int EVP_BytesToKey(type,md,salt,data,datal,count,key,iv) int EVP_BytesToKey(type,md,salt,data,datal,count,key,iv)
EVP_CIPHER *type; const EVP_CIPHER *type;
EVP_MD *md; EVP_MD *md;
unsigned char *salt; unsigned char *salt;
unsigned char *data; unsigned char *data;

View File

@ -77,7 +77,7 @@ int EVP_add_digest(md)
EVP_MD *md; EVP_MD *md;
{ {
int r; int r;
char *name; const char *name;
name=OBJ_nid2sn(md->type); name=OBJ_nid2sn(md->type);
r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(char *)md); r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(char *)md);
@ -96,21 +96,21 @@ EVP_MD *md;
return(r); return(r);
} }
EVP_CIPHER *EVP_get_cipherbyname(name) const EVP_CIPHER *EVP_get_cipherbyname(name)
char *name; const char *name;
{ {
EVP_CIPHER *cp; const EVP_CIPHER *cp;
cp=(EVP_CIPHER *)OBJ_NAME_get(name,OBJ_NAME_TYPE_CIPHER_METH); cp=(const EVP_CIPHER *)OBJ_NAME_get(name,OBJ_NAME_TYPE_CIPHER_METH);
return(cp); return(cp);
} }
EVP_MD *EVP_get_digestbyname(name) const EVP_MD *EVP_get_digestbyname(name)
char *name; const char *name;
{ {
EVP_MD *cp; const EVP_MD *cp;
cp=(EVP_MD *)OBJ_NAME_get(name,OBJ_NAME_TYPE_MD_METH); cp=(const EVP_MD *)OBJ_NAME_get(name,OBJ_NAME_TYPE_MD_METH);
return(cp); return(cp);
} }

View File

@ -64,7 +64,7 @@ void HMAC_Init(ctx,key,len,md)
HMAC_CTX *ctx; HMAC_CTX *ctx;
unsigned char *key; unsigned char *key;
int len; int len;
EVP_MD *md; const EVP_MD *md;
{ {
int i,j,reset=0; int i,j,reset=0;
unsigned char pad[HMAC_MAX_MD_CBLOCK]; unsigned char pad[HMAC_MAX_MD_CBLOCK];

View File

@ -68,7 +68,7 @@ extern "C" {
typedef struct hmac_ctx_st typedef struct hmac_ctx_st
{ {
EVP_MD *md; const EVP_MD *md;
EVP_MD_CTX md_ctx; EVP_MD_CTX md_ctx;
EVP_MD_CTX i_ctx; EVP_MD_CTX i_ctx;
EVP_MD_CTX o_ctx; EVP_MD_CTX o_ctx;
@ -81,7 +81,7 @@ typedef struct hmac_ctx_st
#ifndef NOPROTO #ifndef NOPROTO
void HMAC_Init(HMAC_CTX *ctx, unsigned char *key, int len, void HMAC_Init(HMAC_CTX *ctx, unsigned char *key, int len,
EVP_MD *md); const EVP_MD *md);
void HMAC_Update(HMAC_CTX *ctx,unsigned char *key, int len); void HMAC_Update(HMAC_CTX *ctx,unsigned char *key, int len);
void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
void HMAC_cleanup(HMAC_CTX *ctx); void HMAC_cleanup(HMAC_CTX *ctx);

View File

@ -60,9 +60,9 @@
#include "idea_lcl.h" #include "idea_lcl.h"
#include "opensslv.h" #include "opensslv.h"
char *IDEA_version="IDEA" OPENSSL_VERSION_PTEXT; const char *IDEA_version="IDEA" OPENSSL_VERSION_PTEXT;
char *idea_options() const char *idea_options()
{ {
if (sizeof(short) != sizeof(IDEA_INT)) if (sizeof(short) != sizeof(IDEA_INT))
return("idea(int)"); return("idea(int)");

View File

@ -85,7 +85,7 @@ typedef struct idea_key_st
} IDEA_KEY_SCHEDULE; } IDEA_KEY_SCHEDULE;
#ifndef NOPROTO #ifndef NOPROTO
char *idea_options(void); const char *idea_options(void);
void idea_ecb_encrypt(unsigned char *in, unsigned char *out, void idea_ecb_encrypt(unsigned char *in, unsigned char *out,
IDEA_KEY_SCHEDULE *ks); IDEA_KEY_SCHEDULE *ks);
void idea_set_encrypt_key(unsigned char *key, IDEA_KEY_SCHEDULE *ks); void idea_set_encrypt_key(unsigned char *key, IDEA_KEY_SCHEDULE *ks);
@ -99,7 +99,7 @@ void idea_ofb64_encrypt(unsigned char *in, unsigned char *out,
long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num); long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num);
void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
#else #else
char *idea_options(); const char *idea_options();
void idea_ecb_encrypt(); void idea_ecb_encrypt();
void idea_set_encrypt_key(); void idea_set_encrypt_key();
void idea_set_decrypt_key(); void idea_set_decrypt_key();

View File

@ -100,7 +100,7 @@
#include "crypto.h" #include "crypto.h"
#include "lhash.h" #include "lhash.h"
char *lh_version="lhash" OPENSSL_VERSION_PTEXT; const char *lh_version="lhash" OPENSSL_VERSION_PTEXT;
#undef MIN_NODES #undef MIN_NODES
#define MIN_NODES 16 #define MIN_NODES 16
@ -476,7 +476,7 @@ char *str;
* well, not as good as MD5, but still good. * well, not as good as MD5, but still good.
*/ */
unsigned long lh_strhash(c) unsigned long lh_strhash(c)
char *c; const char *c;
{ {
unsigned long ret=0; unsigned long ret=0;
long n; long n;

View File

@ -120,7 +120,7 @@ char *lh_delete(LHASH *lh, char *data);
char *lh_retrieve(LHASH *lh, char *data); char *lh_retrieve(LHASH *lh, char *data);
void lh_doall(LHASH *lh, void (*func)(/* char *b */)); void lh_doall(LHASH *lh, void (*func)(/* char *b */));
void lh_doall_arg(LHASH *lh, void (*func)(/*char *a,char *b*/),char *arg); void lh_doall_arg(LHASH *lh, void (*func)(/*char *a,char *b*/),char *arg);
unsigned long lh_strhash(char *c); unsigned long lh_strhash(const char *c);
#ifndef NO_FP_API #ifndef NO_FP_API
void lh_stats(LHASH *lh, FILE *out); void lh_stats(LHASH *lh, FILE *out);

View File

@ -86,13 +86,13 @@ typedef struct MD2state_st
} MD2_CTX; } MD2_CTX;
#ifndef NOPROTO #ifndef NOPROTO
char *MD2_options(void); const char *MD2_options(void);
void MD2_Init(MD2_CTX *c); void MD2_Init(MD2_CTX *c);
void MD2_Update(MD2_CTX *c, register unsigned char *data, unsigned long len); void MD2_Update(MD2_CTX *c, register unsigned char *data, unsigned long len);
void MD2_Final(unsigned char *md, MD2_CTX *c); void MD2_Final(unsigned char *md, MD2_CTX *c);
unsigned char *MD2(unsigned char *d, unsigned long n,unsigned char *md); unsigned char *MD2(unsigned char *d, unsigned long n,unsigned char *md);
#else #else
char *MD2_options(); const char *MD2_options();
void MD2_Init(); void MD2_Init();
void MD2_Update(); void MD2_Update();
void MD2_Final(); void MD2_Final();

View File

@ -62,7 +62,7 @@
#include "md2.h" #include "md2.h"
#include "opensslv.h" #include "opensslv.h"
char *MD2_version="MD2" OPENSSL_VERSION_PTEXT; const char *MD2_version="MD2" OPENSSL_VERSION_PTEXT;
/* Implemented from RFC1319 The MD2 Message-Digest Algorithm /* Implemented from RFC1319 The MD2 Message-Digest Algorithm
*/ */
@ -112,7 +112,7 @@ static MD2_INT S[256]={
0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14, 0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14,
}; };
char *MD2_options() const char *MD2_options()
{ {
if (sizeof(MD2_INT) == 1) if (sizeof(MD2_INT) == 1)
return("md2(char)"); return("md2(char)");

View File

@ -76,7 +76,7 @@ typedef struct mem_st
{ {
char *addr; char *addr;
int num; int num;
char *file; const char *file;
int line; int line;
unsigned long order; unsigned long order;
} MEM; } MEM;
@ -206,7 +206,7 @@ void *str;
static unsigned long break_order_num=0; static unsigned long break_order_num=0;
void *CRYPTO_dbg_malloc(num,file,line) void *CRYPTO_dbg_malloc(num,file,line)
int num; int num;
char *file; const char *file;
int line; int line;
{ {
char *ret; char *ret;
@ -280,7 +280,7 @@ void *addr;
void *CRYPTO_dbg_realloc(addr,num,file,line) void *CRYPTO_dbg_realloc(addr,num,file,line)
void *addr; void *addr;
int num; int num;
char *file; const char *file;
int line; int line;
{ {
char *ret; char *ret;
@ -319,7 +319,7 @@ int n;
void *CRYPTO_dbg_remalloc(a,n,file,line) void *CRYPTO_dbg_remalloc(a,n,file,line)
void *a; void *a;
int n; int n;
char *file; const char *file;
int line; int line;
{ {
if (a != NULL) CRYPTO_dbg_free(a); if (a != NULL) CRYPTO_dbg_free(a);

View File

@ -106,8 +106,8 @@ OBJ_NAME *a;
return(ret); return(ret);
} }
char *OBJ_NAME_get(name,type) const char *OBJ_NAME_get(name,type)
char *name; const char *name;
int type; int type;
{ {
OBJ_NAME on,*ret; OBJ_NAME on,*ret;
@ -139,9 +139,9 @@ int type;
} }
int OBJ_NAME_add(name,type,data) int OBJ_NAME_add(name,type,data)
char *name; const char *name;
int type; int type;
char *data; const char *data;
{ {
void (*f)(); void (*f)();
OBJ_NAME *onp,*ret; OBJ_NAME *onp,*ret;
@ -187,7 +187,7 @@ char *data;
} }
int OBJ_NAME_remove(name,type) int OBJ_NAME_remove(name,type)
char *name; const char *name;
int type; int type;
{ {
OBJ_NAME on,*ret; OBJ_NAME on,*ret;

View File

@ -306,7 +306,7 @@ int n;
} }
} }
char *OBJ_nid2sn(n) const char *OBJ_nid2sn(n)
int n; int n;
{ {
ADDED_OBJ ad,*adp; ADDED_OBJ ad,*adp;
@ -339,7 +339,7 @@ int n;
} }
} }
char *OBJ_nid2ln(n) const char *OBJ_nid2ln(n)
int n; int n;
{ {
ADDED_OBJ ad,*adp; ADDED_OBJ ad,*adp;
@ -404,7 +404,7 @@ ASN1_OBJECT *a;
*/ */
ASN1_OBJECT *OBJ_txt2obj(s, no_name) ASN1_OBJECT *OBJ_txt2obj(s, no_name)
char *s; const char *s;
int no_name; int no_name;
{ {
int nid = NID_undef; int nid = NID_undef;
@ -454,7 +454,7 @@ char *s;
} }
int OBJ_ln2nid(s) int OBJ_ln2nid(s)
char *s; const char *s;
{ {
ASN1_OBJECT o,*oo= &o,**op; ASN1_OBJECT o,*oo= &o,**op;
ADDED_OBJ ad,*adp; ADDED_OBJ ad,*adp;
@ -474,7 +474,7 @@ char *s;
} }
int OBJ_sn2nid(s) int OBJ_sn2nid(s)
char *s; const char *s;
{ {
ASN1_OBJECT o,*oo= &o,**op; ASN1_OBJECT o,*oo= &o,**op;
ADDED_OBJ ad,*adp; ADDED_OBJ ad,*adp;

View File

@ -67,18 +67,19 @@ ASN1_OBJECT *o;
{ {
ASN1_OBJECT *r; ASN1_OBJECT *r;
int i; int i;
char *ln=NULL;
if (o == NULL) return(NULL); if (o == NULL) return(NULL);
if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC)) if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
return(o); return(o);
r=(ASN1_OBJECT *)ASN1_OBJECT_new(); r=ASN1_OBJECT_new();
if (r == NULL) if (r == NULL)
{ {
OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB); OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB);
return(NULL); return(NULL);
} }
r->data=(unsigned char *)Malloc(o->length); r->data=Malloc(o->length);
if (r->data == NULL) if (r->data == NULL)
goto err; goto err;
memcpy(r->data,o->data,o->length); memcpy(r->data,o->data,o->length);
@ -88,17 +89,19 @@ ASN1_OBJECT *o;
if (o->ln != NULL) if (o->ln != NULL)
{ {
i=strlen(o->ln)+1; i=strlen(o->ln)+1;
r->ln=(char *)Malloc(i); r->ln=ln=Malloc(i);
if (r->ln == NULL) goto err; if (r->ln == NULL) goto err;
memcpy(r->ln,o->ln,i); memcpy(ln,o->ln,i);
} }
if (o->sn != NULL) if (o->sn != NULL)
{ {
char *s;
i=strlen(o->sn)+1; i=strlen(o->sn)+1;
r->sn=(char *)Malloc(i); r->sn=s=Malloc(i);
if (r->sn == NULL) goto err; if (r->sn == NULL) goto err;
memcpy(r->sn,o->sn,i); memcpy(s,o->sn,i);
} }
r->flags=o->flags|(ASN1_OBJECT_FLAG_DYNAMIC| r->flags=o->flags|(ASN1_OBJECT_FLAG_DYNAMIC|
ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|ASN1_OBJECT_FLAG_DYNAMIC_DATA); ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|ASN1_OBJECT_FLAG_DYNAMIC_DATA);
@ -107,7 +110,7 @@ err:
OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE); OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE);
if (r != NULL) if (r != NULL)
{ {
if (r->ln != NULL) Free(r->ln); if (ln != NULL) Free(ln);
if (r->data != NULL) Free(r->data); if (r->data != NULL) Free(r->data);
Free(r); Free(r);
} }

View File

@ -871,8 +871,8 @@ typedef struct obj_name_st
{ {
int type; int type;
int alias; int alias;
char *name; const char *name;
char *data; const char *data;
} OBJ_NAME; } OBJ_NAME;
#define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c) #define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)
@ -882,20 +882,20 @@ typedef struct obj_name_st
int OBJ_NAME_init(void); int OBJ_NAME_init(void);
int OBJ_NAME_new_index(unsigned long (*hash_func)(),int (*cmp_func)(), int OBJ_NAME_new_index(unsigned long (*hash_func)(),int (*cmp_func)(),
void (*free_func)()); void (*free_func)());
char *OBJ_NAME_get(char *name,int type); const char *OBJ_NAME_get(const char *name,int type);
int OBJ_NAME_add(char *name,int type,char *data); int OBJ_NAME_add(const char *name,int type,const char *data);
int OBJ_NAME_remove(char *name,int type); int OBJ_NAME_remove(const char *name,int type);
void OBJ_NAME_cleanup(int type); /* -1 for everything */ void OBJ_NAME_cleanup(int type); /* -1 for everything */
ASN1_OBJECT * OBJ_dup(ASN1_OBJECT *o); ASN1_OBJECT * OBJ_dup(ASN1_OBJECT *o);
ASN1_OBJECT * OBJ_nid2obj(int n); ASN1_OBJECT * OBJ_nid2obj(int n);
char * OBJ_nid2ln(int n); const char * OBJ_nid2ln(int n);
char * OBJ_nid2sn(int n); const char * OBJ_nid2sn(int n);
int OBJ_obj2nid(ASN1_OBJECT *o); int OBJ_obj2nid(ASN1_OBJECT *o);
ASN1_OBJECT * OBJ_txt2obj(char *s, int no_name); ASN1_OBJECT * OBJ_txt2obj(const char *s, int no_name);
int OBJ_txt2nid(char *s); int OBJ_txt2nid(char *s);
int OBJ_ln2nid(char *s); int OBJ_ln2nid(const char *s);
int OBJ_sn2nid(char *s); int OBJ_sn2nid(const char *s);
int OBJ_cmp(ASN1_OBJECT *a,ASN1_OBJECT *b); int OBJ_cmp(ASN1_OBJECT *a,ASN1_OBJECT *b);
char * OBJ_bsearch(char *key,char *base,int num,int size,int (*cmp)()); char * OBJ_bsearch(char *key,char *base,int num,int size,int (*cmp)());

View File

@ -248,7 +248,7 @@ RSA *x;
int PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb) int PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb)
BIO *bp; BIO *bp;
RSA *x; RSA *x;
EVP_CIPHER *enc; const EVP_CIPHER *enc;
unsigned char *kstr; unsigned char *kstr;
int klen; int klen;
int (*cb)(); int (*cb)();
@ -293,7 +293,7 @@ int (*cb)();
int PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb) int PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb)
FILE *fp; FILE *fp;
DSA *x; DSA *x;
EVP_CIPHER *enc; const EVP_CIPHER *enc;
unsigned char *kstr; unsigned char *kstr;
int klen; int klen;
int (*cb)(); int (*cb)();
@ -306,7 +306,7 @@ int (*cb)();
int PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb) int PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb)
BIO *bp; BIO *bp;
DSA *x; DSA *x;
EVP_CIPHER *enc; const EVP_CIPHER *enc;
unsigned char *kstr; unsigned char *kstr;
int klen; int klen;
int (*cb)(); int (*cb)();

View File

@ -282,7 +282,7 @@ int (*cb)();
EVP_CIPHER_CTX ctx; EVP_CIPHER_CTX ctx;
int i,ret=0; int i,ret=0;
unsigned char *data=NULL; unsigned char *data=NULL;
char *objstr=NULL; const char *objstr=NULL;
#define PEM_BUFSIZE 1024 #define PEM_BUFSIZE 1024
char buf[PEM_BUFSIZE]; char buf[PEM_BUFSIZE];
unsigned char *iv=NULL; unsigned char *iv=NULL;

View File

@ -68,7 +68,7 @@
#include "des.h" #include "des.h"
#endif #endif
char *PEM_version="PEM" OPENSSL_VERSION_PTEXT; const char *PEM_version="PEM" OPENSSL_VERSION_PTEXT;
#define MIN_LENGTH 4 #define MIN_LENGTH 4
@ -96,7 +96,7 @@ int w;
return(-1); return(-1);
#else #else
int i,j; int i,j;
char *prompt; const char *prompt;
prompt=EVP_get_pw_prompt(); prompt=EVP_get_pw_prompt();
if (prompt == NULL) if (prompt == NULL)
@ -127,7 +127,7 @@ void PEM_proc_type(buf, type)
char *buf; char *buf;
int type; int type;
{ {
char *str; const char *str;
if (type == PEM_TYPE_ENCRYPTED) if (type == PEM_TYPE_ENCRYPTED)
str="ENCRYPTED"; str="ENCRYPTED";
@ -145,7 +145,7 @@ int type;
void PEM_dek_info(buf, type, len, str) void PEM_dek_info(buf, type, len, str)
char *buf; char *buf;
char *type; const char *type;
int len; int len;
char *str; char *str;
{ {
@ -169,7 +169,7 @@ char *str;
#ifndef NO_FP_API #ifndef NO_FP_API
char *PEM_ASN1_read(d2i,name,fp, x, cb) char *PEM_ASN1_read(d2i,name,fp, x, cb)
char *(*d2i)(); char *(*d2i)();
char *name; const char *name;
FILE *fp; FILE *fp;
char **x; char **x;
int (*cb)(); int (*cb)();
@ -191,7 +191,7 @@ int (*cb)();
char *PEM_ASN1_read_bio(d2i,name,bp, x, cb) char *PEM_ASN1_read_bio(d2i,name,bp, x, cb)
char *(*d2i)(); char *(*d2i)();
char *name; const char *name;
BIO *bp; BIO *bp;
char **x; char **x;
int (*cb)(); int (*cb)();
@ -244,10 +244,10 @@ err:
#ifndef NO_FP_API #ifndef NO_FP_API
int PEM_ASN1_write(i2d,name,fp, x, enc, kstr, klen, callback) int PEM_ASN1_write(i2d,name,fp, x, enc, kstr, klen, callback)
int (*i2d)(); int (*i2d)();
char *name; const char *name;
FILE *fp; FILE *fp;
char *x; char *x;
EVP_CIPHER *enc; const EVP_CIPHER *enc;
unsigned char *kstr; unsigned char *kstr;
int klen; int klen;
int (*callback)(); int (*callback)();
@ -269,10 +269,10 @@ int (*callback)();
int PEM_ASN1_write_bio(i2d,name,bp, x, enc, kstr, klen, callback) int PEM_ASN1_write_bio(i2d,name,bp, x, enc, kstr, klen, callback)
int (*i2d)(); int (*i2d)();
char *name; const char *name;
BIO *bp; BIO *bp;
char *x; char *x;
EVP_CIPHER *enc; const EVP_CIPHER *enc;
unsigned char *kstr; unsigned char *kstr;
int klen; int klen;
int (*callback)(); int (*callback)();
@ -280,7 +280,7 @@ int (*callback)();
EVP_CIPHER_CTX ctx; EVP_CIPHER_CTX ctx;
int dsize=0,i,j,ret=0; int dsize=0,i,j,ret=0;
unsigned char *p,*data=NULL; unsigned char *p,*data=NULL;
char *objstr=NULL; const char *objstr=NULL;
#define PEM_BUFSIZE 1024 #define PEM_BUFSIZE 1024
char buf[PEM_BUFSIZE]; char buf[PEM_BUFSIZE];
unsigned char key[EVP_MAX_KEY_LENGTH]; unsigned char key[EVP_MAX_KEY_LENGTH];
@ -412,7 +412,7 @@ char *header;
EVP_CIPHER_INFO *cipher; EVP_CIPHER_INFO *cipher;
{ {
int o; int o;
EVP_CIPHER *enc=NULL; const EVP_CIPHER *enc=NULL;
char *p,c; char *p,c;
cipher->cipher=NULL; cipher->cipher=NULL;
@ -515,7 +515,7 @@ long len;
int PEM_write_bio(bp, name, header, data,len) int PEM_write_bio(bp, name, header, data,len)
BIO *bp; BIO *bp;
char *name; const char *name;
char *header; char *header;
unsigned char *data; unsigned char *data;
long len; long len;

View File

@ -77,7 +77,7 @@ void h__dump (unsigned char *p, int len);
int PKCS12_key_gen_asc (pass, passlen, salt, saltlen, id, iter, n, out, md_type) int PKCS12_key_gen_asc (pass, passlen, salt, saltlen, id, iter, n, out, md_type)
unsigned char *pass, *salt, *out; unsigned char *pass, *salt, *out;
int passlen, saltlen, id, iter, n; int passlen, saltlen, id, iter, n;
EVP_MD *md_type; const EVP_MD *md_type;
{ {
int ret; int ret;
unsigned char *unipass; unsigned char *unipass;
@ -96,7 +96,7 @@ EVP_MD *md_type;
int PKCS12_key_gen_uni (pass, passlen, salt, saltlen, id, iter, n, out, md_type) int PKCS12_key_gen_uni (pass, passlen, salt, saltlen, id, iter, n, out, md_type)
unsigned char *pass, *salt, *out; unsigned char *pass, *salt, *out;
int passlen, saltlen, id, iter, n; int passlen, saltlen, id, iter, n;
EVP_MD *md_type; const EVP_MD *md_type;
{ {
unsigned char *B, *D, *I, *p, *Ai; unsigned char *B, *D, *I, *p, *Ai;
int Slen, Plen, Ilen; int Slen, Plen, Ilen;

View File

@ -70,7 +70,7 @@ int passlen;
unsigned char *mac; unsigned char *mac;
unsigned int *maclen; unsigned int *maclen;
{ {
EVP_MD *md_type; const EVP_MD *md_type;
HMAC_CTX hmac; HMAC_CTX hmac;
unsigned char key[PKCS12_MAC_KEY_LENGTH], *salt; unsigned char key[PKCS12_MAC_KEY_LENGTH], *salt;
int saltlen, iter; int saltlen, iter;

View File

@ -206,8 +206,8 @@ unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, unsigned char *pass, int pass
char *PKCS12_decrypt_d2i(X509_ALGOR *algor, char *(*d2i)(), void (*free_func)(), unsigned char *pass, int passlen, ASN1_STRING *oct, int seq); char *PKCS12_decrypt_d2i(X509_ALGOR *algor, char *(*d2i)(), void (*free_func)(), unsigned char *pass, int passlen, ASN1_STRING *oct, int seq);
ASN1_STRING *PKCS12_i2d_encrypt(X509_ALGOR *algor, int (*i2d)(), unsigned char *pass, int passlen, char *obj, int seq); ASN1_STRING *PKCS12_i2d_encrypt(X509_ALGOR *algor, int (*i2d)(), unsigned char *pass, int passlen, char *obj, int seq);
PKCS12 *PKCS12_init(int mode); PKCS12 *PKCS12_init(int mode);
int PKCS12_key_gen_asc(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, EVP_MD *md_type); int PKCS12_key_gen_asc(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type);
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, EVP_MD *md_type); int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type);
int PKCS12_PBE_keyivgen(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int iter, EVP_CIPHER *cipher, EVP_MD *md_type, unsigned char *key, unsigned char *iv); int PKCS12_PBE_keyivgen(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int iter, EVP_CIPHER *cipher, EVP_MD *md_type, unsigned char *key, unsigned char *iv);
int PKCS12_gen_mac(PKCS12 *p12, unsigned char *pass, int passlen, unsigned char *mac, unsigned int *maclen); int PKCS12_gen_mac(PKCS12 *p12, unsigned char *pass, int passlen, unsigned char *mac, unsigned int *maclen);
int PKCS12_gen_mac(PKCS12 *p12, unsigned char *pass, int passlen, unsigned char *mac, unsigned int *maclen); int PKCS12_gen_mac(PKCS12 *p12, unsigned char *pass, int passlen, unsigned char *mac, unsigned int *maclen);

View File

@ -73,8 +73,8 @@ BIO *bio;
int i,j; int i,j;
BIO *out=NULL,*btmp=NULL; BIO *out=NULL,*btmp=NULL;
X509_ALGOR *xa; X509_ALGOR *xa;
EVP_MD *evp_md; const EVP_MD *evp_md;
EVP_CIPHER *evp_cipher=NULL; const EVP_CIPHER *evp_cipher=NULL;
STACK *md_sk=NULL,*rsk=NULL; STACK *md_sk=NULL,*rsk=NULL;
X509_ALGOR *xalg=NULL; X509_ALGOR *xalg=NULL;
PKCS7_RECIP_INFO *ri=NULL; PKCS7_RECIP_INFO *ri=NULL;
@ -268,8 +268,8 @@ X509_STORE *xs;
char *tmp=NULL; char *tmp=NULL;
X509_ALGOR *xa; X509_ALGOR *xa;
ASN1_OCTET_STRING *data_body=NULL; ASN1_OCTET_STRING *data_body=NULL;
EVP_MD *evp_md; const EVP_MD *evp_md;
EVP_CIPHER *evp_cipher=NULL; const EVP_CIPHER *evp_cipher=NULL;
EVP_CIPHER_CTX *evp_ctx=NULL; EVP_CIPHER_CTX *evp_ctx=NULL;
X509_ALGOR *enc_alg=NULL; X509_ALGOR *enc_alg=NULL;
STACK *md_sk=NULL,*rsk=NULL; STACK *md_sk=NULL,*rsk=NULL;
@ -568,7 +568,7 @@ BIO *bio;
unsigned int md_len; unsigned int md_len;
ASN1_OCTET_STRING *digest; ASN1_OCTET_STRING *digest;
ASN1_UTCTIME *sign_time; ASN1_UTCTIME *sign_time;
EVP_MD *md_tmp; const EVP_MD *md_tmp;
/* Add signing time */ /* Add signing time */
sign_time=X509_gmtime_adj(NULL,0); sign_time=X509_gmtime_adj(NULL,0);

View File

@ -128,7 +128,7 @@ static unsigned char state[STATE_SIZE+MD_DIGEST_LENGTH];
static unsigned char md[MD_DIGEST_LENGTH]; static unsigned char md[MD_DIGEST_LENGTH];
static long md_count[2]={0,0}; static long md_count[2]={0,0};
char *RAND_version="RAND" OPENSSL_VERSION_PTEXT; const char *RAND_version="RAND" OPENSSL_VERSION_PTEXT;
static void ssleay_rand_cleanup(void); static void ssleay_rand_cleanup(void);
static void ssleay_rand_seed(const void *buf, int num); static void ssleay_rand_seed(const void *buf, int num);
@ -204,7 +204,7 @@ int num;
MD_Final(md,&m); MD_Final(md,&m);
md_count[1]++; md_count[1]++;
buf=(char *)buf + j; buf=(const char *)buf + j;
for (k=0; k<j; k++) for (k=0; k<j; k++)
{ {

View File

@ -60,7 +60,7 @@
#include "rc2_locl.h" #include "rc2_locl.h"
#include "opensslv.h" #include "opensslv.h"
char *RC2_version="RC2" OPENSSL_VERSION_PTEXT; const char *RC2_version="RC2" OPENSSL_VERSION_PTEXT;
/* RC2 as implemented frm a posting from /* RC2 as implemented frm a posting from
* Newsgroups: sci.crypt * Newsgroups: sci.crypt

View File

@ -83,14 +83,14 @@ typedef struct rc4_key_st
#ifndef NOPROTO #ifndef NOPROTO
char *RC4_options(void); const char *RC4_options(void);
void RC4_set_key(RC4_KEY *key, int len, unsigned char *data); void RC4_set_key(RC4_KEY *key, int len, unsigned char *data);
void RC4(RC4_KEY *key, unsigned long len, unsigned char *indata, void RC4(RC4_KEY *key, unsigned long len, unsigned char *indata,
unsigned char *outdata); unsigned char *outdata);
#else #else
char *RC4_options(); const char *RC4_options();
void RC4_set_key(); void RC4_set_key();
void RC4(); void RC4();

View File

@ -60,9 +60,9 @@
#include "rc4_locl.h" #include "rc4_locl.h"
#include "opensslv.h" #include "opensslv.h"
char *RC4_version="RC4" OPENSSL_VERSION_PTEXT; const char *RC4_version="RC4" OPENSSL_VERSION_PTEXT;
char *RC4_options() const char *RC4_options()
{ {
#ifdef RC4_INDEX #ifdef RC4_INDEX
if (sizeof(RC4_INT) == 1) if (sizeof(RC4_INT) == 1)

View File

@ -70,7 +70,7 @@ typedef struct rsa_st RSA;
typedef struct rsa_meth_st typedef struct rsa_meth_st
{ {
char *name; const char *name;
#ifndef NOPROTO #ifndef NOPROTO
int (*rsa_pub_enc)(int flen,unsigned char *from,unsigned char *to, int (*rsa_pub_enc)(int flen,unsigned char *from,unsigned char *to,
RSA *rsa,int padding); RSA *rsa,int padding);

View File

@ -63,7 +63,7 @@
#include "bn.h" #include "bn.h"
#include "rsa.h" #include "rsa.h"
char *RSA_version="RSA" OPENSSL_VERSION_PTEXT; const char *RSA_version="RSA" OPENSSL_VERSION_PTEXT;
static RSA_METHOD *default_RSA_meth=NULL; static RSA_METHOD *default_RSA_meth=NULL;
static int rsa_meth_num=0; static int rsa_meth_num=0;

View File

@ -72,7 +72,7 @@
#undef MIN_NODES #undef MIN_NODES
#define MIN_NODES 4 #define MIN_NODES 4
char *STACK_version="Stack" OPENSSL_VERSION_PTEXT; const char *STACK_version="Stack" OPENSSL_VERSION_PTEXT;
#ifndef NOPROTO #ifndef NOPROTO
#define FP_ICC (int (*)(const void *,const void *)) #define FP_ICC (int (*)(const void *,const void *))

View File

@ -66,7 +66,7 @@
#undef BUFSIZE #undef BUFSIZE
#define BUFSIZE 512 #define BUFSIZE 512
char *TXT_DB_version="TXT_DB" OPENSSL_VERSION_PTEXT; const char *TXT_DB_version="TXT_DB" OPENSSL_VERSION_PTEXT;
TXT_DB *TXT_DB_read(in,num) TXT_DB *TXT_DB_read(in,num)
BIO *in; BIO *in;

View File

@ -79,7 +79,7 @@ typedef struct lookup_dir_st
static int dir_ctrl(X509_LOOKUP *ctx,int cmd,char *argp,long argl,char **ret); static int dir_ctrl(X509_LOOKUP *ctx,int cmd,char *argp,long argl,char **ret);
static int new_dir(X509_LOOKUP *lu); static int new_dir(X509_LOOKUP *lu);
static void free_dir(X509_LOOKUP *lu); static void free_dir(X509_LOOKUP *lu);
static int add_cert_dir(BY_DIR *ctx,char *dir,int type); static int add_cert_dir(BY_DIR *ctx,const char *dir,int type);
static int get_cert_by_subject(X509_LOOKUP *xl,int type,X509_NAME *name, static int get_cert_by_subject(X509_LOOKUP *xl,int type,X509_NAME *name,
X509_OBJECT *ret); X509_OBJECT *ret);
#else #else
@ -183,12 +183,12 @@ X509_LOOKUP *lu;
static int add_cert_dir(ctx,dir, type) static int add_cert_dir(ctx,dir, type)
BY_DIR *ctx; BY_DIR *ctx;
char *dir; const char *dir;
int type; int type;
{ {
int j,len; int j,len;
int *ip; int *ip;
char *s,*ss,*p; const char *s,*ss,*p;
char **pp; char **pp;
if (dir == NULL || !*dir) if (dir == NULL || !*dir)
@ -269,7 +269,7 @@ X509_OBJECT *ret;
BUF_MEM *b=NULL; BUF_MEM *b=NULL;
struct stat st; struct stat st;
X509_OBJECT stmp,*tmp; X509_OBJECT stmp,*tmp;
char *postfix=""; const char *postfix="";
if (name == NULL) return(0); if (name == NULL) return(0);

View File

@ -140,7 +140,7 @@ char **ret;
int X509_load_cert_file(ctx,file,type) int X509_load_cert_file(ctx,file,type)
X509_LOOKUP *ctx; X509_LOOKUP *ctx;
char *file; const char *file;
int type; int type;
{ {
int ret=0; int ret=0;
@ -210,7 +210,7 @@ err:
int X509_load_crl_file(ctx,file,type) int X509_load_crl_file(ctx,file,type)
X509_LOOKUP *ctx; X509_LOOKUP *ctx;
char *file; const char *file;
int type; int type;
{ {
int ret=0; int ret=0;

View File

@ -528,16 +528,16 @@ typedef struct pkcs8_priv_key_info_st
#ifndef SSLEAY_MACROS #ifndef SSLEAY_MACROS
#ifdef HEADER_ENVELOPE_H #ifdef HEADER_ENVELOPE_H
int X509_verify(X509 *a, EVP_PKEY *r); int X509_verify(X509 *a, EVP_PKEY *r);
char *X509_verify_cert_error_string(long n); const char *X509_verify_cert_error_string(long n);
int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
int X509_sign(X509 *x, EVP_PKEY *pkey, EVP_MD *md); int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, EVP_MD *md); int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, EVP_MD *md); int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, EVP_MD *md); int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_digest(X509 *data,EVP_MD *type,unsigned char *md,unsigned int *len); int X509_digest(X509 *data,EVP_MD *type,unsigned char *md,unsigned int *len);
int X509_NAME_digest(X509_NAME *data,EVP_MD *type, int X509_NAME_digest(X509_NAME *data,EVP_MD *type,
@ -590,12 +590,12 @@ RSA *RSAPrivateKey_dup(RSA *rsa);
int X509_cmp_current_time(ASN1_UTCTIME *s); int X509_cmp_current_time(ASN1_UTCTIME *s);
ASN1_UTCTIME * X509_gmtime_adj(ASN1_UTCTIME *s, long adj); ASN1_UTCTIME * X509_gmtime_adj(ASN1_UTCTIME *s, long adj);
char * X509_get_default_cert_area(void ); const char * X509_get_default_cert_area(void );
char * X509_get_default_cert_dir(void ); const char * X509_get_default_cert_dir(void );
char * X509_get_default_cert_file(void ); const char * X509_get_default_cert_file(void );
char * X509_get_default_cert_dir_env(void ); const char * X509_get_default_cert_dir_env(void );
char * X509_get_default_cert_file_env(void ); const char * X509_get_default_cert_file_env(void );
char * X509_get_default_private_dir(void ); const char * X509_get_default_private_dir(void );
X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, EVP_MD *md); X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, EVP_MD *md);
X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey);
@ -728,7 +728,7 @@ int ASN1_digest(int (*i2d)(),EVP_MD *type,char *data,
int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
ASN1_BIT_STRING *signature, ASN1_BIT_STRING *signature,
char *data,EVP_PKEY *pkey, EVP_MD *type); char *data,EVP_PKEY *pkey, const EVP_MD *type);
#endif #endif
int X509_set_version(X509 *x,long version); int X509_set_version(X509 *x,long version);

View File

@ -63,21 +63,21 @@
#include "crypto.h" #include "crypto.h"
#include "x509.h" #include "x509.h"
char *X509_get_default_private_dir() const char *X509_get_default_private_dir()
{ return(X509_PRIVATE_DIR); } { return(X509_PRIVATE_DIR); }
char *X509_get_default_cert_area() const char *X509_get_default_cert_area()
{ return(X509_CERT_AREA); } { return(X509_CERT_AREA); }
char *X509_get_default_cert_dir() const char *X509_get_default_cert_dir()
{ return(X509_CERT_DIR); } { return(X509_CERT_DIR); }
char *X509_get_default_cert_file() const char *X509_get_default_cert_file()
{ return(X509_CERT_FILE); } { return(X509_CERT_FILE); }
char *X509_get_default_cert_dir_env() const char *X509_get_default_cert_dir_env()
{ return(X509_CERT_DIR_EVP); } { return(X509_CERT_DIR_EVP); }
char *X509_get_default_cert_file_env() const char *X509_get_default_cert_file_env()
{ return(X509_CERT_FILE_EVP); } { return(X509_CERT_FILE_EVP); }

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