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.
[Steve Henson]
"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-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",
"dist", "cc:-O -DNOPROTO::::",
static BIGNUM *load_serial(char *serialfile);
static int save_serial(char *serialfile, BIGNUM *serial);
static int certify(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
- EVP_MD *dgst,STACK *policy,TXT_DB *db,BIGNUM *serial,char *startdate,
- int days, int batch, char *ext_sect, LHASH *conf,int verbose);
+ const EVP_MD *dgst,STACK *policy,TXT_DB *db,BIGNUM *serial,
+ 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,
- EVP_MD *dgst,STACK *policy,TXT_DB *db,BIGNUM *serial,char *startdate,
- int days,int batch,char *ext_sect, LHASH *conf,int verbose);
+ const EVP_MD *dgst,STACK *policy,TXT_DB *db,
+ 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,
- EVP_MD *dgst,STACK *policy,TXT_DB *db,BIGNUM *serial,char *startdate,
- int days,char *ext_sect,LHASH *conf,int verbose);
+ const EVP_MD *dgst,STACK *policy,TXT_DB *db,
+ BIGNUM *serial,char *startdate,int days,
+ char *ext_sect,LHASH *conf,int verbose);
static int fix_data(int nid, int *type);
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,
int days, int batch, int verbose, X509_REQ *req, char *ext_sect,
LHASH *conf);
char **pp,*p,*f;
int i,j;
long l;
- EVP_MD *dgst=NULL;
+ const EVP_MD *dgst=NULL;
STACK *attribs=NULL;
STACK *cert_sk=NULL;
BIO *hex=NULL;
char *infile;
EVP_PKEY *pkey;
X509 *x509;
-EVP_MD *dgst;
+const EVP_MD *dgst;
STACK *policy;
TXT_DB *db;
BIGNUM *serial;
char *infile;
EVP_PKEY *pkey;
X509 *x509;
-EVP_MD *dgst;
+const EVP_MD *dgst;
STACK *policy;
TXT_DB *db;
BIGNUM *serial;
X509 **xret;
EVP_PKEY *pkey;
X509 *x509;
-EVP_MD *dgst;
+const EVP_MD *dgst;
STACK *policy;
TXT_DB *db;
BIGNUM *serial;
char *infile;
EVP_PKEY *pkey;
X509 *x509;
-EVP_MD *dgst;
+const EVP_MD *dgst;
STACK *policy;
TXT_DB *db;
BIGNUM *serial;
{
int ret=1,i;
int verbose=0;
- char **pp,*p;
+ char **pp;
+ const char *p;
int badops=0;
SSL_CTX *ctx=NULL;
SSL *ssl=NULL;
{
unsigned char *buf=NULL;
int i,err=0;
- EVP_MD *md=NULL,*m;
+ const EVP_MD *md=NULL,*m;
BIO *in=NULL,*inp;
BIO *bmd=NULL;
- char *name;
+ const char *name;
#define PROG_NAME_SIZE 16
char pname[PROG_NAME_SIZE];
int separator=0;
int ret=1;
DSA *dsa=NULL;
int i,badops=0;
- EVP_CIPHER *enc=NULL;
+ const EVP_CIPHER *enc=NULL;
BIO *in=NULL,*out=NULL;
int informat,outformat,text=0,noout=0;
char *infile,*outfile,*prog;
char *hkey=NULL,*hiv=NULL;
int enc=1,printkey=0,i,base64=0;
int debug=0,olb64=0;
- EVP_CIPHER *cipher=NULL,*c;
+ const EVP_CIPHER *cipher=NULL,*c;
char *inf=NULL,*outf=NULL;
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
#define PROG_NAME_SIZE 16
EVP_CIPHER *cipher=NULL;
int modulus=0;
char *p;
- EVP_MD *md_alg=NULL,*digest=EVP_md5();
+ const EVP_MD *md_alg=NULL,*digest=EVP_md5();
#ifndef MONOLITH
MS_STATIC char config_name[256];
#endif
int ret=1;
RSA *rsa=NULL;
int i,badops=0;
- EVP_CIPHER *enc=NULL;
+ const EVP_CIPHER *enc=NULL;
BIO *in=NULL,*out=NULL;
int informat,outformat,text=0,noout=0;
char *infile,*outfile,*prog;
int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p);
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);
#ifdef HEADER_SSL_H
long MS_CALLBACK bio_dump_cb(bio,cmd,argp,argi,argl,ret)
BIO *bio;
int cmd;
-char *argp;
+const char *argp;
int argi;
long argl;
long ret;
SSL *con;
{
int i;
- char *str;
+ const char *str;
X509 *peer;
long verify_error;
MS_STATIC char buf[BUFSIZ];
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx);
static EVP_PKEY *load_key(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 x509_certify (X509_STORE *ctx,char *CAfile, EVP_MD *digest,X509 *x,
- X509 *xca, EVP_PKEY *pkey,char *serial, int create, int days);
+static int sign (X509 *x, EVP_PKEY *pkey,int days,const EVP_MD *digest);
+static int x509_certify (X509_STORE *ctx,char *CAfile,const EVP_MD *digest,
+ X509 *x,X509 *xca,EVP_PKEY *pkey,char *serial,
+ int create,int days);
#else
static int MS_CALLBACK callb();
static EVP_PKEY *load_key();
X509_REQ *rq=NULL;
int fingerprint=0;
char buf[256];
- EVP_MD *md_alg,*digest=EVP_md5();
+ const EVP_MD *md_alg,*digest=EVP_md5();
reqfile=0;
static int x509_certify(ctx,CAfile,digest,x,xca,pkey,serialfile,create,days)
X509_STORE *ctx;
char *CAfile;
-EVP_MD *digest;
+const EVP_MD *digest;
X509 *x;
X509 *xca;
EVP_PKEY *pkey;
X509 *x;
EVP_PKEY *pkey;
int days;
-EVP_MD *digest;
+const EVP_MD *digest;
{
EVP_PKEY *pktmp;
int a2d_ASN1_OBJECT(out,olen,buf,num)
unsigned char *out;
int olen;
-char *buf;
+const char *buf;
int num;
{
int i,first,len=0,c;
- char tmp[24],*p;
+ char tmp[24];
+ const char *p;
unsigned long l;
if (num == 0)
int i,idx=0,n=0,len,nid;
unsigned long l;
unsigned char *p;
- char *s;
+ const char *s;
char tbuf[32];
if (buf_len <= 0) return(0);
}
else
{
- s=(char *)OBJ_nid2ln(nid);
+ s=OBJ_nid2ln(nid);
if (s == NULL)
- s=(char *)OBJ_nid2sn(nid);
+ s=OBJ_nid2sn(nid);
strncpy(buf,s,buf_len);
n=strlen(s);
}
if (a == NULL) return;
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS)
{
- if (a->sn != NULL) Free(a->sn);
- if (a->ln != NULL) Free(a->ln);
+#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause mempory leaks */
+ if (a->sn != NULL) Free((void *)a->sn);
+ if (a->ln != NULL) Free((void *)a->ln);
+#endif
a->sn=a->ln=NULL;
}
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA)
a->length=0;
}
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
- Free((char *)a);
+ Free(a);
}
ASN1_OBJECT *ASN1_OBJECT_create(nid,data,len,sn,ln)
*/
static int SetBlobCmp(const void *elem1, const void *elem2 )
{
- MYBLOB *b1 = (MYBLOB *)elem1;
- MYBLOB *b2 = (MYBLOB *)elem2;
+ const MYBLOB *b1 = (const MYBLOB *)elem1;
+ const MYBLOB *b2 = (const MYBLOB *)elem2;
int r;
r = memcmp(b1->pbData, b2->pbData,
ASN1_BIT_STRING *signature;
char *data;
EVP_PKEY *pkey;
-EVP_MD *type;
+const EVP_MD *type;
{
EVP_MD_CTX ctx;
unsigned char *p,*buf_in=NULL,*buf_out=NULL;
EVP_PKEY *pkey;
{
EVP_MD_CTX ctx;
- EVP_MD *type;
+ const EVP_MD *type;
unsigned char *p,*buf_in=NULL;
int ret= -1,i,inl;
}
inl=i2d(data,NULL);
- buf_in=(unsigned char *)Malloc((unsigned int)inl);
+ buf_in=Malloc((unsigned int)inl);
if (buf_in == NULL)
{
ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE);
#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
typedef struct asn1_object_st
{
- char *sn,*ln;
+ const char *sn,*ln;
int nid;
int length;
unsigned char *data;
#endif
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,
char *sn, char *ln);
static void asn1_put_length();
#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)
unsigned char **p;
int constructed;
int indent;
{
- static char *fmt="%-18s";
- static char *fmt2="%2d %-15s";
- char *p,str[128],*p2=NULL;
+ static const char fmt[]="%-18s";
+ static const char fmt2[]="%2d %-15s";
+ char str[128];
+ const char *p,*p2=NULL;
if (constructed & V_ASN1_CONSTRUCTED)
p="cons: ";
ASN1_ENUMERATED *a;
{
int i,n=0;
- static char *h="0123456789ABCDEF";
+ static const char *h="0123456789ABCDEF";
char buf[2];
if (a == NULL) return(0);
ASN1_INTEGER *a;
{
int i,n=0;
- static char *h="0123456789ABCDEF";
+ static const char *h="0123456789ABCDEF";
char buf[2];
if (a == NULL) return(0);
int type;
{
int i,n=0;
- static char *h="0123456789ABCDEF";
+ static const char *h="0123456789ABCDEF";
char buf[2];
if (a == NULL) return(0);
l[2]=i2d_X509_ALGOR(alg,NULL);
l[3]=ASN1_object_size(1,l[2]+l[1],V_ASN1_SEQUENCE);
+#ifndef CONST_STRICT
os.data=(unsigned char *)"private-key";
+#endif
os.length=11;
l[4]=i2d_ASN1_OCTET_STRING(&os,NULL);
i2d_ASN1_OCTET_STRING(&os2,&p);
ret=l[5];
err:
- if (os2.data != NULL) Free((char *)os2.data);
+ if (os2.data != NULL) Free(os2.data);
if (alg != NULL) X509_ALGOR_free(alg);
if (pkey != NULL) NETSCAPE_PKEY_free(pkey);
r=r;
*/
#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);
#else
static int print();
RSA *x;
int off;
{
- char str[128],*s;
+ char str[128];
+ const char *s;
unsigned char *m=NULL;
int i,ret=0;
static int print(bp,number,num,buf,off)
BIO *bp;
-char *number;
+const char *number;
BIGNUM *num;
unsigned char *buf;
int off;
{
int n,i;
- char str[128],*neg;
+ char str[128];
+ const char *neg;
if (num == NULL) return(1);
neg=(num->neg)?"-":"";
{
unsigned long l;
int i,n;
- char *s,*neg;
+ char *s;
+ const char *neg;
X509_REQ_INFO *ri;
EVP_PKEY *pkey;
STACK *sk;
X509_CINF *ci;
ASN1_INTEGER *bs;
EVP_PKEY *pkey=NULL;
- char *neg;
+ const char *neg;
X509_EXTENSION *ex;
ASN1_STRING *str=NULL;
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)
BIO *bp;
{
char *v;
int gmt=0;
- static char *mon[12]={
- "Jan","Feb","Mar","Apr","May","Jun",
- "Jul","Aug","Sep","Oct","Nov","Dec"};
int i;
int y=0,M=0,d=0,h=0,m=0,s=0;
{
char *v;
int gmt=0;
- static char *mon[12]={
- "Jan","Feb","Mar","Apr","May","Jun",
- "Jul","Aug","Sep","Oct","Nov","Dec"};
int i;
int y=0,M=0,d=0,h=0,m=0,s=0;
M_ASN1_D2I_get(ret->cert_info,d2i_X509_CINF);
M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR);
M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING);
-if (ret->name != NULL) Free(ret->name);
-ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);
+ if (ret->name != NULL) Free(ret->name);
+ ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);
M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509);
}
* 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
return("blowfish(ptr)");
BF_KEY *schedule, unsigned char *ivec, int *num, int enc);
void BF_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
BF_KEY *schedule, unsigned char *ivec, int *num);
-char *BF_options(void);
+const char *BF_options(void);
#else
void BF_cbc_encrypt();
void BF_cfb64_encrypt();
void BF_ofb64_encrypt();
-char *BF_options();
+const char *BF_options();
#endif
int BIO_dump(bio,s,len)
BIO *bio;
-char *s;
+const char *s;
int len;
{
int ret=0;
} ghbn_cache[GHBN_NUM];
#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 struct hostent *ghbn_dup(struct hostent *a);
#else
#endif
int BIO_get_host_ip(str,ip)
-char *str;
+const char *str;
unsigned char *ip;
{
int i;
}
int BIO_get_port(str,port_ptr)
-char *str;
+const char *str;
unsigned short *port_ptr;
{
int i;
}
struct hostent *BIO_gethostbyname(name)
-char *name;
+const char *name;
{
struct hostent *ret;
int i,lowi=0,j;
/* The reason I have implemented this instead of using sscanf is because
* Visual C 1.52c gives an unresolved external when linking a DLL :-( */
static int get_ip(str,ip)
-char *str;
+const char *str;
unsigned char ip[4];
{
unsigned int tmp[4];
int s= -1,cs;
unsigned char ip[4];
unsigned short port;
- char *str,*h,*p,*e;
+ char *str,*e;
+ const char *h,*p;
unsigned long l;
int err_num;
typedef struct bio_method_st
{
int type;
- char *name;
+ const char *name;
int (*bwrite)();
int (*bread)();
int (*bputs)();
typedef struct bio_method_st
{
int type;
- char *name;
+ const char *name;
int (_far *bwrite)();
int (_far *bread)();
int (_far *bputs)();
BIO_METHOD *method;
#ifndef NOPROTO
/* 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
long (*callback)();
#endif
/* name is cast to lose const, but might be better to route through a function
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, \
BIO_CLOSE|BIO_FP_READ,(char *)name)
+#endif
#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_WRITE,name)
#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
int BIO_free(BIO *a);
int BIO_read(BIO *b, char *data, int len);
int BIO_gets(BIO *bp,char *buf, int size);
-int BIO_write(BIO *b, char *data, int len);
-int BIO_puts(BIO *bp,char *buf);
+int BIO_write(BIO *b, const char *data, int len);
+int BIO_puts(BIO *bp,const char *buf);
long BIO_ctrl(BIO *bp,int cmd,long larg,char *parg);
char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
BIO * BIO_dup_chain(BIO *in);
#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);
#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);
#endif
int BIO_sock_non_fatal_error(int error);
int BIO_fd_should_retry(int i);
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_socket_ioctl(int fd, long type, unsigned long *arg);
int BIO_socket_nbio(int fd,int mode);
-int BIO_get_port(char *str, unsigned short *port_ptr);
-int BIO_get_host_ip(char *str, unsigned char *ip);
+int BIO_get_port(const char *str, unsigned short *port_ptr);
+int BIO_get_host_ip(const char *str, unsigned char *ip);
int BIO_get_accept_socket(char *host_port,int mode);
int BIO_accept(int sock,char **ip_port);
int BIO_sock_init(void );
long MS_CALLBACK BIO_debug_callback(bio,cmd,argp,argi,argl,ret)
BIO *bio;
int cmd;
-char *argp;
+const char *argp;
int argi;
long argl;
long ret;
int BIO_write(b,in,inl)
BIO *b;
-char *in;
+const char *in;
int inl;
{
int i;
int BIO_puts(b,in)
BIO *b;
-char *in;
+const char *in;
{
int i;
long (*cb)();
{
BIO *dbio;
int *ip;
- char **pptr;
+ const char **pptr;
long ret=1;
BIO_CONNECT *data;
case BIO_C_GET_CONNECT:
if (ptr != NULL)
{
- pptr=(char **)ptr;
+ pptr=(const char **)ptr;
if (num == 0)
{
*pptr=data->param_hostname;
static int MS_CALLBACK slg_free();
#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 BIO_METHOD methods_slg=
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((bp->ptr= (char *)RegisterEventSource(NULL, name)) == NULL){
#include "cryptlib.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
* 2 - 4 == 128
#include "buffer.h"
#include "bn_lcl.h"
-static char *Hex="0123456789ABCDEF";
+const static char *Hex="0123456789ABCDEF";
/* Must 'Free' the returned data */
char *BN_bn2hex(a)
}
char *BUF_strdup(str)
-char *str;
+const char *str;
{
char *ret;
int n;
BUF_MEM *BUF_MEM_new(void);
void BUF_MEM_free(BUF_MEM *a);
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 );
typedef struct comp_method_st
{
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)();
void (*finish)();
int (*compress)();
#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 *h;
if (p != NULL) return(p);
}
}
- vv.section="default";
+ vv.section=BUF_strdup("default");
vv.name=name;
v=(CONF_VALUE *)lh_retrieve(conf,(char *)&vv);
if (v != NULL)
#endif
/* 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>>",
"err",
#ifndef NOPROTO
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,
- int type,char *file,int line)=NULL;
+ int type,const char *file,int line)=NULL;
static unsigned long (MS_FAR *id_callback)(void)=NULL;
#else
static void (MS_FAR *locking_callback)()=NULL;
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);
}
-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);
}
-void CRYPTO_set_locking_callback(func)
-void (*func)(P_I_I_P_I);
+void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
+ const char *file,int line))
{
locking_callback=func;
}
-void CRYPTO_set_add_lock_callback(func)
-int (*func)(P_IP_I_I_P_I);
+void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type,
+ const char *file,int line))
{
add_lock_callback=func;
}
void CRYPTO_lock(mode,type,file,line)
int mode;
int type;
-char *file;
+const char *file;
int line;
{
#ifdef LOCK_DEBUG
int *pointer;
int amount;
int type;
-char *file;
+const char *file;
int line;
{
int ret;
return(ret);
}
-char *CRYPTO_get_lock_name(type)
+const char *CRYPTO_get_lock_name(type)
int type;
{
if (type < 0)
#ifndef NOPROTO
-char *SSLeay_version(int type);
+const char *SSLeay_version(int type);
unsigned long SSLeay(void);
int CRYPTO_get_ex_new_index(int idx,STACK **sk,long argl,char *argp,
int CRYPTO_mem_ctrl(int mode);
int CRYPTO_get_new_lockid(char *name);
-void CRYPTO_lock(int mode, int type,char *file,int line);
-void CRYPTO_set_locking_callback(void (*func)(int mode,int type,char *file,
- int line));
-void (*CRYPTO_get_locking_callback(void))(int mode,int type,char *file,
+void CRYPTO_lock(int mode, int type,const char *file,int line);
+void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
+ const char *file,int line));
+void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file,
int line);
-void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,
- int type,char *file, int line));
-int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,
- int type,char *file,int line);
+void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type,
+ const char *file, int line));
+int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type,
+ const char *file,int line);
void CRYPTO_set_id_callback(unsigned long (*func)(void));
unsigned long (*CRYPTO_get_id_callback(void))(void);
unsigned long CRYPTO_thread_id(void);
-char *CRYPTO_get_lock_name(int type);
-int CRYPTO_add_lock(int *pointer,int amount,int type, char *file,int line);
+const char *CRYPTO_get_lock_name(int type);
+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_get_mem_functions(char *(**m)(),char *(**r)(), void (**f)());
void *CRYPTO_realloc(void *addr,int num);
void *CRYPTO_remalloc(void *addr,int num);
-void *CRYPTO_dbg_malloc(int num,char *file,int line);
-void *CRYPTO_dbg_realloc(void *addr,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,const char *file,int line);
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
void CRYPTO_mem_leaks_fp(FILE *);
#endif
void CRYPTO_set_id_callback();
unsigned long (*CRYPTO_get_id_callback())();
unsigned long CRYPTO_thread_id();
-char *CRYPTO_get_lock_name();
+const char *CRYPTO_get_lock_name();
int CRYPTO_add_lock();
void CRYPTO_set_mem_functions();
#include "crypto.h"
#include "date.h"
-char *SSLeay_version(t)
+const char *SSLeay_version(t)
int t;
{
if (t == SSLEAY_VERSION)
#undef NOPROTO
#endif
#ifndef NOPROTO
-char *des_options(void);
+const char *des_options(void);
void des_ecb3_encrypt(const unsigned char *input,unsigned char *output,
des_key_schedule ks1,des_key_schedule ks2,
des_key_schedule ks3, int enc);
{
register DES_LONG l,r,t,u;
#ifdef DES_PTR
- register unsigned char *des_SP=(unsigned char *)des_SPtrans;
+ register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
#endif
#ifndef DES_UNROLL
register int i;
{
register DES_LONG l,r,t,u;
#ifdef DES_PTR
- register unsigned char *des_SP=(unsigned char *)des_SPtrans;
+ register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
#endif
#ifndef DES_UNROLL
register int i;
{
register DES_LONG tin0,tin1;
register DES_LONG tout0,tout1,xor0,xor1;
- register unsigned char *in,*out;
+ register const unsigned char *in;
+ unsigned char *out;
register long l=length;
DES_LONG tin[2];
unsigned char *iv;
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- iv=(unsigned char *)ivec;
+ in=input;
+ out=output;
+ iv=ivec;
if (enc)
{
l2c(tout0,out);
l2c(tout1,out);
}
- iv=(unsigned char *)ivec;
+ iv=ivec;
l2c(tout0,iv);
l2c(tout1,iv);
}
xor1=t1;
}
- iv=(unsigned char *)ivec;
+ iv=ivec;
l2c(xor0,iv);
l2c(xor1,iv);
}
u2&=0xfc; \
t=ROTATE(t,4); \
u>>=16L; \
- LL^= *(DES_LONG *)((unsigned char *)des_SP +u1); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x200+u2); \
+ LL^= *(const DES_LONG *)(des_SP +u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x200+u2); \
u3=(int)(u>>8L); \
u1=(int)u&0xfc; \
u3&=0xfc; \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x400+u1); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x600+u3); \
+ LL^= *(const DES_LONG *)(des_SP+0x400+u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x600+u3); \
u2=(int)t>>8L; \
u1=(int)t&0xfc; \
u2&=0xfc; \
t>>=16L; \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x100+u1); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x300+u2); \
+ LL^= *(const DES_LONG *)(des_SP+0x100+u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x300+u2); \
u3=(int)t>>8L; \
u1=(int)t&0xfc; \
u3&=0xfc; \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x500+u1); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x700+u3); }
+ LL^= *(const DES_LONG *)(des_SP+0x500+u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x700+u3); }
#endif
#ifdef DES_RISC2
#define D_ENCRYPT(LL,R,S) { \
u1=(int)u&0xfc; \
u2&=0xfc; \
t=ROTATE(t,4); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP +u1); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x200+u2); \
+ LL^= *(const DES_LONG *)(des_SP +u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x200+u2); \
s1=(int)(u>>16L); \
s2=(int)(u>>24L); \
s1&=0xfc; \
s2&=0xfc; \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x400+s1); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x600+s2); \
+ LL^= *(const DES_LONG *)(des_SP+0x400+s1); \
+ LL^= *(const DES_LONG *)(des_SP+0x600+s2); \
u2=(int)t>>8L; \
u1=(int)t&0xfc; \
u2&=0xfc; \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x100+u1); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x300+u2); \
+ LL^= *(const DES_LONG *)(des_SP+0x100+u1); \
+ LL^= *(const DES_LONG *)(des_SP+0x300+u2); \
s1=(int)(t>>16L); \
s2=(int)(t>>24L); \
s1&=0xfc; \
s2&=0xfc; \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x500+s1); \
- LL^= *(DES_LONG *)((unsigned char *)des_SP+0x700+s2); }
+ LL^= *(const DES_LONG *)(des_SP+0x500+s1); \
+ LL^= *(const DES_LONG *)(des_SP+0x700+s2); }
#endif
#else
#define D_ENCRYPT(LL,R,S) { \
LOAD_DATA_tmp(R,S,u,t,E0,E1); \
t=ROTATE(t,4); \
LL^= \
- *(DES_LONG *)((unsigned char *)des_SP +((u )&0xfc))^ \
- *(DES_LONG *)((unsigned char *)des_SP+0x200+((u>> 8L)&0xfc))^ \
- *(DES_LONG *)((unsigned char *)des_SP+0x400+((u>>16L)&0xfc))^ \
- *(DES_LONG *)((unsigned char *)des_SP+0x600+((u>>24L)&0xfc))^ \
- *(DES_LONG *)((unsigned char *)des_SP+0x100+((t )&0xfc))^ \
- *(DES_LONG *)((unsigned char *)des_SP+0x300+((t>> 8L)&0xfc))^ \
- *(DES_LONG *)((unsigned char *)des_SP+0x500+((t>>16L)&0xfc))^ \
- *(DES_LONG *)((unsigned char *)des_SP+0x700+((t>>24L)&0xfc)); }
+ *(const DES_LONG *)(des_SP +((u )&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x200+((u>> 8L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x400+((u>>16L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x600+((u>>24L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x100+((t )&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x300+((t>> 8L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x500+((t>>16L)&0xfc))^ \
+ *(const DES_LONG *)(des_SP+0x700+((t>>24L)&0xfc)); }
#endif
#else /* original version */
#include "spr.h"
#include "opensslv.h"
-char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay";
-char *DES_version="DES" OPENSSL_VERSION_PTEXT;
+const char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay";
+const char *DES_version="DES" OPENSSL_VERSION_PTEXT;
-char *des_options()
+const char *des_options(void)
{
static int init=1;
static char buf[32];
if (init)
{
- char *ptr,*unroll,*risc,*size;
+ const char *ptr,*unroll,*risc,*size;
init=0;
#ifdef DES_PTR
{
register DES_LONG l,r,t,u;
#ifdef DES_PTR
- register unsigned char *des_SP=(unsigned char *)des_SPtrans;
+ register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
#endif
register DES_LONG *s;
register int j;
{
register DES_LONG sin0,sin1,xor0,xor1,tout0,tout1;
DES_LONG tin[2];
- unsigned char *in,*out,*iv;
+ const unsigned char *in;
+ unsigned char *out,*iv;
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- iv=(unsigned char *)ivec;
+ in=input;
+ out=output;
+ iv=ivec;
if (enc)
{
DES_LONG z0,z1,t0,t1;
int i;
long l;
- unsigned char *cp;
+ const unsigned char *cp;
unsigned char *lp;
if (out_count < 1) out_count=1;
for (i=0; ((i<4)&&(i<out_count)); i++)
{
- cp=(unsigned char *)input;
+ cp=input;
l=length;
while (l > 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 unsigned char *in;
+ register const unsigned char *in;
register DES_LONG *k;
register int i;
}
k=(DES_LONG *)schedule;
- in=(unsigned char *)key;
+ in=key;
c2l(in,c);
c2l(in,d);
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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>
FILE *fp;
{
int i;
- unsigned int *p = (unsigned int *)cb;
+ const unsigned int *p = (const unsigned int *)cb;
fprintf(fp, " 0x { ");
for (i = 0; i < 8; i++) {
#include "bn.h"
#include "dh.h"
-char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
+const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
DH *DH_new()
{
#include "dsa.h"
#include "asn1.h"
-char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
+const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
DSA *DSA_new()
{
static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b);
static unsigned long pid_hash(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,
- char **data,int *flags);
+static unsigned long get_error_values(int inc,const char **file,int *line,
+ const char **data,int *flags);
static void ERR_STATE_free(ERR_STATE *s);
#else
static unsigned long err_hash();
void ERR_put_error(lib,func,reason,file,line)
int lib,func,reason;
-char *file;
+const char *file;
int line;
{
ERR_STATE *es;
{ return(get_error_values(1,NULL,NULL,NULL,NULL)); }
unsigned long ERR_get_error_line(file,line)
-char **file;
+const char **file;
int *line;
{ return(get_error_values(1,file,line,NULL,NULL)); }
unsigned long ERR_get_error_line_data(file,line,data,flags)
-char **file;
+const char **file;
int *line;
-char **data;
+const char **data;
int *flags;
{ return(get_error_values(1,file,line,data,flags)); }
{ return(get_error_values(0,NULL,NULL,NULL,NULL)); }
unsigned long ERR_peek_error_line(file,line)
-char **file;
+const char **file;
int *line;
{ return(get_error_values(0,file,line,NULL,NULL)); }
unsigned long ERR_peek_error_line_data(file,line,data,flags)
-char **file;
+const char **file;
int *line;
-char **data;
+const char **data;
int *flags;
{ return(get_error_values(0,file,line,data,flags)); }
static unsigned long get_error_values(inc,file,line,data,flags)
int inc;
-char **file;
+const char **file;
int *line;
-char **data;
+const char **data;
int *flags;
{
int i=0;
char *ret;
{
static char buf[256];
- char *ls,*fs,*rs;
+ const char *ls,*fs,*rs;
unsigned long l,f,r;
int i;
return(thread_hash);
}
-char *ERR_lib_error_string(e)
+const char *ERR_lib_error_string(e)
unsigned long e;
{
ERR_STRING_DATA d,*p=NULL;
return((p == NULL)?NULL:p->string);
}
-char *ERR_func_error_string(e)
+const char *ERR_func_error_string(e)
unsigned long e;
{
ERR_STRING_DATA d,*p=NULL;
return((p == NULL)?NULL:p->string);
}
-char *ERR_reason_error_string(e)
+const char *ERR_reason_error_string(e)
unsigned long e;
{
ERR_STRING_DATA d,*p=NULL;
unsigned long err_buffer[ERR_NUM_ERRORS];
char *err_data[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 top,bottom;
} ERR_STATE;
typedef struct ERR_string_data_st
{
unsigned long error;
- char *string;
+ const char *string;
} ERR_STRING_DATA;
#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);
unsigned long ERR_get_error(void );
-unsigned long ERR_get_error_line(char **file,int *line);
-unsigned long ERR_get_error_line_data(char **file,int *line,
- char **data, int *flags);
+unsigned long ERR_get_error_line(const char **file,int *line);
+unsigned long ERR_get_error_line_data(const char **file,int *line,
+ const char **data, int *flags);
unsigned long ERR_peek_error(void );
-unsigned long ERR_peek_error_line(char **file,int *line);
-unsigned long ERR_peek_error_line_data(char **file,int *line,
- char **data,int *flags);
+unsigned long ERR_peek_error_line(const char **file,int *line);
+unsigned long ERR_peek_error_line_data(const char **file,int *line,
+ const char **data,int *flags);
void ERR_clear_error(void );
char *ERR_error_string(unsigned long e,char *buf);
-char *ERR_lib_error_string(unsigned long e);
-char *ERR_func_error_string(unsigned long e);
-char *ERR_reason_error_string(unsigned long e);
+const char *ERR_lib_error_string(unsigned long e);
+const char *ERR_func_error_string(unsigned long e);
+const char *ERR_reason_error_string(unsigned long e);
#ifndef NO_FP_API
void ERR_print_errors_fp(FILE *fp);
#endif
{
unsigned long l;
char buf[200];
- char *file,*data;
+ const char *file,*data;
int line,flags;
unsigned long es;
unsigned long l;
char buf[256];
char buf2[256];
- char *file,*data;
+ const char *file,*data;
int line,flags;
unsigned long es;
void BIO_set_cipher(b,c,k,i,e)
BIO *b;
-EVP_CIPHER *c;
+const EVP_CIPHER *c;
unsigned char *k;
unsigned char *i;
int e;
if (b == NULL) return;
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;
b->init=1;
EVP_CipherInit(&(ctx->cipher),c,k,i,e);
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);
}
char *ptr;
{
EVP_MD_CTX *ctx,*dctx,**pctx;
- EVP_MD **ppmd;
+ const EVP_MD **ppmd;
EVP_MD *md;
long ret=1;
BIO *dbio;
case BIO_C_GET_MD:
if (b->init)
{
- ppmd=(EVP_MD **)ptr;
+ ppmd=(const EVP_MD **)ptr;
*ppmd=ctx->digest;
}
else
{
BIO_OK_CTX *ctx;
EVP_MD *md;
- EVP_MD **ppmd;
+ const EVP_MD **ppmd;
long ret=1;
int i;
case BIO_C_GET_MD:
if (b->init)
{
- ppmd=(EVP_MD **)ptr;
+ ppmd=(const EVP_MD **)ptr;
*ppmd=ctx->md.digest;
}
else
void EVP_DigestInit(ctx,type)
EVP_MD_CTX *ctx;
-EVP_MD *type;
+const EVP_MD *type;
{
ctx->digest=type;
type->init(&(ctx->md));
void EVP_DigestUpdate(ctx,data,count)
EVP_MD_CTX *ctx;
-unsigned char *data;
+const unsigned char *data;
unsigned int count;
{
ctx->digest->update(&(ctx->md.base[0]),data,(unsigned long)count);
unsigned char *iv,int enc);
static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
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 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_meth_to_magic(e)
-EVP_CIPHER *e;
+const EVP_CIPHER *e;
{
int i;
typedef struct env_md_ctx_st
{
- EVP_MD *digest;
+ const EVP_MD *digest;
union {
unsigned char base[4];
#ifndef NO_MD2
typedef struct evp_cipher_info_st
{
- EVP_CIPHER *cipher;
+ const EVP_CIPHER *cipher;
unsigned char iv[EVP_MAX_IV_LENGTH];
} EVP_CIPHER_INFO;
typedef struct evp_cipher_ctx_st
{
- EVP_CIPHER *cipher;
+ const EVP_CIPHER *cipher;
int encrypt; /* encrypt or decrypt */
int buf_len; /* number we have left */
#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 BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
+#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)
+#endif
#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_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
#ifndef NOPROTO
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_DigestUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt);
+void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
+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);
-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);
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 *key,unsigned char *iv);
-EVP_CIPHER *EVP_get_cipherbyname(char *name);
-
-void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,
+void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
unsigned char *key, unsigned char *iv);
void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
int *outl, unsigned char *in, int inl);
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);
void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
int *outl, unsigned char *in, int inl);
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,
- unsigned char *iv,int enc);
+void EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
+ unsigned char *key,unsigned char *iv,int enc);
void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
int *outl, unsigned char *in, int inl);
int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
BIO_METHOD *BIO_f_base64(void);
BIO_METHOD *BIO_f_cipher(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);
#endif
int EVP_add_cipher(EVP_CIPHER *cipher);
int EVP_add_digest(EVP_MD *digest);
-EVP_CIPHER *EVP_get_cipherbyname(char *name);
-EVP_MD *EVP_get_digestbyname(char *name);
+const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
+const EVP_MD *EVP_get_digestbyname(const char *name);
void EVP_cleanup(void);
int EVP_PKEY_decrypt(unsigned char *dec_key,unsigned char *enc_key,
#include "cryptlib.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)
EVP_CIPHER_CTX *ctx;
void EVP_CipherInit(ctx,data,key,iv,enc)
EVP_CIPHER_CTX *ctx;
-EVP_CIPHER *data;
+const EVP_CIPHER *data;
unsigned char *key;
unsigned char *iv;
int enc;
void EVP_EncryptInit(ctx,cipher,key,iv)
EVP_CIPHER_CTX *ctx;
-EVP_CIPHER *cipher;
+const EVP_CIPHER *cipher;
unsigned char *key;
unsigned char *iv;
{
void EVP_DecryptInit(ctx,cipher,key,iv)
EVP_CIPHER_CTX *ctx;
-EVP_CIPHER *cipher;
+const EVP_CIPHER *cipher;
unsigned char *key;
unsigned char *iv;
{
int EVP_read_pw_string(buf,len,prompt,verify)
char *buf;
int len;
-char *prompt;
+const char *prompt;
int verify;
{
if ((prompt == NULL) && (prompt_string[0] != '\0'))
}
int EVP_BytesToKey(type,md,salt,data,datal,count,key,iv)
-EVP_CIPHER *type;
+const EVP_CIPHER *type;
EVP_MD *md;
unsigned char *salt;
unsigned char *data;
EVP_MD *md;
{
int r;
- char *name;
+ const char *name;
name=OBJ_nid2sn(md->type);
r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(char *)md);
return(r);
}
-EVP_CIPHER *EVP_get_cipherbyname(name)
-char *name;
+const EVP_CIPHER *EVP_get_cipherbyname(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);
}
-EVP_MD *EVP_get_digestbyname(name)
-char *name;
+const EVP_MD *EVP_get_digestbyname(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);
}
HMAC_CTX *ctx;
unsigned char *key;
int len;
-EVP_MD *md;
+const EVP_MD *md;
{
int i,j,reset=0;
unsigned char pad[HMAC_MAX_MD_CBLOCK];
typedef struct hmac_ctx_st
{
- EVP_MD *md;
+ const EVP_MD *md;
EVP_MD_CTX md_ctx;
EVP_MD_CTX i_ctx;
EVP_MD_CTX o_ctx;
#ifndef NOPROTO
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_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
void HMAC_cleanup(HMAC_CTX *ctx);
#include "idea_lcl.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))
return("idea(int)");
} IDEA_KEY_SCHEDULE;
#ifndef NOPROTO
-char *idea_options(void);
+const char *idea_options(void);
void idea_ecb_encrypt(unsigned char *in, unsigned char *out,
IDEA_KEY_SCHEDULE *ks);
void idea_set_encrypt_key(unsigned char *key, IDEA_KEY_SCHEDULE *ks);
long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num);
void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
#else
-char *idea_options();
+const char *idea_options();
void idea_ecb_encrypt();
void idea_set_encrypt_key();
void idea_set_decrypt_key();
#include "crypto.h"
#include "lhash.h"
-char *lh_version="lhash" OPENSSL_VERSION_PTEXT;
+const char *lh_version="lhash" OPENSSL_VERSION_PTEXT;
#undef MIN_NODES
#define MIN_NODES 16
* well, not as good as MD5, but still good.
*/
unsigned long lh_strhash(c)
-char *c;
+const char *c;
{
unsigned long ret=0;
long n;
char *lh_retrieve(LHASH *lh, char *data);
void lh_doall(LHASH *lh, void (*func)(/* char *b */));
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
void lh_stats(LHASH *lh, FILE *out);
} MD2_CTX;
#ifndef NOPROTO
-char *MD2_options(void);
+const char *MD2_options(void);
void MD2_Init(MD2_CTX *c);
void MD2_Update(MD2_CTX *c, register unsigned char *data, unsigned long len);
void MD2_Final(unsigned char *md, MD2_CTX *c);
unsigned char *MD2(unsigned char *d, unsigned long n,unsigned char *md);
#else
-char *MD2_options();
+const char *MD2_options();
void MD2_Init();
void MD2_Update();
void MD2_Final();
#include "md2.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
*/
0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14,
};
-char *MD2_options()
+const char *MD2_options()
{
if (sizeof(MD2_INT) == 1)
return("md2(char)");
{
char *addr;
int num;
- char *file;
+ const char *file;
int line;
unsigned long order;
} MEM;
static unsigned long break_order_num=0;
void *CRYPTO_dbg_malloc(num,file,line)
int num;
-char *file;
+const char *file;
int line;
{
char *ret;
void *CRYPTO_dbg_realloc(addr,num,file,line)
void *addr;
int num;
-char *file;
+const char *file;
int line;
{
char *ret;
void *CRYPTO_dbg_remalloc(a,n,file,line)
void *a;
int n;
-char *file;
+const char *file;
int line;
{
if (a != NULL) CRYPTO_dbg_free(a);
return(ret);
}
-char *OBJ_NAME_get(name,type)
-char *name;
+const char *OBJ_NAME_get(name,type)
+const char *name;
int type;
{
OBJ_NAME on,*ret;
}
int OBJ_NAME_add(name,type,data)
-char *name;
+const char *name;
int type;
-char *data;
+const char *data;
{
void (*f)();
OBJ_NAME *onp,*ret;
}
int OBJ_NAME_remove(name,type)
-char *name;
+const char *name;
int type;
{
OBJ_NAME on,*ret;
}
}
-char *OBJ_nid2sn(n)
+const char *OBJ_nid2sn(n)
int n;
{
ADDED_OBJ ad,*adp;
}
}
-char *OBJ_nid2ln(n)
+const char *OBJ_nid2ln(n)
int n;
{
ADDED_OBJ ad,*adp;
*/
ASN1_OBJECT *OBJ_txt2obj(s, no_name)
-char *s;
+const char *s;
int no_name;
{
int nid = NID_undef;
}
int OBJ_ln2nid(s)
-char *s;
+const char *s;
{
ASN1_OBJECT o,*oo= &o,**op;
ADDED_OBJ ad,*adp;
}
int OBJ_sn2nid(s)
-char *s;
+const char *s;
{
ASN1_OBJECT o,*oo= &o,**op;
ADDED_OBJ ad,*adp;
{
ASN1_OBJECT *r;
int i;
+ char *ln=NULL;
if (o == NULL) return(NULL);
if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
return(o);
- r=(ASN1_OBJECT *)ASN1_OBJECT_new();
+ r=ASN1_OBJECT_new();
if (r == NULL)
{
OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB);
return(NULL);
}
- r->data=(unsigned char *)Malloc(o->length);
+ r->data=Malloc(o->length);
if (r->data == NULL)
goto err;
memcpy(r->data,o->data,o->length);
if (o->ln != NULL)
{
i=strlen(o->ln)+1;
- r->ln=(char *)Malloc(i);
+ r->ln=ln=Malloc(i);
if (r->ln == NULL) goto err;
- memcpy(r->ln,o->ln,i);
+ memcpy(ln,o->ln,i);
}
if (o->sn != NULL)
{
+ char *s;
+
i=strlen(o->sn)+1;
- r->sn=(char *)Malloc(i);
+ r->sn=s=Malloc(i);
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|
ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|ASN1_OBJECT_FLAG_DYNAMIC_DATA);
OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE);
if (r != NULL)
{
- if (r->ln != NULL) Free(r->ln);
+ if (ln != NULL) Free(ln);
if (r->data != NULL) Free(r->data);
Free(r);
}
{
int type;
int alias;
- char *name;
- char *data;
+ const char *name;
+ const char *data;
} OBJ_NAME;
#define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)
int OBJ_NAME_init(void);
int OBJ_NAME_new_index(unsigned long (*hash_func)(),int (*cmp_func)(),
void (*free_func)());
-char *OBJ_NAME_get(char *name,int type);
-int OBJ_NAME_add(char *name,int type,char *data);
-int OBJ_NAME_remove(char *name,int type);
+const char *OBJ_NAME_get(const char *name,int type);
+int OBJ_NAME_add(const char *name,int type,const char *data);
+int OBJ_NAME_remove(const char *name,int type);
void OBJ_NAME_cleanup(int type); /* -1 for everything */
ASN1_OBJECT * OBJ_dup(ASN1_OBJECT *o);
ASN1_OBJECT * OBJ_nid2obj(int n);
-char * OBJ_nid2ln(int n);
-char * OBJ_nid2sn(int n);
+const char * OBJ_nid2ln(int n);
+const char * OBJ_nid2sn(int n);
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_ln2nid(char *s);
-int OBJ_sn2nid(char *s);
+int OBJ_ln2nid(const char *s);
+int OBJ_sn2nid(const char *s);
int OBJ_cmp(ASN1_OBJECT *a,ASN1_OBJECT *b);
char * OBJ_bsearch(char *key,char *base,int num,int size,int (*cmp)());
int PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb)
BIO *bp;
RSA *x;
-EVP_CIPHER *enc;
+const EVP_CIPHER *enc;
unsigned char *kstr;
int klen;
int (*cb)();
int PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb)
FILE *fp;
DSA *x;
-EVP_CIPHER *enc;
+const EVP_CIPHER *enc;
unsigned char *kstr;
int klen;
int (*cb)();
int PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb)
BIO *bp;
DSA *x;
-EVP_CIPHER *enc;
+const EVP_CIPHER *enc;
unsigned char *kstr;
int klen;
int (*cb)();
EVP_CIPHER_CTX ctx;
int i,ret=0;
unsigned char *data=NULL;
- char *objstr=NULL;
+ const char *objstr=NULL;
#define PEM_BUFSIZE 1024
char buf[PEM_BUFSIZE];
unsigned char *iv=NULL;
#include "des.h"
#endif
-char *PEM_version="PEM" OPENSSL_VERSION_PTEXT;
+const char *PEM_version="PEM" OPENSSL_VERSION_PTEXT;
#define MIN_LENGTH 4
return(-1);
#else
int i,j;
- char *prompt;
+ const char *prompt;
prompt=EVP_get_pw_prompt();
if (prompt == NULL)
char *buf;
int type;
{
- char *str;
+ const char *str;
if (type == PEM_TYPE_ENCRYPTED)
str="ENCRYPTED";
void PEM_dek_info(buf, type, len, str)
char *buf;
-char *type;
+const char *type;
int len;
char *str;
{
#ifndef NO_FP_API
char *PEM_ASN1_read(d2i,name,fp, x, cb)
char *(*d2i)();
-char *name;
+const char *name;
FILE *fp;
char **x;
int (*cb)();
char *PEM_ASN1_read_bio(d2i,name,bp, x, cb)
char *(*d2i)();
-char *name;
+const char *name;
BIO *bp;
char **x;
int (*cb)();
#ifndef NO_FP_API
int PEM_ASN1_write(i2d,name,fp, x, enc, kstr, klen, callback)
int (*i2d)();
-char *name;
+const char *name;
FILE *fp;
char *x;
-EVP_CIPHER *enc;
+const EVP_CIPHER *enc;
unsigned char *kstr;
int klen;
int (*callback)();
int PEM_ASN1_write_bio(i2d,name,bp, x, enc, kstr, klen, callback)
int (*i2d)();
-char *name;
+const char *name;
BIO *bp;
char *x;
-EVP_CIPHER *enc;
+const EVP_CIPHER *enc;
unsigned char *kstr;
int klen;
int (*callback)();
EVP_CIPHER_CTX ctx;
int dsize=0,i,j,ret=0;
unsigned char *p,*data=NULL;
- char *objstr=NULL;
+ const char *objstr=NULL;
#define PEM_BUFSIZE 1024
char buf[PEM_BUFSIZE];
unsigned char key[EVP_MAX_KEY_LENGTH];
EVP_CIPHER_INFO *cipher;
{
int o;
- EVP_CIPHER *enc=NULL;
+ const EVP_CIPHER *enc=NULL;
char *p,c;
cipher->cipher=NULL;
int PEM_write_bio(bp, name, header, data,len)
BIO *bp;
-char *name;
+const char *name;
char *header;
unsigned char *data;
long len;
int PKCS12_key_gen_asc (pass, passlen, salt, saltlen, id, iter, n, out, md_type)
unsigned char *pass, *salt, *out;
int passlen, saltlen, id, iter, n;
-EVP_MD *md_type;
+const EVP_MD *md_type;
{
int ret;
unsigned char *unipass;
int PKCS12_key_gen_uni (pass, passlen, salt, saltlen, id, iter, n, out, md_type)
unsigned char *pass, *salt, *out;
int passlen, saltlen, id, iter, n;
-EVP_MD *md_type;
+const EVP_MD *md_type;
{
unsigned char *B, *D, *I, *p, *Ai;
int Slen, Plen, Ilen;
unsigned char *mac;
unsigned int *maclen;
{
- EVP_MD *md_type;
+ const EVP_MD *md_type;
HMAC_CTX hmac;
unsigned char key[PKCS12_MAC_KEY_LENGTH], *salt;
int saltlen, iter;
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);
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_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_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, 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_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 i,j;
BIO *out=NULL,*btmp=NULL;
X509_ALGOR *xa;
- EVP_MD *evp_md;
- EVP_CIPHER *evp_cipher=NULL;
+ const EVP_MD *evp_md;
+ const EVP_CIPHER *evp_cipher=NULL;
STACK *md_sk=NULL,*rsk=NULL;
X509_ALGOR *xalg=NULL;
PKCS7_RECIP_INFO *ri=NULL;
char *tmp=NULL;
X509_ALGOR *xa;
ASN1_OCTET_STRING *data_body=NULL;
- EVP_MD *evp_md;
- EVP_CIPHER *evp_cipher=NULL;
+ const EVP_MD *evp_md;
+ const EVP_CIPHER *evp_cipher=NULL;
EVP_CIPHER_CTX *evp_ctx=NULL;
X509_ALGOR *enc_alg=NULL;
STACK *md_sk=NULL,*rsk=NULL;
unsigned int md_len;
ASN1_OCTET_STRING *digest;
ASN1_UTCTIME *sign_time;
- EVP_MD *md_tmp;
+ const EVP_MD *md_tmp;
/* Add signing time */
sign_time=X509_gmtime_adj(NULL,0);
static unsigned char md[MD_DIGEST_LENGTH];
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_seed(const void *buf, int num);
MD_Final(md,&m);
md_count[1]++;
- buf=(char *)buf + j;
+ buf=(const char *)buf + j;
for (k=0; k<j; k++)
{
#include "rc2_locl.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
* Newsgroups: sci.crypt
#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(RC4_KEY *key, unsigned long len, unsigned char *indata,
unsigned char *outdata);
#else
-char *RC4_options();
+const char *RC4_options();
void RC4_set_key();
void RC4();
#include "rc4_locl.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
if (sizeof(RC4_INT) == 1)
typedef struct rsa_meth_st
{
- char *name;
+ const char *name;
#ifndef NOPROTO
int (*rsa_pub_enc)(int flen,unsigned char *from,unsigned char *to,
RSA *rsa,int padding);
#include "bn.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 int rsa_meth_num=0;
#undef MIN_NODES
#define MIN_NODES 4
-char *STACK_version="Stack" OPENSSL_VERSION_PTEXT;
+const char *STACK_version="Stack" OPENSSL_VERSION_PTEXT;
#ifndef NOPROTO
#define FP_ICC (int (*)(const void *,const void *))
#undef BUFSIZE
#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)
BIO *in;
static int dir_ctrl(X509_LOOKUP *ctx,int cmd,char *argp,long argl,char **ret);
static int new_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,
X509_OBJECT *ret);
#else
static int add_cert_dir(ctx,dir, type)
BY_DIR *ctx;
-char *dir;
+const char *dir;
int type;
{
int j,len;
int *ip;
- char *s,*ss,*p;
+ const char *s,*ss,*p;
char **pp;
if (dir == NULL || !*dir)
BUF_MEM *b=NULL;
struct stat st;
X509_OBJECT stmp,*tmp;
- char *postfix="";
+ const char *postfix="";
if (name == NULL) return(0);
int X509_load_cert_file(ctx,file,type)
X509_LOOKUP *ctx;
-char *file;
+const char *file;
int type;
{
int ret=0;
int X509_load_crl_file(ctx,file,type)
X509_LOOKUP *ctx;
-char *file;
+const char *file;
int type;
{
int ret=0;
#ifndef SSLEAY_MACROS
#ifdef HEADER_ENVELOPE_H
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_CRL_verify(X509_CRL *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_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, EVP_MD *md);
-int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, EVP_MD *md);
-int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *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, const 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, const EVP_MD *md);
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_cmp_current_time(ASN1_UTCTIME *s);
ASN1_UTCTIME * X509_gmtime_adj(ASN1_UTCTIME *s, long adj);
-char * X509_get_default_cert_area(void );
-char * X509_get_default_cert_dir(void );
-char * X509_get_default_cert_file(void );
-char * X509_get_default_cert_dir_env(void );
-char * X509_get_default_cert_file_env(void );
-char * X509_get_default_private_dir(void );
+const char * X509_get_default_cert_area(void );
+const char * X509_get_default_cert_dir(void );
+const char * X509_get_default_cert_file(void );
+const char * X509_get_default_cert_dir_env(void );
+const char * X509_get_default_cert_file_env(void );
+const char * X509_get_default_private_dir(void );
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);
int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
ASN1_BIT_STRING *signature,
- char *data,EVP_PKEY *pkey, EVP_MD *type);
+ char *data,EVP_PKEY *pkey, const EVP_MD *type);
#endif
int X509_set_version(X509 *x,long version);
#include "crypto.h"
#include "x509.h"
-char *X509_get_default_private_dir()
+const char *X509_get_default_private_dir()
{ return(X509_PRIVATE_DIR); }
-char *X509_get_default_cert_area()
+const char *X509_get_default_cert_area()
{ return(X509_CERT_AREA); }
-char *X509_get_default_cert_dir()
+const char *X509_get_default_cert_dir()
{ return(X509_CERT_DIR); }
-char *X509_get_default_cert_file()
+const char *X509_get_default_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); }
-char *X509_get_default_cert_file_env()
+const char *X509_get_default_cert_file_env()
{ return(X509_CERT_FILE_EVP); }
X509_NAME_ENTRY *ne;
unsigned int i;
int n,lold,l,l1,l2,num,j,type;
- char *s,*p;
+ const char *s;
+ char *p;
unsigned char *q;
BUF_MEM *b=NULL;
static char hex[17]="0123456789ABCDEF";
int gs_doit[4];
char tmp_buf[80];
- if (a == NULL) return("NO X509_NAME");
if (buf == NULL)
{
if ((b=BUF_MEM_new()) == NULL) goto err;
b->data[0]='\0';
len=200;
}
+ if (a == NULL)
+ {
+ if(b)
+ {
+ buf=b->data;
+ Free(b);
+ }
+ strncpy(buf,"NO X509_NAME",len);
+ return buf;
+ }
len--; /* space for '\0' */
l=0;
if (b != NULL)
{
p=b->data;
- Free((char *)b);
+ Free(b);
}
else
p=buf;
#include "x509.h"
#include "objects.h"
-char *X509_verify_cert_error_string(n)
+const char *X509_verify_cert_error_string(n)
long n;
{
static char buf[100];
static int internal_verify();
#endif
-char *X509_version="X.509" OPENSSL_VERSION_PTEXT;
+const char *X509_version="X.509" OPENSSL_VERSION_PTEXT;
static STACK *x509_store_ctx_method=NULL;
static int x509_store_ctx_num=0;
/* This is a static that defines the function interface */
typedef struct x509_lookup_method_st
{
- char *name;
+ const char *name;
int (*new_item)(X509_LOOKUP *ctx);
void (*free)(X509_LOOKUP *ctx);
int (*init)(X509_LOOKUP *ctx);
int X509_LOOKUP_ctrl(X509_LOOKUP *ctx,int cmd,char *argc,long argl,char **ret);
#ifndef NO_STDIO
-int X509_load_cert_file(X509_LOOKUP *ctx, char *file, int type);
-int X509_load_crl_file(X509_LOOKUP *ctx, char *file, int type);
+int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
+int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
#endif
int X509_sign(x,pkey,md)
X509 *x;
EVP_PKEY *pkey;
-EVP_MD *md;
+const EVP_MD *md;
{
return(ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature,
x->sig_alg, x->signature, (char *)x->cert_info,pkey,md));
int X509_REQ_sign(x,pkey,md)
X509_REQ *x;
EVP_PKEY *pkey;
-EVP_MD *md;
+const EVP_MD *md;
{
return(ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL,
x->signature, (char *)x->req_info,pkey,md));
int X509_CRL_sign(x,pkey,md)
X509_CRL *x;
EVP_PKEY *pkey;
-EVP_MD *md;
+const EVP_MD *md;
{
return(ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg,
x->sig_alg, x->signature, (char *)x->crl,pkey,md));
int NETSCAPE_SPKI_sign(x,pkey,md)
NETSCAPE_SPKI *x;
EVP_PKEY *pkey;
-EVP_MD *md;
+const EVP_MD *md;
{
return(ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL,
x->signature, (char *)x->spkac,pkey,md));
static int v3_check_critical(char **value);
static int v3_check_generic(char **value);
static X509_EXTENSION *do_ext_conf(LHASH *conf, X509V3_CTX *ctx, int ext_nid, int crit, char *value);
-static X509_EXTENSION *v3_generic_extension(char *ext, char *value, int crit, int type);
+static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type);
#else
static int v3_check_critical();
static int v3_check_generic();
/* Create a generic extension: for now just handle RAW type */
static X509_EXTENSION *v3_generic_extension(ext, value, crit, type)
-char *ext;
+const char *ext;
char *value;
int crit;
int type;
/* Add a CONF_VALUE name value pair to stack */
int X509V3_add_value(name, value, extlist)
-char *name;
-char *value;
+const char *name;
+const char *value;
STACK **extlist;
{
CONF_VALUE *vtmp = NULL;
}
int X509V3_add_value_bool(name, asn1_bool, extlist)
-char *name;
+const char *name;
int asn1_bool;
STACK **extlist;
{
}
int X509V3_add_value_int(name, aint, extlist)
-char *name;
+const char *name;
ASN1_INTEGER *aint;
STACK **extlist;
{
*/
int name_cmp(name, cmp)
-char *name;
-char *cmp;
+const char *name;
+const char *cmp;
{
int len, ret;
char c;
typedef struct BIT_STRING_BITNAME_st {
int bitnum;
-char *lname;
-char *sname;
+const char *lname;
+const char *sname;
} BIT_STRING_BITNAME;
typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
X509_REQ *req, X509_CRL *crl, int flags);
-int X509V3_add_value(char *name, char *value, STACK **extlist);
-int X509V3_add_value_bool(char *name, int asn1_bool, STACK **extlist);
-int X509V3_add_value_int( char *name, ASN1_INTEGER *aint, STACK **extlist);
+int X509V3_add_value(const char *name, const char *value, STACK **extlist);
+int X509V3_add_value_bool(const char *name, int asn1_bool, STACK **extlist);
+int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, STACK **extlist);
char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);
ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value);
char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
char *hex_to_string(unsigned char *buffer, long len);
unsigned char *string_to_hex(char *str, long *len);
-int name_cmp(char *name, char *cmp);
+int name_cmp(const char *name, const char *cmp);
int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent);
int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
unsigned char *p,*d;
int clear,enc,karg,i;
SSL_SESSION *sess;
- EVP_CIPHER *c;
- EVP_MD *md;
+ const EVP_CIPHER *c;
+ const EVP_MD *md;
buf=(unsigned char *)s->init_buf->data;
if (s->state == SSL2_ST_SEND_CLIENT_MASTER_KEY_A)
{
/* Max number of bytes needed */
EVP_CIPHER_CTX *rs,*ws;
- EVP_CIPHER *c;
- EVP_MD *md;
+ const EVP_CIPHER *c;
+ const EVP_MD *md;
int num;
if (!ssl_cipher_get_evp(s->session,&c,&md,NULL))
static long ssl2_default_timeout();
#endif
-char *ssl2_version_str="SSLv2" OPENSSL_VERSION_PTEXT;
+const char *ssl2_version_str="SSLv2" OPENSSL_VERSION_PTEXT;
#define SSL2_NUM_CIPHERS (sizeof(ssl2_ciphers)/sizeof(SSL_CIPHER))
/* lets try to actually write the data */
s->s2->wpend_tot=olen;
- s->s2->wpend_buf=(char *)buf;
+ s->s2->wpend_buf=buf;
s->s2->wpend_ret=len;
int export,i,n,keya,ek;
unsigned char *p;
SSL_CIPHER *cp;
- EVP_CIPHER *c;
- EVP_MD *md;
+ const EVP_CIPHER *c;
+ const EVP_MD *md;
p=(unsigned char *)s->init_buf->data;
if (s->state == SSL2_ST_GET_CLIENT_MASTER_KEY_A)
unsigned char exp_iv[EVP_MAX_KEY_LENGTH];
unsigned char *ms,*key,*iv,*er1,*er2;
EVP_CIPHER_CTX *dd;
- EVP_CIPHER *c;
+ const EVP_CIPHER *c;
COMP_METHOD *comp;
- EVP_MD *m;
+ const EVP_MD *m;
MD5_CTX md;
int exp,n,i,j,k,cl;
SSL *s;
{
unsigned char *p;
- EVP_CIPHER *c;
- EVP_MD *hash;
+ const EVP_CIPHER *c;
+ const EVP_MD *hash;
int num;
SSL_COMP *comp;
EVP_CIPHER_CTX *ds;
unsigned long l;
int bs,i;
- EVP_CIPHER *enc;
+ const EVP_CIPHER *enc;
if (send)
{
void ssl3_finish_mac(s,buf,len)
SSL *s;
-unsigned char *buf;
+const unsigned char *buf;
int len;
{
EVP_DigestUpdate(&(s->s3->finish_dgst1),buf,len);
SSL3_RECORD *rec;
unsigned char *mac_sec,*seq;
EVP_MD_CTX md_ctx;
- EVP_MD *hash;
+ const EVP_MD *hash;
unsigned char *p,rec_char;
unsigned int md_size;
int npad,i;
unsigned char *p;
int len;
{
- static unsigned char *salt[3]={
- (unsigned char *)"A",
- (unsigned char *)"BB",
- (unsigned char *)"CCC",
+ static const unsigned char *salt[3]={
+ (const unsigned char *)"A",
+ (const unsigned char *)"BB",
+ (const unsigned char *)"CCC",
};
unsigned char buf[EVP_MAX_MD_SIZE];
EVP_MD_CTX ctx;
for (i=0; i<3; i++)
{
EVP_DigestInit(&ctx,s->ctx->sha1);
- EVP_DigestUpdate(&ctx,salt[i],strlen((char *)salt[i]));
+ EVP_DigestUpdate(&ctx,salt[i],strlen((const char *)salt[i]));
EVP_DigestUpdate(&ctx,p,len);
EVP_DigestUpdate(&ctx,&(s->s3->client_random[0]),
SSL3_RANDOM_SIZE);
#include "objects.h"
#include "ssl_locl.h"
-char *ssl3_version_str="SSLv3" OPENSSL_VERSION_PTEXT;
+const char *ssl3_version_str="SSLv3" OPENSSL_VERSION_PTEXT;
#define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers)/sizeof(SSL_CIPHER))
if (s->s3->delay_buf_pop_ret == 0)
{
ret=ssl3_write_bytes(s,SSL3_RT_APPLICATION_DATA,
- (char *)buf,len);
+ buf,len);
if (ret <= 0) return(ret);
s->s3->delay_buf_pop_ret=ret;
else
{
ret=ssl3_write_bytes(s,SSL3_RT_APPLICATION_DATA,
- (char *)buf,len);
+ buf,len);
if (ret <= 0) return(ret);
}
*/
#ifndef NOPROTO
-static int do_ssl3_write(SSL *s, int type, char *buf, unsigned int len);
-static int ssl3_write_pending(SSL *s, int type, char *buf, unsigned int len);
+static int do_ssl3_write(SSL *s, int type, const char *buf, unsigned int len);
+static int ssl3_write_pending(SSL *s, int type, const char *buf,
+ unsigned int len);
static int ssl3_get_record(SSL *s);
static int do_compress(SSL *ssl);
static int do_uncompress(SSL *ssl);
int ssl3_write_bytes(s,type,buf,len)
SSL *s;
int type;
-char *buf;
+const char *buf;
int len;
{
unsigned int tot,n,nw;
}
if (type == SSL3_RT_HANDSHAKE)
- ssl3_finish_mac(s,(unsigned char *)&(buf[tot]),i);
+ ssl3_finish_mac(s,&(buf[tot]),i);
if (i == (int)n) return(tot+i);
static int do_ssl3_write(s,type,buf,len)
SSL *s;
int type;
-char *buf;
+const char *buf;
unsigned int len;
{
unsigned char *p,*plen;
static int ssl3_write_pending(s,type,buf,len)
SSL *s;
int type;
-char *buf;
+const char *buf;
unsigned int len;
{
int i;
}
if (type == SSL3_RT_HANDSHAKE)
- ssl3_finish_mac(s,(unsigned char *)buf,n);
+ ssl3_finish_mac(s,buf,n);
return(n);
f_err:
ssl3_send_alert(s,SSL3_AL_FATAL,al);
typedef struct ssl_cipher_st
{
int valid;
- char *name; /* text name */
+ const char *name; /* text name */
unsigned long id; /* id, 4 bytes, first is version */
unsigned long algorithms; /* what ciphers are used */
unsigned long algorithm2; /* Extra flags */
CRYPTO_EX_DATA ex_data;
- EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */
- EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */
- EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
+ const EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */
+ const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */
+ const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
STACK_OF(X509) *extra_certs;
STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
* the ones to be 'copied' into these ones */
EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
- EVP_MD *read_hash; /* used for mac generation */
+ const EVP_MD *read_hash; /* used for mac generation */
#ifdef HEADER_COMP_H
COMP_CTX *expand; /* uncompress */
#else
#endif
EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
- EVP_MD *write_hash; /* used for mac generation */
+ const EVP_MD *write_hash; /* used for mac generation */
#ifdef HEADER_COMP_H
COMP_CTX *compress; /* compression */
#else
SSL_CIPHER *SSL_get_current_cipher(SSL *s);
int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits);
char * SSL_CIPHER_get_version(SSL_CIPHER *c);
-char * SSL_CIPHER_get_name(SSL_CIPHER *c);
+const char * SSL_CIPHER_get_name(SSL_CIPHER *c);
int SSL_get_fd(SSL *s);
-char * SSL_get_cipher_list(SSL *s,int n);
+const char * SSL_get_cipher_list(SSL *s,int n);
char * SSL_get_shared_ciphers(SSL *s, char *buf, int len);
int SSL_get_read_ahead(SSL * s);
int SSL_pending(SSL *s);
* args were passwd */
unsigned int wnum; /* number of bytes sent so far */
int wpend_tot;
- char *wpend_buf;
+ const char *wpend_buf;
int wpend_off; /* offset to data to write */
int wpend_len; /* number of bytes passwd to write */
int wpend_tot; /* number bytes written */
int wpend_type;
int wpend_ret; /* number of bytes submitted */
- char *wpend_buf;
+ const char *wpend_buf;
/* used during startup, digest all incoming/outgoing packets */
EVP_MD_CTX finish_dgst1;
int key_block_length;
unsigned char *key_block;
- EVP_CIPHER *new_sym_enc;
- EVP_MD *new_hash;
+ const EVP_CIPHER *new_sym_enc;
+ const EVP_MD *new_hash;
#ifdef HEADER_COMP_H
- SSL_COMP *new_compression;
+ const SSL_COMP *new_compression;
#else
char *new_compression;
#endif
#define SSL_ENC_NULL_IDX 6
#define SSL_ENC_NUM_IDX 7
-static EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX]={
+static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX]={
NULL,NULL,NULL,NULL,NULL,NULL,
};
#define SSL_MD_MD5_IDX 0
#define SSL_MD_SHA1_IDX 1
#define SSL_MD_NUM_IDX 2
-static EVP_MD *ssl_digest_methods[SSL_MD_NUM_IDX]={
+static const EVP_MD *ssl_digest_methods[SSL_MD_NUM_IDX]={
NULL,NULL,
};
int ssl_cipher_get_evp(s,enc,md,comp)
SSL_SESSION *s;
-EVP_CIPHER **enc;
-EVP_MD **md;
+const EVP_CIPHER **enc;
+const EVP_MD **md;
SSL_COMP **comp;
{
int i;
}
/* return the actual cipher being used */
-char *SSL_CIPHER_get_name(c)
+const char *SSL_CIPHER_get_name(c)
SSL_CIPHER *c;
{
if (c != NULL)
int *alg_bits;
{
int ret=0,a=0;
- EVP_CIPHER *enc;
- EVP_MD *md;
+ const EVP_CIPHER *enc;
+ const EVP_MD *md;
SSL_SESSION ss;
if (c != NULL)
}
/** The old interface to get the same thing as SSL_get_ciphers() */
-char *SSL_get_cipher_list(SSL *s,int n)
+const char *SSL_get_cipher_list(SSL *s,int n)
{
SSL_CIPHER *c;
STACK_OF(SSL_CIPHER) *sk;
/* works well for SSLv2, not so good for SSLv3 */
char *SSL_get_shared_ciphers(SSL *s,char *buf,int len)
{
- char *p,*cp;
+ char *p;
+ const char *cp;
STACK_OF(SSL_CIPHER) *sk;
SSL_CIPHER *c;
int i;
STACK_OF(SSL_CIPHER) **sorted,
char *str);
void ssl_update_cache(SSL *s, int mode);
-int ssl_cipher_get_evp(SSL_SESSION *s, EVP_CIPHER **enc, EVP_MD **md,
- SSL_COMP **comp);
+int ssl_cipher_get_evp(SSL_SESSION *s,const EVP_CIPHER **enc,const EVP_MD **md,
+ SSL_COMP **comp);
int ssl_verify_cert_chain(SSL *s,STACK_OF(X509) *sk);
int ssl_undefined_function(SSL *s);
X509 *ssl_get_server_send_cert(SSL *);
int ssl3_dispatch_alert(SSL *s);
int ssl3_read_bytes(SSL *s, int type, char *buf, int len);
int ssl3_part_read(SSL *s, int i);
-int ssl3_write_bytes(SSL *s, int type, char *buf, int len);
+int ssl3_write_bytes(SSL *s, int type, const char *buf, int len);
int ssl3_final_finish_mac(SSL *s, EVP_MD_CTX *ctx1,EVP_MD_CTX *ctx2,
unsigned char *sender, int slen,unsigned char *p);
int ssl3_cert_verify_mac(SSL *s, EVP_MD_CTX *in, unsigned char *p);
-void ssl3_finish_mac(SSL *s, unsigned char *buf, int len);
+void ssl3_finish_mac(SSL *s, const unsigned char *buf, int len);
int ssl3_enc(SSL *s, int send_data);
int ssl3_mac(SSL *ssl, unsigned char *md, int send_data);
unsigned long ssl3_output_cert_chain(SSL *s, X509 *x);
unsigned char *ms,*key,*iv,*er1,*er2;
int client_write;
EVP_CIPHER_CTX *dd;
- EVP_CIPHER *c;
- SSL_COMP *comp;
- EVP_MD *m;
+ const EVP_CIPHER *c;
+ const SSL_COMP *comp;
+ const EVP_MD *m;
int _exp,n,i,j,k,exp_label_len,cl;
_exp=SSL_C_IS_EXPORT(s->s3->tmp.new_cipher);
SSL *s;
{
unsigned char *p1,*p2;
- EVP_CIPHER *c;
- EVP_MD *hash;
+ const EVP_CIPHER *c;
+ const EVP_MD *hash;
int num;
SSL_COMP *comp;
EVP_CIPHER_CTX *ds;
unsigned long l;
int bs,i,ii,j,k,n=0;
- EVP_CIPHER *enc;
+ const EVP_CIPHER *enc;
if (send)
{
{
SSL3_RECORD *rec;
unsigned char *mac_sec,*seq;
- EVP_MD *hash;
+ const EVP_MD *hash;
unsigned int md_size;
int i;
HMAC_CTX hmac;