VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.5/test/sysdefaulttest.c@ 105770

Last change on this file since 105770 was 104078, checked in by vboxsync, 8 months ago

openssl-3.1.5: Applied and adjusted our OpenSSL changes to 3.1.4. bugref:10638

File size: 1.1 KB
Line 
1/*
2 * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
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
19static SSL_CTX *ctx;
20
21static int test_func(void)
22{
23 if (!TEST_int_eq(SSL_CTX_get_min_proto_version(ctx), TLS1_2_VERSION)
24 && !TEST_int_eq(SSL_CTX_get_max_proto_version(ctx), TLS1_2_VERSION)) {
25 TEST_info("min/max version setting incorrect");
26 return 0;
27 }
28 return 1;
29}
30
31int global_init(void)
32{
33 if (!OPENSSL_init_ssl(OPENSSL_INIT_ENGINE_ALL_BUILTIN
34 | OPENSSL_INIT_LOAD_CONFIG, NULL))
35 return 0;
36 return 1;
37}
38
39int setup_tests(void)
40{
41 if (!TEST_ptr(ctx = SSL_CTX_new(TLS_method())))
42 return 0;
43 ADD_TEST(test_func);
44 return 1;
45}
46
47void cleanup_tests(void)
48{
49 SSL_CTX_free(ctx);
50}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette