fix(hsm): support strict-template HSMs - #7068
Conversation
|
💬 Discussion in Slack: #pr-review-infisical-7068-fix-hsm-support-strict-template-hsms Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
| Filename | Overview |
|---|---|
| backend/src/ee/services/hsm/hsm-service.ts | Adds explicit false attributes to AES and HMAC key generation templates for strict-template HSM compatibility; relaxes HMAC find query to match on class+label only to support vendor-specific key subtypes (e.g. nShield CKK_SHA256_HMAC). |
Reviews (1): Last reviewed commit: "Update hsm-service.ts" | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a8f510245
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Context
Adds explicit-false usage attributes (
CKA_WRAP/UNWRAP/DERIVE, andCKA_SIGN/VERIFYon AES andCKA_ENCRYPT/DECRYPTon HMAC) to both generate templates so HSMs with strict template validation no longer reject key creation withCKR_TEMPLATE_INCONSISTENT. Also relaxes the HMAC find to match on class + label only so vendor-specific generic-secret subtypes (e.g. nShield's CKK_SHA256_HMAC) are accepted. AES stays pinned to CKK_AES.Type
Checklist
type(scope): short description(scope is optional, e.g.,fix: prevent crash on syncorfix(api): handle null response).