| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ | 5 #ifndef NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ |
| 6 #define NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ | 6 #define NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "net/quic/crypto/quic_encrypter.h" | 9 #include "net/quic/crypto/quic_encrypter.h" |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // can assert at compile time their key_size_ and nonce_prefix_size_ do not | 64 // can assert at compile time their key_size_ and nonce_prefix_size_ do not |
| 65 // exceed the maximum. | 65 // exceed the maximum. |
| 66 static const size_t kMaxKeySize = 32; | 66 static const size_t kMaxKeySize = 32; |
| 67 static const size_t kMaxNoncePrefixSize = 4; | 67 static const size_t kMaxNoncePrefixSize = 4; |
| 68 | 68 |
| 69 #if !defined(USE_OPENSSL) | 69 #if !defined(USE_OPENSSL) |
| 70 struct AeadParams { | 70 struct AeadParams { |
| 71 unsigned int len; | 71 unsigned int len; |
| 72 union { | 72 union { |
| 73 CK_GCM_PARAMS gcm_params; | 73 CK_GCM_PARAMS gcm_params; |
| 74 #if !defined(USE_NSS) | 74 #if !defined(USE_NSS_CERTS) |
| 75 // USE_NSS means we are using system NSS rather than our copy of NSS. | 75 // USE_NSS_CERTS implies we are using system NSS rather than our copy of |
| 76 // The system NSS <pkcs11n.h> header doesn't define this type yet. | 76 // NSS. The system NSS <pkcs11n.h> header doesn't define this type yet. |
| 77 CK_NSS_AEAD_PARAMS nss_aead_params; | 77 CK_NSS_AEAD_PARAMS nss_aead_params; |
| 78 #endif | 78 #endif |
| 79 } data; | 79 } data; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 virtual void FillAeadParams(base::StringPiece nonce, | 82 virtual void FillAeadParams(base::StringPiece nonce, |
| 83 base::StringPiece associated_data, | 83 base::StringPiece associated_data, |
| 84 size_t auth_tag_size, | 84 size_t auth_tag_size, |
| 85 AeadParams* aead_params) const = 0; | 85 AeadParams* aead_params) const = 0; |
| 86 #endif | 86 #endif |
| (...skipping 17 matching lines...) Expand all Loading... |
| 104 #if defined(USE_OPENSSL) | 104 #if defined(USE_OPENSSL) |
| 105 ScopedEVPAEADCtx ctx_; | 105 ScopedEVPAEADCtx ctx_; |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(AeadBaseEncrypter); | 108 DISALLOW_COPY_AND_ASSIGN(AeadBaseEncrypter); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace net | 111 } // namespace net |
| 112 | 112 |
| 113 #endif // NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ | 113 #endif // NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ |
| OLD | NEW |