diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-12 12:03:54 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-12 12:03:54 +0000 |
commit | ac0f8bedfb550bc04770f6b468dffd3d3ddeead5 (patch) | |
tree | dca645bd1d4c5e97d9df87fee6271a8edd2a5f37 /base/openssl_util.h | |
parent | 7ee45785e32196ea2b4b32ef3aed93c4a962aa2f (diff) | |
download | chromium_src-ac0f8bedfb550bc04770f6b468dffd3d3ddeead5.zip chromium_src-ac0f8bedfb550bc04770f6b468dffd3d3ddeead5.tar.gz chromium_src-ac0f8bedfb550bc04770f6b468dffd3d3ddeead5.tar.bz2 |
implement openssl symmetric key
add AES derived key test
Also includes some build fixes.
BUG=None
TEST=./out/Debug/base_unittests --gtest_filter=SymmetricKey*
Review URL: http://codereview.chromium.org/4691003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/openssl_util.h')
-rw-r--r-- | base/openssl_util.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/base/openssl_util.h b/base/openssl_util.h index 4f564cf..a3f64d4 100644 --- a/base/openssl_util.h +++ b/base/openssl_util.h @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_OPENNSSL_UTIL_H_ -#define BASE_OPENNSSL_UTIL_H_ +#ifndef BASE_OPENSSL_UTIL_H_ +#define BASE_OPENSSL_UTIL_H_ #pragma once #include "base/basictypes.h" +#include "base/tracked.h" namespace base { @@ -46,8 +47,25 @@ class ScopedOpenSSLSafeSizeBuffer { // Temporary buffer writen into in the case where the caller's // buffer is not of sufficient size. unsigned char min_sized_buffer_[MIN_SIZE]; + + DISALLOW_COPY_AND_ASSIGN(ScopedOpenSSLSafeSizeBuffer); +}; + +// Drains the OpenSSL ERR_get_error stack. On a debug build the error codes +// are send to VLOG(1), on a release build they are disregarded. +void ClearOpenSSLERRStack(); + +// Put an instance of this class on the call stack to automatically clear the +// OpenSSL error stack on exit of your function. +class ScopedOpenSSLERRClearer { + public: + ScopedOpenSSLERRClearer() {} + ~ScopedOpenSSLERRClearer() { ClearOpenSSLERRStack(); } + + private: + DISALLOW_COPY_AND_ASSIGN(ScopedOpenSSLERRClearer); }; } // namespace base -#endif // BASE_NSS_UTIL_H_ +#endif // BASE_OPENSSL_UTIL_H_ |