diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-09-23 21:42:14 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-09-23 21:42:17 +0200 |
commit | 49bbfcde40d27d49b978415ce9f08ecd12eaafb0 (patch) | |
tree | b8ea605984a1b0b88085515930d28cfb250a7ac1 | |
parent | f63f0e4866c8e7955162caa075b1d253647b36a4 (diff) | |
download | gnutls-49bbfcde40d27d49b978415ce9f08ecd12eaafb0.tar.gz |
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 <nmav@redhat.com>
-rw-r--r-- | tests/cipher-alignment.c | 7 |
1 files changed, 6 insertions, 1 deletions
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(); } |