Convert enums to typedefs

Various enums were introduced as part of the state machine rewrite. As a
matter of style it is preferred for these to be typedefs.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Matt Caswell 2015-10-26 11:46:33 +00:00
parent 3616bb6358
commit be3583fa40
7 changed files with 83 additions and 94 deletions

View File

@ -525,8 +525,8 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) {
unsigned long len = 0; unsigned long len = 0;
int (*transition)(SSL *s, int mt); int (*transition)(SSL *s, int mt);
PACKET pkt; PACKET pkt;
enum MSG_PROCESS_RETURN (*process_message)(SSL *s, PACKET *pkt); MSG_PROCESS_RETURN (*process_message)(SSL *s, PACKET *pkt);
enum WORK_STATE (*post_process_message)(SSL *s, enum WORK_STATE wst); WORK_STATE (*post_process_message)(SSL *s, WORK_STATE wst);
unsigned long (*max_message_size)(SSL *s); unsigned long (*max_message_size)(SSL *s);
void (*cb) (const SSL *ssl, int type, int val) = NULL; void (*cb) (const SSL *ssl, int type, int val) = NULL;
@ -721,9 +721,9 @@ static SUB_STATE_RETURN write_state_machine(SSL *s)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
int ret; int ret;
enum WRITE_TRAN (*transition)(SSL *s); WRITE_TRAN (*transition)(SSL *s);
enum WORK_STATE (*pre_work)(SSL *s, enum WORK_STATE wst); WORK_STATE (*pre_work)(SSL *s, WORK_STATE wst);
enum WORK_STATE (*post_work)(SSL *s, enum WORK_STATE wst); WORK_STATE (*post_work)(SSL *s, WORK_STATE wst);
int (*construct_message)(SSL *s); int (*construct_message)(SSL *s);
void (*cb) (const SSL *ssl, int type, int val) = NULL; void (*cb) (const SSL *ssl, int type, int val) = NULL;

View File

@ -63,7 +63,7 @@
* Valid return codes used for functions performing work prior to or after * Valid return codes used for functions performing work prior to or after
* sending or receiving a message * sending or receiving a message
*/ */
enum WORK_STATE { typedef enum {
/* Something went wrong */ /* Something went wrong */
WORK_ERROR, WORK_ERROR,
/* We're done working and there shouldn't be anything else to do after */ /* We're done working and there shouldn't be anything else to do after */
@ -74,20 +74,20 @@ enum WORK_STATE {
WORK_MORE_A, WORK_MORE_A,
/* We're working on phase B */ /* We're working on phase B */
WORK_MORE_B WORK_MORE_B
}; } WORK_STATE;
/* Write transition return codes */ /* Write transition return codes */
enum WRITE_TRAN { typedef enum {
/* Something went wrong */ /* Something went wrong */
WRITE_TRAN_ERROR, WRITE_TRAN_ERROR,
/* A transition was successfully completed and we should continue */ /* A transition was successfully completed and we should continue */
WRITE_TRAN_CONTINUE, WRITE_TRAN_CONTINUE,
/* There is no more write work to be done */ /* There is no more write work to be done */
WRITE_TRAN_FINISHED WRITE_TRAN_FINISHED
}; } WRITE_TRAN;
/* Message flow states */ /* Message flow states */
enum MSG_FLOW_STATE { typedef enum {
/* No handshake in progress */ /* No handshake in progress */
MSG_FLOW_UNINITED, MSG_FLOW_UNINITED,
/* A permanent error with this connection */ /* A permanent error with this connection */
@ -100,22 +100,22 @@ enum MSG_FLOW_STATE {
MSG_FLOW_WRITING, MSG_FLOW_WRITING,
/* Handshake has finished */ /* Handshake has finished */
MSG_FLOW_FINISHED MSG_FLOW_FINISHED
}; } MSG_FLOW_STATE;
/* Read states */ /* Read states */
enum READ_STATE { typedef enum {
READ_STATE_HEADER, READ_STATE_HEADER,
READ_STATE_BODY, READ_STATE_BODY,
READ_STATE_POST_PROCESS READ_STATE_POST_PROCESS
}; } READ_STATE;
/* Write states */ /* Write states */
enum WRITE_STATE { typedef enum {
WRITE_STATE_TRANSITION, WRITE_STATE_TRANSITION,
WRITE_STATE_PRE_WORK, WRITE_STATE_PRE_WORK,
WRITE_STATE_SEND, WRITE_STATE_SEND,
WRITE_STATE_POST_WORK WRITE_STATE_POST_WORK
}; } WRITE_STATE;
/***************************************************************************** /*****************************************************************************
@ -127,11 +127,11 @@ enum WRITE_STATE {
*****************************************************************************/ *****************************************************************************/
struct ossl_statem_st { struct ossl_statem_st {
enum MSG_FLOW_STATE state; MSG_FLOW_STATE state;
enum WRITE_STATE write_state; WRITE_STATE write_state;
enum WORK_STATE write_state_work; WORK_STATE write_state_work;
enum READ_STATE read_state; READ_STATE read_state;
enum WORK_STATE read_state_work; WORK_STATE read_state_work;
OSSL_HANDSHAKE_STATE hand_state; OSSL_HANDSHAKE_STATE hand_state;
int in_init; int in_init;
int read_state_first_init; int read_state_first_init;

View File

@ -391,7 +391,7 @@ int client_read_transition(SSL *s, int mt)
* client_write_transition() works out what handshake state to move to next * client_write_transition() works out what handshake state to move to next
* when the client is writing messages to be sent to the server. * when the client is writing messages to be sent to the server.
*/ */
enum WRITE_TRAN client_write_transition(SSL *s) WRITE_TRAN client_write_transition(SSL *s)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
@ -495,7 +495,7 @@ enum WRITE_TRAN client_write_transition(SSL *s)
* Perform any pre work that needs to be done prior to sending a message from * Perform any pre work that needs to be done prior to sending a message from
* the client to the server. * the client to the server.
*/ */
enum WORK_STATE client_pre_work(SSL *s, enum WORK_STATE wst) WORK_STATE client_pre_work(SSL *s, WORK_STATE wst)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
@ -542,7 +542,7 @@ enum WORK_STATE client_pre_work(SSL *s, enum WORK_STATE wst)
* Perform any work that needs to be done after sending a message from the * Perform any work that needs to be done after sending a message from the
* client to the server. * client to the server.
*/ */
enum WORK_STATE client_post_work(SSL *s, enum WORK_STATE wst) WORK_STATE client_post_work(SSL *s, WORK_STATE wst)
{ {
OSSL_STATEM *st = &s->statem; 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. * Process a message that the client has been received from the server.
*/ */
enum MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
@ -780,7 +780,7 @@ enum MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt)
* Perform any further processing required following the receipt of a message * Perform any further processing required following the receipt of a message
* from the server * from the server
*/ */
enum WORK_STATE client_post_process_message(SSL *s, enum WORK_STATE wst) WORK_STATE client_post_process_message(SSL *s, WORK_STATE wst)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
@ -1093,7 +1093,7 @@ int tls_construct_client_hello(SSL *s)
return 0; return 0;
} }
enum MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt)
{ {
int al; int al;
unsigned int cookie_len; unsigned int cookie_len;
@ -1127,7 +1127,7 @@ enum MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt)
return MSG_PROCESS_ERROR; return MSG_PROCESS_ERROR;
} }
enum MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt)
{ {
STACK_OF(SSL_CIPHER) *sk; STACK_OF(SSL_CIPHER) *sk;
const SSL_CIPHER *c; const SSL_CIPHER *c;
@ -1467,7 +1467,7 @@ enum MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt)
return MSG_PROCESS_ERROR; return MSG_PROCESS_ERROR;
} }
enum MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt)
{ {
int al, i, ret = MSG_PROCESS_ERROR, exp_idx; int al, i, ret = MSG_PROCESS_ERROR, exp_idx;
unsigned long cert_list_len, cert_len; unsigned long cert_list_len, cert_len;
@ -1590,7 +1590,7 @@ enum MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt)
return ret; return ret;
} }
enum MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s, PACKET *pkt)
{ {
#ifndef OPENSSL_NO_RSA #ifndef OPENSSL_NO_RSA
unsigned char *q, md_buf[EVP_MAX_MD_SIZE * 2]; unsigned char *q, md_buf[EVP_MAX_MD_SIZE * 2];
@ -2045,7 +2045,7 @@ enum MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s, PACKET *pkt)
return MSG_PROCESS_ERROR; return MSG_PROCESS_ERROR;
} }
enum MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, PACKET *pkt)
{ {
int ret = MSG_PROCESS_ERROR; int ret = MSG_PROCESS_ERROR;
unsigned int list_len, ctype_num, i, name_len; unsigned int list_len, ctype_num, i, name_len;
@ -2168,7 +2168,7 @@ static int ca_dn_cmp(const X509_NAME *const *a, const X509_NAME *const *b)
return (X509_NAME_cmp(*a, *b)); return (X509_NAME_cmp(*a, *b));
} }
enum MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt)
{ {
int al; int al;
unsigned int ticklen; unsigned int ticklen;
@ -2255,7 +2255,7 @@ enum MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt)
return MSG_PROCESS_ERROR; return MSG_PROCESS_ERROR;
} }
enum MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt)
{ {
int al; int al;
unsigned long resplen; unsigned long resplen;
@ -2307,7 +2307,7 @@ enum MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt)
return MSG_PROCESS_ERROR; return MSG_PROCESS_ERROR;
} }
enum MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt)
{ {
if (PACKET_remaining(pkt) > 0) { if (PACKET_remaining(pkt) > 0) {
/* should contain no data */ /* should contain no data */
@ -3154,7 +3154,7 @@ static int ssl3_check_client_certificate(SSL *s)
return 1; return 1;
} }
enum WORK_STATE tls_prepare_client_certificate(SSL *s, enum WORK_STATE wst) WORK_STATE tls_prepare_client_certificate(SSL *s, WORK_STATE wst)
{ {
X509 *x509 = NULL; X509 *x509 = NULL;
EVP_PKEY *pkey = NULL; EVP_PKEY *pkey = NULL;

View File

@ -973,7 +973,7 @@ int dtls_construct_change_cipher_spec(SSL *s)
} }
#ifndef OPENSSL_NO_SCTP #ifndef OPENSSL_NO_SCTP
enum WORK_STATE dtls_wait_for_dry(SSL *s) WORK_STATE dtls_wait_for_dry(SSL *s)
{ {
int ret; int ret;

View File

@ -225,7 +225,7 @@ static void ssl3_take_mac(SSL *s)
} }
#endif #endif
enum MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt)
{ {
int al; int al;
long remain; long remain;
@ -292,7 +292,7 @@ enum MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt)
return MSG_PROCESS_ERROR; return MSG_PROCESS_ERROR;
} }
enum MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt)
{ {
int al, i; int al, i;
@ -370,13 +370,13 @@ unsigned long ssl3_output_cert_chain(SSL *s, CERT_PKEY *cpk)
return l + SSL_HM_HEADER_LENGTH(s); return l + SSL_HM_HEADER_LENGTH(s);
} }
enum WORK_STATE tls_finish_handshake(SSL *s, enum WORK_STATE wst) WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst)
{ {
void (*cb) (const SSL *ssl, int type, int val) = NULL; void (*cb) (const SSL *ssl, int type, int val) = NULL;
#ifndef OPENSSL_NO_SCTP #ifndef OPENSSL_NO_SCTP
if (SSL_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(s))) { if (SSL_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(s))) {
enum WORK_STATE ret; WORK_STATE ret;
ret = dtls_wait_for_dry(s); ret = dtls_wait_for_dry(s);
if (ret != WORK_FINISHED_CONTINUE) if (ret != WORK_FINISHED_CONTINUE)
return ret; return ret;

View File

@ -72,7 +72,7 @@
#define FINISHED_MAX_LENGTH 64 #define FINISHED_MAX_LENGTH 64
/* Message processing return codes */ /* Message processing return codes */
enum MSG_PROCESS_RETURN { typedef enum {
/* Something bad happened */ /* Something bad happened */
MSG_PROCESS_ERROR, MSG_PROCESS_ERROR,
/* We've finished reading - swap to writing */ /* We've finished reading - swap to writing */
@ -84,7 +84,7 @@ enum MSG_PROCESS_RETURN {
MSG_PROCESS_CONTINUE_PROCESSING, MSG_PROCESS_CONTINUE_PROCESSING,
/* We've finished this message - read the next message */ /* We've finished this message - read the next message */
MSG_PROCESS_CONTINUE_READING MSG_PROCESS_CONTINUE_READING
}; } MSG_PROCESS_RETURN;
/* Flush the write BIO */ /* Flush the write BIO */
int statem_flush(SSL *s); int statem_flush(SSL *s);
@ -93,25 +93,25 @@ int statem_flush(SSL *s);
* TLS/DTLS client state machine functions * TLS/DTLS client state machine functions
*/ */
int client_read_transition(SSL *s, int mt); int client_read_transition(SSL *s, int mt);
enum WRITE_TRAN client_write_transition(SSL *s); WRITE_TRAN client_write_transition(SSL *s);
enum WORK_STATE client_pre_work(SSL *s, enum WORK_STATE wst); WORK_STATE client_pre_work(SSL *s, WORK_STATE wst);
enum WORK_STATE client_post_work(SSL *s, enum WORK_STATE wst); WORK_STATE client_post_work(SSL *s, WORK_STATE wst);
int client_construct_message(SSL *s); int client_construct_message(SSL *s);
unsigned long client_max_message_size(SSL *s); unsigned long client_max_message_size(SSL *s);
enum MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt); MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt);
enum WORK_STATE client_post_process_message(SSL *s, enum WORK_STATE wst); WORK_STATE client_post_process_message(SSL *s, WORK_STATE wst);
/* /*
* TLS/DTLS server state machine functions * TLS/DTLS server state machine functions
*/ */
int server_read_transition(SSL *s, int mt); int server_read_transition(SSL *s, int mt);
enum WRITE_TRAN server_write_transition(SSL *s); WRITE_TRAN server_write_transition(SSL *s);
enum WORK_STATE server_pre_work(SSL *s, enum WORK_STATE wst); WORK_STATE server_pre_work(SSL *s, WORK_STATE wst);
enum WORK_STATE server_post_work(SSL *s, enum WORK_STATE wst); WORK_STATE server_post_work(SSL *s, WORK_STATE wst);
int server_construct_message(SSL *s); int server_construct_message(SSL *s);
unsigned long server_max_message_size(SSL *s); unsigned long server_max_message_size(SSL *s);
enum MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt); MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt);
enum WORK_STATE server_post_process_message(SSL *s, enum WORK_STATE wst); WORK_STATE server_post_process_message(SSL *s, WORK_STATE wst);
/* Functions for getting new message data */ /* Functions for getting new message data */
__owur int tls_get_message_header(SSL *s, int *mt); __owur int tls_get_message_header(SSL *s, int *mt);
@ -119,48 +119,41 @@ __owur int tls_get_message_body(SSL *s, unsigned long *len);
__owur int dtls_get_message(SSL *s, int *mt, unsigned long *len); __owur int dtls_get_message(SSL *s, int *mt, unsigned long *len);
/* Message construction and processing functions */ /* Message construction and processing functions */
__owur enum MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, __owur MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt);
PACKET *pkt); __owur MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt);
__owur enum MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt);
__owur int tls_construct_change_cipher_spec(SSL *s); __owur int tls_construct_change_cipher_spec(SSL *s);
__owur int dtls_construct_change_cipher_spec(SSL *s); __owur int dtls_construct_change_cipher_spec(SSL *s);
__owur int tls_construct_finished(SSL *s, const char *sender, int slen); __owur int tls_construct_finished(SSL *s, const char *sender, int slen);
__owur enum WORK_STATE tls_finish_handshake(SSL *s, enum WORK_STATE wst); __owur WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst);
__owur enum WORK_STATE dtls_wait_for_dry(SSL *s); __owur WORK_STATE dtls_wait_for_dry(SSL *s);
/* some client-only functions */ /* some client-only functions */
__owur int tls_construct_client_hello(SSL *s); __owur int tls_construct_client_hello(SSL *s);
__owur enum MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, __owur MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt);
PACKET *pkt); __owur MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, PACKET *pkt);
__owur enum MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, __owur MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt);
PACKET *pkt); __owur MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt);
__owur enum MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, __owur MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt);
PACKET *pkt);
__owur enum MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt);
__owur enum MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt);
__owur int tls_construct_client_verify(SSL *s); __owur int tls_construct_client_verify(SSL *s);
__owur enum WORK_STATE tls_prepare_client_certificate(SSL *s, __owur WORK_STATE tls_prepare_client_certificate(SSL *s, WORK_STATE wst);
enum WORK_STATE wst);
__owur int tls_construct_client_certificate(SSL *s); __owur int tls_construct_client_certificate(SSL *s);
__owur int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey); __owur int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey);
__owur int tls_construct_client_key_exchange(SSL *s); __owur int tls_construct_client_key_exchange(SSL *s);
__owur int tls_client_key_exchange_post_work(SSL *s); __owur int tls_client_key_exchange_post_work(SSL *s);
__owur int tls_construct_cert_status(SSL *s); __owur int tls_construct_cert_status(SSL *s);
__owur enum MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s, __owur MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s,
PACKET *pkt); PACKET *pkt);
__owur enum MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, __owur MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt);
PACKET *pkt);
__owur int ssl3_check_cert_and_algorithm(SSL *s); __owur int ssl3_check_cert_and_algorithm(SSL *s);
# ifndef OPENSSL_NO_NEXTPROTONEG # ifndef OPENSSL_NO_NEXTPROTONEG
__owur int tls_construct_next_proto(SSL *s); __owur int tls_construct_next_proto(SSL *s);
# endif # endif
__owur enum MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt); __owur MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt);
/* some server-only functions */ /* some server-only functions */
__owur enum MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt); __owur MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt);
__owur enum WORK_STATE tls_post_process_client_hello(SSL *s, __owur WORK_STATE tls_post_process_client_hello(SSL *s, WORK_STATE wst);
enum WORK_STATE wst);
__owur int tls_construct_server_hello(SSL *s); __owur int tls_construct_server_hello(SSL *s);
__owur int tls_construct_hello_request(SSL *s); __owur int tls_construct_hello_request(SSL *s);
__owur int dtls_construct_hello_verify_request(SSL *s); __owur int dtls_construct_hello_verify_request(SSL *s);
@ -168,14 +161,11 @@ __owur int tls_construct_server_certificate(SSL *s);
__owur int tls_construct_server_key_exchange(SSL *s); __owur int tls_construct_server_key_exchange(SSL *s);
__owur int tls_construct_certificate_request(SSL *s); __owur int tls_construct_certificate_request(SSL *s);
__owur int tls_construct_server_done(SSL *s); __owur int tls_construct_server_done(SSL *s);
__owur enum MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, __owur MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt);
PACKET *pkt); __owur MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt);
__owur enum MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, __owur WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst);
PACKET *pkt); __owur MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt);
__owur enum WORK_STATE tls_post_process_client_key_exchange(SSL *s,
enum WORK_STATE wst);
__owur enum MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt);
# ifndef OPENSSL_NO_NEXTPROTONEG # ifndef OPENSSL_NO_NEXTPROTONEG
__owur enum MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt); __owur MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt);
# endif # endif
__owur int tls_construct_new_session_ticket(SSL *s); __owur int tls_construct_new_session_ticket(SSL *s);

View File

@ -402,7 +402,7 @@ static inline int send_certificate_request(SSL *s)
* server_write_transition() works out what handshake state to move to next * server_write_transition() works out what handshake state to move to next
* when the server is writing messages to be sent to the client. * when the server is writing messages to be sent to the client.
*/ */
enum WRITE_TRAN server_write_transition(SSL *s) WRITE_TRAN server_write_transition(SSL *s)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
@ -520,7 +520,7 @@ enum WRITE_TRAN server_write_transition(SSL *s)
* Perform any pre work that needs to be done prior to sending a message from * Perform any pre work that needs to be done prior to sending a message from
* the server to the client. * the server to the client.
*/ */
enum WORK_STATE server_pre_work(SSL *s, enum WORK_STATE wst) WORK_STATE server_pre_work(SSL *s, WORK_STATE wst)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
@ -599,7 +599,7 @@ enum WORK_STATE server_pre_work(SSL *s, enum WORK_STATE wst)
* Perform any work that needs to be done after sending a message from the * Perform any work that needs to be done after sending a message from the
* server to the client. * server to the client.
*/ */
enum WORK_STATE server_post_work(SSL *s, enum WORK_STATE wst) WORK_STATE server_post_work(SSL *s, WORK_STATE wst)
{ {
OSSL_STATEM *st = &s->statem; 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. * Process a message that the server has received from the client.
*/ */
enum MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
@ -846,7 +846,7 @@ enum MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt)
* Perform any further processing required following the receipt of a message * Perform any further processing required following the receipt of a message
* from the client * from the client
*/ */
enum WORK_STATE server_post_process_message(SSL *s, enum WORK_STATE wst) WORK_STATE server_post_process_message(SSL *s, WORK_STATE wst)
{ {
OSSL_STATEM *st = &s->statem; OSSL_STATEM *st = &s->statem;
@ -976,7 +976,7 @@ int dtls_construct_hello_verify_request(SSL *s)
return 1; return 1;
} }
enum MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt)
{ {
int i, al = SSL_AD_INTERNAL_ERROR; int i, al = SSL_AD_INTERNAL_ERROR;
unsigned int j, complen = 0; unsigned int j, complen = 0;
@ -1516,7 +1516,7 @@ enum MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt)
} }
enum WORK_STATE tls_post_process_client_hello(SSL *s, enum WORK_STATE wst) WORK_STATE tls_post_process_client_hello(SSL *s, WORK_STATE wst)
{ {
int al = SSL_AD_HANDSHAKE_FAILURE; int al = SSL_AD_HANDSHAKE_FAILURE;
SSL_CIPHER *cipher; SSL_CIPHER *cipher;
@ -2266,7 +2266,7 @@ int tls_construct_certificate_request(SSL *s)
return 0; return 0;
} }
enum MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt)
{ {
int al; int al;
unsigned int i; unsigned int i;
@ -2894,8 +2894,7 @@ enum MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt)
return MSG_PROCESS_ERROR; return MSG_PROCESS_ERROR;
} }
enum WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst)
enum WORK_STATE wst)
{ {
#ifndef OPENSSL_NO_SCTP #ifndef OPENSSL_NO_SCTP
if (wst == WORK_MORE_A) { if (wst == WORK_MORE_A) {
@ -3005,7 +3004,7 @@ enum WORK_STATE tls_post_process_client_key_exchange(SSL *s,
return WORK_FINISHED_CONTINUE; return WORK_FINISHED_CONTINUE;
} }
enum MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
{ {
EVP_PKEY *pkey = NULL; EVP_PKEY *pkey = NULL;
unsigned char *sig, *data; unsigned char *sig, *data;
@ -3181,7 +3180,7 @@ enum MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
return ret; return ret;
} }
enum MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt)
{ {
int i, al = SSL_AD_INTERNAL_ERROR, ret = MSG_PROCESS_ERROR; int i, al = SSL_AD_INTERNAL_ERROR, ret = MSG_PROCESS_ERROR;
X509 *x = NULL; X509 *x = NULL;
@ -3501,7 +3500,7 @@ int tls_construct_cert_status(SSL *s)
* tls_process_next_proto reads a Next Protocol Negotiation handshake message. * tls_process_next_proto reads a Next Protocol Negotiation handshake message.
* It sets the next_proto member in s if found * It sets the next_proto member in s if found
*/ */
enum MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt) MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt)
{ {
PACKET next_proto, padding; PACKET next_proto, padding;
size_t next_proto_len; size_t next_proto_len;