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

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

Issue 6714032: Move some files in base to base/memory. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: only base Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/signature_creator.h" 5 #include "base/crypto/signature_creator.h"
6 6
7 #include <openssl/evp.h> 7 #include <openssl/evp.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h"
10 #include "base/openssl_util.h" 11 #include "base/openssl_util.h"
11 #include "base/scoped_ptr.h"
12 #include "base/stl_util-inl.h" 12 #include "base/stl_util-inl.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 // static 16 // static
17 SignatureCreator* SignatureCreator::Create(RSAPrivateKey* key) { 17 SignatureCreator* SignatureCreator::Create(RSAPrivateKey* key) {
18 OpenSSLErrStackTracer err_tracer(FROM_HERE); 18 OpenSSLErrStackTracer err_tracer(FROM_HERE);
19 scoped_ptr<SignatureCreator> result(new SignatureCreator); 19 scoped_ptr<SignatureCreator> result(new SignatureCreator);
20 result->key_ = key; 20 result->key_ = key;
21 if (!EVP_SignInit_ex(result->sign_context_, EVP_sha1(), NULL)) 21 if (!EVP_SignInit_ex(result->sign_context_, EVP_sha1(), NULL))
(...skipping 23 matching lines...) Expand all
45 int rv = EVP_SignFinal(sign_context_, vector_as_array(signature), &len, key); 45 int rv = EVP_SignFinal(sign_context_, vector_as_array(signature), &len, key);
46 if (!rv) { 46 if (!rv) {
47 signature->clear(); 47 signature->clear();
48 return false; 48 return false;
49 } 49 }
50 signature->resize(len); 50 signature->resize(len);
51 return true; 51 return true;
52 } 52 }
53 53
54 } // namespace base 54 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698