Instead of returning a std::string(), the fake client should return a syntactically valid serialized SignedData. This will allow callers to do basic operations such as recovering the data in a callback to operate on it.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/911199cb30f608636c79d47e50dca84735e3a08f commit 911199cb30f608636c79d47e50dca84735e3a08f Author: drcrash <drcrash@chromium.org> Date: Wed Sep 07 23:43:04 2016 Do a better job at faking simple challenge signatures. By returning a signed simple challenge that can actually be parsed as SignedData, we allow callers of the FakeCryptohomeClient to extract the original data back and process it, making for better fake behavior and simpler tests. Note that the signature is purposedly not verifiable in the FakeCryptohomeClient. BUG= 643245 TEST=chromeos_unittests; unit_tests and components_unittests also pass Review-Url: https://codereview.chromium.org/2297193006 Cr-Commit-Position: refs/heads/master@{#417118} [modify] https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f/chrome/browser/chromeos/BUILD.gn [modify] https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f/chrome/browser/chromeos/attestation/platform_verification_flow.cc [modify] https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f/chromeos/BUILD.gn [modify] https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f/chromeos/chromeos.gyp [modify] https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f/chromeos/dbus/fake_cryptohome_client.cc [modify] https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f/chromeos/dbus/fake_cryptohome_client.h [add] https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f/chromeos/dbus/fake_cryptohome_client_unittest.cc [rename] https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f/chromeos/dbus/proto/attestation.proto
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/746d1dd68119cacc6636152921db9f1e88d92c52 commit 746d1dd68119cacc6636152921db9f1e88d92c52 Author: achuith <achuith@chromium.org> Date: Thu Sep 08 09:50:56 2016 Revert of Do a better job at faking simple challenge signatures. (patchset #7 id:120001 of https://codereview.chromium.org/2297193006/ ) Reason for revert: crbug.com/645052 This is causing build_package failures on chromeos. Original issue's description: > Do a better job at faking simple challenge signatures. > > By returning a signed simple challenge that can actually be parsed as SignedData, we allow callers of the FakeCryptohomeClient to extract the original data back and process it, making for better fake behavior and simpler tests. > > Note that the signature is purposedly not verifiable in the FakeCryptohomeClient. > > BUG= 643245 > TEST=chromeos_unittests; unit_tests and components_unittests also pass > > Committed: https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f > Cr-Commit-Position: refs/heads/master@{#417118} TBR=dkrahn@chromium.org,xiyuan@chromium.org,drcrash@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 643245 Review-Url: https://codereview.chromium.org/2326473002 Cr-Commit-Position: refs/heads/master@{#417242} [modify] https://crrev.com/746d1dd68119cacc6636152921db9f1e88d92c52/chrome/browser/chromeos/BUILD.gn [rename] https://crrev.com/746d1dd68119cacc6636152921db9f1e88d92c52/chrome/browser/chromeos/attestation/attestation_signed_data.proto [modify] https://crrev.com/746d1dd68119cacc6636152921db9f1e88d92c52/chrome/browser/chromeos/attestation/platform_verification_flow.cc [modify] https://crrev.com/746d1dd68119cacc6636152921db9f1e88d92c52/chromeos/BUILD.gn [modify] https://crrev.com/746d1dd68119cacc6636152921db9f1e88d92c52/chromeos/chromeos.gyp [modify] https://crrev.com/746d1dd68119cacc6636152921db9f1e88d92c52/chromeos/dbus/fake_cryptohome_client.cc [modify] https://crrev.com/746d1dd68119cacc6636152921db9f1e88d92c52/chromeos/dbus/fake_cryptohome_client.h [delete] https://crrev.com/411f4fc60df3a256dd2d15ab39c540228ed66e7f/chromeos/dbus/fake_cryptohome_client_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7da3d8b32b30123c741dfd31371e45416c680bd4 commit 7da3d8b32b30123c741dfd31371e45416c680bd4 Author: drcrash <drcrash@chromium.org> Date: Fri Sep 09 05:39:53 2016 Do a better job at faking simple challenge signatures. (Redo due to http://crbug.com/645052 ) By returning a signed simple challenge that can actually be parsed as SignedData, we allow callers of the FakeCryptohomeClient to extract the original data back and process it, making for better fake behavior and simpler tests. Note that the signature is purposedly not verifiable in the FakeCryptohomeClient. BUG= 643245 TEST=chromeos_unittests; unit_tests and components_unittests also pass TBR=xiyuan@chromium.org Committed: https://crrev.com/911199cb30f608636c79d47e50dca84735e3a08f Cr-Commit-Position: refs/heads/master@{#417118} patch from issue 2297193006 at patchset 120001 (http://crrev.com/2297193006#ps120001) Review-Url: https://codereview.chromium.org/2324793003 Cr-Commit-Position: refs/heads/master@{#417509} [modify] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chrome/browser/chromeos/BUILD.gn [modify] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chrome/browser/chromeos/attestation/platform_verification_flow.cc [modify] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc [modify] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chrome/browser/chromeos/policy/device_cloud_policy_initializer.cc [modify] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chromeos/BUILD.gn [modify] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chromeos/chromeos.gyp [modify] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chromeos/dbus/fake_cryptohome_client.cc [modify] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chromeos/dbus/fake_cryptohome_client.h [add] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chromeos/dbus/fake_cryptohome_client_unittest.cc [rename] https://crrev.com/7da3d8b32b30123c741dfd31371e45416c680bd4/chromeos/dbus/proto/attestation.proto
Comment 1 by bugdroid1@chromium.org
, Sep 7 2016