diff options
author | Ben Laurie <ben@openssl.org> | 2002-01-12 15:56:13 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2002-01-12 15:56:13 +0000 |
commit | 45d87a1ffe45b668cb6a6645bdc3e21a69324a41 (patch) | |
tree | 8ae8409ca34138234bd53020665619e80b60273f /ssl | |
parent | a3feb21bbe14539160bdf66a520d669b8dff79f6 (diff) | |
download | openssl-45d87a1ffe45b668cb6a6645bdc3e21a69324a41.tar.gz |
Prototype info function.
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/bio_ssl.c | 4 | ||||
-rw-r--r-- | ssl/s23_clnt.c | 4 | ||||
-rw-r--r-- | ssl/s23_srvr.c | 2 | ||||
-rw-r--r-- | ssl/s2_clnt.c | 2 | ||||
-rw-r--r-- | ssl/s2_srvr.c | 2 | ||||
-rw-r--r-- | ssl/s3_clnt.c | 2 | ||||
-rw-r--r-- | ssl/s3_pkt.c | 4 | ||||
-rw-r--r-- | ssl/s3_srvr.c | 2 | ||||
-rw-r--r-- | ssl/ssl.h | 17 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 9 | ||||
-rw-r--r-- | ssl/ssl_stat.c | 8 |
11 files changed, 30 insertions, 26 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index 9141ec0d7b..467e149947 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c @@ -486,7 +486,9 @@ static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) { case BIO_CTRL_SET_CALLBACK: { - SSL_set_info_callback(ssl,fp); + /* FIXME: setting this via a completely different prototype + seems like a crap idea */ + SSL_set_info_callback(ssl,(void (*)(const SSL *,int,int))fp); } break; default: diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c index d74245384a..b2be8340fb 100644 --- a/ssl/s23_clnt.c +++ b/ssl/s23_clnt.c @@ -100,7 +100,7 @@ int ssl23_connect(SSL *s) { BUF_MEM *buf; unsigned long Time=time(NULL); - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type,int val)=NULL; int ret= -1; int new_state,state; @@ -440,7 +440,7 @@ static int ssl23_get_server_hello(SSL *s) (p[3] == 0) && (p[4] == 2)) { - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type,int val)=NULL; int j; /* An alert */ diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c index bcf8e51c5d..6170861705 100644 --- a/ssl/s23_srvr.c +++ b/ssl/s23_srvr.c @@ -152,7 +152,7 @@ int ssl23_accept(SSL *s) { BUF_MEM *buf; unsigned long Time=time(NULL); - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type,int val)=NULL; int ret= -1; int new_state,state; diff --git a/ssl/s2_clnt.c b/ssl/s2_clnt.c index 868a975dc9..4cb1184161 100644 --- a/ssl/s2_clnt.c +++ b/ssl/s2_clnt.c @@ -158,7 +158,7 @@ int ssl2_connect(SSL *s) unsigned long l=time(NULL); BUF_MEM *buf=NULL; int ret= -1; - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type,int val)=NULL; int new_state,state; RAND_add(&l,sizeof(l),0); diff --git a/ssl/s2_srvr.c b/ssl/s2_srvr.c index 582420bcff..56da65195e 100644 --- a/ssl/s2_srvr.c +++ b/ssl/s2_srvr.c @@ -159,7 +159,7 @@ int ssl2_accept(SSL *s) BUF_MEM *buf=NULL; int ret= -1; long num1; - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type,int val)=NULL; int new_state,state; RAND_add(&l,sizeof(l),0); diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index c3be69b928..27bc16eb6b 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -106,7 +106,7 @@ int ssl3_connect(SSL *s) BUF_MEM *buf; unsigned long Time=time(NULL),l; long num1; - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type,int val)=NULL; int ret= -1; int new_state,state,skip=0;; diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index ec4b665939..616698f70a 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -730,7 +730,7 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) int al,i,j,ret; unsigned int n; SSL3_RECORD *rr; - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type2,int val)=NULL; if (s->s3->rbuf.buf == NULL) /* Not initialized yet */ if (!ssl3_setup_buffers(s)) @@ -1207,7 +1207,7 @@ void ssl3_send_alert(SSL *s, int level, int desc) int ssl3_dispatch_alert(SSL *s) { int i,j; - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type,int val)=NULL; s->s3->alert_dispatch=0; i=do_ssl3_write(s,SSL3_RT_ALERT,&s->s3->send_alert[0],2); diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 72a73cd9d0..3ef6eeeb71 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -164,7 +164,7 @@ int ssl3_accept(SSL *s) { BUF_MEM *buf; unsigned long l,Time=time(NULL); - void (*cb)()=NULL; + void (*cb)(const SSL *ssl,int type,int val)=NULL; long num1; int ret= -1; int new_state,state,skip=0; @@ -578,7 +578,7 @@ struct ssl_ctx_st /* Default values used when no per-SSL value is defined follow */ - void (*info_callback)(); /* used if SSL's info_callback is NULL */ + void (*info_callback)(const SSL *ssl,int type,int val); /* used if SSL's info_callback is NULL */ /* what we put in client cert requests */ STACK_OF(X509_NAME) *client_CA; @@ -794,7 +794,7 @@ struct ssl_st int verify_depth; int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */ - void (*info_callback)(); /* optional informational callback */ + void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */ int error; /* error bytes to be written */ int error_code; /* actual code */ @@ -1135,10 +1135,10 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, #endif void SSL_load_error_strings(void ); -const char *SSL_state_string(SSL *s); -const char *SSL_rstate_string(SSL *s); -const char *SSL_state_string_long(SSL *s); -const char *SSL_rstate_string_long(SSL *s); +const char *SSL_state_string(const SSL *s); +const char *SSL_rstate_string(const SSL *s); +const char *SSL_state_string_long(const SSL *s); +const char *SSL_rstate_string_long(const SSL *s); long SSL_SESSION_get_time(SSL_SESSION *s); long SSL_SESSION_set_time(SSL_SESSION *s, long t); long SSL_SESSION_get_timeout(SSL_SESSION *s); @@ -1289,8 +1289,9 @@ int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, SSL_SESSION *SSL_get_session(SSL *ssl); SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */ SSL_CTX *SSL_get_SSL_CTX(SSL *ssl); -void SSL_set_info_callback(SSL *ssl,void (*cb)()); -void (*SSL_get_info_callback(SSL *ssl))(); +void SSL_set_info_callback(SSL *ssl, + void (*cb)(const SSL *ssl,int type,int val)); +void (*SSL_get_info_callback(SSL *ssl))(const SSL *ssl,int type,int val); int SSL_state(SSL *ssl); void SSL_set_verify_result(SSL *ssl,long v); diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 72821a1fce..2bd30d91f0 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1313,7 +1313,7 @@ SSL_CTX *SSL_CTX_new(SSL_METHOD *meth) ret->key_arg=NULL; ret->s2->conn_id=NULL; */ - ret->info_callback=0; + ret->info_callback=NULL; ret->app_verify_callback=0; ret->app_verify_arg=NULL; @@ -2136,14 +2136,15 @@ int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, } #endif -void SSL_set_info_callback(SSL *ssl,void (*cb)()) +void SSL_set_info_callback(SSL *ssl, + void (*cb)(const SSL *ssl,int type,int val)) { ssl->info_callback=cb; } -void (*SSL_get_info_callback(SSL *ssl))(void) +void (*SSL_get_info_callback(SSL *ssl))(const SSL *ssl,int type,int val) { - return((void (*)())ssl->info_callback); + return ssl->info_callback; } int SSL_state(SSL *ssl) diff --git a/ssl/ssl_stat.c b/ssl/ssl_stat.c index 963a502678..b16d253081 100644 --- a/ssl/ssl_stat.c +++ b/ssl/ssl_stat.c @@ -59,7 +59,7 @@ #include <stdio.h> #include "ssl_locl.h" -const char *SSL_state_string_long(SSL *s) +const char *SSL_state_string_long(const SSL *s) { const char *str; @@ -199,7 +199,7 @@ default: str="unknown state"; break; return(str); } -const char *SSL_rstate_string_long(SSL *s) +const char *SSL_rstate_string_long(const SSL *s) { const char *str; @@ -213,7 +213,7 @@ const char *SSL_rstate_string_long(SSL *s) return(str); } -const char *SSL_state_string(SSL *s) +const char *SSL_state_string(const SSL *s) { const char *str; @@ -487,7 +487,7 @@ const char *SSL_alert_desc_string_long(int value) return(str); } -const char *SSL_rstate_string(SSL *s) +const char *SSL_rstate_string(const SSL *s) { const char *str; |