test/sslapitest.c:2578: error: MEMORY_LEAK
  memory dynamically allocated by call to `SSL_CONF_CTX_new()` at line 2569, column 37 is not reachable after line 2578, column 17.
Showing all 70 steps of the trace


test/sslapitest.c:2549:1: start of procedure test_early_data_replay_int()
2547.    * confopt == 1: Configure anti-replay using SSL_CONF
2548.    */
2549. > static int test_early_data_replay_int(int idx, int usecb, int confopt)
2550.   {
2551.       SSL_CTX *cctx = NULL, *sctx = NULL;

test/sslapitest.c:2551:5: 
2549.   static int test_early_data_replay_int(int idx, int usecb, int confopt)
2550.   {
2551. >     SSL_CTX *cctx = NULL, *sctx = NULL;
2552.       SSL *clientssl = NULL, *serverssl = NULL;
2553.       int testresult = 0;

test/sslapitest.c:2552:5: 
2550.   {
2551.       SSL_CTX *cctx = NULL, *sctx = NULL;
2552. >     SSL *clientssl = NULL, *serverssl = NULL;
2553.       int testresult = 0;
2554.       SSL_SESSION *sess = NULL;

test/sslapitest.c:2553:5: 
2551.       SSL_CTX *cctx = NULL, *sctx = NULL;
2552.       SSL *clientssl = NULL, *serverssl = NULL;
2553. >     int testresult = 0;
2554.       SSL_SESSION *sess = NULL;
2555.       size_t readbytes, written;

test/sslapitest.c:2554:5: 
2552.       SSL *clientssl = NULL, *serverssl = NULL;
2553.       int testresult = 0;
2554. >     SSL_SESSION *sess = NULL;
2555.       size_t readbytes, written;
2556.       unsigned char buf[20];

test/sslapitest.c:2558:5: 
2556.       unsigned char buf[20];
2557.   
2558. >     allow_ed_cb_called = 0;
2559.   
2560.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),

test/sslapitest.c:2560:10: 
2558.       allow_ed_cb_called = 0;
2559.   
2560. >     if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
2561.                                          TLS1_VERSION, 0, &sctx,
2562.                                          &cctx, cert, privkey)))

ssl/methods.c:49:1: start of procedure TLS_server_method()
  47.    * TLS/SSLv3 server methods
  48.    */
  49. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
  50.                           TLS_server_method,
  51.                           ossl_statem_accept,

ssl/methods.c:49:1: return from a call to TLS_server_method
  47.    * TLS/SSLv3 server methods
  48.    */
  49. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
  50.                           TLS_server_method,
  51.                           ossl_statem_accept,

ssl/methods.c:82:1: start of procedure TLS_client_method()
  80.    * TLS/SSLv3 client methods
  81.    */
  82. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
  83.                           TLS_client_method,
  84.                           ssl_undefined_function,

ssl/methods.c:82:1: return from a call to TLS_client_method
  80.    * TLS/SSLv3 client methods
  81.    */
  82. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
  83.                           TLS_client_method,
  84.                           ssl_undefined_function,

test/sslapitest.c:2560:10: Condition is true
2558.       allow_ed_cb_called = 0;
2559.   
2560.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2561.                                          TLS1_VERSION, 0, &sctx,
2562.                                          &cctx, cert, privkey)))

test/testutil/tests.c:236:1: start of procedure test_true()
  234.   }
  235.   
  236. > int test_true(const char *file, int line, const char *s, int b)
  237.   {
  238.       if (b)

test/testutil/tests.c:238:9: Taking true branch
  236.   int test_true(const char *file, int line, const char *s, int b)
  237.   {
  238.       if (b)
                 ^
  239.           return 1;
  240.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");

test/testutil/tests.c:239:9: 
  237.   {
  238.       if (b)
  239. >         return 1;
  240.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
  241.       return 0;

test/testutil/tests.c:242:1: return from a call to test_true
  240.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
  241.       return 0;
  242. > }
  243.   
  244.   int test_false(const char *file, int line, const char *s, int b)

test/sslapitest.c:2560:10: Taking false branch
2558.       allow_ed_cb_called = 0;
2559.   
2560.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2561.                                          TLS1_VERSION, 0, &sctx,
2562.                                          &cctx, cert, privkey)))

