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


test/sslapitest.c:2186:1: start of procedure test_early_data_replay_int()
2184.    * confopt == 1: Configure anti-replay using SSL_CONF
2185.    */
2186. > static int test_early_data_replay_int(int idx, int usecb, int confopt)
2187.   {
2188.       SSL_CTX *cctx = NULL, *sctx = NULL;

test/sslapitest.c:2188:5: 
2186.   static int test_early_data_replay_int(int idx, int usecb, int confopt)
2187.   {
2188. >     SSL_CTX *cctx = NULL, *sctx = NULL;
2189.       SSL *clientssl = NULL, *serverssl = NULL;
2190.       int testresult = 0;

test/sslapitest.c:2189:5: 
2187.   {
2188.       SSL_CTX *cctx = NULL, *sctx = NULL;
2189. >     SSL *clientssl = NULL, *serverssl = NULL;
2190.       int testresult = 0;
2191.       SSL_SESSION *sess = NULL;

test/sslapitest.c:2190:5: 
2188.       SSL_CTX *cctx = NULL, *sctx = NULL;
2189.       SSL *clientssl = NULL, *serverssl = NULL;
2190. >     int testresult = 0;
2191.       SSL_SESSION *sess = NULL;
2192.       size_t readbytes, written;

test/sslapitest.c:2191:5: 
2189.       SSL *clientssl = NULL, *serverssl = NULL;
2190.       int testresult = 0;
2191. >     SSL_SESSION *sess = NULL;
2192.       size_t readbytes, written;
2193.       unsigned char buf[20];

test/sslapitest.c:2195:5: 
2193.       unsigned char buf[20];
2194.   
2195. >     allow_ed_cb_called = 0;
2196.   
2197.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),

test/sslapitest.c:2197:10: 
2195.       allow_ed_cb_called = 0;
2196.   
2197. >     if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
2198.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2199.                                          &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:2197:10: Condition is true
2195.       allow_ed_cb_called = 0;
2196.   
2197.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2198.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2199.                                          &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:2197:10: Taking false branch
2195.       allow_ed_cb_called = 0;
2196.   
2197.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2198.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2199.                                          &cctx, cert, privkey)))

test/sslapitest.c:2202:9: Taking true branch
2200.           return 0;
2201.   
2202.       if (usecb > 0) {
                ^
2203.           if (confopt == 0) {
2204.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);

test/sslapitest.c:2203:13: Taking false branch
2201.   
2202.       if (usecb > 0) {
2203.           if (confopt == 0) {
                    ^
2204.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2205.           } else {

test/sslapitest.c:2206:13: 
2204.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2205.           } else {
2206. >             SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2207.   
2208.               if (!TEST_ptr(confctx))

ssl/ssl_conf.c:876:1: start of procedure SSL_CONF_CTX_new()
  874.   }
  875.   
  876. > SSL_CONF_CTX *SSL_CONF_CTX_new(void)
  877.   {
  878.       SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));

ssl/ssl_conf.c:878:5: 
  876.   SSL_CONF_CTX *SSL_CONF_CTX_new(void)
  877.   {
  878. >     SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  879.   
  880.       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:880:5: 
  878.       SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  879.   
  880. >     return ret;
  881.   }
  882.   

ssl/ssl_conf.c:881:1: return from a call to SSL_CONF_CTX_new
  879.   
  880.       return ret;
  881. > }
  882.   
  883.   int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx)

test/sslapitest.c:2208:18: 
2206.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2207.   
2208. >             if (!TEST_ptr(confctx))
2209.                   goto end;
2210.               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:2208:18: Taking false branch
2206.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2207.   
2208.               if (!TEST_ptr(confctx))
                         ^
2209.                   goto end;
2210.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE

test/sslapitest.c:2210:13: 
2208.               if (!TEST_ptr(confctx))
2209.                   goto end;
2210. >             SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2211.                                               | SSL_CONF_FLAG_SERVER);
2212.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);

ssl/ssl_conf.c:928:1: start of procedure SSL_CONF_CTX_set_flags()
  926.   }
  927.   
  928. > unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags)
  929.   {
  930.       cctx->flags |= flags;

ssl/ssl_conf.c:930:5: 
  928.   unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags)
  929.   {
  930. >     cctx->flags |= flags;
  931.       return cctx->flags;
  932.   }

