R-1280: a signed job's validity window is at most 24 h — the verifier, the root wrapper and felhom-opsign. Red-proved. Commit only, not released.
gates / gates (push) Successful in 1m42s
gates / gates (push) Successful in 1m42s
This commit is contained in:
1 parent
feaaa0e8ff
commit
d912307bb7
7 files changed
+58
No files matched your search
@@ -117,6 +117,26 @@ func TestVerify_RejectsPerStage(t *testing.T) {
|
||||
rejects(t, err, ErrTarget)
|
||||
})
|
||||
|
||||
// R-1280: a window longer than 24 h is refused even while it is current; exactly 24 h is accepted.
|
||||
// RED-PROOF: drop the MaxWindow check → the 24 h + 1 s case verifies.
|
||||
t.Run("window longer than 24 h", func(t *testing.T) {
|
||||
blob := canonicalBlob("guest_destroy", "demo-felhom", "9001", "op", "n-win-1", "{}",
|
||||
refNow.Add(-time.Minute), refNow.Add(-time.Minute).Add(MaxWindow+time.Second))
|
||||
sig := mintArmor(t, pub.Marshal(), Namespace, "sha512", blob, sign)
|
||||
v := atRefNow(New(signerSet(pub, "op"), NewMemoryNonceStore(), "demo-felhom"))
|
||||
_, err := v.Verify(blob, sig)
|
||||
rejects(t, err, ErrWindowTooLong)
|
||||
})
|
||||
t.Run("window of exactly 24 h is accepted", func(t *testing.T) {
|
||||
blob := canonicalBlob("guest_destroy", "demo-felhom", "9001", "op", "n-win-2", "{}",
|
||||
refNow.Add(-time.Minute), refNow.Add(-time.Minute).Add(MaxWindow))
|
||||
sig := mintArmor(t, pub.Marshal(), Namespace, "sha512", blob, sign)
|
||||
v := atRefNow(New(signerSet(pub, "op"), NewMemoryNonceStore(), "demo-felhom"))
|
||||
if _, err := v.Verify(blob, sig); err != nil {
|
||||
t.Fatalf("a 24 h window must verify: %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("expired", func(t *testing.T) {
|
||||
blob := canonicalBlob("guest_destroy", "demo-felhom", "9001", "op", "n-exp-1", "{}",
|
||||
refNow.Add(-2*time.Hour), refNow.Add(-time.Hour))
|
||||
|
||||
Reference in new issue
Block a user