-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't build the Windows stuff with openssl yet. Should give some time for people to move away from blowfish first. Change-Id: I947ffef949f2fe3c37e48dced25c925c6d64fca4
- Loading branch information
Showing
10 changed files
with
54 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <check.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include "../src/alloc.h" | ||
#include "../src/hexmap.h" | ||
#include "../src/md5.h" | ||
#include "test.h" | ||
|
||
START_TEST(test_md5) | ||
{ | ||
uint8_t checksum[MD5_DIGEST_LENGTH]; | ||
struct md5 *md5; | ||
fail_unless((md5=md5_alloc(__func__))!=NULL); | ||
fail_unless(md5_init(md5)); | ||
|
||
fail_unless(md5_update(md5, "blah", strlen("blah"))!=4); | ||
fail_unless(md5_final(md5, checksum)!=16); | ||
ck_assert_str_eq( | ||
"6f1ed002ab5595859014ebf0951522d9", | ||
bytes_to_md5str(checksum) | ||
); | ||
|
||
md5_free(&md5); | ||
fail_unless(md5==NULL); | ||
alloc_check(); | ||
} | ||
END_TEST | ||
|
||
Suite *suite_md5(void) | ||
{ | ||
Suite *s; | ||
TCase *tc_core; | ||
|
||
s=suite_create("md5"); | ||
|
||
tc_core=tcase_create("Core"); | ||
|
||
tcase_add_test(tc_core, test_md5); | ||
suite_add_tcase(s, tc_core); | ||
|
||
return s; | ||
} |