4 years, 7 months ago
(2016-04-28 14:09:03 UTC)
#4
Peter Beverloo
Hey John, Thanks for the CL! Firstly, let's split this up in two CLs: one ...
4 years, 7 months ago
(2016-05-04 13:58:53 UTC)
#5
Hey John,
Thanks for the CL! Firstly, let's split this up in two CLs: one where you
introduce the ability to store keys separately in the key store, one where
you hook up the key store with the InstanceID implementation.
I'm going to focus on the key store part of this CL for my comments, since
that is the meaty part. A few higher level comments:
- The GCMEncryptionProvider doesn't have to know about the distinction
between the different key storage types supported by the GCMKeyStore.
Can it just pass through what it knows ([app_id, sender_id]) to the
GCMKeyStore in all cases, trusting that class to do the right thing?
- You're introducing the concept of a "key owner". The GCM Driver already
has the established concepts of "app_id" and "sender_id" (even when its
known as "authorized_entry"), I would like us to build on that.
Could we, instead, consider changing the GCMKeyStore API to provide the
following methods with the following contracts?
:: GCMKeyStore::GetKeys(app_id, authorized_entry, callback)
1) Loads the key for [app_id, authorized_entry].
2) If said key does not exist, loads the key for [app_id, ""].
:: GCMKeyStore::CreateKeys(app_id, authorized_entry, callback)
1) Creates a key for [app_id, authorized_entry].
GCMDriver::GetEncryptionInfo() would deliberately pass an empty string for
the authorized_entry. InstanceID::GetEncryptionInfo() would pass both.
:: GCMKeyStore::RemoveKeys(app_id, authorized_entry, callback)
1) If |authorized_entry| is "*", removes all non-empty keys associated
with the |app_id|.
2) Otherwise, removes the key for [app_id, authorized_entry]
This will support GCMDriver::Unregister (which will pass [app_id, ""]),
InstanceID::DeleteToken (which will pass [app_id, authorized_entry]) as
well as InstanceID::DeleteID (which will pass [app_id, "*"]), without
causing conflicts.
This API will allow us to limit the need for a "key owner" concept to the
GCMKeyStore, and even then it depends on how we decide to store the actual
key information. (I don't think we even have to do that.)
WDYT?
johnme
Description was changed from ========== Integrate InstanceID with GCM crypto provider It's now possible to ...
4 years, 7 months ago
(2016-05-06 12:03:50 UTC)
#6
Addressed review comments. > Thanks for the CL! Firstly, let's split this up in two ...
4 years, 7 months ago
(2016-05-06 12:33:01 UTC)
#8
Addressed review comments.
> Thanks for the CL! Firstly, let's split this up in two CLs: one where you
> introduce the ability to store keys separately in the key store, one where
> you hook up the key store with the InstanceID implementation.
Done. Key store changes moved to https://codereview.chromium.org/1953273002
> The GCMEncryptionProvider doesn't have to know about the distinction
> between the different key storage types supported by the GCMKeyStore.
> Can it just pass through what it knows ([app_id, sender_id]) to the
> GCMKeyStore in all cases, trusting that class to do the right thing?
Doneish - it passes through an instance_id_authorized_entity, which is the
empty string for legacy GCM registrations.
> You're introducing the concept of a "key owner". The GCM Driver already
> has the established concepts of "app_id" and "sender_id" (even when its
> known as "authorized_entry"), I would like us to build on that.
Done. No more owner.
> :: GCMKeyStore::GetKeys(app_id, authorized_entry, callback)
Done, though see next point.
> 1) Loads the key for [app_id, authorized_entry].
> 2) If said key does not exist, loads the key for [app_id, ""].
No, this could potentially cause conflicts between legacy GCM registations
and IID tokens for the same app_id. Instead GCMEncryptionProvider's Decrypt
method still tries both.
> :: GCMKeyStore::CreateKeys(app_id, authorized_entry, callback)
>
> 1) Creates a key for [app_id, authorized_entry].
>
> GCMDriver::GetEncryptionInfo() would deliberately pass an empty string for
> the authorized_entry. InstanceID::GetEncryptionInfo() would pass both.
Done.
> :: GCMKeyStore::RemoveKeys(app_id, authorized_entry, callback)
>
> 1) If |authorized_entry| is "*", removes all non-empty keys associated
> with the |app_id|.
> 2) Otherwise, removes the key for [app_id, authorized_entry]
>
> This will support GCMDriver::Unregister (which will pass [app_id, ""]),
> InstanceID::DeleteToken (which will pass [app_id, authorized_entry]) as
> well as InstanceID::DeleteID (which will pass [app_id, "*"]), without
> causing conflicts.
Done.
> This API will allow us to limit the need for a "key owner" concept to the
> GCMKeyStore, and even then it depends on how we decide to store the actual
> key information. (I don't think we even have to do that.)
Even the store no longer uses owners, since I used separate fields in the
proto. The only remnant is DatabaseKey in gcm_key_store.cc, since app_id is
no longer a valid unique key for database objects.
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1923953002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1923953002/120001
4 years, 7 months ago
(2016-05-13 16:26:10 UTC)
#14
Try jobs failed on following builders: ios-device on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/5165)
4 years, 7 months ago
(2016-05-13 16:35:28 UTC)
#16
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1923953002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1923953002/140001
4 years, 7 months ago
(2016-05-24 17:30:48 UTC)
#19
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/166616)
4 years, 7 months ago
(2016-05-24 19:04:18 UTC)
#21
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1923953002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1923953002/160001
4 years, 6 months ago
(2016-06-02 12:58:13 UTC)
#24
Issue 1923953002: Integrate InstanceID with GCM crypto provider
(Closed)
Created 4 years, 7 months ago by johnme
Modified 4 years, 6 months ago
Reviewers: Peter Beverloo
Base URL: https://chromium.googlesource.com/chromium/src.git@iid5default
Comments: 10