Don't disable rollback attack detection as a recommended bug workaround.
[openssl.git] / ssl / ssl.h
index 26d131fb36f8c26b06c66809181b45b794877f39..8f5d0a4d4754c8d00146490613d9ef4888e75402 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -106,6 +106,7 @@ extern "C" {
 #define SSL_TXT_KRB5_DES_64_CBC_MD5   SSL3_TXT_KRB5_DES_64_CBC_MD5
 #define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
 #define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
+#define SSL_MAX_KRB5_PRINCIPAL_LENGTH  256
 
 #define SSL_MAX_SSL_SESSION_ID_LENGTH          32
 #define SSL_MAX_SID_CTX_LENGTH                 32
@@ -226,7 +227,7 @@ typedef struct ssl_method_st
        int (*ssl_accept)(SSL *s);
        int (*ssl_connect)(SSL *s);
        int (*ssl_read)(SSL *s,void *buf,int len);
-       int (*ssl_peek)(SSL *s,char *buf,int len);
+       int (*ssl_peek)(SSL *s,void *buf,int len);
        int (*ssl_write)(SSL *s,const void *buf,int len);
        int (*ssl_shutdown)(SSL *s);
        int (*ssl_renegotiate)(SSL *s);
@@ -283,6 +284,11 @@ typedef struct ssl_session_st
        unsigned int sid_ctx_length;
        unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
 
+#ifndef OPENSSL_NO_KRB5
+        unsigned int krb5_client_princ_len;
+        unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH];
+#endif /* OPENSSL_NO_KRB5 */
+
        int not_resumable;
 
        /* The cert is the certificate used to establish this connection */
@@ -326,7 +332,6 @@ typedef struct ssl_session_st
 #define SSL_OP_SSLEAY_080_CLIENT_DH_BUG                        0x00000080L
 #define SSL_OP_TLS_D5_BUG                              0x00000100L
 #define SSL_OP_TLS_BLOCK_PADDING_BUG                   0x00000200L
-#define SSL_OP_TLS_ROLLBACK_BUG                                0x00000400L
 
 /* If set, always create a new key when using tmp_dh parameters */
 #define SSL_OP_SINGLE_DH_USE                           0x00100000L
@@ -335,15 +340,18 @@ typedef struct ssl_session_st
 /* Set on servers to choose the cipher according to the server's
  * preferences */
 #define SSL_OP_CIPHER_SERVER_PREFERENCE                        0x00400000L
+/* If set, a server will allow a client to issue a SSLv3.0 version number
+ * as latest version supported in the premaster secret, even when TLSv1.0
+ * (version 3.1) was announced in the client hello. Normally this is
+ * forbidden to prevent version rollback attacks. */
+#define SSL_OP_TLS_ROLLBACK_BUG                                0x00800000L
 
 /* The next flag deliberately changes the ciphertest, this is a check
  * for the PKCS#1 attack */
 #define SSL_OP_PKCS1_CHECK_1                           0x08000000L
 #define SSL_OP_PKCS1_CHECK_2                           0x10000000L
 #define SSL_OP_NETSCAPE_CA_DN_BUG                      0x20000000L
-/* SSL_OP_NON_EXPORT_FIRST looks utterly broken .. */
-#define SSL_OP_NON_EXPORT_FIRST                        0x40000000L
-#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG         0x80000000L
+#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG         0x40000000L
 #define SSL_OP_ALL                                     0x000FFFFFL
 
 #define SSL_OP_NO_SSLv2                                        0x01000000L
@@ -391,7 +399,7 @@ typedef struct ssl_session_st
  * callbacks should themselves check if the id they generate is unique otherwise
  * the SSL handshake will fail with an error - callbacks can do this using the
  * 'ssl' value they're passed by;
- *      SSL_CTX_has_matching_session_id(ssl->ctx, id, *id_len)
+ *      SSL_has_matching_session_id(ssl, id, *id_len)
  * The length value passed in is set at the maximum size the session ID can be.
  * In SSLv2 this is 16 bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback
  * can alter this length to be less if desired, but under SSLv2 session IDs are
@@ -973,6 +981,8 @@ char *      SSL_CIPHER_get_version(SSL_CIPHER *c);
 const char *   SSL_CIPHER_get_name(SSL_CIPHER *c);
 
 int    SSL_get_fd(SSL *s);
+int    SSL_get_rfd(SSL *s);
+int    SSL_get_wfd(SSL *s);
 const char  * SSL_get_cipher_list(SSL *s,int n);
 char * SSL_get_shared_ciphers(SSL *s, char *buf, int len);
 int    SSL_get_read_ahead(SSL * s);
@@ -1054,7 +1064,7 @@ int       SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
 int    SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c);
 int    SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);
 int    SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);
-int    SSL_CTX_has_matching_session_id(const SSL_CTX *ctx, const unsigned char *id,
+int    SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
                                        unsigned int id_len);
 SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,unsigned char **pp,long length);
 