test/sslapitest.c:2565:9: Taking true branch
2563.           return 0;
2564.   
2565.       if (usecb > 0) {
                ^
2566.           if (confopt == 0) {
2567.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);

test/sslapitest.c:2566:13: Taking false branch
2564.   
2565.       if (usecb > 0) {
2566.           if (confopt == 0) {
                    ^
2567.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2568.           } else {

test/sslapitest.c:2569:13: 
2567.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2568.           } else {
2569. >             SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2570.   
2571.               if (!TEST_ptr(confctx))

ssl/ssl_conf.c:872:1: start of procedure SSL_CONF_CTX_new()
  870.   }
  871.   
  872. > SSL_CONF_CTX *SSL_CONF_CTX_new(void)
  873.   {
  874.       SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));

ssl/ssl_conf.c:874:5: 
  872.   SSL_CONF_CTX *SSL_CONF_CTX_new(void)
  873.   {
  874. >     SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  875.   
  876.       return ret;

crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
    226.   }
    227.   
    228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230. >     void *ret = CRYPTO_malloc(num, file, line);
    231.   
    232.       FAILTEST();

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
      190.   #endif
      191.   
      192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      193.   {
      194.       void *ret = NULL;

crypto/mem.c:194:5: 
      192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      193.   {
      194. >     void *ret = NULL;
      195.   
      196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking false branch
      195.   
      196.       INCREMENT(malloc_count);
      197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      198.           return malloc_impl(num, file, line);
      199.   

crypto/mem.c:200:9: Taking false branch
      198.           return malloc_impl(num, file, line);
      199.   
      200.       if (num == 0)
                     ^
      201.           return NULL;
      202.   

crypto/mem.c:204:9: Taking true branch
      202.   
      203.       FAILTEST();
      204.       if (allow_customize) {
                     ^
      205.           /*
      206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:210:9: 
      208.            * allocation.
      209.            */
      210. >         allow_customize = 0;
      211.       }
      212.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:221:5: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:221:19: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:222:5: 
      220.   #else
      221.       (void)(file); (void)(line);
      222. >     ret = malloc(num);
      223.   #endif
      224.   

crypto/mem.c:225:5: 
      223.   #endif
      224.   
      225. >     return ret;
      226.   }
      227.   

crypto/mem.c:226:1: return from a call to CRYPTO_malloc
      224.   
      225.       return ret;
      226. > }
      227.   
      228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:233:9: Taking true branch
    231.   
    232.       FAILTEST();
    233.       if (ret != NULL)
                   ^
    234.           memset(ret, 0, num);
    235.       return ret;

crypto/mem.c:234:9: 
    232.       FAILTEST();
    233.       if (ret != NULL)
    234. >         memset(ret, 0, num);
    235.       return ret;
    236.   }

crypto/mem.c:235:5: 
    233.       if (ret != NULL)
    234.           memset(ret, 0, num);
    235. >     return ret;
    236.   }
    237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
    234.           memset(ret, 0, num);
    235.       return ret;
    236. > }
    237.   
    238.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

ssl/ssl_conf.c:876:5: 
  874.       SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  875.   
  876. >     return ret;
  877.   }
  878.   

ssl/ssl_conf.c:877:1: return from a call to SSL_CONF_CTX_new
  875.   
  876.       return ret;
  877. > }
  878.   
  879.   int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx)

test/sslapitest.c:2571:18: 
2569.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2570.   
2571. >             if (!TEST_ptr(confctx))
2572.                   goto end;
2573.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE

test/testutil/tests.c:228:1: start of procedure test_ptr()
  226.   }
  227.   
  228. > int test_ptr(const char *file, int line, const char *s, const void *p)
  229.   {
  230.       if (p != NULL)

test/testutil/tests.c:230:9: Taking true branch
  228.   int test_ptr(const char *file, int line, const char *s, const void *p)
  229.   {
  230.       if (p != NULL)
                 ^
  231.           return 1;
  232.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:231:9: 
  229.   {
  230.       if (p != NULL)
  231. >         return 1;
  232.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  233.       return 0;

test/testutil/tests.c:234:1: return from a call to test_ptr
  232.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  233.       return 0;
  234. > }
  235.   
  236.   int test_true(const char *file, int line, const char *s, int b)

test/sslapitest.c:2571:18: Taking false branch
2569.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2570.   
2571.               if (!TEST_ptr(confctx))
                         ^
2572.                   goto end;
2573.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE

test/sslapitest.c:2573:13: 
2571.               if (!TEST_ptr(confctx))
2572.                   goto end;
2573. >             SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2574.                                               | SSL_CONF_FLAG_SERVER);
2575.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);

ssl/ssl_conf.c:924:1: start of procedure SSL_CONF_CTX_set_flags()
  922.   }
  923.   
  924. > unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags)
  925.   {
  926.       cctx->flags |= flags;

ssl/ssl_conf.c:926:5: 
  924.   unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags)
  925.   {
  926. >     cctx->flags |= flags;
  927.       return cctx->flags;
  928.   }

