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/ssl_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/ssl_lib.c')
-rw-r--r-- | ssl/ssl_lib.c | 40 |
1 files changed, 36 insertions, 4 deletions
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) |