diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2009-12-02 21:51:40 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2009-12-02 22:10:05 +0200 |
commit | 54486afbfcf3398846d5c20d3094bdb7d0a43ff2 (patch) | |
tree | b43c1792f4037b7d4d1b9e967b474758443a3c86 /tests | |
parent | b373f5d1aac157916c6b44cb6a2ec505e4b46784 (diff) | |
download | gnutls-54486afbfcf3398846d5c20d3094bdb7d0a43ff2.tar.gz |
Added plain MD5 hash check and corrected gnutls_hash_fast() usage in openssl.c
Corrected new hash API bug that prevented usage of plain hash functions.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/gc.c b/tests/gc.c index 86614ac6a1..9330ac2fc3 100644 --- a/tests/gc.c +++ b/tests/gc.c @@ -42,6 +42,22 @@ doit (void) gnutls_global_init (); err = + _gnutls_hash_fast (GNUTLS_MAC_MD5, NULL, 0, "testtest", 8, digest); + if (err < 0) + fail ("_gnutls_hash_fast(MD5) failed: %d\n", err); + else + { + if (memcmp (digest, "\x05\xa6\x71\xc6\x6a\xef\xea\x12\x4c\xc0\x8b\x76\xea\x6d\x30\xbb", 16) == 0) + success ("HASH: _gnutls_hash_fast(MD5) OK\n"); + else + { + hexprint (digest, 16); + fail ("HASH: _gnutls_hash_fast(MD5) failure\n"); + } + } + + + err = _gnutls_hash_fast (GNUTLS_MAC_MD5, "keykeykey", 9, "abcdefgh", 8, digest); if (err < 0) fail ("_gnutls_hash_fast(MD5) failed: %d\n", err); |