Change HANDSHAKE_STATE to OSSL_HANDSHAKE_STATE
authorMatt Caswell <matt@openssl.org>
Mon, 5 Oct 2015 09:18:06 +0000 (10:18 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 30 Oct 2015 08:39:46 +0000 (08:39 +0000)
Rename the enum HANDSHAKE_STATE to OSSL_HANDSHAKE_STATE to ensure there are
no namespace clashes, and convert it into a typedef.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
CHANGES
doc/ssl/ssl.pod
include/openssl/ssl.h
ssl/statem/statem.c
ssl/statem/statem.h

diff --git a/CHANGES b/CHANGES
index 2be8ecccbe2a43d4be81109fd3d317f8991edb54..34ad35595c0594dbfb89b7c34ba0856f50907083 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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
      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
      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.
      [Matt Caswell]
 
   *) The demo files in crypto/threads were moved to demo/threads.
index 03e5e0a814a21df9fed0375eb0ad75fd9a3433d8..c8c577d83e4a0cb9153ff34b4684559a117a228b 100644 (file)
@@ -624,7 +624,7 @@ success or 0 on failure.
 
 =item int B<SSL_shutdown>(SSL *ssl);
 
 
 =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.
 
 
 Returns the current handshake state.
 
index de858f6006955e328dd750e1637f2f86de48c855..8570f33653ba9e6633d01e7776c4b121b67f9e59 100644 (file)
@@ -933,7 +933,7 @@ extern "C" {
  * TLS_ST_BEFORE = No handshake has been initiated yet
  * TLS_ST_OK = A handshake has been successfully completed
  */
  * 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,
     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
     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
 
 /*
  * 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);
                            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);
 
 void SSL_set_verify_result(SSL *ssl, long v);
 __owur long SSL_get_verify_result(const SSL *ssl);
index 5032c3b2676e925349bb9adfaf616d5990d650a5..1df669bc33f44709feb1651c56a445cb9899f307 100644 (file)
@@ -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);
 
 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;
 }
 
 {
     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
 {
     /*
      * This function seems like a really bad idea. Should we remove it
index 873ed0e7bf6b68a5778c704e5d78dfa53a2e9501..44c1dd45bcac2630f7aa6c081697dadf64c9fb44 100644 (file)
@@ -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 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;
     int in_init;
     int read_state_first_init;
     int use_timer;