Commit e4c9ddaf authored by rvargas@google.com's avatar rvargas@google.com

Crypto: Add crypto_api to code needed outside of crypto

that is not covered by crypto_unittests

BUG=85776
TEST=none
Review URL: http://codereview.chromium.org/7209001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89756 0039d316-1c4b-4281-b951-d872f2087c98
parent 696e4715
......@@ -9,6 +9,8 @@
#include <windows.h>
#include <wincrypt.h>
#include "crypto/crypto_api.h"
namespace crypto {
// CryptAcquireContext when passed CRYPT_NEWKEYSET or CRYPT_DELETEKEYSET in
......@@ -21,11 +23,11 @@ namespace crypto {
// "The CryptAcquireContext function is generally thread safe unless
// CRYPT_NEWKEYSET or CRYPT_DELETEKEYSET is specified in the dwFlags
// parameter."
BOOL CryptAcquireContextLocked(HCRYPTPROV* prov,
LPCWSTR container,
LPCWSTR provider,
DWORD prov_type,
DWORD flags);
CRYPTO_API BOOL CryptAcquireContextLocked(HCRYPTPROV* prov,
LPCWSTR container,
LPCWSTR provider,
DWORD prov_type,
DWORD flags);
} // namespace crypto
......
......@@ -8,6 +8,7 @@
#include <string>
#include "base/basictypes.h"
#include "crypto/crypto_api.h"
#if defined(USE_NSS)
class FilePath;
......@@ -32,12 +33,12 @@ void EarlySetupForNSSInit();
// Initialize NRPR if it isn't already initialized. This function is
// thread-safe, and NSPR will only ever be initialized once.
void EnsureNSPRInit();
void CRYPTO_API EnsureNSPRInit();
// Initialize NSS if it isn't already initialized. This must be called before
// any other NSS functions. This function is thread-safe, and NSS will only
// ever be initialized once.
void EnsureNSSInit();
void CRYPTO_API EnsureNSSInit();
// Call this before calling EnsureNSSInit() will force NSS to initialize
// without a persistent DB. This is used for the special case where access of
......
......@@ -8,6 +8,8 @@
#include <secmodt.h>
#include "crypto/crypto_api.h"
// These functions return a type defined in an NSS header, and so cannot be
// declared in nss_util.h. Hence, they are declared here.
......@@ -16,14 +18,14 @@ namespace crypto {
// Returns a reference to the default NSS key slot for storing
// public-key data only (e.g. server certs). Caller must release
// returned reference with PK11_FreeSlot.
PK11SlotInfo* GetPublicNSSKeySlot();
CRYPTO_API PK11SlotInfo* GetPublicNSSKeySlot();
// Returns a reference to the default slot for storing private-key and
// mixed private-key/public-key data. Returns a hardware (TPM) NSS
// key slot if on ChromeOS and EnableTPMForNSS() has been called
// successfully. Caller must release returned reference with
// PK11_FreeSlot.
PK11SlotInfo* GetPrivateNSSKeySlot();
CRYPTO_API PK11SlotInfo* GetPrivateNSSKeySlot();
// A helper class that acquires the SECMOD list read lock while the
// AutoSECMODListReadLock is in scope.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment