Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve TPMUSymKeyBits and TPMUSymMode #384

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AlexandreEXFO
Copy link
Contributor

No description provided.

@AlexandreEXFO AlexandreEXFO requested review from alexmwu, jkl73 and a team as code owners December 20, 2024 17:43
Copy link
Member

@chrisfenner chrisfenner left a comment

Choose a reason for hiding this comment

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

Thanks for this change! I have a couple comments.

// AES returns the 'aes' member of the union.
//
// Deprecated: AES exists for historical compatibility
Copy link
Member

Choose a reason for hiding this comment

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

The structure does indeed have members for each algorithm, see https://trustedcomputinggroup.org/wp-content/uploads/TPM-2.0-1.83-Part-2-Structures.pdf#page=150 (and see https://trustedcomputinggroup.org/wp-content/uploads/TPM-2.0-1.83-Part-2-Structures.pdf#page=32 for an explanation of the algorithm tokens). sym is there as a convenience within the reference implementation and IMHO probably shouldn't even be mentioned in the spec. Also, I'm expecting that a future version of the spec flattens these macros, because they're hard to understand.

@@ -1446,7 +1461,7 @@ type SymModeContents interface {
// create implements the unmarshallableWithHint interface.
func (u *TPMUSymMode) create(hint int64) (reflect.Value, error) {
switch TPMAlgID(hint) {
case TPMAlgAES:
case TPMAlgTDES, TPMAlgAES, TPMAlgSM4, TPMAlgCamellia:
Copy link
Member

Choose a reason for hiding this comment

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

TDES is deprecated (https://csrc.nist.gov/news/2023/nist-to-withdraw-sp-800-67-rev-2) so can we just not implement support for it?

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.

2 participants