summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-01-18 09:30:51 +0000
committerRichard Levitte <levitte@openssl.org>2000-01-18 09:30:51 +0000
commita9188d4e173304948c7711566556602bfb3ee32f (patch)
treee9b4a390ef9692cc6212c8f1ae60a82cc8854f33 /ssl
parentea5e7bcf632bba51618ab9407409b24cc4df8fa0 (diff)
Compaq C 6.2 for VMS will complain when we want to convert
non-function pointers to function pointers and vice versa. The current solution is to have unions that describe the conversion we want to do, and gives us the ability to extract the type of data we want. The current solution is a quick fix, and can probably be made in a more general or elegant way.
Diffstat (limited to 'ssl')
-rw-r--r--ssl/bio_ssl.c13
-rw-r--r--ssl/s3_lib.c40
-rw-r--r--ssl/ssl_lib.c40
3 files changed, 84 insertions, 9 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c
index f62cde4e5d..aa296996e6 100644
--- a/ssl/bio_ssl.c
+++ b/ssl/bio_ssl.c
@@ -94,6 +94,12 @@ static BIO_METHOD methods_sslp=
ssl_free,
};
+union void_fn_to_char_u
+ {
+ char *char_p;
+ void (*fn_p)();
+ };
+
BIO_METHOD *BIO_f_ssl(void)
{
return(&methods_sslp);
@@ -444,7 +450,12 @@ static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
ret=BIO_ctrl(ssl->rbio,cmd,num,ptr);
break;
case BIO_CTRL_SET_CALLBACK:
- SSL_set_info_callback(ssl,(void (*)())ptr);
+ {
+ union void_fn_to_char_u tmp_cb;
+
+ tmp_cb.char_p = ptr;
+ SSL_set_info_callback(ssl,tmp_cb.fn_p);
+ }
break;
case BIO_CTRL_GET_CALLBACK:
{
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 1ff796b71e..53e83d7757 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -462,6 +462,18 @@ static SSL_METHOD SSLv3_data= {
&SSLv3_enc_data,
};
+union rsa_fn_to_char_u
+ {
+ char *char_p;
+ RSA *(*fn_p)(SSL *, int, int);
+ };
+
+union dh_fn_to_char_u
+ {
+ char *char_p;
+ DH *(*fn_p)(SSL *, int, int);
+ };
+
static long ssl3_default_timeout(void)
{
/* 2 hours, the 24 hours mentioned in the SSLv3 spec
@@ -638,7 +650,12 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, char *parg)
}
break;
case SSL_CTRL_SET_TMP_RSA_CB:
- s->cert->rsa_tmp_cb = (RSA *(*)(SSL *, int, int))parg;
+ {
+ union rsa_fn_to_char_u rsa_tmp_cb;
+
+ rsa_tmp_cb.char_p = parg;
+ s->cert->rsa_tmp_cb = rsa_tmp_cb.fn_p;
+ }
break;
#endif
#ifndef NO_DH
@@ -665,7 +682,12 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, char *parg)
}
break;
case SSL_CTRL_SET_TMP_DH_CB:
- s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))parg;
+ {
+ union dh_fn_to_char_u dh_tmp_cb;
+
+ dh_tmp_cb.char_p = parg;
+ s->cert->dh_tmp_cb = dh_tmp_cb.fn_p;
+ }
break;
#endif
default:
@@ -721,7 +743,12 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg)
}
/* break; */
case SSL_CTRL_SET_TMP_RSA_CB:
- cert->rsa_tmp_cb=(RSA *(*)(SSL *, int, int))parg;
+ {
+ union rsa_fn_to_char_u rsa_tmp_cb;
+
+ rsa_tmp_cb.char_p = parg;
+ cert->rsa_tmp_cb = rsa_tmp_cb.fn_p;
+ }
break;
#endif
#ifndef NO_DH
@@ -748,7 +775,12 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg)
}
/*break; */
case SSL_CTRL_SET_TMP_DH_CB:
- cert->dh_tmp_cb=(DH *(*)(SSL *, int, int))parg;
+ {
+ union dh_fn_to_char_u dh_tmp_cb;
+
+ dh_tmp_cb.char_p = parg;
+ cert->dh_tmp_cb = dh_tmp_cb.fn_p;
+ }
break;
#endif
/* A Thawte special :-) */
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 3770bdf0f5..39ee0280b8 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -81,6 +81,18 @@ OPENSSL_GLOBAL SSL3_ENC_METHOD ssl3_undef_enc_method={
(int (*)(SSL *, EVP_MD_CTX *, EVP_MD_CTX *, const char*, int, unsigned char *))ssl_undefined_function
};
+union rsa_fn_to_char_u
+ {
+ char *char_p;
+ RSA *(*fn_p)(SSL *, int, int);
+ };
+
+union dh_fn_to_char_u
+ {
+ char *char_p;
+ DH *(*fn_p)(SSL *, int, int);
+ };
+
int SSL_clear(SSL *s)
{
int state;
@@ -1975,13 +1987,23 @@ int SSL_want(SSL *s)
void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,RSA *(*cb)(SSL *ssl,
int is_export,
int keylength))
- { SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA_CB,0,(char *)cb); }
+ {
+ union rsa_fn_to_char_u rsa_tmp_cb;
+
+ rsa_tmp_cb.fn_p = cb;
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA_CB,0,rsa_tmp_cb.char_p);
+ }
#endif
#ifndef NO_RSA
void SSL_set_tmp_rsa_callback(SSL *ssl,RSA *(*cb)(SSL *ssl,int is_export,
int keylength))
- { SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA_CB,0,(char *)cb); }
+ {
+ union rsa_fn_to_char_u rsa_tmp_cb;
+
+ rsa_tmp_cb.fn_p = cb;
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA_CB,0,rsa_tmp_cb.char_p);
+ }
#endif
#ifdef DOXYGEN
@@ -2008,11 +2030,21 @@ RSA *cb(SSL *ssl,int is_export,int keylength)
#ifndef NO_DH
void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,DH *(*dh)(SSL *ssl,int is_export,
int keylength))
- { SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH_CB,0,(char *)dh); }
+ {
+ union dh_fn_to_char_u dh_tmp_cb;
+
+ dh_tmp_cb.fn_p = dh;
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH_CB,0,dh_tmp_cb.char_p);
+ }
void SSL_set_tmp_dh_callback(SSL *ssl,DH *(*dh)(SSL *ssl,int is_export,
int keylength))
- { SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH_CB,0,(char *)dh); }
+ {
+ union dh_fn_to_char_u dh_tmp_cb;
+
+ dh_tmp_cb.fn_p = dh;
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH_CB,0,dh_tmp_cb.char_p);
+ }
#endif
#if defined(_WINDLL) && defined(WIN16)