ssl/ssl_conf.c:927:5: 
  925.   {
  926.       cctx->flags |= flags;
  927. >     return cctx->flags;
  928.   }
  929.   

ssl/ssl_conf.c:928:1: return from a call to SSL_CONF_CTX_set_flags
  926.       cctx->flags |= flags;
  927.       return cctx->flags;
  928. > }
  929.   
  930.   unsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, unsigned int flags)

test/sslapitest.c:2575:13: 
2573.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2574.                                               | SSL_CONF_FLAG_SERVER);
2575. >             SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2576.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2577.                                2)) {

ssl/ssl_conf.c:972:1: start of procedure SSL_CONF_CTX_set_ssl_ctx()
  970.   }
  971.   
  972. > void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx)
  973.   {
  974.       cctx->ctx = ctx;

ssl/ssl_conf.c:974:5: 
  972.   void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx)
  973.   {
  974. >     cctx->ctx = ctx;
  975.       cctx->ssl = NULL;
  976.       if (ctx) {

ssl/ssl_conf.c:975:5: 
  973.   {
  974.       cctx->ctx = ctx;
  975. >     cctx->ssl = NULL;
  976.       if (ctx) {
  977.           cctx->poptions = &ctx->options;

ssl/ssl_conf.c:976:9: Taking true branch
  974.       cctx->ctx = ctx;
  975.       cctx->ssl = NULL;
  976.       if (ctx) {
                 ^
  977.           cctx->poptions = &ctx->options;
  978.           cctx->min_version = &ctx->min_proto_version;

ssl/ssl_conf.c:977:9: 
  975.       cctx->ssl = NULL;
  976.       if (ctx) {
  977. >         cctx->poptions = &ctx->options;
  978.           cctx->min_version = &ctx->min_proto_version;
  979.           cctx->max_version = &ctx->max_proto_version;

ssl/ssl_conf.c:978:9: 
  976.       if (ctx) {
  977.           cctx->poptions = &ctx->options;
  978. >         cctx->min_version = &ctx->min_proto_version;
  979.           cctx->max_version = &ctx->max_proto_version;
  980.           cctx->pcert_flags = &ctx->cert->cert_flags;

ssl/ssl_conf.c:979:9: 
  977.           cctx->poptions = &ctx->options;
  978.           cctx->min_version = &ctx->min_proto_version;
  979. >         cctx->max_version = &ctx->max_proto_version;
  980.           cctx->pcert_flags = &ctx->cert->cert_flags;
  981.           cctx->pvfy_flags = &ctx->verify_mode;

ssl/ssl_conf.c:980:9: 
  978.           cctx->min_version = &ctx->min_proto_version;
  979.           cctx->max_version = &ctx->max_proto_version;
  980. >         cctx->pcert_flags = &ctx->cert->cert_flags;
  981.           cctx->pvfy_flags = &ctx->verify_mode;
  982.       } else {

ssl/ssl_conf.c:981:9: 
  979.           cctx->max_version = &ctx->max_proto_version;
  980.           cctx->pcert_flags = &ctx->cert->cert_flags;
  981. >         cctx->pvfy_flags = &ctx->verify_mode;
  982.       } else {
  983.           cctx->poptions = NULL;

ssl/ssl_conf.c:976:5: 
  974.       cctx->ctx = ctx;
  975.       cctx->ssl = NULL;
  976. >     if (ctx) {
  977.           cctx->poptions = &ctx->options;
  978.           cctx->min_version = &ctx->min_proto_version;

ssl/ssl_conf.c:989:1: return from a call to SSL_CONF_CTX_set_ssl_ctx
  987.           cctx->pvfy_flags = NULL;
  988.       }
  989. > }

test/sslapitest.c:2576:18: Skipping SSL_CONF_cmd(): empty list of specs
2574.                                               | SSL_CONF_FLAG_SERVER);
2575.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2576.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                         ^
2577.                                2)) {
2578.                   SSL_CONF_CTX_free(confctx);

test/testutil/tests.c:209:1: start of procedure test_int_eq()
  207.       DEFINE_COMPARISON(type, name, ge, >=, fmt)
  208.   
  209. > DEFINE_COMPARISONS(int, int, "%d")
  210.   DEFINE_COMPARISONS(unsigned int, uint, "%u")
  211.   DEFINE_COMPARISONS(char, char, "%c")

test/testutil/tests.c:209:1: Taking false branch
  207.       DEFINE_COMPARISON(type, name, ge, >=, fmt)
  208.   
  209. > DEFINE_COMPARISONS(int, int, "%d")
  210.   DEFINE_COMPARISONS(unsigned int, uint, "%u")
  211.   DEFINE_COMPARISONS(char, char, "%c")

test/testutil/tests.c:209:1: return from a call to test_int_eq
  207.       DEFINE_COMPARISON(type, name, ge, >=, fmt)
  208.   
  209. > DEFINE_COMPARISONS(int, int, "%d")
  210.   DEFINE_COMPARISONS(unsigned int, uint, "%u")
  211.   DEFINE_COMPARISONS(char, char, "%c")

test/sslapitest.c:2576:18: Taking true branch
2574.                                               | SSL_CONF_FLAG_SERVER);
2575.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2576.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                         ^
2577.                                2)) {
2578.                   SSL_CONF_CTX_free(confctx);

test/sslapitest.c:2578:17: Skipping SSL_CONF_CTX_free(): empty list of specs
2576.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2577.                                2)) {
2578.                   SSL_CONF_CTX_free(confctx);
                        ^
2579.                   goto end;
2580.               }

