From 04180c525c9c7467e73689e40c8d3cff52f5544d Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Sat, 12 Nov 2022 23:30:20 -0600 Subject: [PATCH] Add test for rejection of uploaded file with future timestamp --- testsuite/gatekeeper.all/03_triplet.exp | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/testsuite/gatekeeper.all/03_triplet.exp b/testsuite/gatekeeper.all/03_triplet.exp index 953141b..310852b 100644 --- a/testsuite/gatekeeper.all/03_triplet.exp +++ b/testsuite/gatekeeper.all/03_triplet.exp @@ -457,6 +457,41 @@ check_triplet "bogus: directive signature from the future" setup { } } +check_triplet "bogus: file signature from the future" setup { + packages { + foo { + email { "foo@example.org" } + keys { { id 1000 name "foo " } } + maintainers { "foo " } + } + } +} upload { + foo.bin { + directive { + version 1.2 + directory foo + filename foo.bin + } dsig { good 05 1000 } + file { test } fsig { good 06 1000 "3 days" } + } +} check { + file-tree { + { incoming stage pub archive } empty {} + { in-stage } files { + .foo.bin.directive.asc .foo.bin.sig .foo.bin + } + } log { + found,foo.bin.directive.asc "found directive in triplet" + found-packet,foo.bin.directive.asc:foo.bin.sig:foo.bin \ + "found triplet" + validate,future-signature-timestamp \ + "reject upload from the future" + } email-to { + ftp-upload-script@gnu.org foo@example.gnu.org + ftp-upload-report@gnu.org foo@example.org foo@example.net + } +} + check_triplet "bogus: signed with wrong key" setup { packages { foo { -- 2.25.1