Fix no-ec, no-tls1_3 and no-tls
[openssl.git] / test / sslapitest.c
index fe1c1e6ff3a92658acde5a1283a3928ac60c05dd..9b0237e060354a2ff2d902e6cb9ca560e5733fda 100644 (file)
@@ -1197,6 +1197,7 @@ static int test_session_with_both_cache(void)
 #endif
 }
 
+#ifndef OPENSSL_NO_TLS1_3
 static SSL_SESSION *sesscache[6];
 static int do_cache;
 
@@ -1324,6 +1325,7 @@ static int test_tickets(int idx)
 
     return testresult;
 }
+#endif
 
 #define USE_NULL            0
 #define USE_BIO_1           1
@@ -2351,15 +2353,6 @@ static int test_early_data_not_sent(int idx)
             || !TEST_size_t_eq(written, strlen(MSG2)))
         goto end;
 
-    /*
-     * Should block due to the NewSessionTicket arrival unless we're using
-     * read_ahead, or PSKs
-     */
-    if (idx != 1 && idx != 2) {
-        if (!TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)))
-            goto end;
-    }
-
     if (!TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes))
             || !TEST_mem_eq(buf, readbytes, MSG2, strlen(MSG2)))
         goto end;
@@ -4473,7 +4466,9 @@ static int test_info_callback(int tst)
     int tlsvers;
 
     if (tst < 2) {
-#ifndef OPENSSL_NO_TLS1_2
+/* We need either ECDHE or DHE for the TLSv1.2 test to work */
+#if !defined(OPENSSL_NO_TLS1_2) && (!defined(OPENSSL_NO_EC) \
+                                    || !defined(OPENSSL_NO_DH))
         tlsvers = TLS1_2_VERSION;
 #else
         return 1;