Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: net/third_party/nss/ssl/sslinit.c

Issue 1882433002: Removing NSS files and USE_OPENSSL flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/third_party/nss/ssl/sslinfo.c ('k') | net/third_party/nss/ssl/sslmutex.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * NSS utility functions
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
8 #include "prtypes.h"
9 #include "prinit.h"
10 #include "seccomon.h"
11 #include "secerr.h"
12 #include "ssl.h"
13 #include "sslimpl.h"
14 #include "sslproto.h"
15
16 static int ssl_isInited = 0;
17 static PRCallOnceType ssl_init = { 0 };
18
19 PRStatus
20 ssl_InitCallOnce(void *arg)
21 {
22 int *error = (int *)arg;
23 SECStatus rv;
24
25 rv = ssl_InitializePRErrorTable();
26 if (rv != SECSuccess) {
27 *error = SEC_ERROR_NO_MEMORY;
28 return PR_FAILURE;
29 }
30 #ifdef DEBUG
31 ssl3_CheckCipherSuiteOrderConsistency();
32 #endif
33
34 rv = ssl3_ApplyNSSPolicy();
35 if (rv != SECSuccess) {
36 *error = PORT_GetError();
37 return PR_FAILURE;
38 }
39 return PR_SUCCESS;
40 }
41
42 SECStatus
43 ssl_Init(void)
44 {
45 PRStatus nrv;
46
47 /* short circuit test if we are already inited */
48 if (!ssl_isInited) {
49 int error;
50 /* only do this once at init time, block all others until we are done */
51 nrv = PR_CallOnceWithArg(&ssl_init, ssl_InitCallOnce, &error);
52 if (nrv != PR_SUCCESS) {
53 PORT_SetError(error);
54 return SECFailure;
55 }
56 ssl_isInited = 1;
57 }
58 return SECSuccess;
59 }
OLDNEW
« no previous file with comments | « net/third_party/nss/ssl/sslinfo.c ('k') | net/third_party/nss/ssl/sslmutex.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698