]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/cipher_overhead_test.c
VMS: Make sure to include MAIN from static libraries if needed
[thirdparty/openssl.git] / test / cipher_overhead_test.c
CommitLineData
542dd9c5
DW
1/*
2 * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the OpenSSL license (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
3304d578
RS
10#include "e_os.h"
11#include "testutil.h"
12#include "test_main.h"
542dd9c5 13
27fc8ae2
RL
14#ifdef __VMS
15# pragma names save
16# pragma names as_is,shortened
17#endif
18
542dd9c5
DW
19#include "../ssl/ssl_locl.h"
20
27fc8ae2
RL
21#ifdef __VMS
22# pragma names restore
23#endif
24
3304d578 25static int cipher_overhead(void)
542dd9c5 26{
3304d578 27 int ret = 1, i, n = ssl3_num_ciphers();
542dd9c5
DW
28 const SSL_CIPHER *ciph;
29 size_t mac, in, blk, ex;
30
31 for (i = 0; i < n; i++) {
32 ciph = ssl3_get_cipher(i);
33 if (!ciph->min_dtls)
34 continue;
3304d578
RS
35 if (!TEST_true(ssl_cipher_get_overhead(ciph, &mac, &in, &blk, &ex))) {
36 TEST_info("Failed getting %s", ciph->name);
37 ret = 0;
542dd9c5 38 } else {
3304d578
RS
39 TEST_info("Cipher %s: %"OSSLzu" %"OSSLzu" %"OSSLzu" %"OSSLzu,
40 ciph->name, mac, in, blk, ex);
542dd9c5
DW
41 }
42 }
3304d578
RS
43 return ret;
44}
45
46void register_tests(void)
47{
48 ADD_TEST(cipher_overhead);
542dd9c5 49}