]>
Commit | Line | Data |
---|---|---|
8a5ed9dc | 1 | /* |
b0edda11 | 2 | * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. |
8a5ed9dc | 3 | * |
909f1a2e | 4 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
8a5ed9dc TM |
5 | * this file except in compliance with the License. You can obtain a copy |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
8 | */ | |
9 | ||
10 | #include <stdio.h> | |
11 | #include <openssl/opensslconf.h> | |
12 | ||
13 | #include <string.h> | |
14 | #include <openssl/evp.h> | |
15 | #include <openssl/ssl.h> | |
16 | #include <openssl/tls1.h> | |
17 | #include "testutil.h" | |
18 | ||
8a5ed9dc TM |
19 | |
20 | static int test_func(void) | |
21 | { | |
21819f78 TM |
22 | int ret = 1; |
23 | SSL_CTX *ctx; | |
24 | ||
25 | if (!TEST_ptr(ctx = SSL_CTX_new(TLS_method()))) | |
26 | return 0; | |
8a5ed9dc TM |
27 | if (!TEST_int_eq(SSL_CTX_get_min_proto_version(ctx), TLS1_2_VERSION) |
28 | && !TEST_int_eq(SSL_CTX_get_max_proto_version(ctx), TLS1_2_VERSION)) { | |
29 | TEST_info("min/max version setting incorrect"); | |
21819f78 | 30 | ret = 0; |
8a5ed9dc | 31 | } |
21819f78 TM |
32 | SSL_CTX_free(ctx); |
33 | return ret; | |
8a5ed9dc TM |
34 | } |
35 | ||
36 | int global_init(void) | |
37 | { | |
38 | if (!OPENSSL_init_ssl(OPENSSL_INIT_ENGINE_ALL_BUILTIN | |
39 | | OPENSSL_INIT_LOAD_CONFIG, NULL)) | |
40 | return 0; | |
41 | return 1; | |
42 | } | |
43 | ||
44 | int setup_tests(void) | |
45 | { | |
8a5ed9dc TM |
46 | ADD_TEST(test_func); |
47 | return 1; | |
48 | } |