1. Add new API supports for PEM & X509 key retrieving & verification;

2. Add new MD4 hash supports;
3. Add corresponding test case in Cryptest utility;
4. Fix MACRO definition issue in OpensslLib.inf and parameter checking issues in some wrapper implementations.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11214 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qlong
2010-12-31 07:22:48 +00:00
parent 2a6433fef2
commit 4a567c9690
19 changed files with 1223 additions and 4 deletions

View File

@@ -24,6 +24,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *HashData = "abc";
//
// Result for MD4("abc"). (From "A.5 Test suite" of IETF RFC1320)
//
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 Md4Digest[MD4_DIGEST_SIZE] = {
0xa4, 0x48, 0x01, 0x7a, 0xaf, 0x21, 0xd8, 0x52, 0x5f, 0xc1, 0x0a, 0xe8, 0x7a, 0xa6, 0x72, 0x9d
};
//
// Result for MD5("abc"). (From "A.5 Test suite" of IETF RFC1321)
//
@@ -68,6 +75,46 @@ ValidateCryptDigest (
Print (L" UEFI-OpenSSL Hash Engine Testing:\n");
DataSize = AsciiStrLen (HashData);
Print (L"- MD4: ");
//
// MD4 Digest Validation
//
ZeroMem (Digest, MAX_DIGEST_SIZE);
CtxSize = Md4GetContextSize ();
HashCtx = AllocatePool (CtxSize);
Print (L"Init... ");
Status = Md4Init (HashCtx);
if (!Status) {
Print (L"[Fail]");
return EFI_ABORTED;
}
Print (L"Update... ");
Status = Md4Update (HashCtx, HashData, DataSize);
if (!Status) {
Print (L"[Fail]");
return EFI_ABORTED;
}
Print (L"Finalize... ");
Status = Md4Final (HashCtx, Digest);
if (!Status) {
Print (L"[Fail]");
return EFI_ABORTED;
}
FreePool (HashCtx);
Print (L"Check Value... ");
if (CompareMem (Digest, Md4Digest, MD5_DIGEST_SIZE) != 0) {
Print (L"[Fail]");
return EFI_ABORTED;
}
Print (L"[Pass]\n");
Print (L"- MD5: ");
//