X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CryptoPkg%2FApplication%2FCryptest%2FRsaVerify2.c;h=9db43d6eef7aed481a1674b2f24b36d29e6e21d9;hp=98b5aad9009808fd74d3d932889731bcbf4bd5e7;hb=5b7c22450591a9e20ff54b970c11087ccfff563d;hpb=b7d320f8117ed2fffe001b1a0b7bfcd4f40fafc4 diff --git a/CryptoPkg/Application/Cryptest/RsaVerify2.c b/CryptoPkg/Application/Cryptest/RsaVerify2.c index 98b5aad900..9db43d6eef 100644 --- a/CryptoPkg/Application/Cryptest/RsaVerify2.c +++ b/CryptoPkg/Application/Cryptest/RsaVerify2.c @@ -204,13 +204,17 @@ ValidateCryptRsa2 ( VOID ) { - BOOLEAN Status; - VOID *RsaPrivKey; - VOID *RsaPubKey; - UINT8 *Signature; - UINTN SigSize; - UINT8 *Subject; - UINTN SubjectSize; + BOOLEAN Status; + VOID *RsaPrivKey; + VOID *RsaPubKey; + UINT8 *Signature; + UINTN SigSize; + UINT8 *Subject; + UINTN SubjectSize; + RETURN_STATUS ReturnStatus; + CHAR8 CommonName[64]; + CHAR16 CommonNameUnicode[64]; + UINTN CommonNameSize; Print (L"\nUEFI-OpenSSL RSA Key Retrieving Testing: "); @@ -286,6 +290,20 @@ ValidateCryptRsa2 ( Print (L"[Pass]"); } + // + // Get CommonName from X509 Certificate Subject + // + CommonNameSize = 64; + ZeroMem (CommonName, CommonNameSize); + ReturnStatus = X509GetCommonName (TestCert, sizeof (TestCert), CommonName, &CommonNameSize); + if (RETURN_ERROR (ReturnStatus)) { + Print (L"\n - Retrieving Common Name - [Fail]"); + return EFI_ABORTED; + } else { + AsciiStrToUnicodeStrS (CommonName, CommonNameUnicode, CommonNameSize); + Print (L"\n - Retrieving Common Name = \"%s\" (Size = %d)", CommonNameUnicode, CommonNameSize); + } + // // X509 Certificate Verification. //