Commit 7d7f6834 authored by Richard Levitte's avatar Richard Levitte
Browse files

Enhance ssltestlib's create_ssl_ctx_pair to take min and max proto version



Have all test programs using that function specify those versions.
Additionally, have the remaining test programs that use SSL_CTX_new
directly specify at least the maximum protocol version.

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5663)
parent 2e2faa8c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -299,6 +299,7 @@ static int test_asyncio(int test)
    char buf[sizeof(testdata)];

    if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                                       TLS1_VERSION, TLS_MAX_VERSION,
                                       &serverctx, &clientctx, cert, privkey)))
        goto end;

+2 −0
Original line number Diff line number Diff line
@@ -78,6 +78,8 @@ static int test_client_hello(int currtest)
    ctx = SSL_CTX_new(TLS_method());
    if (!TEST_ptr(ctx))
        goto end;
    if (!TEST_true(SSL_CTX_set_max_proto_version(ctx, TLS_MAX_VERSION)))
        goto end;

    switch(currtest) {
    case TEST_SET_SESSION_TICK_DATA_VER_NEG:
+3 −2
Original line number Diff line number Diff line
@@ -61,8 +61,9 @@ static int test_dtls_unprocessed(int testidx)
    timer_cb_count = 0;

    if (!TEST_true(create_ssl_ctx_pair(DTLS_server_method(),
                                       DTLS_client_method(), &sctx,
                                       &cctx, cert, privkey)))
                                       DTLS_client_method(),
                                       DTLS1_VERSION, DTLS_MAX_VERSION,
                                       &sctx, &cctx, cert, privkey)))
        return 0;

    if (!TEST_true(SSL_CTX_set_cipher_list(cctx, "AES128-SHA")))
+3 −2
Original line number Diff line number Diff line
@@ -28,8 +28,9 @@ static int test_fatalerr(void)
        0x17, 0x03, 0x03, 0x00, 0x05, 'D', 'u', 'm', 'm', 'y'
    };

    if (!TEST_true(create_ssl_ctx_pair(TLS_method(), TLS_method(), &sctx, &cctx,
                                       cert, privkey)))
    if (!TEST_true(create_ssl_ctx_pair(TLS_method(), TLS_method(),
                                       TLS1_VERSION, TLS_MAX_VERSION,
                                       &sctx, &cctx, cert, privkey)))
        goto err;

    /*
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ static int test_record_overflow(int idx)
    ERR_clear_error();

    if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                                       TLS1_VERSION, TLS_MAX_VERSION,
                                       &sctx, &cctx, cert, privkey)))
        goto end;

Loading