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

Side by Side Diff: crypto/signature_creator_openssl.cc

Issue 1312203002: Include BoringSSL headers from third_party/ in crypto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « crypto/secure_hash_openssl.cc ('k') | crypto/signature_verifier_openssl.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "crypto/signature_creator.h" 5 #include "crypto/signature_creator.h"
6 6
7 #include <openssl/evp.h>
8 #include <openssl/rsa.h>
9
10 #include "base/logging.h" 7 #include "base/logging.h"
11 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
12 #include "base/stl_util.h" 9 #include "base/stl_util.h"
13 #include "crypto/openssl_util.h" 10 #include "crypto/openssl_util.h"
14 #include "crypto/rsa_private_key.h" 11 #include "crypto/rsa_private_key.h"
15 #include "crypto/scoped_openssl_types.h" 12 #include "crypto/scoped_openssl_types.h"
13 #include "third_party/boringssl/src/include/openssl/digest.h"
14 #include "third_party/boringssl/src/include/openssl/evp.h"
15 #include "third_party/boringssl/src/include/openssl/obj.h"
16 #include "third_party/boringssl/src/include/openssl/rsa.h"
16 17
17 namespace crypto { 18 namespace crypto {
18 19
19 namespace { 20 namespace {
20 21
21 const EVP_MD* ToOpenSSLDigest(SignatureCreator::HashAlgorithm hash_alg) { 22 const EVP_MD* ToOpenSSLDigest(SignatureCreator::HashAlgorithm hash_alg) {
22 switch (hash_alg) { 23 switch (hash_alg) {
23 case SignatureCreator::SHA1: 24 case SignatureCreator::SHA1:
24 return EVP_sha1(); 25 return EVP_sha1();
25 case SignatureCreator::SHA256: 26 case SignatureCreator::SHA256:
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // Sign it. 106 // Sign it.
106 if (!EVP_DigestSignFinal(sign_context_, vector_as_array(signature), &len)) { 107 if (!EVP_DigestSignFinal(sign_context_, vector_as_array(signature), &len)) {
107 signature->clear(); 108 signature->clear();
108 return false; 109 return false;
109 } 110 }
110 signature->resize(len); 111 signature->resize(len);
111 return true; 112 return true;
112 } 113 }
113 114
114 } // namespace crypto 115 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/secure_hash_openssl.cc ('k') | crypto/signature_verifier_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698