]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/TlsLibNull/TlsInitNull.c
CryptoPkg: Add Null instance of the TlsLib class
[mirror_edk2.git] / CryptoPkg / Library / TlsLibNull / TlsInitNull.c
diff --git a/CryptoPkg/Library/TlsLibNull/TlsInitNull.c b/CryptoPkg/Library/TlsLibNull/TlsInitNull.c
new file mode 100644 (file)
index 0000000..3e44117
--- /dev/null
@@ -0,0 +1,111 @@
+/** @file\r
+  SSL/TLS Initialization Null Library Wrapper Implementation.\r
+\r
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include "InternalTlsLib.h"\r
+\r
+/**\r
+  Initializes the library.\r
+\r
+  This function registers ciphers and digests used directly and indirectly\r
+  by SSL/TLS, and initializes the readable error messages.\r
+  This function must be called before any other action takes places.\r
+\r
+  @retval TRUE   The library has been initialized.\r
+  @retval FALSE  Failed to initialize the library.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+TlsInitialize (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT(FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Free an allocated SSL_CTX object.\r
+\r
+  @param[in]  TlsCtx    Pointer to the SSL_CTX object to be released.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+TlsCtxFree (\r
+  IN   VOID                  *TlsCtx\r
+  )\r
+{\r
+  ASSERT(FALSE);\r
+  return;\r
+}\r
+\r
+/**\r
+  Creates a new SSL_CTX object as framework to establish TLS/SSL enabled\r
+  connections.\r
+\r
+  @param[in]  MajorVer    Major Version of TLS/SSL Protocol.\r
+  @param[in]  MinorVer    Minor Version of TLS/SSL Protocol.\r
+\r
+  @return  Pointer to an allocated SSL_CTX object.\r
+           If the creation failed, TlsCtxNew() returns NULL.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+TlsCtxNew (\r
+  IN     UINT8                    MajorVer,\r
+  IN     UINT8                    MinorVer\r
+  )\r
+{\r
+  ASSERT(FALSE);\r
+  return NULL;\r
+}\r
+\r
+/**\r
+  Free an allocated TLS object.\r
+\r
+  This function removes the TLS object pointed to by Tls and frees up the\r
+  allocated memory. If Tls is NULL, nothing is done.\r
+\r
+  @param[in]  Tls    Pointer to the TLS object to be freed.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+TlsFree (\r
+  IN     VOID                     *Tls\r
+  )\r
+{\r
+  ASSERT(FALSE);\r
+}\r
+\r
+/**\r
+  Create a new TLS object for a connection.\r
+\r
+  This function creates a new TLS object for a connection. The new object\r
+  inherits the setting of the underlying context TlsCtx: connection method,\r
+  options, verification setting.\r
+\r
+  @param[in]  TlsCtx    Pointer to the SSL_CTX object.\r
+\r
+  @return  Pointer to an allocated SSL object.\r
+           If the creation failed, TlsNew() returns NULL.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+TlsNew (\r
+  IN     VOID                     *TlsCtx\r
+  )\r
+{\r
+  ASSERT(FALSE);\r
+  return NULL;\r
+}\r
+\r