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 OpenSSL library has been initialized.\r
+ @retval FALSE Failed to initialize the OpenSSL library.\r
+\r
**/\r
-VOID\r
+BOOLEAN\r
EFIAPI\r
TlsInitialize (\r
VOID\r
)\r
{\r
+ INTN Ret;\r
+\r
//\r
// Performs initialization of crypto and ssl library, and loads required\r
// algorithms.\r
//\r
- OPENSSL_init_ssl (\r
- OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS,\r
- NULL\r
- );\r
+ Ret = OPENSSL_init_ssl (\r
+ OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS,\r
+ NULL\r
+ );\r
+ if (Ret != 1) {\r
+ return FALSE;\r
+ }\r
\r
//\r
// Initialize the pseudorandom number generator.\r
//\r
- RandomSeed (NULL, 0);\r
+ return RandomSeed (NULL, 0);\r
}\r
\r
/**\r
}\r
\r
//\r
- // Free the internal TLS and BIO objects.\r
+ // Free the internal TLS and related BIO objects.\r
//\r
if (TlsConn->Ssl != NULL) {\r
SSL_free (TlsConn->Ssl);\r
}\r
\r
- if (TlsConn->InBio != NULL) {\r
- BIO_free (TlsConn->InBio);\r
- }\r
-\r
- if (TlsConn->OutBio != NULL) {\r
- BIO_free (TlsConn->OutBio);\r
- }\r
-\r
OPENSSL_free (Tls);\r
}\r
\r