diff options
author | Matthew Miller <matthew@millerti.me> | 2020-07-07 16:16:23 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-07-07 16:16:23 -0700 |
commit | cd09be38a18f5ab0491ce708d135bd963aad3bb9 (patch) | |
tree | 7f25e5cdcdbc9677b062283b839f70dc15059ec2 /packages/server/src/helpers/validateCertificatePath.ts | |
parent | 24955f56d61871531bee2d4c9618a305550bc963 (diff) |
Add revocation check to validateCertificatePath
Diffstat (limited to 'packages/server/src/helpers/validateCertificatePath.ts')
-rw-r--r-- | packages/server/src/helpers/validateCertificatePath.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/server/src/helpers/validateCertificatePath.ts b/packages/server/src/helpers/validateCertificatePath.ts index 1dd8c04..1023ff7 100644 --- a/packages/server/src/helpers/validateCertificatePath.ts +++ b/packages/server/src/helpers/validateCertificatePath.ts @@ -34,6 +34,10 @@ export default async function validateCertificatePath(certificates: string[]): P const issuerCert = new X509(); issuerCert.readCertPEM(issuerPem); + if (subjectCertRevoked) { + throw new Error(`Found revoked certificate in certificate path`); + } + // Check that intermediate certificate is within its valid time window const notBefore = zulutodate(issuerCert.getNotBefore()); const notAfter = zulutodate(issuerCert.getNotAfter()); |