diff options
Diffstat (limited to 'src/libgcrypt-test.c')
-rw-r--r-- | src/libgcrypt-test.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/libgcrypt-test.c b/src/libgcrypt-test.c new file mode 100644 index 0000000..5b4ec31 --- /dev/null +++ b/src/libgcrypt-test.c @@ -0,0 +1,32 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include <stdio.h> +#include <gcrypt.h> + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + if (!gcry_check_version (GCRYPT_VERSION)) { + fputs ("libgcrypt version mismatch\n", stderr); + exit (2); + } + + gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN); + gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0); + gcry_control (GCRYCTL_RESUME_SECMEM_WARN); + gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); + + if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) { + fputs ("libgcrypt has not been initialized\n", stderr); + abort (); + } + + printf("gcrypt version: %s", GCRYPT_VERSION ); + + return 0; +} |