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

Side by Side Diff: base/crypto/encryptor_openssl.cc

Issue 5105003: Implements Signature Creator & Verifier for openssl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wtc comments - change error stack tracer to use FROM_HERE Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/crypto/rsa_private_key.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/crypto/encryptor.h" 5 #include "base/crypto/encryptor.h"
6 6
7 #include <openssl/aes.h> 7 #include <openssl/aes.h>
8 #include <openssl/evp.h> 8 #include <openssl/evp.h>
9 9
10 #include "base/crypto/symmetric_key.h" 10 #include "base/crypto/symmetric_key.h"
(...skipping 16 matching lines...) Expand all
27 27
28 // On destruction this class will cleanup the ctx, and also clear the OpenSSL 28 // On destruction this class will cleanup the ctx, and also clear the OpenSSL
29 // ERR stack as a convenience. 29 // ERR stack as a convenience.
30 class ScopedCipherCTX { 30 class ScopedCipherCTX {
31 public: 31 public:
32 explicit ScopedCipherCTX() { 32 explicit ScopedCipherCTX() {
33 EVP_CIPHER_CTX_init(&ctx_); 33 EVP_CIPHER_CTX_init(&ctx_);
34 } 34 }
35 ~ScopedCipherCTX() { 35 ~ScopedCipherCTX() {
36 EVP_CIPHER_CTX_cleanup(&ctx_); 36 EVP_CIPHER_CTX_cleanup(&ctx_);
37 ClearOpenSSLERRStack(); 37 ClearOpenSSLERRStack(FROM_HERE);
38 } 38 }
39 EVP_CIPHER_CTX* get() { return &ctx_; } 39 EVP_CIPHER_CTX* get() { return &ctx_; }
40 40
41 private: 41 private:
42 EVP_CIPHER_CTX ctx_; 42 EVP_CIPHER_CTX ctx_;
43 }; 43 };
44 44
45 } // namespace 45 } // namespace
46 46
47 Encryptor::Encryptor() 47 Encryptor::Encryptor()
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 out_len += tail_len; 118 out_len += tail_len;
119 DCHECK_LE(out_len, static_cast<int>(output_size)); 119 DCHECK_LE(out_len, static_cast<int>(output_size));
120 result.resize(out_len); 120 result.resize(out_len);
121 121
122 output->swap(result); 122 output->swap(result);
123 return true; 123 return true;
124 } 124 }
125 125
126 } // namespace base 126 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/crypto/rsa_private_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698