mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-23 12:05:27 +08:00
feat(ql3): revalidate release evidence at closure
This commit is contained in:
@@ -382,9 +382,20 @@ function inspectPrivateReleaseEvidenceReceipt(actual, options) {
|
||||
) {
|
||||
fail('receipt shape or release binding is invalid');
|
||||
}
|
||||
if (!Number.isFinite(Date.parse(actual.evidence.observedAt))) {
|
||||
const observedAtMs = Date.parse(actual.evidence.observedAt);
|
||||
if (!Number.isFinite(observedAtMs)) {
|
||||
fail('receipt freshness binding is invalid');
|
||||
}
|
||||
if (options.validationClockMs !== undefined) {
|
||||
const validationClockMs = options.validationClockMs;
|
||||
if (
|
||||
!Number.isSafeInteger(validationClockMs) ||
|
||||
observedAtMs > validationClockMs + MAX_FUTURE_SKEW_MS ||
|
||||
validationClockMs - observedAtMs > MAX_EVIDENCE_AGE_SECONDS * 1000
|
||||
) {
|
||||
fail('receipt is outside the release freshness window');
|
||||
}
|
||||
}
|
||||
const { receiptDigest, ...unsigned } = actual;
|
||||
if (
|
||||
!DIGEST_PATTERN.test(receiptDigest || '') ||
|
||||
|
||||
Reference in New Issue
Block a user