mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix match logic
This commit is contained in:
@@ -680,15 +680,16 @@ export const pkiAcmeServiceFactory = ({
|
||||
tx
|
||||
))!;
|
||||
const csrIdentifierValues = new Set(
|
||||
orderWithAuthorizations.authorizations
|
||||
.map((auth) => auth.identifierValue.toLowerCase())
|
||||
(certificateRequest.subjectAlternativeNames ?? [])
|
||||
.map((san) => san.value.toLowerCase())
|
||||
.concat([certificateRequest.commonName!.toLowerCase()])
|
||||
);
|
||||
const expectedIdentifierValues = new Set(
|
||||
orderWithAuthorizations.authorizations.map((auth) => auth.identifierValue.toLowerCase())
|
||||
);
|
||||
if (
|
||||
csrIdentifierValues.size !== orderWithAuthorizations.authorizations.length ||
|
||||
!orderWithAuthorizations.authorizations.every((auth) =>
|
||||
csrIdentifierValues.has(auth.identifierValue.toLowerCase())
|
||||
)
|
||||
csrIdentifierValues.size != expectedIdentifierValues.size ||
|
||||
!csrIdentifierValues.isSubsetOf(expectedIdentifierValues)
|
||||
) {
|
||||
throw new AcmeBadCSRError({ detail: "Invalid CSR: Common name + SANs mismatch with order identifiers" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user