@@ -1102,9 +1112,9 @@ int SSL_set_trust(SSL *s, int trust);
 void   SSL_free(SSL *ssl);
 int    SSL_accept(SSL *ssl);
 int    SSL_connect(SSL *ssl);
-int    SSL_read(SSL *ssl,char *buf,int num);
-int    SSL_peek(SSL *ssl,char *buf,int num);
-int    SSL_write(SSL *ssl,const char *buf,int num);
+int    SSL_read(SSL *ssl,void *buf,int num);
+int    SSL_peek(SSL *ssl,void *buf,int num);
+int    SSL_write(SSL *ssl,const void *buf,int num);
 long   SSL_ctrl(SSL *ssl,int cmd, long larg, char *parg);
 long   SSL_callback_ctrl(SSL *, int, void (*)());
 long   SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, char *parg);
@@ -1250,6 +1260,7 @@ int SSL_COMP_add_compression_method(int id,char *cm);
 /* The following lines are auto generated by the script mkerr.pl. Any changes
  * made after this point may be overwritten when the script is next run.
  */
+void ERR_load_SSL_strings(void);
 
 /* Error codes for the SSL functions. */
 
@@ -1274,6 +1285,7 @@ int SSL_COMP_add_compression_method(int id,char *cm);
 #define SSL_F_SSL23_CONNECT                             117
 #define SSL_F_SSL23_GET_CLIENT_HELLO                    118
 #define SSL_F_SSL23_GET_SERVER_HELLO                    119
+#define SSL_F_SSL23_PEEK                                237
 #define SSL_F_SSL23_READ                                120
 #define SSL_F_SSL23_WRITE                               121
 #define SSL_F_SSL2_ACCEPT                               122
@@ -1293,6 +1305,7 @@ int SSL_COMP_add_compression_method(int id,char *cm);
 #define SSL_F_SSL3_CTRL                                         213
 #define SSL_F_SSL3_CTX_CTRL                             133
 #define SSL_F_SSL3_ENC                                  134
+#define SSL_F_SSL3_GENERATE_KEY_BLOCK                   238
 #define SSL_F_SSL3_GET_CERTIFICATE_REQUEST              135
 #define SSL_F_SSL3_GET_CERT_VERIFY                      136
 #define SSL_F_SSL3_GET_CLIENT_CERTIFICATE               137
@@ -1452,18 +1465,21 @@ int SSL_COMP_add_compression_method(int id,char *cm);
 #define SSL_R_GOT_A_FIN_BEFORE_A_CCS                    154
 #define SSL_R_HTTPS_PROXY_REQUEST                       155
 #define SSL_R_HTTP_REQUEST                              156
-#define SSL_R_INTERNAL_ERROR                            157
 #define SSL_R_INVALID_CHALLENGE_LENGTH                  158
 #define SSL_R_INVALID_COMMAND                           280
 #define SSL_R_INVALID_PURPOSE                           278
 #define SSL_R_INVALID_TRUST                             279
+#define SSL_R_KRB5                                      1104
 #define SSL_R_KRB5_C_CC_PRINC                           1094
 #define SSL_R_KRB5_C_GET_CRED                           1095
 #define SSL_R_KRB5_C_INIT                               1096
 #define SSL_R_KRB5_C_MK_REQ                             1097
 #define SSL_R_KRB5_S_BAD_TICKET                                 1098
 #define SSL_R_KRB5_S_INIT                               1099
-#define SSL_R_KRB5_S_RD_REQ                             1100
+#define SSL_R_KRB5_S_RD_REQ                             1108
+#define SSL_R_KRB5_S_TKT_EXPIRED                        1105
+#define SSL_R_KRB5_S_TKT_NYV                            1106
+#define SSL_R_KRB5_S_TKT_SKEW                           1107
 #define SSL_R_LENGTH_MISMATCH                           159
 #define SSL_R_LENGTH_TOO_SHORT                          160
 #define SSL_R_LIBRARY_BUG                               274
@@ -1551,10 +1567,10 @@ int SSL_COMP_add_compression_method(int id,char *cm);
 #define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION        228
 #define SSL_R_SSL_HANDSHAKE_FAILURE                     229
 #define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS                230
-#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH             1101
 #define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED            1102
 #define SSL_R_SSL_SESSION_ID_CONFLICT                   1103
 #define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG           273
+#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH             1101
 #define SSL_R_SSL_SESSION_ID_IS_DIFFERENT               231
 #define SSL_R_TLSV1_ALERT_ACCESS_DENIED                         1049
 #define SSL_R_TLSV1_ALERT_DECODE_ERROR                  1050
@@ -1613,4 +1629,3 @@ int SSL_COMP_add_compression_method(int id,char *cm);
 }
 #endif
 #endif
-