If a callback is generating a new session ID for SSLv2, then upon exiting,
[openssl.git] / ssl / s23_clnt.c
index aaedf6a9bbcb4f42a7822be91123c530dab79679..1eafb4b446358939396f1e6a9c84845573690f89 100644 (file)
@@ -68,7 +68,7 @@ static int ssl23_client_hello(SSL *s);
 static int ssl23_get_server_hello(SSL *s);
 static SSL_METHOD *ssl23_get_client_method(int ver)
        {
-#ifndef NO_SSL2
+#ifndef OPENSSL_NO_SSL2
        if (ver == SSL2_VERSION)
                return(SSLv2_client_method());
 #endif
@@ -322,7 +322,7 @@ static int ssl23_get_server_hello(SSL *s)
        if ((p[0] & 0x80) && (p[2] == SSL2_MT_SERVER_HELLO) &&
                (p[5] == 0x00) && (p[6] == 0x02))
                {
-#ifdef NO_SSL2
+#ifdef OPENSSL_NO_SSL2
                SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_PROTOCOL);
                goto err;
 #else
@@ -366,7 +366,9 @@ static int ssl23_get_server_hello(SSL *s)
                        }
 
                s->state=SSL2_ST_GET_SERVER_HELLO_A;
-               s->s2->ssl2_rollback=1;
+               if (!(s->client_version == SSL2_VERSION))
+                       /* use special padding (SSL 3.0 draft/RFC 2246, App. E.2) */
+                       s->s2->ssl2_rollback=1;
 
                /* setup the 5 bytes we have read so we get them from
                 * the sslv2 buffer */