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

Unified Diff: chromeos/dbus/fake_easy_unlock_client.h

Issue 513013003: Add unit tests for easyUnlockPrivate API - crypto methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/fake_easy_unlock_client.h
diff --git a/chromeos/dbus/fake_easy_unlock_client.h b/chromeos/dbus/fake_easy_unlock_client.h
index ddb0b92abd3a3b7d8c1318a18991bb5334b1b2f4..dd9cc8d7024da0ceb50cef01e56d00875f4426cd 100644
--- a/chromeos/dbus/fake_easy_unlock_client.h
+++ b/chromeos/dbus/fake_easy_unlock_client.h
@@ -14,6 +14,11 @@ namespace chromeos {
// A fake implemetation of EasyUnlockClient.
class CHROMEOS_EXPORT FakeEasyUnlockClient : public EasyUnlockClient {
public:
+ // Tests if the provided keys belong to the same (fake) EC P256 key pair
+ // generated by |this|.
+ static bool IsEcP256KeyPair(const std::string& private_key,
+ const std::string& public_key);
+
FakeEasyUnlockClient();
virtual ~FakeEasyUnlockClient();
@@ -24,7 +29,7 @@ class CHROMEOS_EXPORT FakeEasyUnlockClient : public EasyUnlockClient {
const std::string& public_key,
const DataCallback& callback) OVERRIDE;
virtual void CreateSecureMessage(const std::string& payload,
- const std::string& secret_key,
+ const std::string& key,
const std::string& associated_data,
const std::string& public_metadata,
const std::string& verification_key_id,
@@ -32,13 +37,15 @@ class CHROMEOS_EXPORT FakeEasyUnlockClient : public EasyUnlockClient {
const std::string& signature_type,
const DataCallback& callback) OVERRIDE;
virtual void UnwrapSecureMessage(const std::string& message,
- const std::string& secret_key,
+ const std::string& key,
const std::string& associated_data,
const std::string& encryption_type,
const std::string& signature_type,
const DataCallback& callback) OVERRIDE;
private:
+ int generated_keys_count_;
+
DISALLOW_COPY_AND_ASSIGN(FakeEasyUnlockClient);
};

Powered by Google App Engine
This is Rietveld 408576698