static void init_write_state_machine(SSL *s);
static enum SUB_STATE_RETURN write_state_machine(SSL *s);
-enum HANDSHAKE_STATE SSL_state(const SSL *ssl)
+OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl)
{
return ssl->statem.hand_state;
}
-void SSL_set_state(SSL *ssl, enum HANDSHAKE_STATE state)
-{
- /*
- * This function seems like a really bad idea. Should we remove it
- * completely?
- */
- ssl->statem.hand_state = state;
-}
-
int SSL_in_init(SSL *s)
{
return s->statem.in_init;
/*
* Clear the state machine state and reset back to MSG_FLOW_UNINITED
*/
-void statem_clear(SSL *s)
+void ossl_statem_clear(SSL *s)
{
s->statem.state = MSG_FLOW_UNINITED;
s->statem.hand_state = TLS_ST_BEFORE;
s->statem.in_init = 1;
+ s->statem.no_cert_verify = 0;
}
/*
* Set the state machine up ready for a renegotiation handshake
*/
-void statem_set_renegotiate(SSL *s)
+void ossl_statem_set_renegotiate(SSL *s)
{
s->statem.state = MSG_FLOW_RENEGOTIATE;
s->statem.in_init = 1;
* Put the state machine into an error state. This is a permanent error for
* the current connection.
*/
-void statem_set_error(SSL *s)
+void ossl_statem_set_error(SSL *s)
{
s->statem.state = MSG_FLOW_ERROR;
}
* 1: Yes
* 0: No
*/
-int statem_in_error(const SSL *s)
+int ossl_statem_in_error(const SSL *s)
{
if (s->statem.state == MSG_FLOW_ERROR)
return 1;
return 0;
}
-void statem_set_in_init(SSL *s, int init)
+void ossl_statem_set_in_init(SSL *s, int init)
{
s->statem.in_init = init;
}
-int statem_connect(SSL *s) {
+int ossl_statem_connect(SSL *s) {
return state_machine(s, 0);
}
-int statem_accept(SSL *s)
+int ossl_statem_accept(SSL *s)
{
return state_machine(s, 1);
}
SSLerr(SSL_F_STATE_MACHINE,
SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED);
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE);
- statem_set_error(s);
+ ossl_statem_set_error(s);
goto end;
} else {
/*
- * s->state == SSL_ST_RENEGOTIATE, we will just send a
+ * st->state == MSG_FLOW_RENEGOTIATE, we will just send a
* HelloRequest
*/
s->ctx->stats.sess_accept_renegotiate++;
}
} else {
/* Error */
- statem_set_error(s);
+ ossl_statem_set_error(s);
goto end;
}
}
/* Shouldn't happen */
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR);
SSLerr(SSL_F_READ_STATE_MACHINE, ERR_R_INTERNAL_ERROR);
- statem_set_error(s);
+ ossl_statem_set_error(s);
return SUB_STATE_ERROR;
}
}
* 1: Yes (application data allowed)
* 0: No (application data not allowed)
*/
-int statem_app_data_allowed(SSL *s)
+int ossl_statem_app_data_allowed(SSL *s)
{
STATEM *st = &s->statem;
/*
* Set flag used by SCTP to determine whether we are in the read sock state
*/
-void statem_set_sctp_read_sock(SSL *s, int read_sock)
+void ossl_statem_set_sctp_read_sock(SSL *s, int read_sock)
{
s->statem.in_sctp_read_sock = read_sock;
}