X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=CryptoPkg%2FLibrary%2FBaseCryptLib%2FPk%2FCryptX509Null.c;h=38819723c791e8845f0cb442cafdda379f496f91;hb=7c342378317039e632d9a1a5d4cf7c21aec8cb7a;hp=d00f38daa83f8dc0fd2b31eb5acfaf62748af5fa;hpb=5b7c22450591a9e20ff54b970c11087ccfff563d;p=mirror_edk2.git
diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c
index d00f38daa8..38819723c7 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c
@@ -2,14 +2,8 @@
X.509 Certificate Handler Wrapper Implementation which does not provide
real capabilities.
-Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -39,6 +33,36 @@ X509ConstructCertificate (
return FALSE;
}
+/**
+ Construct a X509 stack object from a list of DER-encoded certificate data.
+
+ If X509Stack is NULL, then return FALSE.
+ If this interface is not supported, then return FALSE.
+
+ @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
+ On output, pointer to the X509 stack object with new
+ inserted X509 certificate.
+ @param[in] Args VA_LIST marker for the variable argument list.
+ A list of DER-encoded single certificate data followed
+ by certificate size. A NULL terminates the list. The
+ pairs are the arguments to X509ConstructCertificate().
+
+ @retval TRUE The X509 stack construction succeeded.
+ @retval FALSE The construction operation failed.
+ @retval FALSE This interface is not supported.
+
+**/
+BOOLEAN
+EFIAPI
+X509ConstructCertificateStackV (
+ IN OUT UINT8 **X509Stack,
+ IN VA_LIST Args
+ )
+{
+ ASSERT (FALSE);
+ return FALSE;
+}
+
/**
Construct a X509 stack object from a list of DER-encoded certificate data.
@@ -50,7 +74,7 @@ X509ConstructCertificate (
@param ... A list of DER-encoded single certificate data followed
by certificate size. A NULL terminates the list. The
pairs are the arguments to X509ConstructCertificate().
-
+
@retval FALSE This interface is not supported.
**/
@@ -58,7 +82,7 @@ BOOLEAN
EFIAPI
X509ConstructCertificateStack (
IN OUT UINT8 **X509Stack,
- ...
+ ...
)
{
ASSERT (FALSE);
@@ -78,7 +102,7 @@ EFIAPI
X509Free (
IN VOID *X509Cert
)
-{
+{
ASSERT (FALSE);
}
@@ -135,7 +159,7 @@ X509GetSubjectName (
@param[in] Cert Pointer to the DER-encoded X509 certificate.
@param[in] CertSize Size of the X509 certificate in bytes.
@param[out] CommonName Buffer to contain the retrieved certificate common
- name string. At most CommonNameSize bytes will be
+ name string (UTF8). At most CommonNameSize bytes will be
written and the string will be null terminated. May be
NULL in order to determine the size buffer needed.
@param[in,out] CommonNameSize The size in bytes of the CommonName buffer on input,
@@ -151,7 +175,7 @@ EFIAPI
X509GetCommonName (
IN CONST UINT8 *Cert,
IN UINTN CertSize,
- OUT CHAR8 *CommonName, OPTIONAL
+ OUT CHAR8 *CommonName OPTIONAL,
IN OUT UINTN *CommonNameSize
)
{
@@ -159,6 +183,38 @@ X509GetCommonName (
return RETURN_UNSUPPORTED;
}
+/**
+ Retrieve the organization name (ON) string from one X.509 certificate.
+
+ Return RETURN_UNSUPPORTED to indicate this interface is not supported.
+
+ @param[in] Cert Pointer to the DER-encoded X509 certificate.
+ @param[in] CertSize Size of the X509 certificate in bytes.
+ @param[out] NameBuffer Buffer to contain the retrieved certificate organization
+ name string. At most NameBufferSize bytes will be
+ written and the string will be null terminated. May be
+ NULL in order to determine the size buffer needed.
+ @param[in,out] NameBufferSize The size in bytes of the Name buffer on input,
+ and the size of buffer returned Name on output.
+ If NameBuffer is NULL then the amount of space needed
+ in buffer (including the final null) is returned.
+
+ @retval RETURN_UNSUPPORTED The operation is not supported.
+
+**/
+RETURN_STATUS
+EFIAPI
+X509GetOrganizationName (
+ IN CONST UINT8 *Cert,
+ IN UINTN CertSize,
+ OUT CHAR8 *NameBuffer OPTIONAL,
+ IN OUT UINTN *NameBufferSize
+ )
+{
+ ASSERT (FALSE);
+ return RETURN_UNSUPPORTED;
+}
+
/**
Retrieve the RSA Public Key from one DER-encoded X509 certificate.
@@ -196,7 +252,7 @@ RsaGetPublicKeyFromX509 (
@param[in] CACertSize Size of the CA Certificate in bytes.
@retval FALSE This interface is not supported.
-
+
**/
BOOLEAN
EFIAPI