From 8481f583d3aebd7383ba5824bfbe854242231e1b Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 26 Oct 2015 11:54:17 +0000 Subject: [PATCH] Add ossl_statem prefix to various functions Add the ossl_statem prefix to various funtions to avoid name clashes. Reviewed-by: Tim Hudson Reviewed-by: Richard Levitte --- ssl/statem/statem.c | 32 ++++++++++++++++---------------- ssl/statem/statem_clnt.c | 24 ++++++++++++------------ ssl/statem/statem_locl.h | 32 ++++++++++++++++---------------- ssl/statem/statem_srvr.c | 16 ++++++++-------- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c index 24efd03043..3a44846e5c 100644 --- a/ssl/statem/statem.c +++ b/ssl/statem/statem.c @@ -533,15 +533,15 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) { cb = get_callback(s); if(s->server) { - transition = server_read_transition; - process_message = server_process_message; - max_message_size = server_max_message_size; - post_process_message = server_post_process_message; + transition = ossl_statem_server_read_transition; + process_message = ossl_statem_server_process_message; + max_message_size = ossl_statem_server_max_message_size; + post_process_message = ossl_statem_server_post_process_message; } else { - transition = client_read_transition; - process_message = client_process_message; - max_message_size = client_max_message_size; - post_process_message = client_post_process_message; + transition = ossl_statem_client_read_transition; + process_message = ossl_statem_client_process_message; + max_message_size = ossl_statem_client_max_message_size; + post_process_message = ossl_statem_client_post_process_message; } if (st->read_state_first_init) { @@ -730,15 +730,15 @@ static SUB_STATE_RETURN write_state_machine(SSL *s) cb = get_callback(s); if(s->server) { - transition = server_write_transition; - pre_work = server_pre_work; - post_work = server_post_work; - construct_message = server_construct_message; + transition = ossl_statem_server_write_transition; + pre_work = ossl_statem_server_pre_work; + post_work = ossl_statem_server_post_work; + construct_message = ossl_statem_server_construct_message; } else { - transition = client_write_transition; - pre_work = client_pre_work; - post_work = client_post_work; - construct_message = client_construct_message; + transition = ossl_statem_client_write_transition; + pre_work = ossl_statem_client_pre_work; + post_work = ossl_statem_client_post_work; + construct_message = ossl_statem_client_construct_message; } while(1) { diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index 1218b19efd..b4c9a59b14 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -238,16 +238,16 @@ static int key_exchange_expected(SSL *s) } /* - * client_read_transition() encapsulates the logic for the allowed handshake - * state transitions when the client is reading messages from the server. The - * message type that the server has sent is provided in |mt|. The current state - * is in |s->statem.hand_state|. + * ossl_statem_client_read_transition() encapsulates the logic for the allowed + * handshake state transitions when the client is reading messages from the + * server. The message type that the server has sent is provided in |mt|. The + * current state is in |s->statem.hand_state|. * * Return values are: * 1: Success (transition allowed) * 0: Error (transition not allowed) */ -int client_read_transition(SSL *s, int mt) +int ossl_statem_client_read_transition(SSL *s, int mt) { OSSL_STATEM *st = &s->statem; int ske_expected; @@ -391,7 +391,7 @@ int client_read_transition(SSL *s, int mt) * client_write_transition() works out what handshake state to move to next * when the client is writing messages to be sent to the server. */ -WRITE_TRAN client_write_transition(SSL *s) +WRITE_TRAN ossl_statem_client_write_transition(SSL *s) { OSSL_STATEM *st = &s->statem; @@ -495,7 +495,7 @@ WRITE_TRAN client_write_transition(SSL *s) * Perform any pre work that needs to be done prior to sending a message from * the client to the server. */ -WORK_STATE client_pre_work(SSL *s, WORK_STATE wst) +WORK_STATE ossl_statem_client_pre_work(SSL *s, WORK_STATE wst) { OSSL_STATEM *st = &s->statem; @@ -542,7 +542,7 @@ WORK_STATE client_pre_work(SSL *s, WORK_STATE wst) * Perform any work that needs to be done after sending a message from the * client to the server. */ -WORK_STATE client_post_work(SSL *s, WORK_STATE wst) +WORK_STATE ossl_statem_client_post_work(SSL *s, WORK_STATE wst) { OSSL_STATEM *st = &s->statem; @@ -641,7 +641,7 @@ WORK_STATE client_post_work(SSL *s, WORK_STATE wst) * 1: Success * 0: Error */ -int client_construct_message(SSL *s) +int ossl_statem_client_construct_message(SSL *s) { OSSL_STATEM *st = &s->statem; @@ -687,7 +687,7 @@ int client_construct_message(SSL *s) * Returns the maximum allowed length for the current message that we are * reading. Excludes the message header. */ -unsigned long client_max_message_size(SSL *s) +unsigned long ossl_statem_client_max_message_size(SSL *s) { OSSL_STATEM *st = &s->statem; @@ -733,7 +733,7 @@ unsigned long client_max_message_size(SSL *s) /* * Process a message that the client has been received from the server. */ -MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt) +MSG_PROCESS_RETURN ossl_statem_client_process_message(SSL *s, PACKET *pkt) { OSSL_STATEM *st = &s->statem; @@ -780,7 +780,7 @@ MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt) * Perform any further processing required following the receipt of a message * from the server */ -WORK_STATE client_post_process_message(SSL *s, WORK_STATE wst) +WORK_STATE ossl_statem_client_post_process_message(SSL *s, WORK_STATE wst) { OSSL_STATEM *st = &s->statem; diff --git a/ssl/statem/statem_locl.h b/ssl/statem/statem_locl.h index 93fed35340..4c3d797623 100644 --- a/ssl/statem/statem_locl.h +++ b/ssl/statem/statem_locl.h @@ -92,26 +92,26 @@ int statem_flush(SSL *s); /* * TLS/DTLS client state machine functions */ -int client_read_transition(SSL *s, int mt); -WRITE_TRAN client_write_transition(SSL *s); -WORK_STATE client_pre_work(SSL *s, WORK_STATE wst); -WORK_STATE client_post_work(SSL *s, WORK_STATE wst); -int client_construct_message(SSL *s); -unsigned long client_max_message_size(SSL *s); -MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt); -WORK_STATE client_post_process_message(SSL *s, WORK_STATE wst); +int ossl_statem_client_read_transition(SSL *s, int mt); +WRITE_TRAN ossl_statem_client_write_transition(SSL *s); +WORK_STATE ossl_statem_client_pre_work(SSL *s, WORK_STATE wst); +WORK_STATE ossl_statem_client_post_work(SSL *s, WORK_STATE wst); +int ossl_statem_client_construct_message(SSL *s); +unsigned long ossl_statem_client_max_message_size(SSL *s); +MSG_PROCESS_RETURN ossl_statem_client_process_message(SSL *s, PACKET *pkt); +WORK_STATE ossl_statem_client_post_process_message(SSL *s, WORK_STATE wst); /* * TLS/DTLS server state machine functions */ -int server_read_transition(SSL *s, int mt); -WRITE_TRAN server_write_transition(SSL *s); -WORK_STATE server_pre_work(SSL *s, WORK_STATE wst); -WORK_STATE server_post_work(SSL *s, WORK_STATE wst); -int server_construct_message(SSL *s); -unsigned long server_max_message_size(SSL *s); -MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt); -WORK_STATE server_post_process_message(SSL *s, WORK_STATE wst); +int ossl_statem_server_read_transition(SSL *s, int mt); +WRITE_TRAN ossl_statem_server_write_transition(SSL *s); +WORK_STATE ossl_statem_server_pre_work(SSL *s, WORK_STATE wst); +WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst); +int ossl_statem_server_construct_message(SSL *s); +unsigned long ossl_statem_server_max_message_size(SSL *s); +MSG_PROCESS_RETURN ossl_statem_server_process_message(SSL *s, PACKET *pkt); +WORK_STATE ossl_statem_server_post_process_message(SSL *s, WORK_STATE wst); /* Functions for getting new message data */ __owur int tls_get_message_header(SSL *s, int *mt); diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 64bbee9392..6423522efa 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -180,7 +180,7 @@ static STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s, * 1: Success (transition allowed) * 0: Error (transition not allowed) */ -int server_read_transition(SSL *s, int mt) +int ossl_statem_server_read_transition(SSL *s, int mt) { OSSL_STATEM *st = &s->statem; @@ -402,7 +402,7 @@ static inline int send_certificate_request(SSL *s) * server_write_transition() works out what handshake state to move to next * when the server is writing messages to be sent to the client. */ -WRITE_TRAN server_write_transition(SSL *s) +WRITE_TRAN ossl_statem_server_write_transition(SSL *s) { OSSL_STATEM *st = &s->statem; @@ -520,7 +520,7 @@ WRITE_TRAN server_write_transition(SSL *s) * Perform any pre work that needs to be done prior to sending a message from * the server to the client. */ -WORK_STATE server_pre_work(SSL *s, WORK_STATE wst) +WORK_STATE ossl_statem_server_pre_work(SSL *s, WORK_STATE wst) { OSSL_STATEM *st = &s->statem; @@ -599,7 +599,7 @@ WORK_STATE server_pre_work(SSL *s, WORK_STATE wst) * Perform any work that needs to be done after sending a message from the * server to the client. */ -WORK_STATE server_post_work(SSL *s, WORK_STATE wst) +WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst) { OSSL_STATEM *st = &s->statem; @@ -707,7 +707,7 @@ WORK_STATE server_post_work(SSL *s, WORK_STATE wst) * 1: Success * 0: Error */ -int server_construct_message(SSL *s) +int ossl_statem_server_construct_message(SSL *s) { OSSL_STATEM *st = &s->statem; @@ -767,7 +767,7 @@ int server_construct_message(SSL *s) * Returns the maximum allowed length for the current message that we are * reading. Excludes the message header. */ -unsigned long server_max_message_size(SSL *s) +unsigned long ossl_statem_server_max_message_size(SSL *s) { OSSL_STATEM *st = &s->statem; @@ -806,7 +806,7 @@ unsigned long server_max_message_size(SSL *s) /* * Process a message that the server has received from the client. */ -MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt) +MSG_PROCESS_RETURN ossl_statem_server_process_message(SSL *s, PACKET *pkt) { OSSL_STATEM *st = &s->statem; @@ -846,7 +846,7 @@ MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt) * Perform any further processing required following the receipt of a message * from the client */ -WORK_STATE server_post_process_message(SSL *s, WORK_STATE wst) +WORK_STATE ossl_statem_server_post_process_message(SSL *s, WORK_STATE wst) { OSSL_STATEM *st = &s->statem; -- 2.40.0