| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/login/easy_unlock/secure_message_delegate_chro
meos.h" | 5 #include "chrome/browser/chromeos/login/easy_unlock/secure_message_delegate_chro
meos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chromeos/dbus/dbus_thread_manager.h" | 8 #include "chromeos/dbus/dbus_thread_manager.h" |
| 9 #include "chromeos/dbus/easy_unlock_client.h" | 9 #include "chromeos/dbus/easy_unlock_client.h" |
| 10 #include "components/proximity_auth/logging/logging.h" | 10 #include "components/proximity_auth/logging/logging.h" |
| 11 #include "third_party/cros_system_api/dbus/service_constants.h" | 11 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 12 | 12 |
| 13 using proximity_auth::SecureMessageDelegate; | 13 using cryptauth::SecureMessageDelegate; |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 // Converts encryption type to a string representation used by EasyUnlock dbus | 18 // Converts encryption type to a string representation used by EasyUnlock dbus |
| 19 // client. | 19 // client. |
| 20 std::string EncSchemeToString(securemessage::EncScheme scheme) { | 20 std::string EncSchemeToString(securemessage::EncScheme scheme) { |
| 21 switch (scheme) { | 21 switch (scheme) { |
| 22 case securemessage::AES_256_CBC: | 22 case securemessage::AES_256_CBC: |
| 23 return easy_unlock::kEncryptionTypeAES256CBC; | 23 return easy_unlock::kEncryptionTypeAES256CBC; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 options.associated_data.assign(unwrap_options.associated_data); | 143 options.associated_data.assign(unwrap_options.associated_data); |
| 144 | 144 |
| 145 options.encryption_type = EncSchemeToString(unwrap_options.encryption_scheme); | 145 options.encryption_type = EncSchemeToString(unwrap_options.encryption_scheme); |
| 146 options.signature_type = SigSchemeToString(unwrap_options.signature_scheme); | 146 options.signature_type = SigSchemeToString(unwrap_options.signature_scheme); |
| 147 | 147 |
| 148 dbus_client_->UnwrapSecureMessage(serialized_message, options, | 148 dbus_client_->UnwrapSecureMessage(serialized_message, options, |
| 149 base::Bind(&HandleUnwrapResult, callback)); | 149 base::Bind(&HandleUnwrapResult, callback)); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace chromeos | 152 } // namespace chromeos |
| OLD | NEW |