From: Nikos Mavrogiannopoulos Date: Mon, 23 Sep 2019 19:42:14 +0000 (+0200) Subject: tests: cipher-alignment: ensure cipher registration X-Git-Tag: gnutls_3_6_10~9^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49bbfcde40d27d49b978415ce9f08ecd12eaafb0;p=thirdparty%2Fgnutls.git tests: cipher-alignment: ensure cipher registration That is, ensure that the registered cipher is called at least once in the program. That is, to make this test fail if the registration API ever become deprecated/no-op. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/tests/cipher-alignment.c b/tests/cipher-alignment.c index bc5239281a..0537c58186 100644 --- a/tests/cipher-alignment.c +++ b/tests/cipher-alignment.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) #include "ex-session-info.c" #include "ex-x509-info.c" -pid_t child; +static pid_t child; static void tls_log_func(int level, const char *str) { @@ -126,6 +126,8 @@ struct myaes_ctx { int enc; }; +static unsigned aes_init = 0; + static int myaes_init(gnutls_cipher_algorithm_t algorithm, void **_ctx, int enc) { @@ -138,6 +140,7 @@ myaes_init(gnutls_cipher_algorithm_t algorithm, void **_ctx, int enc) } ((struct myaes_ctx *) (*_ctx))->enc = enc; + aes_init = 1; return 0; } @@ -511,6 +514,8 @@ void doit(void) start("NORMAL:-CIPHER-ALL:+AES-128-CBC:-VERS-ALL:+VERS-TLS1.1"); start("NORMAL:-CIPHER-ALL:+AES-128-CBC:-VERS-ALL:+VERS-TLS1.2"); + assert(aes_init != 0); + gnutls_global_deinit(); }