Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: crypto/auto_cbb.h

Issue 1739403002: Cut down on usage of deprecated APIs in //crypto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef CRYPTO_AUTO_CBB_H_
6 #define CRYPTO_AUTO_CBB_H_
7
8 #include <openssl/bytestring.h>
9
10 #include "base/macros.h"
11
12 namespace crypto {
13
14 // AutoCBB is a wrapper over OpenSSL's CBB type that automatically releases
15 // resources when going out of scope.
16 class AutoCBB {
davidben 2016/02/26 21:51:34 I still very strongly think this is a bad name and
17 public:
18 AutoCBB() { CBB_zero(&cbb_); }
19 ~AutoCBB() { CBB_cleanup(&cbb_); }
20
21 CBB* get() { return &cbb_; }
22
23 void Reset() {
24 CBB_cleanup(&cbb_);
25 CBB_zero(&cbb_);
26 }
27
28 private:
29 CBB cbb_;
30 DISALLOW_COPY_AND_ASSIGN(AutoCBB);
31 };
32
33 } // namespace crypto
34
35 #endif // CRYPTO_AUTO_CBB_H_
OLDNEW
« no previous file with comments | « crypto/BUILD.gn ('k') | crypto/crypto.gyp » ('j') | crypto/ec_private_key_nss.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698