static int test_early_data_replay_int(int idx, int usecb, int confopt)
{
    SSL_CTX *cctx = NULL, *sctx = NULL;
    SSL *clientssl = NULL, *serverssl = NULL;
    int testresult = 0;
    SSL_SESSION *sess = NULL;
    size_t readbytes, written;
    unsigned char buf[20];
    allow_ed_cb_called = 0;
    if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                                       TLS1_VERSION, 0, &sctx,
                                       &cctx, cert, privkey)))
        return 0;
    if (usecb > 0) {
        if (confopt == 0) {
            SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
        } else {
            SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
            if (!TEST_ptr(confctx))
                goto end;
            SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
                                            | SSL_CONF_FLAG_SERVER);
            SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
            if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                             2)) {
                SSL_CONF_CTX_free(confctx);
                goto end;
            }
            SSL_CONF_CTX_free(confctx);
        }
        SSL_CTX_set_allow_early_data_cb(sctx, allow_early_data_cb, &usecb);
    }
    if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl,
                                        &serverssl, &sess, idx)))
        goto end;
    if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))
            || !TEST_true(SSL_session_reused(clientssl)))
        goto end;
    SSL_shutdown(clientssl);
    SSL_shutdown(serverssl);
    SSL_free(serverssl);
    SSL_free(clientssl);
    serverssl = clientssl = NULL;
    if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl,
                                      &clientssl, NULL, NULL))
            || !TEST_true(SSL_set_session(clientssl, sess)))
        goto end;
    if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1),
                                        &written))
            || !TEST_size_t_eq(written, strlen(MSG1)))
        goto end;
    if (usecb <= 1) {
        if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf),
                                             &readbytes),
                         SSL_READ_EARLY_DATA_FINISH)
                || !TEST_int_eq(SSL_get_early_data_status(serverssl),
                                SSL_EARLY_DATA_REJECTED))
            goto end;
    } else {
        if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf),
                                             &readbytes),
                         SSL_READ_EARLY_DATA_SUCCESS)
                || !TEST_mem_eq(MSG1, strlen(MSG1), buf, readbytes)
                || !TEST_int_gt(SSL_connect(clientssl), 0)
                || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf),
                                             &readbytes),
                                SSL_READ_EARLY_DATA_FINISH)
                || !TEST_int_eq(SSL_get_early_data_status(serverssl),
                                SSL_EARLY_DATA_ACCEPTED))
            goto end;
    }
    if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))
            || !TEST_int_eq(SSL_session_reused(clientssl), (usecb > 0) ? 1 : 0)
            || !TEST_int_eq(allow_ed_cb_called, usecb > 0 ? 1 : 0))
        goto end;
    testresult = 1;
 end:
    SSL_SESSION_free(sess);
    SSL_SESSION_free(clientpsk);
    SSL_SESSION_free(serverpsk);
    clientpsk = serverpsk = NULL;
    SSL_free(serverssl);
    SSL_free(clientssl);
    SSL_CTX_free(sctx);
    SSL_CTX_free(cctx);
    return testresult;
}
['static int test_early_data_replay_int(int idx, int usecb, int confopt)\n{\n    SSL_CTX *cctx = NULL, *sctx = NULL;\n    SSL *clientssl = NULL, *serverssl = NULL;\n    int testresult = 0;\n    SSL_SESSION *sess = NULL;\n    size_t readbytes, written;\n    unsigned char buf[20];\n    allow_ed_cb_called = 0;\n    if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),\n                                       TLS1_VERSION, 0, &sctx,\n                                       &cctx, cert, privkey)))\n        return 0;\n    if (usecb > 0) {\n        if (confopt == 0) {\n            SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);\n        } else {\n            SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();\n            if (!TEST_ptr(confctx))\n                goto end;\n            SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE\n                                            | SSL_CONF_FLAG_SERVER);\n            SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);\n            if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),\n                             2)) {\n                SSL_CONF_CTX_free(confctx);\n                goto end;\n            }\n            SSL_CONF_CTX_free(confctx);\n        }\n        SSL_CTX_set_allow_early_data_cb(sctx, allow_early_data_cb, &usecb);\n    }\n    if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl,\n                                        &serverssl, &sess, idx)))\n        goto end;\n    if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))\n            || !TEST_true(SSL_session_reused(clientssl)))\n        goto end;\n    SSL_shutdown(clientssl);\n    SSL_shutdown(serverssl);\n    SSL_free(serverssl);\n    SSL_free(clientssl);\n    serverssl = clientssl = NULL;\n    if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl,\n                                      &clientssl, NULL, NULL))\n            || !TEST_true(SSL_set_session(clientssl, sess)))\n        goto end;\n    if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1),\n                                        &written))\n            || !TEST_size_t_eq(written, strlen(MSG1)))\n        goto end;\n    if (usecb <= 1) {\n        if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf),\n                                             &readbytes),\n                         SSL_READ_EARLY_DATA_FINISH)\n                || !TEST_int_eq(SSL_get_early_data_status(serverssl),\n                                SSL_EARLY_DATA_REJECTED))\n            goto end;\n    } else {\n        if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf),\n                                             &readbytes),\n                         SSL_READ_EARLY_DATA_SUCCESS)\n                || !TEST_mem_eq(MSG1, strlen(MSG1), buf, readbytes)\n                || !TEST_int_gt(SSL_connect(clientssl), 0)\n                || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf),\n                                             &readbytes),\n                                SSL_READ_EARLY_DATA_FINISH)\n                || !TEST_int_eq(SSL_get_early_data_status(serverssl),\n                                SSL_EARLY_DATA_ACCEPTED))\n            goto end;\n    }\n    if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))\n            || !TEST_int_eq(SSL_session_reused(clientssl), (usecb > 0) ? 1 : 0)\n            || !TEST_int_eq(allow_ed_cb_called, usecb > 0 ? 1 : 0))\n        goto end;\n    testresult = 1;\n end:\n    SSL_SESSION_free(sess);\n    SSL_SESSION_free(clientpsk);\n    SSL_SESSION_free(serverpsk);\n    clientpsk = serverpsk = NULL;\n    SSL_free(serverssl);\n    SSL_free(clientssl);\n    SSL_CTX_free(sctx);\n    SSL_CTX_free(cctx);\n    return testresult;\n}', 'IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,\n                        TLS_server_method,\n                        ossl_statem_accept,\n                        ssl_undefined_function, TLSv1_2_enc_data)', 'IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,\n                        TLS_client_method,\n                        ssl_undefined_function,\n                        ossl_statem_connect, TLSv1_2_enc_data)', 'int test_true(const char *file, int line, const char *s, int b)\n{\n    if (b)\n        return 1;\n    test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");\n    return 0;\n}', 'SSL_CONF_CTX *SSL_CONF_CTX_new(void)\n{\n    SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));\n    return ret;\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    FAILTEST();\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    INCREMENT(malloc_count);\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\n    if (allow_customize) {\n        allow_customize = 0;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)(file); (void)(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'int test_ptr(const char *file, int line, const char *s, const void *p)\n{\n    if (p != NULL)\n        return 1;\n    test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);\n    return 0;\n}', 'unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags)\n{\n    cctx->flags |= flags;\n    return cctx->flags;\n}', 'void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx)\n{\n    cctx->ctx = ctx;\n    cctx->ssl = NULL;\n    if (ctx) {\n        cctx->poptions = &ctx->options;\n        cctx->min_version = &ctx->min_proto_version;\n        cctx->max_version = &ctx->max_proto_version;\n        cctx->pcert_flags = &ctx->cert->cert_flags;\n        cctx->pvfy_flags = &ctx->verify_mode;\n    } else {\n        cctx->poptions = NULL;\n        cctx->min_version = NULL;\n        cctx->max_version = NULL;\n        cctx->pcert_flags = NULL;\n        cctx->pvfy_flags = NULL;\n    }\n}', 'DEFINE_COMPARISONS(int, int, "%d")']