OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SCOPED_EVP_AEAD_CTX_H_ | 5 #ifndef NET_QUIC_CORE_CRYPTO_SCOPED_EVP_AEAD_CTX_H_ |
6 #define NET_QUIC_CRYPTO_SCOPED_EVP_AEAD_CTX_H_ | 6 #define NET_QUIC_CORE_CRYPTO_SCOPED_EVP_AEAD_CTX_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "third_party/boringssl/src/include/openssl/evp.h" | 9 #include "third_party/boringssl/src/include/openssl/evp.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 // ScopedEVPAEADCtx manages an EVP_AEAD_CTX object and calls the needed cleanup | 13 // ScopedEVPAEADCtx manages an EVP_AEAD_CTX object and calls the needed cleanup |
14 // functions when it goes out of scope. | 14 // functions when it goes out of scope. |
15 class ScopedEVPAEADCtx { | 15 class ScopedEVPAEADCtx { |
16 public: | 16 public: |
17 ScopedEVPAEADCtx(); | 17 ScopedEVPAEADCtx(); |
18 ~ScopedEVPAEADCtx(); | 18 ~ScopedEVPAEADCtx(); |
19 | 19 |
20 EVP_AEAD_CTX* get(); | 20 EVP_AEAD_CTX* get(); |
21 | 21 |
22 private: | 22 private: |
23 EVP_AEAD_CTX ctx_; | 23 EVP_AEAD_CTX ctx_; |
24 | 24 |
25 DISALLOW_COPY_AND_ASSIGN(ScopedEVPAEADCtx); | 25 DISALLOW_COPY_AND_ASSIGN(ScopedEVPAEADCtx); |
26 }; | 26 }; |
27 | 27 |
28 } // namespace net | 28 } // namespace net |
29 | 29 |
30 #endif // NET_QUIC_CRYPTO_SCOPED_EVP_AEAD_CTX_H_ | 30 #endif // NET_QUIC_CORE_CRYPTO_SCOPED_EVP_AEAD_CTX_H_ |
OLD | NEW |