OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/devtools/device/usb/android_rsa.h" | 5 #include "chrome/browser/devtools/device/usb/android_rsa.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/prefs/pref_service_syncable.h" | |
10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 #include "components/syncable_prefs/pref_service_syncable.h" |
12 #include "crypto/rsa_private_key.h" | 12 #include "crypto/rsa_private_key.h" |
13 #include "crypto/signature_creator.h" | 13 #include "crypto/signature_creator.h" |
14 #include "net/cert/asn1_util.h" | 14 #include "net/cert/asn1_util.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 const size_t kRSANumWords = 64; | 18 const size_t kRSANumWords = 64; |
19 const size_t kBigIntSize = 1024; | 19 const size_t kBigIntSize = 1024; |
20 | 20 |
21 static const char kDummyRSAPublicKey[] = | 21 static const char kDummyRSAPublicKey[] = |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 const std::string& body) { | 262 const std::string& body) { |
263 std::vector<uint8> digest(body.begin(), body.end()); | 263 std::vector<uint8> digest(body.begin(), body.end()); |
264 std::vector<uint8> result; | 264 std::vector<uint8> result; |
265 if (!crypto::SignatureCreator::Sign(key, crypto::SignatureCreator::SHA1, | 265 if (!crypto::SignatureCreator::Sign(key, crypto::SignatureCreator::SHA1, |
266 vector_as_array(&digest), digest.size(), | 266 vector_as_array(&digest), digest.size(), |
267 &result)) { | 267 &result)) { |
268 return std::string(); | 268 return std::string(); |
269 } | 269 } |
270 return std::string(result.begin(), result.end()); | 270 return std::string(result.begin(), result.end()); |
271 } | 271 } |
OLD | NEW |