Loading test/build.info +5 −1 Changes for test/build.info: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -276,10 +276,14 @@ IF[{- !$disabled{tests} -}] DEPEND[bio_enc_test]=../libcrypto IF[{- $disabled{shared} -}] PROGRAMS_NO_INST=wpackettest PROGRAMS_NO_INST=wpackettest cipher_overhead_test SOURCE[wpackettest]=wpackettest.c testutil.c INCLUDE[wpackettest]=../include DEPEND[wpackettest]=../libcrypto ../libssl SOURCE[cipher_overhead_test]=cipher_overhead_test.c INCLUDE[cipher_overhead_test]=.. ../include DEPEND[cipher_overhead_test]=../libcrypto ../libssl ENDIF ENDIF Loading test/cipher_overhead_test.c +33 Changes for test/cipher_overhead_test.c: 33 added lines, 0 removed lines. Original line number Diff line number Diff line /* * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <stdio.h> #include "../ssl/ssl_locl.h" int main(void) { int i, n = ssl3_num_ciphers(); const SSL_CIPHER *ciph; size_t mac, in, blk, ex; for (i = 0; i < n; i++) { ciph = ssl3_get_cipher(i); if (!ciph->min_dtls) continue; if (!ssl_cipher_get_overhead(ciph, &mac, &in, &blk, &ex)) { printf("Error getting overhead for %s\n", ciph->name); exit(1); } else { printf("Cipher %s: %"OSSLzu" %"OSSLzu" %"OSSLzu" %"OSSLzu"\n", ciph->name, mac, in, blk, ex); } } exit(0); } test/recipes/90-test_overhead.t +20 Changes for test/recipes/90-test_overhead.t: 20 added lines, 0 removed lines. Original line number Diff line number Diff line #! /usr/bin/env perl # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html use OpenSSL::Test; use OpenSSL::Test::Utils; setup("test_overhead"); plan skip_all => "Only supported in no-shared builds" if !disabled("shared"); plan tests => 1; ok(run(test(["cipher_overhead_test"])), "running cipher_overhead_test"); Loading
test/build.info +5 −1 Changes for test/build.info: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -276,10 +276,14 @@ IF[{- !$disabled{tests} -}] DEPEND[bio_enc_test]=../libcrypto IF[{- $disabled{shared} -}] PROGRAMS_NO_INST=wpackettest PROGRAMS_NO_INST=wpackettest cipher_overhead_test SOURCE[wpackettest]=wpackettest.c testutil.c INCLUDE[wpackettest]=../include DEPEND[wpackettest]=../libcrypto ../libssl SOURCE[cipher_overhead_test]=cipher_overhead_test.c INCLUDE[cipher_overhead_test]=.. ../include DEPEND[cipher_overhead_test]=../libcrypto ../libssl ENDIF ENDIF Loading
test/cipher_overhead_test.c +33 Changes for test/cipher_overhead_test.c: 33 added lines, 0 removed lines. Original line number Diff line number Diff line /* * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <stdio.h> #include "../ssl/ssl_locl.h" int main(void) { int i, n = ssl3_num_ciphers(); const SSL_CIPHER *ciph; size_t mac, in, blk, ex; for (i = 0; i < n; i++) { ciph = ssl3_get_cipher(i); if (!ciph->min_dtls) continue; if (!ssl_cipher_get_overhead(ciph, &mac, &in, &blk, &ex)) { printf("Error getting overhead for %s\n", ciph->name); exit(1); } else { printf("Cipher %s: %"OSSLzu" %"OSSLzu" %"OSSLzu" %"OSSLzu"\n", ciph->name, mac, in, blk, ex); } } exit(0); }
test/recipes/90-test_overhead.t +20 Changes for test/recipes/90-test_overhead.t: 20 added lines, 0 removed lines. Original line number Diff line number Diff line #! /usr/bin/env perl # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html use OpenSSL::Test; use OpenSSL::Test::Utils; setup("test_overhead"); plan skip_all => "Only supported in no-shared builds" if !disabled("shared"); plan tests => 1; ok(run(test(["cipher_overhead_test"])), "running cipher_overhead_test");