diff options
author | Richard Levitte <levitte@openssl.org> | 2000-01-18 09:30:51 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-01-18 09:30:51 +0000 |
commit | a9188d4e173304948c7711566556602bfb3ee32f (patch) | |
tree | e9b4a390ef9692cc6212c8f1ae60a82cc8854f33 /ssl/s3_lib.c | |
parent | ea5e7bcf632bba51618ab9407409b24cc4df8fa0 (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/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 40 |
1 files changed, 36 insertions, 4 deletions
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 :-) */ |