More evil cast removal.

This commit is contained in:
Ben Laurie 1999-06-03 18:04:04 +00:00
parent 213a75dbf2
commit b4f76582d4
11 changed files with 25 additions and 22 deletions

View File

@ -5,6 +5,9 @@
Changes between 0.9.3a and 0.9.4 Changes between 0.9.3a and 0.9.4
*) Make callbacks for key generation use void * instead of char *.
[Ben Laurie]
*) Make S/MIME samples compile (not yet tested). *) Make S/MIME samples compile (not yet tested).
[Ben Laurie] [Ben Laurie]

View File

@ -74,7 +74,7 @@
#undef PROG #undef PROG
#define PROG gendh_main #define PROG gendh_main
static void MS_CALLBACK dh_cb(int p, int n, char *arg); static void MS_CALLBACK dh_cb(int p, int n, void *arg);
static long dh_load_rand(char *names); static long dh_load_rand(char *names);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
@ -164,7 +164,7 @@ bad:
BIO_printf(bio_err,"Generating DH parameters, %d bit long strong prime, generator of %d\n",num,g); BIO_printf(bio_err,"Generating DH parameters, %d bit long strong prime, generator of %d\n",num,g);
BIO_printf(bio_err,"This is going to take a long time\n"); BIO_printf(bio_err,"This is going to take a long time\n");
dh=DH_generate_parameters(num,g,dh_cb,(char *)bio_err); dh=DH_generate_parameters(num,g,dh_cb,bio_err);
if (dh == NULL) goto end; if (dh == NULL) goto end;
@ -184,7 +184,7 @@ end:
EXIT(ret); EXIT(ret);
} }
static void MS_CALLBACK dh_cb(int p, int n, char *arg) static void MS_CALLBACK dh_cb(int p, int n, void *arg)
{ {
char c='*'; char c='*';

View File

@ -75,7 +75,7 @@
#undef PROG #undef PROG
#define PROG genrsa_main #define PROG genrsa_main
static void MS_CALLBACK genrsa_cb(int p, int n, char *arg); static void MS_CALLBACK genrsa_cb(int p, int n, void *arg);
static long gr_load_rand(char *names); static long gr_load_rand(char *names);
int MAIN(int argc, char **argv) int MAIN(int argc, char **argv)
{ {
@ -194,7 +194,7 @@ bad:
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
num); num);
rsa=RSA_generate_key(num,f4,genrsa_cb,(char *)bio_err); rsa=RSA_generate_key(num,f4,genrsa_cb,bio_err);
if (randfile == NULL) if (randfile == NULL)
BIO_printf(bio_err,"unable to write 'random state'\n"); BIO_printf(bio_err,"unable to write 'random state'\n");
@ -227,7 +227,7 @@ err:
EXIT(ret); EXIT(ret);
} }
static void MS_CALLBACK genrsa_cb(int p, int n, char *arg) static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
{ {
char c='*'; char c='*';

View File

@ -113,7 +113,7 @@ static int add_attribute_object(STACK_OF(X509_ATTRIBUTE) *n, char *text,
int max); int max);
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value, static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
int nid,int min,int max); int nid,int min,int max);
static void MS_CALLBACK req_cb(int p,int n,char *arg); static void MS_CALLBACK req_cb(int p,int n,void *arg);
static int req_fix_data(int nid,int *type,int len,int min,int max); static int req_fix_data(int nid,int *type,int len,int min,int max);
static int check_end(char *str, char *end); static int check_end(char *str, char *end);
static int add_oid_section(LHASH *conf); static int add_oid_section(LHASH *conf);
@ -513,7 +513,7 @@ bad:
{ {
if (!EVP_PKEY_assign_RSA(pkey, if (!EVP_PKEY_assign_RSA(pkey,
RSA_generate_key(newkey,0x10001, RSA_generate_key(newkey,0x10001,
req_cb,(char *)bio_err))) req_cb,bio_err)))
goto end; goto end;
} }
else else
@ -1111,7 +1111,7 @@ err:
return(0); return(0);
} }
static void MS_CALLBACK req_cb(int p, int n, char *arg) static void MS_CALLBACK req_cb(int p, int n, void *arg)
{ {
char c='*'; char c='*';

View File

@ -381,9 +381,9 @@ int BN_dec2bn(BIGNUM **a,char *str);
int BN_gcd(BIGNUM *r,BIGNUM *in_a,BIGNUM *in_b,BN_CTX *ctx); int BN_gcd(BIGNUM *r,BIGNUM *in_a,BIGNUM *in_b,BN_CTX *ctx);
BIGNUM *BN_mod_inverse(BIGNUM *ret,BIGNUM *a, BIGNUM *n,BN_CTX *ctx); BIGNUM *BN_mod_inverse(BIGNUM *ret,BIGNUM *a, BIGNUM *n,BN_CTX *ctx);
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int strong,BIGNUM *add, BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int strong,BIGNUM *add,
BIGNUM *rem,void (*callback)(int,int,char *),char *cb_arg); BIGNUM *rem,void (*callback)(int,int,void *),void *cb_arg);
int BN_is_prime(BIGNUM *p,int nchecks,void (*callback)(int,int,char *), int BN_is_prime(BIGNUM *p,int nchecks,void (*callback)(int,int,void *),
BN_CTX *ctx,char *cb_arg); BN_CTX *ctx,void *cb_arg);
void ERR_load_BN_strings(void ); void ERR_load_BN_strings(void );
BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w); BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w);

View File

@ -76,7 +76,7 @@ static int probable_prime_dh(BIGNUM *rnd, int bits,
static int probable_prime_dh_strong(BIGNUM *rnd, int bits, static int probable_prime_dh_strong(BIGNUM *rnd, int bits,
BIGNUM *add, BIGNUM *rem, BN_CTX *ctx); BIGNUM *add, BIGNUM *rem, BN_CTX *ctx);
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int strong, BIGNUM *add, BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int strong, BIGNUM *add,
BIGNUM *rem, void (*callback)(int,int,char *), char *cb_arg) BIGNUM *rem, void (*callback)(int,int,void *), void *cb_arg)
{ {
BIGNUM *rnd=NULL; BIGNUM *rnd=NULL;
BIGNUM t; BIGNUM t;
@ -151,8 +151,8 @@ err:
return(ret); return(ret);
} }
int BN_is_prime(BIGNUM *a, int checks, void (*callback)(int,int,char *), int BN_is_prime(BIGNUM *a, int checks, void (*callback)(int,int,void *),
BN_CTX *ctx_passed, char *cb_arg) BN_CTX *ctx_passed, void *cb_arg)
{ {
int i,j,c2=0,ret= -1; int i,j,c2=0,ret= -1;
BIGNUM *check; BIGNUM *check;

View File

@ -112,7 +112,7 @@ DH * DH_new(void);
void DH_free(DH *dh); void DH_free(DH *dh);
int DH_size(DH *dh); int DH_size(DH *dh);
DH * DH_generate_parameters(int prime_len,int generator, DH * DH_generate_parameters(int prime_len,int generator,
void (*callback)(int,int,char *),char *cb_arg); void (*callback)(int,int,void *),void *cb_arg);
int DH_check(DH *dh,int *codes); int DH_check(DH *dh,int *codes);
int DH_generate_key(DH *dh); int DH_generate_key(DH *dh);
int DH_compute_key(unsigned char *key,BIGNUM *pub_key,DH *dh); int DH_compute_key(unsigned char *key,BIGNUM *pub_key,DH *dh);

View File

@ -84,7 +84,7 @@
*/ */
DH *DH_generate_parameters(int prime_len, int generator, DH *DH_generate_parameters(int prime_len, int generator,
void (*callback)(int,int,char *), char *cb_arg) void (*callback)(int,int,void *), void *cb_arg)
{ {
BIGNUM *p=NULL,*t1,*t2; BIGNUM *p=NULL,*t1,*t2;
DH *ret=NULL; DH *ret=NULL;

View File

@ -81,7 +81,7 @@ int main(int argc, char *argv[])
#define MS_CALLBACK #define MS_CALLBACK
#endif #endif
static void MS_CALLBACK cb(int p, int n, char *arg); static void MS_CALLBACK cb(int p, int n, void *arg);
#ifdef NO_STDIO #ifdef NO_STDIO
#define APPS_WIN16 #define APPS_WIN16
#include "bss_file.c" #include "bss_file.c"
@ -104,7 +104,7 @@ int main(int argc, char *argv[])
if (out == NULL) exit(1); if (out == NULL) exit(1);
BIO_set_fp(out,stdout,BIO_NOCLOSE); BIO_set_fp(out,stdout,BIO_NOCLOSE);
a=DH_generate_parameters(64,DH_GENERATOR_5,cb,(char *)out); a=DH_generate_parameters(64,DH_GENERATOR_5,cb,out);
if (a == NULL) goto err; if (a == NULL) goto err;
BIO_puts(out,"\np ="); BIO_puts(out,"\np =");
@ -171,7 +171,7 @@ err:
return(ret); return(ret);
} }
static void MS_CALLBACK cb(int p, int n, char *arg) static void MS_CALLBACK cb(int p, int n, void *arg)
{ {
char c='*'; char c='*';

View File

@ -145,7 +145,7 @@ RSA * RSA_new(void);
RSA * RSA_new_method(RSA_METHOD *method); RSA * RSA_new_method(RSA_METHOD *method);
int RSA_size(RSA *); int RSA_size(RSA *);
RSA * RSA_generate_key(int bits, unsigned long e,void RSA * RSA_generate_key(int bits, unsigned long e,void
(*callback)(int,int,char *),char *cb_arg); (*callback)(int,int,void *),void *cb_arg);
/* next 4 return -1 on error */ /* next 4 return -1 on error */
int RSA_public_encrypt(int flen, unsigned char *from, int RSA_public_encrypt(int flen, unsigned char *from,
unsigned char *to, RSA *rsa,int padding); unsigned char *to, RSA *rsa,int padding);

View File

@ -63,7 +63,7 @@
#include <openssl/rsa.h> #include <openssl/rsa.h>
RSA *RSA_generate_key(int bits, unsigned long e_value, RSA *RSA_generate_key(int bits, unsigned long e_value,
void (*callback)(int,int,char *), char *cb_arg) void (*callback)(int,int,void *), void *cb_arg)
{ {
RSA *rsa=NULL; RSA *rsa=NULL;
BIGNUM *r0=NULL,*r1=NULL,*r2=NULL,*r3=NULL,*tmp; BIGNUM *r0=NULL,*r1=NULL,*r2=NULL,*r3=NULL,*tmp;