chromium/crypto/nss_util.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "crypto/nss_util.h"

#include <nss.h>
#include <pk11pub.h>
#include <plarena.h>
#include <prerror.h>
#include <prinit.h>
#include <prtime.h>
#include <secmod.h>

#include <memory>
#include <utility>

#include "base/base_paths.h"
#include "base/containers/flat_map.h"
#include "base/containers/heap_array.h"
#include "base/debug/alias.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "base/threading/scoped_blocking_call.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "crypto/nss_crypto_module_delegate.h"
#include "crypto/nss_util_internal.h"

namespace crypto {

namespace {

#if !(BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS))
base::FilePath GetDefaultConfigDirectory() {}
#endif  // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

// On non-Chrome OS platforms, return the default config directory. On Chrome
// OS return a empty path which will result in NSS being initialized without a
// persistent database.
base::FilePath GetInitialConfigDirectory() {}

// This callback for NSS forwards all requests to a caller-specified
// CryptoModuleBlockingPasswordDelegate object.
char* PKCS11PasswordFunc(PK11SlotInfo* slot, PRBool retry, void* arg) {}

// A singleton to initialize/deinitialize NSPR.
// Separate from the NSS singleton because we initialize NSPR on the UI thread.
// Now that we're leaking the singleton, we could merge back with the NSS
// singleton.
class NSPRInitSingleton {};

base::LazyInstance<NSPRInitSingleton>::Leaky g_nspr_singleton =;

// Force a crash with error info on NSS_NoDB_Init failure.
void CrashOnNSSInitFailure() {}

class NSSInitSingleton {};

base::LazyInstance<NSSInitSingleton>::Leaky g_nss_singleton =;
}  // namespace

ScopedPK11Slot OpenSoftwareNSSDB(const base::FilePath& path,
                                 const std::string& description) {}

SECStatus CloseSoftwareNSSDB(PK11SlotInfo* slot) {}

void EnsureNSPRInit() {}

void EnsureNSSInit() {}

bool CheckNSSVersion(const char* version) {}

AutoSECMODListReadLock::AutoSECMODListReadLock()
    :{}

AutoSECMODListReadLock::~AutoSECMODListReadLock() {}

base::Time PRTimeToBaseTime(PRTime prtime) {}

PRTime BaseTimeToPRTime(base::Time time) {}

SECMODModule* LoadNSSModule(const char* name,
                            const char* library_path,
                            const char* params) {}

std::string GetNSSErrorMessage() {}

}  // namespace crypto