summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-20 23:24:09 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-20 23:24:09 +0000
commite4c9ddaf1f515ab9b11855d710107c91771cb5a9 (patch)
tree955d35dd2b66abb75b4d30d71344d91786a0fa99
parent696e471564eee41d4077c450ec331d57992c303a (diff)
downloadchromium_src-e4c9ddaf1f515ab9b11855d710107c91771cb5a9.zip
chromium_src-e4c9ddaf1f515ab9b11855d710107c91771cb5a9.tar.gz
chromium_src-e4c9ddaf1f515ab9b11855d710107c91771cb5a9.tar.bz2
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
-rw-r--r--crypto/capi_util.h12
-rw-r--r--crypto/nss_util.h5
-rw-r--r--crypto/nss_util_internal.h6
3 files changed, 14 insertions, 9 deletions
diff --git a/crypto/capi_util.h b/crypto/capi_util.h
index faaf012..b61c268 100644
--- a/crypto/capi_util.h
+++ b/crypto/capi_util.h
@@ -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
diff --git a/crypto/nss_util.h b/crypto/nss_util.h
index c350c93..1244db9 100644
--- a/crypto/nss_util.h
+++ b/crypto/nss_util.h
@@ -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
diff --git a/crypto/nss_util_internal.h b/crypto/nss_util_internal.h
index e90e4c4..4d6a928 100644
--- a/crypto/nss_util_internal.h
+++ b/crypto/nss_util_internal.h
@@ -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.