]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/cipher_overhead_test.c
Don't store an HMAC key for longer than we need
[thirdparty/openssl.git] / test / cipher_overhead_test.c
CommitLineData
542dd9c5 1/*
ad887416 2 * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
542dd9c5
DW
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
176db6dc 10#include "internal/nelem.h"
3304d578 11#include "testutil.h"
542dd9c5 12
27fc8ae2
RL
13#ifdef __VMS
14# pragma names save
15# pragma names as_is,shortened
16#endif
17
b5acbf91 18#include "../ssl/ssl_local.h"
542dd9c5 19
27fc8ae2
RL
20#ifdef __VMS
21# pragma names restore
22#endif
23
3304d578 24static int cipher_overhead(void)
542dd9c5 25{
3304d578 26 int ret = 1, i, n = ssl3_num_ciphers();
542dd9c5
DW
27 const SSL_CIPHER *ciph;
28 size_t mac, in, blk, ex;
29
30 for (i = 0; i < n; i++) {
31 ciph = ssl3_get_cipher(i);
32 if (!ciph->min_dtls)
33 continue;
3304d578
RS
34 if (!TEST_true(ssl_cipher_get_overhead(ciph, &mac, &in, &blk, &ex))) {
35 TEST_info("Failed getting %s", ciph->name);
36 ret = 0;
542dd9c5 37 } else {
a9c6d221 38 TEST_info("Cipher %s: %zu %zu %zu %zu",
3304d578 39 ciph->name, mac, in, blk, ex);
542dd9c5
DW
40 }
41 }
3304d578
RS
42 return ret;
43}
44
ad887416 45int setup_tests(void)
3304d578
RS
46{
47 ADD_TEST(cipher_overhead);
ad887416 48 return 1;
542dd9c5 49}