]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptX509Null.c
CryptoPkg: Clean up source files
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLibRuntimeCryptProtocol / Pk / CryptX509Null.c
index c43ca075839037aed65e9837f387ce87b978d24e..f95a2c0a890ef140f0448d8fc371806db03d9866 100644 (file)
@@ -2,7 +2,7 @@
   X.509 Certificate Handler Wrapper Implementation which does not provide\r
   real capabilities.\r
 \r
-Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>\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
@@ -44,13 +44,13 @@ X509ConstructCertificate (
 \r
   Return FALSE to indicate this interface is not supported.\r
 \r
-  @param[in, out]  X509Stack  On input, pointer to an existing X509 stack object.\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
+\r
   @retval FALSE  This interface is not supported.\r
 \r
 **/\r
@@ -58,7 +58,7 @@ BOOLEAN
 EFIAPI\r
 X509ConstructCertificateStack (\r
   IN OUT  UINT8  **X509Stack,\r
-  ...  \r
+  ...\r
   )\r
 {\r
   ASSERT (FALSE);\r
@@ -78,7 +78,7 @@ EFIAPI
 X509Free (\r
   IN  VOID  *X509Cert\r
   )\r
-{ \r
+{\r
   ASSERT (FALSE);\r
 }\r
 \r
@@ -127,6 +127,38 @@ X509GetSubjectName (
   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
@@ -164,7 +196,7 @@ RsaGetPublicKeyFromX509 (
   @param[in]      CACertSize   Size of the CA Certificate in bytes.\r
 \r
   @retval FALSE  This interface is not supported.\r
\r
+\r
 **/\r
 BOOLEAN\r
 EFIAPI\r
@@ -203,4 +235,4 @@ X509GetTBSCert (
 {\r
   ASSERT (FALSE);\r
   return FALSE;\r
-}
\ No newline at end of file
+}\r