Skip to content

Conversation

@maraino
Copy link
Contributor

@maraino maraino commented Jan 8, 2026

This commit implements the experimental SearchKeys method on the tpmkms. With this method.

This commit implements the experimental SearchKeys method on the tpmkms.
With this method.
This commit fixes empty results on unsigned binaries when we search for
keys in the secure enclave.
}

// SearchKeys searches for keys according to the query URI in the request. By
// default, with the query "tpmkms:", it will return all keys and attestation
Copy link
Member

Choose a reason for hiding this comment

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

Minor, but this makes the distinction a little bit clearer:

Suggested change
// default, with the query "tpmkms:", it will return all keys and attestation
// default, with the query "tpmkms:", it will return all application and attestation

// - "tpmkms:" will return all keys and AKs managed by the KMS
// - "tpmkms:ak=true" will return all AKs managed by the KMS
// - "tpmkms:ak=false" will return all the keys managed by the KMS
// - "tpmkms:name=my-name" will only return the key with the selected name
Copy link
Member

Choose a reason for hiding this comment

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

This means it defaults to the behavior of ak=false? If so, that sounds OK.

Comment on lines +1287 to +1288
// - "tpmkms:name=my-name;ak=false" will only return the key with the selected name
//
Copy link
Member

Choose a reason for hiding this comment

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

It might be an option to include support for searching application keys by the AK they were attested by. Not a blocker, though.

}},
},
}, assert.NoError},
{"ok enpty", fields{sim, nil, nil}, args{&apiv1.SearchKeysRequest{Query: "tpmkms:name=not-found"}}, &apiv1.SearchKeysResponse{}, assert.NoError},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{"ok enpty", fields{sim, nil, nil}, args{&apiv1.SearchKeysRequest{Query: "tpmkms:name=not-found"}}, &apiv1.SearchKeysResponse{}, assert.NoError},
{"ok empty", fields{sim, nil, nil}, args{&apiv1.SearchKeysRequest{Query: "tpmkms:name=not-found"}}, &apiv1.SearchKeysResponse{}, assert.NoError},

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants