Commit 13083215 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Fixes for Win32 build.

This is mostly a work around for the old VC++ problem
that it treats func() as func(void).

Various prototypes had been added to 'compare' function
pointers that triggered this. This could be fixed by removing
the prototype, adding function pointer casts to every call or
changing the passed function to use the expected arguments.
I mostly did the latter.

The mkdef.pl script was modified to remove the typesafe
functions which no longer exist.

Oh and some functions called OPENSSL_freeLibrary() were
changed back to FreeLibrary(), wonder how that happened :-)
parent 7ef82068
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4,6 +4,12 @@

 Changes between 0.9.5a and 0.9.6  [xx XXX 2000]

  *) Patches to make OpenSSL compile under Win32 again. Mostly
     work arounds for the VC++ problem that it treats func() as
     func(void). Also stripped out the parts of mkdef.pl that
     added extra typesafe functions: these no longer exist.
     [Steve Henson]

  *) Reorganisation of the stack code. The macros are now all 
     collected in safestack.h . Each macro is defined in terms of
     a "stack macro" of the form SKM_<name>(type, a, b). The 
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ SetBlob
        }

STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
	     char *(*func)(), void (*free_func)(), int ex_tag, int ex_class)
	     char *(*func)(), void (*free_func)(void *), int ex_tag, int ex_class)
	{
	ASN1_CTX c;
	STACK *ret=NULL;
+5 −4
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;
static void st_free(ASN1_STRING_TABLE *tbl);
static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
			const ASN1_STRING_TABLE * const *b);
static int table_cmp(ASN1_STRING_TABLE *a, ASN1_STRING_TABLE *b);
static int table_cmp(const void *a, const void *b);


/* This is the global mask for the mbstring functions: this is use to
@@ -180,9 +180,10 @@ static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
	return (*a)->nid - (*b)->nid;
}

static int table_cmp(ASN1_STRING_TABLE *a, ASN1_STRING_TABLE *b)
static int table_cmp(const void *a, const void *b)
{
	return a->nid - b->nid;
	const ASN1_STRING_TABLE *sa = a, *sb = b;
	return sa->nid - sb->nid;
}

ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid)
@@ -194,7 +195,7 @@ ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid)
	ttmp = (ASN1_STRING_TABLE *) OBJ_bsearch((char *)&fnd,
					(char *)tbl_standard, 
			sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE),
			sizeof(ASN1_STRING_TABLE), (int(*)())table_cmp);
			sizeof(ASN1_STRING_TABLE), table_cmp);
	if(ttmp) return ttmp;
	if(!stable) return NULL;
	idx = sk_ASN1_STRING_TABLE_find(stable, &fnd);
+2 −2
Original line number Diff line number Diff line
@@ -658,7 +658,7 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t);
int		i2d_ASN1_SET(STACK *a, unsigned char **pp,
			int (*func)(), int ex_tag, int ex_class, int is_set);
STACK *		d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
			char *(*func)(), void (*free_func)(),
			char *(*func)(), void (*free_func)(void *),
			int ex_tag, int ex_class);

#ifndef NO_BIO
@@ -753,7 +753,7 @@ int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
	unsigned char *data, int max_len);

STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
						 void (*free_func)() ); 
						 void (*free_func)(void *) ); 
unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
			     int *len );
void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)());
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
/* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */

STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
	     void (*free_func)())
	     void (*free_func)(void *))
{
    STACK *sk;
    unsigned char *pbuf;
Loading