Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Address PR comments
Carlos Monastyrski30a3ccff5878
diff --git a/backend/src/lib/crypto/pqc/pqc-crypto.ts b/backend/src/lib/crypto/pqc/pqc-crypto.tsindex 29e7f5f8f1..6ff9ced46f 100644--- a/backend/src/lib/crypto/pqc/pqc-crypto.ts+++ b/backend/src/lib/crypto/pqc/pqc-crypto.ts@@ -77,7 +77,11 @@ const extractRawKeyFromPkcs8 = (der: Buffer): Buffer => {const raw = Buffer.from(parsed.privateKey.buffer);// Handle keys stored with double OCTET STRING wrapping (legacy encoding)if (raw[0] === 0x04) {- return Buffer.from(AsnConvert.parse(raw, OctetString).buffer);+ try {+ return Buffer.from(AsnConvert.parse(raw, OctetString).buffer);+ } catch {+ // Not actually double-wrapped — use raw bytes directly+ }}return raw;};diff --git a/backend/src/services/certificate-common/certificate-issuance-utils.ts b/backend/src/services/certificate-common/certificate-issuance-utils.tsindex d95ebf5d91..c03385bfc5 100644--- a/backend/src/services/certificate-common/certificate-issuance-utils.ts+++ b/backend/src/services/certificate-common/certificate-issuance-utils.ts@@ -133,12 +133,9 @@ export const validateAlgorithmCompatibility = (const compatibleAlgorithms =template.algorithms?.signature?.filter((sigAlg: string) => {- if (sigAlg.startsWith("ML-DSA")) {- return caKeyAlgorithm.startsWith("ML-DSA");- }-- if (sigAlg.startsWith("SLH-DSA")) {- return caKeyAlgorithm.startsWith("SLH-DSA");+ // PQC: key algorithm = signature algorithm, so require exact match+ if (sigAlg.startsWith("ML-DSA") || sigAlg.startsWith("SLH-DSA")) {+ return sigAlg === caKeyAlgorithm;}const parts = sigAlg.split("-");diff --git a/backend/src/services/certificate/certificate-fns.ts b/backend/src/services/certificate/certificate-fns.tsindex 7104511cfa..5441bd615d 100644--- a/backend/src/services/certificate/certificate-fns.ts+++ b/backend/src/services/certificate/certificate-fns.ts@@ -167,6 +167,7 @@ export const generatePkcs12FromCertificate = async ({return Buffer.from(p12Der, "binary");} catch (error) {+ if (error instanceof BadRequestError) throw error;throw new BadRequestError({message: `Failed to generate PKCS12 keystore: ${error instanceof Error ? error.message : "Unknown error"}`});