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
3 // found in the LICENSE file.
5 #ifndef NET_QUIC_CRYPTO_SCOPED_EVP_CIPHER_CTX_H_
6 #define NET_QUIC_CRYPTO_SCOPED_EVP_CIPHER_CTX_H_
8 typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
12 // TODO(wtc): this is the same as the ScopedCipherCTX class defined in
13 // crypto/encryptor_openssl.cc. Eliminate the duplicate code.
14 // crypto::ScopedOpenSSL is not suitable for EVP_CIPHER_CTX because
15 // there are no EVP_CIPHER_CTX_create and EVP_CIPHER_CTX_destroy
17 class ScopedEVPCipherCtx {
20 ~ScopedEVPCipherCtx();
22 EVP_CIPHER_CTX* get() const;
25 EVP_CIPHER_CTX* const ctx_;
30 #endif // NET_QUIC_CRYPTO_SCOPED_EVP_CIPHER_CTX_H_