summaryrefslogtreecommitdiffstats
path: root/net/quic/crypto/scoped_evp_aead_ctx.h
blob: f0f04c1caafc1da5278691b48fa202d55c70c509 (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
28
29
30
31
// 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>

#include "base/basictypes.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_;

  DISALLOW_COPY_AND_ASSIGN(ScopedEVPAEADCtx);
};

}  // namespace net

#endif  // NET_QUIC_CRYPTO_SCOPED_EVP_AEAD_CTX_H_