diff options
author | davidben <davidben@chromium.org> | 2014-10-29 10:51:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-29 17:52:06 +0000 |
commit | 365d6967b6b9306b90cd001ff2887189a43838e3 (patch) | |
tree | 9263c409a359b3fa252d7dd021ce6ca1cd3a84af /crypto | |
parent | 4eabaefc160f47c849e5a1f00d6c16dad3b43397 (diff) | |
download | chromium_src-365d6967b6b9306b90cd001ff2887189a43838e3.zip chromium_src-365d6967b6b9306b90cd001ff2887189a43838e3.tar.gz chromium_src-365d6967b6b9306b90cd001ff2887189a43838e3.tar.bz2 |
NACL_WIN64 takes precedence over USE_OPENSSL.
With the BoringSSL Windows port, it is possible for Windows to
have USE_OPENSSL set. The #ifdefs in symmetric_key.h should still
resolve in the NACL_WIN64 direction.
This fixes the crypto_nacl build target.
BUG=338884
Review URL: https://codereview.chromium.org/689463002
Cr-Commit-Position: refs/heads/master@{#301870}
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/symmetric_key.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crypto/symmetric_key.h b/crypto/symmetric_key.h index 413f61e..ab105c1 100644 --- a/crypto/symmetric_key.h +++ b/crypto/symmetric_key.h @@ -57,10 +57,10 @@ class CRYPTO_EXPORT SymmetricKey { // size for use with |algorithm|. The caller owns the returned SymmetricKey. static SymmetricKey* Import(Algorithm algorithm, const std::string& raw_key); -#if defined(USE_OPENSSL) - const std::string& key() { return key_; } -#elif defined(NACL_WIN64) +#if defined(NACL_WIN64) HCRYPTKEY key() const { return key_.get(); } +#elif defined(USE_OPENSSL) + const std::string& key() { return key_; } #elif defined(USE_NSS) || defined(OS_WIN) || defined(OS_MACOSX) PK11SymKey* key() const { return key_.get(); } #endif @@ -71,10 +71,7 @@ class CRYPTO_EXPORT SymmetricKey { bool GetRawKey(std::string* raw_key); private: -#if defined(USE_OPENSSL) - SymmetricKey() {} - std::string key_; -#elif defined(NACL_WIN64) +#if defined(NACL_WIN64) SymmetricKey(HCRYPTPROV provider, HCRYPTKEY key, const void* key_data, size_t key_size_in_bytes); @@ -88,6 +85,9 @@ class CRYPTO_EXPORT SymmetricKey { // TODO(rsleevi): See if KP_EFFECTIVE_KEYLEN is the reason why CryptExportKey // fails with NTE_BAD_KEY/NTE_BAD_LEN std::string raw_key_; +#elif defined(USE_OPENSSL) + SymmetricKey() {} + std::string key_; #elif defined(USE_NSS) || defined(OS_WIN) || defined(OS_MACOSX) explicit SymmetricKey(PK11SymKey* key); ScopedPK11SymKey key_; |