Add the ossl_statem prefix to various funtions to avoid name clashes.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
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) {
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) {
}
/*
- * 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;
* 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;
* 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;
* 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;
* 1: Success
* 0: Error
*/
-int client_construct_message(SSL *s)
+int ossl_statem_client_construct_message(SSL *s)
{
OSSL_STATEM *st = &s->statem;
* 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;
/*
* 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;
* 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;
/*
* 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);
* 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;
* 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;
* 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;
* 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;
* 1: Success
* 0: Error
*/
-int server_construct_message(SSL *s)
+int ossl_statem_server_construct_message(SSL *s)
{
OSSL_STATEM *st = &s->statem;
* 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;
/*
* 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;
* 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;