diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /security/nss/lib/ssl/sslinit.c | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'security/nss/lib/ssl/sslinit.c')
-rw-r--r-- | security/nss/lib/ssl/sslinit.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/security/nss/lib/ssl/sslinit.c b/security/nss/lib/ssl/sslinit.c new file mode 100644 index 000000000..0f38c0b57 --- /dev/null +++ b/security/nss/lib/ssl/sslinit.c @@ -0,0 +1,59 @@ +/* + * NSS utility functions + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "prtypes.h" +#include "prinit.h" +#include "seccomon.h" +#include "secerr.h" +#include "ssl.h" +#include "sslimpl.h" +#include "sslproto.h" + +static int ssl_isInited = 0; +static PRCallOnceType ssl_init = { 0 }; + +PRStatus +ssl_InitCallOnce(void *arg) +{ + int *error = (int *)arg; + SECStatus rv; + + rv = ssl_InitializePRErrorTable(); + if (rv != SECSuccess) { + *error = SEC_ERROR_NO_MEMORY; + return PR_FAILURE; + } +#ifdef DEBUG + ssl3_CheckCipherSuiteOrderConsistency(); +#endif + + rv = ssl3_ApplyNSSPolicy(); + if (rv != SECSuccess) { + *error = PORT_GetError(); + return PR_FAILURE; + } + return PR_SUCCESS; +} + +SECStatus +ssl_Init(void) +{ + PRStatus nrv; + + /* short circuit test if we are already inited */ + if (!ssl_isInited) { + int error; + /* only do this once at init time, block all others until we are done */ + nrv = PR_CallOnceWithArg(&ssl_init, ssl_InitCallOnce, &error); + if (nrv != PR_SUCCESS) { + PORT_SetError(error); + return SECFailure; + } + ssl_isInited = 1; + } + return SECSuccess; +} |