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 <stddef.h> |
7 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> |
8 | 10 |
9 #include <limits> | 11 #include <limits> |
10 | 12 |
11 #include "base/base64.h" | 13 #include "base/base64.h" |
12 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
15 #include "components/syncable_prefs/pref_service_syncable.h" | 17 #include "components/syncable_prefs/pref_service_syncable.h" |
16 #include "crypto/rsa_private_key.h" | 18 #include "crypto/rsa_private_key.h" |
17 #include "crypto/signature_creator.h" | 19 #include "crypto/signature_creator.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 std::string AndroidRSASign(crypto::RSAPrivateKey* key, | 271 std::string AndroidRSASign(crypto::RSAPrivateKey* key, |
270 const std::string& body) { | 272 const std::string& body) { |
271 std::vector<uint8_t> digest(body.begin(), body.end()); | 273 std::vector<uint8_t> digest(body.begin(), body.end()); |
272 std::vector<uint8_t> result; | 274 std::vector<uint8_t> result; |
273 if (!crypto::SignatureCreator::Sign(key, crypto::SignatureCreator::SHA1, | 275 if (!crypto::SignatureCreator::Sign(key, crypto::SignatureCreator::SHA1, |
274 digest.data(), digest.size(), &result)) { | 276 digest.data(), digest.size(), &result)) { |
275 return std::string(); | 277 return std::string(); |
276 } | 278 } |
277 return std::string(result.begin(), result.end()); | 279 return std::string(result.begin(), result.end()); |
278 } | 280 } |
OLD | NEW |