Move the registration of callback functions to special functions
designed for that. This removes the potential error to mix data and function pointers. Please note that I'm a little unsure how incorrect calls to the old ctrl functions should be handled, in som cases. I currently return 0 and that's it, but it may be more correct to generate a genuine error in those cases.
This commit is contained in:
13
ssl/s2_lib.c
13
ssl/s2_lib.c
@@ -230,6 +230,9 @@ static SSL_METHOD SSLv2_data= {
|
||||
ssl_bad_method,
|
||||
ssl2_default_timeout,
|
||||
&ssl3_undef_enc_method,
|
||||
ssl_undefined_function,
|
||||
ssl2_callback_ctrl, /* local */
|
||||
ssl2_ctx_callback_ctrl, /* local */
|
||||
};
|
||||
|
||||
static long ssl2_default_timeout(void)
|
||||
@@ -335,11 +338,21 @@ long ssl2_ctrl(SSL *s, int cmd, long larg, char *parg)
|
||||
return(ret);
|
||||
}
|
||||
|
||||
long ssl2_callback_ctrl(SSL *s, int cmd, void (*fp)())
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
long ssl2_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
long ssl2_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)())
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* This function needs to check if the ciphers required are actually
|
||||
* available */
|
||||
SSL_CIPHER *ssl2_get_cipher_by_char(const unsigned char *p)
|
||||
|
Reference in New Issue
Block a user