]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/cipher_overhead_test.c
Fix SSL_check_chain()
[thirdparty/openssl.git] / test / cipher_overhead_test.c
CommitLineData
542dd9c5 1/*
c486283c 2 * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
542dd9c5 3 *
909f1a2e 4 * Licensed under the Apache License 2.0 (the "License"). You may not use
542dd9c5
DW
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
176db6dc 10#include "internal/nelem.h"
3304d578 11#include "testutil.h"
542dd9c5
DW
12#include "../ssl/ssl_locl.h"
13
3304d578 14static int cipher_overhead(void)
542dd9c5 15{
3304d578 16 int ret = 1, i, n = ssl3_num_ciphers();
542dd9c5
DW
17 const SSL_CIPHER *ciph;
18 size_t mac, in, blk, ex;
19
20 for (i = 0; i < n; i++) {
21 ciph = ssl3_get_cipher(i);
22 if (!ciph->min_dtls)
23 continue;
3304d578
RS
24 if (!TEST_true(ssl_cipher_get_overhead(ciph, &mac, &in, &blk, &ex))) {
25 TEST_info("Failed getting %s", ciph->name);
26 ret = 0;
542dd9c5 27 } else {
a9c6d221 28 TEST_info("Cipher %s: %zu %zu %zu %zu",
3304d578 29 ciph->name, mac, in, blk, ex);
542dd9c5
DW
30 }
31 }
3304d578
RS
32 return ret;
33}
34
ad887416 35int setup_tests(void)
3304d578
RS
36{
37 ADD_TEST(cipher_overhead);
ad887416 38 return 1;
542dd9c5 39}