aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssl/statem/statem.c')
-rw-r--r--ssl/statem/statem.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 9bfd29dcd1..3df4ce61e1 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -46,7 +46,7 @@
*/
/* Sub state machine return values */
-typedef enum {
+typedef enum {
/* Something bad happened or NBIO */
SUB_STATE_ERROR,
/* Sub state finished go to the next sub state */
@@ -165,7 +165,8 @@ void ossl_statem_set_hello_verify_done(SSL *s)
s->statem.hand_state = TLS_ST_SR_CLNT_HELLO;
}
-int ossl_statem_connect(SSL *s) {
+int ossl_statem_connect(SSL *s)
+{
return state_machine(s, 0);
}
@@ -174,7 +175,9 @@ int ossl_statem_accept(SSL *s)
return state_machine(s, 1);
}
-static void (*get_callback(SSL *s))(const SSL *, int, int)
+typedef void (*info_cb) (const SSL *, int, int);
+
+static info_cb get_callback(SSL *s)
{
if (s->info_callback != NULL)
return s->info_callback;
@@ -237,7 +240,6 @@ static int state_machine(SSL *s, int server)
if (!SSL_clear(s))
return -1;
}
-
#ifndef OPENSSL_NO_SCTP
if (SSL_IS_DTLS(s)) {
/*
@@ -282,8 +284,7 @@ static int state_machine(SSL *s, int server)
if (SSL_IS_DTLS(s)) {
if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00) &&
- (server
- || (s->version & 0xff00) != (DTLS1_BAD_VER & 0xff00))) {
+ (server || (s->version & 0xff00) != (DTLS1_BAD_VER & 0xff00))) {
SSLerr(SSL_F_STATE_MACHINE, ERR_R_INTERNAL_ERROR);
goto end;
}
@@ -320,7 +321,6 @@ static int state_machine(SSL *s, int server)
*/
s->s3->change_cipher_spec = 0;
-
/*
* Ok, we now need to push on a buffering BIO ...but not with
* SCTP
@@ -471,15 +471,16 @@ static void init_read_state_machine(SSL *s)
* control returns to the calling application. When this function is recalled we
* will resume in the same state where we left off.
*/
-static SUB_STATE_RETURN read_state_machine(SSL *s) {
+static SUB_STATE_RETURN read_state_machine(SSL *s)
+{
OSSL_STATEM *st = &s->statem;
int ret, mt;
unsigned long len = 0;
- int (*transition)(SSL *s, int mt);
+ int (*transition) (SSL *s, int mt);
PACKET pkt;
- MSG_PROCESS_RETURN (*process_message)(SSL *s, PACKET *pkt);
- WORK_STATE (*post_process_message)(SSL *s, WORK_STATE wst);
- unsigned long (*max_message_size)(SSL *s);
+ MSG_PROCESS_RETURN(*process_message) (SSL *s, PACKET *pkt);
+ WORK_STATE(*post_process_message) (SSL *s, WORK_STATE wst);
+ unsigned long (*max_message_size) (SSL *s);
void (*cb) (const SSL *ssl, int type, int val) = NULL;
cb = get_callback(s);
@@ -620,7 +621,7 @@ static int statem_do_write(SSL *s)
OSSL_STATEM *st = &s->statem;
if (st->hand_state == TLS_ST_CW_CHANGE
- || st->hand_state == TLS_ST_SW_CHANGE) {
+ || st->hand_state == TLS_ST_SW_CHANGE) {
if (SSL_IS_DTLS(s))
return dtls1_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC);
else
@@ -675,10 +676,10 @@ static SUB_STATE_RETURN write_state_machine(SSL *s)
{
OSSL_STATEM *st = &s->statem;
int ret;
- WRITE_TRAN (*transition)(SSL *s);
- WORK_STATE (*pre_work)(SSL *s, WORK_STATE wst);
- WORK_STATE (*post_work)(SSL *s, WORK_STATE wst);
- int (*construct_message)(SSL *s);
+ WRITE_TRAN(*transition) (SSL *s);
+ WORK_STATE(*pre_work) (SSL *s, WORK_STATE wst);
+ WORK_STATE(*post_work) (SSL *s, WORK_STATE wst);
+ int (*construct_message) (SSL *s);
void (*cb) (const SSL *ssl, int type, int val) = NULL;
cb = get_callback(s);
@@ -807,7 +808,7 @@ int ossl_statem_app_data_allowed(SSL *s)
* ServerHello yet then we allow app data
*/
if (st->hand_state == TLS_ST_BEFORE
- || st->hand_state == TLS_ST_SR_CLNT_HELLO)
+ || st->hand_state == TLS_ST_SR_CLNT_HELLO)
return 1;
} else {
/*