feat: support multiple bytes key_id for hsm signer (cka_id)#1107
Open
Spinbazz wants to merge 1 commit into
Open
feat: support multiple bytes key_id for hsm signer (cka_id)#1107Spinbazz wants to merge 1 commit into
Spinbazz wants to merge 1 commit into
Conversation
jku
requested changes
May 12, 2026
Collaborator
jku
left a comment
There was a problem hiding this comment.
apologies for the silence, did not mean to leave you on unread for so long. The basic idea makes sense to me: the search filter is actually a byte array and current code fails if keyid > 0xFF.
I left one comment in code -- that looks like a hex conversion bug to me. Maybe adding a test with odd and even length hex string ids would make sense? let me know if you're not invested enough, I can look at adding that.
Comment on lines
+213
to
+216
| keyid_hexstr = hex(keyid)[2::] | ||
| cka_id_filter = [ | ||
| int(keyid_hexstr[i : i + 2], 16) for i in range(0, len(keyid_hexstr), 2) | ||
| ] |
Collaborator
There was a problem hiding this comment.
I think this bit is buggy:
>>> hex(255)[2::]
'ff'
>>> hex(256)[2::]
'100'
that will screw up the filter AFAICT. The latter leads to cka_id_filter = [16, 0] which sounds wrong.
using keyid.to_bytes() instead might be simpler (but still requires figuring out the length).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the changes being introduced by the pull request:
Fix: remove keyid size limitation to 1 byte (FF)
Fixes #1105