From 1fb326bc461257254fc20cb53921e9eb74d5dacf Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Thu, 17 Nov 2011 08:33:56 +0100 Subject: [PATCH] remove obsolete non conformant tests for crypt --- tests/crypt.c | 40 ---------------------------------------- tests/decrypt.c | 40 ---------------------------------------- 2 files changed, 80 deletions(-) delete mode 100644 tests/crypt.c delete mode 100644 tests/decrypt.c diff --git a/tests/crypt.c b/tests/crypt.c deleted file mode 100644 index 878015b..0000000 --- a/tests/crypt.c +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include -#include -#include -#include - -#include "token/cclass.h" -#include "token/crypt.h" -#include "base64.h" - - -int -main(int argc, char * argv[]) -{ - char data[] = "ein weiterer test"; - char pass[] = "1234"; - char * b64d = NULL; - char * encrypted = NULL; - size_t length = strlen(data); - - struct CRYPT * crypt = NULL; - - crypt = new(CRYPT, MCRYPT_RIJNDAEL_256, MCRYPT_CFB); - encrypted = crypt_encrypt(crypt, data, pass, &length); - delete(&crypt); - - b64d = calloc(BASE64_LENGTH(length), sizeof(char)); - base64_encode(encrypted, length, b64d, BASE64_LENGTH(length)); - free(encrypted); - - b64d = realloc(b64d, BASE64_LENGTH(length) + 1); - b64d[BASE64_LENGTH(length)] = '\0'; - - printf("%s\n", b64d); - free(b64d); - - return 0; -} - -// vim: set et ts=4 sw=4: diff --git a/tests/decrypt.c b/tests/decrypt.c deleted file mode 100644 index 5085c16..0000000 --- a/tests/decrypt.c +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include -#include -#include -#include - -#include "token/cclass.h" -#include "token/crypt.h" -#include "base64.h" - - -int -main(int argc, char * argv[]) -{ - char b64d[] = "J4rYV+oJ9+EzoyLy/o8aolRSw51DzDhTyeht/tcdUA6hNNxaVFrW/FXVTfWXzkZgW1oc1D2vwkfQ80PD+iWzcw"; - char pass[] = "1234"; - char * data = NULL; - char * decrypted = NULL; - size_t length = strlen(b64d); - - struct CRYPT * crypt = NULL; - - data = calloc(length, sizeof(char)); - base64_decode(b64d, length, data, &length); - - data = realloc(data, length + 1); - data[length] = '\0'; - - crypt = new(CRYPT, MCRYPT_RIJNDAEL_256, MCRYPT_CFB); - decrypted = crypt_decrypt(crypt, data, pass, &length); - delete(&crypt); - free(data); - - printf("%s\n", decrypted); - free(decrypted); - - return 0; -} - -// vim: set et ts=4 sw=4: