Commit 35bf6e05 authored by Matt Caswell's avatar Matt Caswell
Browse files

Change HANDSHAKE_STATE to OSSL_HANDSHAKE_STATE



Rename the enum HANDSHAKE_STATE to OSSL_HANDSHAKE_STATE to ensure there are
no namespace clashes, and convert it into a typedef.

Reviewed-by: default avatarTim Hudson <tjh@openssl.org>
Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
parent a455d0f6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -8,11 +8,11 @@
     refactored in order to remove much duplication of code and solve issues
     with the old code (see ssl/statem/README for further details). This change
     does have some associated API changes. Notably SSL_get_state/SSL_state now
     returns an "enum HANDSHAKE_STATE" instead of an int. The previous handshake
     returns an "OSSL_HANDSHAKE_STATE" instead of an int. The previous handshake
     states defined in ssl.h and ssl3.h have been redefined to be the nearest
     equivalent HANDSHAKE_STATE value. Not all states have an equivalent value,
     (e.g. SSL_ST_CW_FLUSH). New application code should not use the old
     handshake state values, but should instead use HANDSHAKE_STATE.
     equivalent OSS_HANDSHAKE_STATE value. Not all states have an equivalent
     value, (e.g. SSL_ST_CW_FLUSH). New application code should not use the old
     handshake state values, but should instead use OSSL_HANDSHAKE_STATE.
     [Matt Caswell]

  *) The demo files in crypto/threads were moved to demo/threads.
+1 −1
Original line number Diff line number Diff line
@@ -624,7 +624,7 @@ success or 0 on failure.

=item int B<SSL_shutdown>(SSL *ssl);

=item enum HANDSHAKE_STATE B<SSL_state>(const SSL *ssl);
=item OSSL_HANDSHAKE_STATE B<SSL_state>(const SSL *ssl);

Returns the current handshake state.

+4 −4
Original line number Diff line number Diff line
@@ -933,7 +933,7 @@ extern "C" {
 * TLS_ST_BEFORE = No handshake has been initiated yet
 * TLS_ST_OK = A handshake has been successfully completed
 */
enum HANDSHAKE_STATE {
typedef enum {
    TLS_ST_BEFORE,
    TLS_ST_OK,
    DTLS_ST_CR_HELLO_VERIFY_REQUEST,
@@ -971,7 +971,7 @@ enum HANDSHAKE_STATE {
    TLS_ST_SW_CERT_STATUS,
    TLS_ST_SW_CHANGE,
    TLS_ST_SW_FINISHED
};
} OSSL_HANDSHAKE_STATE;

/*
 * Most of the following state values are no longer used and are defined to be
@@ -1700,8 +1700,8 @@ void SSL_set_info_callback(SSL *ssl,
                           void (*cb) (const SSL *ssl, int type, int val));
void (*SSL_get_info_callback(const SSL *ssl)) (const SSL *ssl, int type,
                                               int val);
__owur enum HANDSHAKE_STATE SSL_state(const SSL *ssl);
void SSL_set_state(SSL *ssl, enum HANDSHAKE_STATE state);
__owur OSSL_HANDSHAKE_STATE SSL_state(const SSL *ssl);
void SSL_set_state(SSL *ssl, OSSL_HANDSHAKE_STATE state);

void SSL_set_verify_result(SSL *ssl, long v);
__owur long SSL_get_verify_result(const SSL *ssl);
+2 −2
Original line number Diff line number Diff line
@@ -110,12 +110,12 @@ static enum SUB_STATE_RETURN read_state_machine(SSL *s);
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_state(const SSL *ssl)
{
    return ssl->statem.hand_state;
}

void SSL_set_state(SSL *ssl, enum HANDSHAKE_STATE state)
void SSL_set_state(SSL *ssl, OSSL_HANDSHAKE_STATE state)
{
    /*
     * This function seems like a really bad idea. Should we remove it
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ struct statem_st {
    enum WORK_STATE write_state_work;
    enum READ_STATE read_state;
    enum WORK_STATE read_state_work;
    enum HANDSHAKE_STATE hand_state;
    OSSL_HANDSHAKE_STATE hand_state;
    int in_init;
    int read_state_first_init;
    int use_timer;