Skip to content

Conversation

rishav-karanjit
Copy link
Member

@rishav-karanjit rishav-karanjit commented Jun 26, 2025

Issue #, if available:

Description of changes:
Crypto tools is adding a new feature (Hierarchical Keyring V2) in MPL main branch. This PR adds the specification for it.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

@rishav-karanjit rishav-karanjit marked this pull request as ready for review June 26, 2025 19:28
@rishav-karanjit rishav-karanjit requested a review from a team as a code owner June 26, 2025 19:28
Copy link
Contributor

@texastony texastony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, need to do a proper review when I get home.

If the `hierarchy-version` is v1, AWS KMS encryption context MUST be same as [branch key context](#branch-key-context).
If the `hierarchy-version` is v2, AWS KMS encryption context MUST be the [encryption context](../structures.md#encryption-context) send by users without any transformation.

AWS KMS encryption context MUST be always the same encryption context send by user regardless of any variation of encryption context (i.e.: ACTIVE Encryption Context, DECRYPT_ONLY Encryption Context, Beacon Key Encryption Context and Custom Encryption Context).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line reads funny. I think I understand what we are trying to say.
But I think we need to clean it up.

Copy link
Member Author

@rishav-karanjit rishav-karanjit Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rephrase it to

"""
If the hierarchy-version is v2, the encryption context send to AWS KMS MUST always match the encryption context originally sent by the user, without any variations. This requirement applies regardless of the type of encryption context being used, whether it is the ACTIVE encryption context, the DECRYPT_ONLY encryption context, the Beacon Key encryption context, or a custom encryption context.
"""

lmk if you have any suggestion


# 1 Plain-text Commitment instead of KMS Encryption Context

The KMS RSA Keyring has already solved the need
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the ecdh keyrings as well

A root key used to then derive different beacon keys per beacon.
- [UUID](https://www.ietf.org/rfc/rfc4122.txt): a universally unique identifier that can be represented as a byte sequence or a string.

#### kms-arn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another nit:
i think kms-arn and hierachy version are meant to be bullet points under definitions and not their own sections?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having them as sections so we can link to them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair, it's just hard to read

Comment on lines 14 to 15
These are any members of the Branch Key's Context whose key is not prefixed by `aws-crypto-ec:` OR another reserved Branch Key Context Key Name, such as `kms-arn` or `hierarchy-version`.
Such Key-Value pairs were NOT added to a Branch Key Item by a Crypto Tools product.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are revered keys not added by CryptoTools?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOT (prefixed with aws-crypto-ec: or another reserved word).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the NOT applies to both sides of the OR.

Comment on lines +393 to +395
- [KMS ARN](#kms-arn)
- [Create Time](#create-time)
- [Hierarchy Version](#hierarchy-version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is breaking. We may consider this lightly breaking because who else is constructing these. Just bringing it up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. I think it is worth it.
I have a ticket right now where this would solve an issue.

texastony
texastony previously approved these changes Aug 29, 2025
@A2Zwholesalediscounters

Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants