diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-26 11:46:33 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-10-30 08:39:47 +0000 |
commit | be3583fa40a2658cbbcf73320f75e9d674bb39f4 (patch) | |
tree | 96eddc8230e9f21643a8ff4c24b44327cb1d86ed /ssl/statem/statem_locl.h | |
parent | 3616bb63586df04b22de00f49bc92d92dff1b8b6 (diff) |
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>
Diffstat (limited to 'ssl/statem/statem_locl.h')
-rw-r--r-- | ssl/statem/statem_locl.h | 74 |
1 files changed, 32 insertions, 42 deletions
diff --git a/ssl/statem/statem_locl.h b/ssl/statem/statem_locl.h index 65787bd5b4..93fed35340 100644 --- a/ssl/statem/statem_locl.h +++ b/ssl/statem/statem_locl.h @@ -72,7 +72,7 @@ #define FINISHED_MAX_LENGTH 64 /* Message processing return codes */ -enum MSG_PROCESS_RETURN { +typedef enum { /* Something bad happened */ MSG_PROCESS_ERROR, /* We've finished reading - swap to writing */ @@ -84,7 +84,7 @@ enum MSG_PROCESS_RETURN { MSG_PROCESS_CONTINUE_PROCESSING, /* We've finished this message - read the next message */ MSG_PROCESS_CONTINUE_READING -}; +} MSG_PROCESS_RETURN; /* Flush the write BIO */ int statem_flush(SSL *s); @@ -93,25 +93,25 @@ int statem_flush(SSL *s); * TLS/DTLS client state machine functions */ int client_read_transition(SSL *s, int mt); -enum WRITE_TRAN client_write_transition(SSL *s); -enum WORK_STATE client_pre_work(SSL *s, enum WORK_STATE wst); -enum WORK_STATE client_post_work(SSL *s, enum WORK_STATE wst); +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); -enum MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt); -enum WORK_STATE client_post_process_message(SSL *s, enum WORK_STATE wst); +MSG_PROCESS_RETURN client_process_message(SSL *s, PACKET *pkt); +WORK_STATE client_post_process_message(SSL *s, WORK_STATE wst); /* * TLS/DTLS server state machine functions */ int server_read_transition(SSL *s, int mt); -enum WRITE_TRAN server_write_transition(SSL *s); -enum WORK_STATE server_pre_work(SSL *s, enum WORK_STATE wst); -enum WORK_STATE server_post_work(SSL *s, enum WORK_STATE wst); +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); -enum MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt); -enum WORK_STATE server_post_process_message(SSL *s, enum WORK_STATE wst); +MSG_PROCESS_RETURN server_process_message(SSL *s, PACKET *pkt); +WORK_STATE 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); @@ -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); /* Message construction and processing functions */ -__owur enum MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, - PACKET *pkt); -__owur enum MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt); +__owur MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt); +__owur MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt); __owur int tls_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 enum WORK_STATE tls_finish_handshake(SSL *s, enum WORK_STATE wst); -__owur enum WORK_STATE dtls_wait_for_dry(SSL *s); +__owur WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst); +__owur WORK_STATE dtls_wait_for_dry(SSL *s); /* some client-only functions */ __owur int tls_construct_client_hello(SSL *s); -__owur enum MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, - PACKET *pkt); -__owur enum MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, - PACKET *pkt); -__owur enum MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, - 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 MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt); +__owur MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, PACKET *pkt); +__owur MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt); +__owur MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt); +__owur MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt); __owur int tls_construct_client_verify(SSL *s); -__owur enum WORK_STATE tls_prepare_client_certificate(SSL *s, - enum WORK_STATE wst); +__owur WORK_STATE tls_prepare_client_certificate(SSL *s, WORK_STATE wst); __owur int tls_construct_client_certificate(SSL *s); __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_client_key_exchange_post_work(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); -__owur enum MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, - PACKET *pkt); +__owur MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt); __owur int ssl3_check_cert_and_algorithm(SSL *s); # ifndef OPENSSL_NO_NEXTPROTONEG __owur int tls_construct_next_proto(SSL *s); # 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 */ -__owur enum MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt); -__owur enum WORK_STATE tls_post_process_client_hello(SSL *s, - enum WORK_STATE wst); +__owur MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt); +__owur WORK_STATE tls_post_process_client_hello(SSL *s, WORK_STATE wst); __owur int tls_construct_server_hello(SSL *s); __owur int tls_construct_hello_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_certificate_request(SSL *s); __owur int tls_construct_server_done(SSL *s); -__owur enum MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, - PACKET *pkt); -__owur enum MSG_PROCESS_RETURN tls_process_client_key_exchange(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); +__owur MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt); +__owur MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt); +__owur WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst); +__owur MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt); # 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 __owur int tls_construct_new_session_ticket(SSL *s); |