Check range of test values using isascii before diving into the full
[openssl.git] / test / sslapitest.c
index e44e9c1f4d9eb1f350cc8f9b3b4a22b1e5d590fa..622f159f1a3c36712e5f318a1fd827325ad6b31c 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "ssltestlib.h"
 #include "testutil.h"
-#include "e_os.h"
+#include "internal/nelem.h"
 #include "../ssl/ssl_locl.h"
 
 static char *cert = NULL;
@@ -91,7 +91,7 @@ static void server_keylog_callback(const SSL *ssl, const char *line)
 
     /* If the log doesn't fit, error out. */
     if (server_log_buffer_index + line_length > sizeof(server_log_buffer) - 1) {
-        TEST_info("Server og too full");
+        TEST_info("Server log too full");
         error_writing_log = 1;
         return;
     }
@@ -417,7 +417,7 @@ static int full_early_callback(SSL *s, int *al, void *arg)
 #ifndef OPENSSL_NO_EC
                                        11, 10,
 #endif
-                                       35, 13, 22, 23};
+                                       35, 22, 23, 13};
     size_t len;
 
     /* Make sure we can defer processing and get called back. */
@@ -992,10 +992,12 @@ static int execute_test_session(int maxprot, int use_int_cache,
          * the external cache. We take a copy first because
          * SSL_CTX_remove_session() also marks the session as non-resumable.
          */
-        if (use_int_cache
-                && (!TEST_ptr(tmp = SSL_SESSION_dup(sess2))
-                    || !TEST_true(SSL_CTX_remove_session(sctx, sess2))))
-            goto end;
+        if (use_int_cache) {
+            if (!TEST_ptr(tmp = SSL_SESSION_dup(sess2))
+                    || !TEST_true(SSL_CTX_remove_session(sctx, sess2)))
+                goto end;
+            SSL_SESSION_free(sess2);
+        }
         sess2 = tmp;
     }