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

Unified Diff: crypto/symmetric_key.h

Issue 689463002: NACL_WIN64 takes precedence over USE_OPENSSL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@net-fix
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/symmetric_key.h
diff --git a/crypto/symmetric_key.h b/crypto/symmetric_key.h
index 413f61e0bca4e3c4be1fde391036e3b096ff0d81..ab105c1754ccdd622e0af1e651ca82a633a4a3e1 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_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698