Commit 13c9bb3e authored by Matt Caswell's avatar Matt Caswell
Browse files

Client side version negotiation rewrite



Continuing from the previous commit this changes the way we do client side
version negotiation. Similarly all of the s23* "up front" state machine code
has been avoided and again things now work much the same way as they already
did for DTLS, i.e. we just do most of the work in the
ssl3_get_server_hello() function.

Reviewed-by: default avatarKurt Roeckx <kurt@openssl.org>
parent 32ec4153
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1261,7 +1261,7 @@ OCSP_RESPONSE *process_responder(OCSP_REQUEST *req,
        BIO_set_conn_port(cbio, port);
    if (use_ssl == 1) {
        BIO *sbio;
        ctx = SSL_CTX_new(SSLv23_client_method());
        ctx = SSL_CTX_new(TLS_client_method());
        if (ctx == NULL) {
            BIO_printf(bio_err, "Error creating SSL context.\n");
            goto end;
+1 −1
Original line number Diff line number Diff line
@@ -636,7 +636,7 @@ int s_client_main(int argc, char **argv)
    SSL_CONF_CTX *cctx = NULL;
    STACK_OF(OPENSSL_STRING) *ssl_args = NULL;
    STACK_OF(X509_CRL) *crls = NULL;
    const SSL_METHOD *meth = SSLv23_client_method();
    const SSL_METHOD *meth = TLS_client_method();
    char *CApath = NULL, *CAfile = NULL, *cbuf = NULL, *sbuf = NULL, *mbuf =
        NULL;
    char *cert_file = NULL, *key_file = NULL, *chain_file = NULL, *prog;
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ int s_time_main(int argc, char **argv)
    int exitNow = 0;            /* Set when it's time to exit main */
#endif

    meth = SSLv23_client_method();
    meth = TLS_client_method();
    verify_depth = 0;
    verify_error = X509_V_OK;

+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ int main(int argc, char **argv)
    ERR_load_SSL_strings();
    SSL_library_init();

    ctx = SSL_CTX_new(SSLv23_client_method());
    ctx = SSL_CTX_new(TLS_client_method());
    cctx = SSL_CONF_CTX_new();
    SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_CLIENT);
    SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ int main(int argc, char **argv)
        goto end;
    }

    ctx = SSL_CTX_new(SSLv23_client_method());
    ctx = SSL_CTX_new(TLS_client_method());
    cctx = SSL_CONF_CTX_new();
    SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_CLIENT);
    SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_FILE);
Loading