Commit 7b9f8f7f authored by Matt Caswell's avatar Matt Caswell
Browse files

Auto init/deinit libcrypto



This builds on the previous commit to auto initialise/deinitialise
libcrypto.

Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
parent b184e3ef
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -1504,7 +1504,6 @@ int s_client_main(int argc, char **argv)


    if (async) {
    if (async) {
        SSL_CTX_set_mode(ctx, SSL_MODE_ASYNC);
        SSL_CTX_set_mode(ctx, SSL_MODE_ASYNC);
        ASYNC_init(1, 0, 0);
    }
    }


    if (!config_ctx(cctx, ssl_args, ctx, jpake_secret == NULL))
    if (!config_ctx(cctx, ssl_args, ctx, jpake_secret == NULL))
@@ -2420,9 +2419,6 @@ int s_client_main(int argc, char **argv)
            print_stuff(bio_c_out, con, 1);
            print_stuff(bio_c_out, con, 1);
        SSL_free(con);
        SSL_free(con);
    }
    }
    if (async) {
        ASYNC_cleanup(1);
    }
#if !defined(OPENSSL_NO_NEXTPROTONEG)
#if !defined(OPENSSL_NO_NEXTPROTONEG)
    OPENSSL_free(next_proto.data);
    OPENSSL_free(next_proto.data);
#endif
#endif
+0 −4
Original line number Original line Diff line number Diff line
@@ -1721,7 +1721,6 @@ int s_server_main(int argc, char *argv[])


    if (async) {
    if (async) {
        SSL_CTX_set_mode(ctx, SSL_MODE_ASYNC);
        SSL_CTX_set_mode(ctx, SSL_MODE_ASYNC);
        ASYNC_init(1, 0, 0);
    }
    }


#ifndef OPENSSL_NO_SRTP
#ifndef OPENSSL_NO_SRTP
@@ -2026,9 +2025,6 @@ int s_server_main(int argc, char *argv[])
    bio_s_out = NULL;
    bio_s_out = NULL;
    BIO_free(bio_s_msg);
    BIO_free(bio_s_msg);
    bio_s_msg = NULL;
    bio_s_msg = NULL;
    if (async) {
        ASYNC_cleanup(1);
    }
    return (ret);
    return (ret);
}
}


+0 −5
Original line number Original line Diff line number Diff line
@@ -80,11 +80,6 @@ int async_global_init(void)
    return 0;
    return 0;
}
}


int async_local_init(void)
{
    return 0;
}

void async_local_cleanup(void)
void async_local_cleanup(void)
{
{
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -66,7 +66,7 @@ typedef struct async_fibre_st {




# define async_set_ctx(nctx)                    0
# define async_set_ctx(nctx)                    0
# define async_get_ctx()                        ((async_ctx *)NULL)
# define async_arch_get_ctx()                   ((async_ctx *)NULL)
# define async_fibre_swapcontext(o,n,r)         0
# define async_fibre_swapcontext(o,n,r)         0
# define async_fibre_makecontext(c)             0
# define async_fibre_makecontext(c)             0
# define async_fibre_free(f)
# define async_fibre_free(f)
+0 −8
Original line number Original line Diff line number Diff line
@@ -72,14 +72,6 @@ int async_global_init(void)
    return 1;
    return 1;
}
}


int async_local_init(void)
{
    if (!async_set_ctx(NULL) || ! async_set_pool(NULL))
        return 0;

    return 1;
}

void async_local_cleanup(void)
void async_local_cleanup(void)
{
{
}
}
Loading