ssl/ssl_conf.c:931:5: 
  929.   {
  930.       cctx->flags |= flags;
  931. >     return cctx->flags;
  932.   }
  933.   

ssl/ssl_conf.c:932:1: return from a call to SSL_CONF_CTX_set_flags
  930.       cctx->flags |= flags;
  931.       return cctx->flags;
  932. > }
  933.   
  934.   unsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, unsigned int flags)

test/sslapitest.c:2212:13: 
2210.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2211.                                               | SSL_CONF_FLAG_SERVER);
2212. >             SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2213.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2214.                                2)) {

ssl/ssl_conf.c:976:1: start of procedure SSL_CONF_CTX_set_ssl_ctx()
  974.   }
  975.   
  976. > void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx)
  977.   {
  978.       cctx->ctx = ctx;

ssl/ssl_conf.c:978:5: 
  976.   void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx)
  977.   {
  978. >     cctx->ctx = ctx;
  979.       cctx->ssl = NULL;
  980.       if (ctx) {

ssl/ssl_conf.c:979:5: 
  977.   {
  978.       cctx->ctx = ctx;
  979. >     cctx->ssl = NULL;
  980.       if (ctx) {
  981.           cctx->poptions = &ctx->options;

ssl/ssl_conf.c:980:9: Taking true branch
  978.       cctx->ctx = ctx;
  979.       cctx->ssl = NULL;
  980.       if (ctx) {
                 ^
  981.           cctx->poptions = &ctx->options;
  982.           cctx->min_version = &ctx->min_proto_version;

ssl/ssl_conf.c:981:9: 
  979.       cctx->ssl = NULL;
  980.       if (ctx) {
  981. >         cctx->poptions = &ctx->options;
  982.           cctx->min_version = &ctx->min_proto_version;
  983.           cctx->max_version = &ctx->max_proto_version;

ssl/ssl_conf.c:982:9: 
  980.       if (ctx) {
  981.           cctx->poptions = &ctx->options;
  982. >         cctx->min_version = &ctx->min_proto_version;
  983.           cctx->max_version = &ctx->max_proto_version;
  984.           cctx->pcert_flags = &ctx->cert->cert_flags;

ssl/ssl_conf.c:983:9: 
  981.           cctx->poptions = &ctx->options;
  982.           cctx->min_version = &ctx->min_proto_version;
  983. >         cctx->max_version = &ctx->max_proto_version;
  984.           cctx->pcert_flags = &ctx->cert->cert_flags;
  985.           cctx->pvfy_flags = &ctx->verify_mode;

ssl/ssl_conf.c:984:9: 
  982.           cctx->min_version = &ctx->min_proto_version;
  983.           cctx->max_version = &ctx->max_proto_version;
  984. >         cctx->pcert_flags = &ctx->cert->cert_flags;
  985.           cctx->pvfy_flags = &ctx->verify_mode;
  986.       } else {

ssl/ssl_conf.c:985:9: 
  983.           cctx->max_version = &ctx->max_proto_version;
  984.           cctx->pcert_flags = &ctx->cert->cert_flags;
  985. >         cctx->pvfy_flags = &ctx->verify_mode;
  986.       } else {
  987.           cctx->poptions = NULL;

ssl/ssl_conf.c:980:5: 
  978.       cctx->ctx = ctx;
  979.       cctx->ssl = NULL;
  980. >     if (ctx) {
  981.           cctx->poptions = &ctx->options;
  982.           cctx->min_version = &ctx->min_proto_version;

ssl/ssl_conf.c:993:1: return from a call to SSL_CONF_CTX_set_ssl_ctx
  991.           cctx->pvfy_flags = NULL;
  992.       }
  993. > }

test/sslapitest.c:2213:18: Skipping SSL_CONF_cmd(): empty list of specs
2211.                                               | SSL_CONF_FLAG_SERVER);
2212.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2213.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                         ^
2214.                                2)) {
2215.                   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:2213:18: Taking true branch
2211.                                               | SSL_CONF_FLAG_SERVER);
2212.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2213.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                         ^
2214.                                2)) {
2215.                   SSL_CONF_CTX_free(confctx);

test/sslapitest.c:2215:17: Skipping SSL_CONF_CTX_free(): empty list of specs
2213.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2214.                                2)) {
2215.                   SSL_CONF_CTX_free(confctx);
                        ^
2216.                   goto end;
2217.               }

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, TLS_MAX_VERSION, &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, TLS_MAX_VERSION, &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")']