Extend local and shared credential protos to included duplicated metadata_encryption_key and metadata_encryption_key_tag for all protocol version

PiperOrigin-RevId: 538612138
This commit is contained in:
Anthony Rueda
2023-06-07 15:43:30 -07:00
committed by Copybara-Service
parent e101795cac
commit 72b249474d
9 changed files with 42 additions and 29 deletions
+12 -5
View File
@@ -40,7 +40,7 @@ enum CredentialType {
// The shared credential is derived from local credential, and distributed to
// remote devices based on the trust token for identity decryption and
// authentication.
// NEXT_ID=12
// NEXT_ID=14
message SharedCredential {
// The randomly generated unique id of the public credential.
bytes secret_id = 1;
@@ -54,12 +54,12 @@ message SharedCredential {
// The time in millis from epoch when this credential expires.
int64 end_time_millis = 4;
// The encrypted Metadata in bytes. Encrypted either by the v0 or v1
// The encrypted Metadata in bytes. Encrypted by the v0
// metadata_encryption_key.
bytes encrypted_metadata_bytes = 5;
bytes encrypted_metadata_bytes_v0 = 5;
// The tag for verifying metadata_encryption_key.
bytes metadata_encryption_key_tag = 6;
// The tag for verifying metadata_encryption_key for an unsigned adv.
bytes metadata_encryption_key_unsigned_adv_tag = 6;
// The public key is used to create a secure connection with the device.
bytes connection_signature_verification_key = 7;
@@ -83,4 +83,11 @@ message SharedCredential {
// determine whether a device identity credential or account based identity
// credential is used for decryption.
CredentialType type = 11;
// The encrypted Metadata in bytes. Encrypted by the v1
// metadata_encryption_key.
bytes encrypted_metadata_bytes_v1 = 12;
// The tag for verifying metadata_encryption_key for a signed V1 adv.
bytes metadata_encryption_key_signed_adv_tag = 13;
}
+5 -2
View File
@@ -52,8 +52,8 @@ message LocalCredential {
// The time in millis from epoch when this credential expires.
int64 end_time_millis = 4;
// The 14 or 16 bytes aes key to encrypt metadata in PublicCredential.
bytes metadata_encryption_key = 5;
// The 14 bytes aes key to encrypt metadata in PublicCredential.
bytes metadata_encryption_key_v0 = 5;
// It is used for signing advertisement.
PrivateKey advertisement_signing_key = 6;
@@ -68,4 +68,7 @@ message LocalCredential {
// The set of 2-byte salts already used to encrypt the metadata key.
map<uint32, bool> consumed_salts = 9;
// The 16 bytes aes key to encrypt metadata in PublicCredential.
bytes metadata_encryption_key_v1 = 10;
}