]> git.ipfire.org Git - thirdparty/openssl.git/blob - test/cipher_overhead_test.c
Fix undefined behaviour when printing the X509 serial
[thirdparty/openssl.git] / test / cipher_overhead_test.c
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
10 #include <stdio.h>
11
12 #include "../ssl/ssl_locl.h"
13
14 int main(void)
15 {
16 int i, n = ssl3_num_ciphers();
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;
24 if (!ssl_cipher_get_overhead(ciph, &mac, &in, &blk, &ex)) {
25 printf("Error getting overhead for %s\n", ciph->name);
26 exit(1);
27 } else {
28 printf("Cipher %s: %"OSSLzu" %"OSSLzu" %"OSSLzu" %"OSSLzu"\n",
29 ciph->name, mac, in, blk, ex);
30 }
31 }
32 exit(0);
33 }