1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2001-12-13  Ulrich Drepper  <drepper@redhat.com>

	* crypt/md5.c (md5_process_bytes): Correct handling of alignment.
	Patch by Eric Sharkey <sharkey@netrics.com>.

	* crypt/md5test.c (main): Add test for multiple calls to
	__md5_process_bytes to itererate over input string.
This commit is contained in:
Ulrich Drepper
2001-12-14 06:33:57 +00:00
parent 7afc594790
commit 0838e0b926
3 changed files with 41 additions and 10 deletions

View File

@ -35,10 +35,19 @@ main (int argc, char *argv[])
for (cnt = 0; cnt < (int) (sizeof (tests) / sizeof (tests[0])); ++cnt)
{
int i;
int j;
__md5_init_ctx (&ctx);
__md5_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx);
__md5_finish_ctx (&ctx, sum);
result |= memcmp (tests[cnt].result, sum, 16);
__md5_init_ctx (&ctx);
for (i = 0; tests[cnt].input[i] != '\0'; ++i)
__md5_process_bytes (&tests[cnt].input[i], 1, &ctx);
__md5_finish_ctx (&ctx, sum);
result |= memcmp (tests[cnt].result, sum, 16);
}
return result;