Skip to content

Commit

Permalink
implement offline dist cert validation
Browse files Browse the repository at this point in the history
  • Loading branch information
dsokal committed Apr 20, 2021
1 parent 567aef6 commit b844396
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ export class SetupDistributionCertificate {
if (!currentCertificate) {
return false;
}

const now = new Date();
if (
now < new Date(currentCertificate.validityNotBefore) ||
now > new Date(currentCertificate.validityNotAfter)
) {
return false;
}

if (!ctx.appStore.authCtx) {
Log.warn(
"Skipping Distribution Certificate validation on Apple Servers because we aren't authenticated."
);
return true;
}

const validCertSerialNumbers = (await this.getValidDistCertsAsync(ctx)).map(
i => i.serialNumber
);
Expand Down

0 comments on commit b844396

Please sign in to comment.