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_DECRYPTER_H_ | 5 #ifndef NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ |
6 #define NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ | 6 #define NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // can assert at compile time their key_size_ and nonce_prefix_size_ do not | 56 // can assert at compile time their key_size_ and nonce_prefix_size_ do not |
57 // exceed the maximum. | 57 // exceed the maximum. |
58 static const size_t kMaxKeySize = 32; | 58 static const size_t kMaxKeySize = 32; |
59 static const size_t kMaxNoncePrefixSize = 4; | 59 static const size_t kMaxNoncePrefixSize = 4; |
60 | 60 |
61 #if !defined(USE_OPENSSL) | 61 #if !defined(USE_OPENSSL) |
62 struct AeadParams { | 62 struct AeadParams { |
63 unsigned int len; | 63 unsigned int len; |
64 union { | 64 union { |
65 CK_GCM_PARAMS gcm_params; | 65 CK_GCM_PARAMS gcm_params; |
66 #if !defined(USE_NSS) | 66 #if !defined(USE_NSS_CERTS) |
67 // USE_NSS means we are using system NSS rather than our copy of NSS. | 67 // USE_NSS_CERTS implies we are using system NSS rather than our copy of |
68 // The system NSS <pkcs11n.h> header doesn't define this type yet. | 68 // NSS. The system NSS <pkcs11n.h> header doesn't define this type yet. |
69 CK_NSS_AEAD_PARAMS nss_aead_params; | 69 CK_NSS_AEAD_PARAMS nss_aead_params; |
70 #endif | 70 #endif |
71 } data; | 71 } data; |
72 }; | 72 }; |
73 | 73 |
74 virtual void FillAeadParams(base::StringPiece nonce, | 74 virtual void FillAeadParams(base::StringPiece nonce, |
75 const base::StringPiece& associated_data, | 75 const base::StringPiece& associated_data, |
76 size_t auth_tag_size, | 76 size_t auth_tag_size, |
77 AeadParams* aead_params) const = 0; | 77 AeadParams* aead_params) const = 0; |
78 #endif // !defined(USE_OPENSSL) | 78 #endif // !defined(USE_OPENSSL) |
(...skipping 24 matching lines...) Expand all Loading... |
103 #if defined(USE_OPENSSL) | 103 #if defined(USE_OPENSSL) |
104 ScopedEVPAEADCtx ctx_; | 104 ScopedEVPAEADCtx ctx_; |
105 #endif | 105 #endif |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(AeadBaseDecrypter); | 107 DISALLOW_COPY_AND_ASSIGN(AeadBaseDecrypter); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace net | 110 } // namespace net |
111 | 111 |
112 #endif // NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ | 112 #endif // NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ |
OLD | NEW |