+++ /dev/null
-/** @file\r
- X.509 Certificate Handler Wrapper Implementation which does not provide\r
- real capabilities.\r
-\r
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "InternalCryptLib.h"\r
-\r
-/**\r
- Construct a X509 object from DER-encoded certificate data.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] Cert Pointer to the DER-encoded certificate data.\r
- @param[in] CertSize The size of certificate data in bytes.\r
- @param[out] SingleX509Cert The generated X509 object.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-X509ConstructCertificate (\r
- IN CONST UINT8 *Cert,\r
- IN UINTN CertSize,\r
- OUT UINT8 **SingleX509Cert\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Construct a X509 stack object from a list of DER-encoded certificate data.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.\r
- On output, pointer to the X509 stack object with new\r
- inserted X509 certificate.\r
- @param ... A list of DER-encoded single certificate data followed\r
- by certificate size. A NULL terminates the list. The\r
- pairs are the arguments to X509ConstructCertificate().\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-X509ConstructCertificateStack (\r
- IN OUT UINT8 **X509Stack,\r
- ...\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Release the specified X509 object.\r
-\r
- If the interface is not supported, then ASSERT().\r
-\r
- @param[in] X509Cert Pointer to the X509 object to be released.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-X509Free (\r
- IN VOID *X509Cert\r
- )\r
-{\r
- ASSERT (FALSE);\r
-}\r
-\r
-/**\r
- Release the specified X509 stack object.\r
-\r
- If the interface is not supported, then ASSERT().\r
-\r
- @param[in] X509Stack Pointer to the X509 stack object to be released.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-X509StackFree (\r
- IN VOID *X509Stack\r
- )\r
-{\r
- ASSERT (FALSE);\r
-}\r
-\r
-/**\r
- Retrieve the subject bytes from one X.509 certificate.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] Cert Pointer to the DER-encoded X509 certificate.\r
- @param[in] CertSize Size of the X509 certificate in bytes.\r
- @param[out] CertSubject Pointer to the retrieved certificate subject bytes.\r
- @param[in, out] SubjectSize The size in bytes of the CertSubject buffer on input,\r
- and the size of buffer returned CertSubject on output.\r
-\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-X509GetSubjectName (\r
- IN CONST UINT8 *Cert,\r
- IN UINTN CertSize,\r
- OUT UINT8 *CertSubject,\r
- IN OUT UINTN *SubjectSize\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Retrieve the common name (CN) string from one X.509 certificate.\r
-\r
- Return RETURN_UNSUPPORTED to indicate this interface is not supported.\r
-\r
- @param[in] Cert Pointer to the DER-encoded X509 certificate.\r
- @param[in] CertSize Size of the X509 certificate in bytes.\r
- @param[out] CommonName Buffer to contain the retrieved certificate common\r
- name string. At most CommonNameSize bytes will be\r
- written and the string will be null terminated. May be\r
- NULL in order to determine the size buffer needed.\r
- @param[in,out] CommonNameSize The size in bytes of the CommonName buffer on input,\r
- and the size of buffer returned CommonName on output.\r
- If CommonName is NULL then the amount of space needed\r
- in buffer (including the final null) is returned.\r
-\r
- @retval RETURN_UNSUPPORTED The operation is not supported.\r
-\r
-**/\r
-RETURN_STATUS\r
-EFIAPI\r
-X509GetCommonName (\r
- IN CONST UINT8 *Cert,\r
- IN UINTN CertSize,\r
- OUT CHAR8 *CommonName, OPTIONAL\r
- IN OUT UINTN *CommonNameSize\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return RETURN_UNSUPPORTED;\r
-}\r
-\r
-/**\r
- Retrieve the RSA Public Key from one DER-encoded X509 certificate.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] Cert Pointer to the DER-encoded X509 certificate.\r
- @param[in] CertSize Size of the X509 certificate in bytes.\r
- @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved\r
- RSA public key component. Use RsaFree() function to free the\r
- resource.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-RsaGetPublicKeyFromX509 (\r
- IN CONST UINT8 *Cert,\r
- IN UINTN CertSize,\r
- OUT VOID **RsaContext\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Verify one X509 certificate was issued by the trusted CA.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] Cert Pointer to the DER-encoded X509 certificate to be verified.\r
- @param[in] CertSize Size of the X509 certificate in bytes.\r
- @param[in] CACert Pointer to the DER-encoded trusted CA certificate.\r
- @param[in] CACertSize Size of the CA Certificate in bytes.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-X509VerifyCert (\r
- IN CONST UINT8 *Cert,\r
- IN UINTN CertSize,\r
- IN CONST UINT8 *CACert,\r
- IN UINTN CACertSize\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Retrieve the TBSCertificate from one given X.509 certificate.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] Cert Pointer to the given DER-encoded X509 certificate.\r
- @param[in] CertSize Size of the X509 certificate in bytes.\r
- @param[out] TBSCert DER-Encoded To-Be-Signed certificate.\r
- @param[out] TBSCertSize Size of the TBS certificate in bytes.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-X509GetTBSCert (\r
- IN CONST UINT8 *Cert,\r
- IN UINTN CertSize,\r
- OUT UINT8 **TBSCert,\r
- OUT UINTN *TBSCertSize\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r