summaryrefslogtreecommitdiffstats
path: root/net/quic/crypto/scoped_evp_aead_ctx.h
blob: f8bb35689bb406f921fbea0b55c201315dcdb9e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_QUIC_CRYPTO_SCOPED_EVP_AEAD_CTX_H_
#define NET_QUIC_CRYPTO_SCOPED_EVP_AEAD_CTX_H_

#include <openssl/evp.h>

namespace net {

// ScopedEVPAEADCtx manages an EVP_AEAD_CTX object and calls the needed cleanup
// functions when it goes out of scope.
class ScopedEVPAEADCtx {
 public:
  ScopedEVPAEADCtx();
  ~ScopedEVPAEADCtx();

  EVP_AEAD_CTX* get();

 private:
  EVP_AEAD_CTX ctx_;
};

}  // namespace net

#endif  // NET_QUIC_CRYPTO_SCOPED_EVP_AEAD_CTX_H_