emacs/test/lisp
Stefan Kangas bcde5f86c5 Support expiration of metadata by package archives
Expiring package metadata is done by checking the timestamp in package
archive file.  This is intended to limit the effectiveness of a replay
attack.  The onus is on the package archives to implement a secure and
reasonable policy.  (Debian uses 7 days before metadata expires.)

Together with package checksums, this adds sufficient protection
against metadata replay attacks.  (Bug#19479)

* lisp/emacs-lisp/package.el (package-check-timestamp): New defcustom.
(bad-timestamp): New error.
(package--parse-header-from-buffer)
(package--parse-valid-until-from-buffer)
(package--parse-last-updated-from-buffer)
(package--archive-verify-timestamp)
(package--archive-verify-not-expired)
(package--compare-archive-timestamps)
(package--check-archive-timestamp): New defuns.
(package--download-one-archive): Check timestamp of the
'archive-contents' file using above functions.  It is only checked if
it exists, which makes this change backwards compatible.

* lisp/calendar/iso8601.el (iso8601-parse): Add autoload cookie.

* test/lisp/emacs-lisp/package-tests.el
(package-test-parse-valid-until-from-buffer)
(package-test-parse-last-updated-from-buffer)
(package-test-archive-verify-timestamp)
(package-test-check-archive-timestamp)
(package-test-check-archive-timestamp/not-expired)
(package-test-check-archive-timestamp/expired): New tests.

* test/lisp/emacs-lisp/package-resources/archives/older/archive-contents:
* test/lisp/emacs-lisp/package-resources/archives/newer/archive-contents:
New files.

* doc/lispref/package.texi (Package Archives, Archive Web Server):
Document how to increase the security of a package archive using
checksums, signing and timestamps.
2020-11-22 00:38:35 +01:00
..
bookmark-resources Add ability to mark/unmark/delete all bookmarks 2020-08-09 15:13:05 -05:00
calc Calc: allow infinite binary word size (bug#43764) 2020-10-13 11:29:01 +02:00
calendar `format-time' can now do sub-second times 2020-10-30 12:10:53 +01:00
cedet Remove some compat code for old versions and XEmacs 2020-11-19 20:43:51 +01:00
custom-resources Use lexical-binding in most remaining tests 2020-05-01 13:05:26 +02:00
emacs-lisp Support expiration of metadata by package archives 2020-11-22 00:38:35 +01:00
emulation Use lexical-binding in most remaining tests 2020-05-01 13:05:26 +02:00
epg-resources Move epg.el test data to follow our conventions 2020-10-24 02:36:55 +02:00
erc Make the erc /ignore command prompt for a timeout 2020-08-05 10:27:40 +02:00
eshell Use lexical-binding in more tests 2020-08-29 22:41:51 +02:00
faces-resources Move faces.el test data to follow our conventions 2020-10-24 13:35:49 +02:00
files-resources Move some test data to follow our conventions 2020-10-23 16:29:46 +02:00
gnus New gnus-search library 2020-11-03 21:20:17 -08:00
hfy-cmap-resources * test/lisp/hfy-cmap-resources/rgb.txt: Add comment line. 2020-11-12 03:20:39 +01:00
image Make gravatar-build-url respect dynamically bound variables again 2020-07-31 04:19:03 +02:00
international Fix mule-util-tests after recent truncation changes 2020-10-06 03:48:00 +02:00
mail * test/lisp/mail/rfc822-tests.el: New file. 2020-10-17 15:55:42 +02:00
minibuffer-resources Move more test data to follow our conventions 2020-10-23 21:07:26 +02:00
net Some minor Tramp fixes, resulting from test campaign 2020-11-13 16:55:08 +01:00
nxml Convert a manual test for nxml-mode to unit test 2020-09-21 18:47:55 +02:00
obsolete Silence byte-compiler in two tests 2020-10-01 15:34:46 +02:00
org * test/lisp/org/org-tests.el: Use lexical-binding. 2020-09-10 19:32:53 +02:00
pcmpl-linux-resources Use lexical-binding in pcmpl-linux.el and add tests 2020-09-02 12:53:02 +02:00
play Use lexical-binding in fortune.el and add tests 2020-11-14 15:55:08 +01:00
progmodes perl-mode and cperl-mode: Recognize regex after "return" 2020-11-17 00:20:26 +01:00
saveplace-resources Use lexical-binding in saveplace.el and add tests 2020-08-08 01:40:38 +02:00
so-long-tests ; shorten https://lists.gnu.org/archive/html/... links 2020-10-09 12:23:02 +02:00
term Update copyright year to 2020 2020-01-01 00:59:52 +00:00
textmodes Don't quote lambdas in several places 2020-11-14 17:04:23 +01:00
time-resources Add missed file needed by time-tests.el 2020-10-22 18:51:00 +02:00
url Use new resource directory macros in tests (Bug#43792) 2020-10-16 11:28:09 +02:00
vc ; Fix license statement in several files 2020-10-28 03:41:55 +01:00
xdg-resources Move more test data to follow our conventions 2020-10-23 21:07:26 +02:00
abbrev-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
allout-tests.el Convert allout unit tests to ERT 2020-09-23 20:03:19 +02:00
allout-widgets-tests.el Convert allout unit tests to ERT 2020-09-23 20:03:19 +02:00
ansi-color-tests.el Add an option to preserve ANSI sequences 2020-11-14 16:24:38 +01:00
apropos-tests.el Use lexical-binding in apropos.el and add tests 2020-04-18 18:43:23 +02:00
arc-mode-tests.el Silence some byte-compiler warnings 2020-09-26 12:03:07 +02:00
auth-source-pass-tests.el * test/lisp/auth-source-pass-tests.el: Test for multiple ports. 2020-01-22 07:37:01 +01:00
auth-source-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
autoinsert-tests.el Evaluate some unnecessarily quoted lambdas 2020-06-21 13:42:14 +01:00
autorevert-tests.el ; Fix license statement in several files 2020-10-28 03:41:55 +01:00
battery-tests.el Improve battery.el UPower support 2020-06-18 13:11:17 +01:00
bookmark-tests.el Make a bookmark test more robust 2020-10-20 03:21:31 +02:00
buff-menu-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
button-tests.el Substitute command keys in button help-echo values 2020-10-16 09:32:48 +02:00
char-fold-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
color-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
comint-tests.el Match OpenBSD doas password prompt in comint 2020-10-09 06:57:07 +02:00
completion-tests.el Convert some completion.el tests to ERT 2020-09-23 20:03:19 +02:00
cus-edit-tests.el Use cl-letf instead of unwind-protect in a test 2020-11-20 19:28:03 -03:00
custom-tests.el Add test for recent change in enable-theme 2020-11-07 09:53:21 -03:00
dabbrev-tests.el Use lexical-binding in most remaining tests 2020-05-01 13:05:26 +02:00
delim-col-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
descr-text-tests.el Update tests for recent changes 2020-07-08 17:35:54 -07:00
dired-aux-tests.el ; Fix typos 2020-09-21 14:26:42 +02:00
dired-tests.el Fix some glitches in recent directory-files-* changes 2020-11-02 17:56:06 +01:00
dired-x-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
dom-tests.el ; Fix last addition to dom-tests.el 2020-04-30 10:46:54 +01:00
electric-tests.el Merge from origin/emacs-27 2020-10-02 09:38:24 -07:00
elide-head-tests.el Use lexical-binding in elide-head.el and add tests 2020-04-19 08:04:57 +02:00
epg-tests.el Move epg.el test data to follow our conventions 2020-10-24 02:36:55 +02:00
faces-tests.el Move faces.el test data to follow our conventions 2020-10-24 13:35:49 +02:00
ffap-tests.el `ffap-gopher-at-point' interminable without newlines 2020-10-19 11:56:49 +02:00
filenotify-tests.el ; Fix license statement in several files 2020-10-28 03:41:55 +01:00
files-tests.el Move some test data to follow our conventions 2020-10-23 16:29:46 +02:00
files-x-tests.el Use lexical-binding in files-x-tests.el 2020-10-21 13:25:39 +02:00
font-lock-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
format-spec-tests.el Fix and extend format-spec (bug#41758) 2020-06-18 12:46:21 +01:00
help-fns-tests.el * test/lisp/help-fns-tests.el: Silence byte-compiler. 2020-11-12 03:27:26 +01:00
help-mode-tests.el Use lexical-binding in help-mode.el and add tests 2020-05-09 20:01:37 +02:00
help-tests.el Test that substitute-command-keys preserves text properties 2020-11-17 02:21:17 +01:00
hfy-cmap-tests.el Use lexical-binding in hfy-cmap.el and add tests 2020-10-21 13:06:38 +02:00
hi-lock-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
htmlfontify-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
ibuffer-tests.el Remove (or double) redundant backslashes in string literals 2020-01-24 23:04:34 +01:00
ido-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
image-file-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
image-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
imenu-tests.el Silence some warnings in tests 2020-06-21 12:50:34 +01:00
info-xref-tests.el Use lexical-binding in most remaining tests 2020-05-01 13:05:26 +02:00
isearch-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
jit-lock-tests.el Use lexical-binding in most remaining tests 2020-05-01 13:05:26 +02:00
json-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
jsonrpc-tests.el ; Fix typos 2020-09-21 14:26:42 +02:00
kmacro-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
ls-lisp-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
makesum-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
man-tests.el ; Prefer https to http in more URLs 2020-10-24 20:23:27 +02:00
md4-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
minibuffer-tests.el Move more test data to follow our conventions 2020-10-23 21:07:26 +02:00
misc-tests.el Use lexical-binding in misc.el and add tests 2020-04-26 00:30:37 +02:00
mouse-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
mwheel-tests.el Use mouse-wheel-up-event in mwheel-tests.el 2020-09-08 18:31:15 +02:00
obarray-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
paren-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
password-cache-tests.el Don’t attempt to modify constant strings 2020-05-16 22:25:07 -07:00
pcmpl-linux-tests.el Use new resource directory macros in tests (Bug#43792) 2020-10-16 11:28:09 +02:00
ps-print-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
register-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
replace-tests.el occur: Add bindings for next-error-no-select 2020-05-31 12:31:27 +02:00
rot13-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
saveplace-tests.el Fix file-name problems in several tests 2020-10-16 16:49:47 +03:00
scroll-lock-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
ses-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
shadowfile-tests.el ; Fix license statement in several files 2020-10-28 03:41:55 +01:00
shell-tests.el Fix shell-tests failures 2020-01-20 15:52:27 +01:00
simple-tests.el Merge from origin/emacs-27 2020-10-10 07:50:20 -07:00
sort-tests.el ; Fix license statements. 2020-08-27 02:53:25 +02:00
soundex-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
startup-tests.el Fix documentation related to 'command-switch-alist'. 2020-05-14 19:29:14 +02:00
subr-tests.el ; * test/lisp/subr-tests.el (string-replace): Add more test cases 2020-09-27 13:32:27 +02:00
tabify-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
tar-mode-tests.el Combine archive-int-to-mode and tar-grind-file-mode 2020-05-14 18:43:15 +02:00
tempo-tests.el Allow tempo-define-template to reassign tags to new templates 2020-02-21 11:15:00 +02:00
term-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
thingatpt-tests.el Use lexical-binding in most remaining tests 2020-05-01 13:05:26 +02:00
thread-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
time-stamp-tests.el Merge from origin/emacs-27 2020-01-01 01:08:16 +00:00
time-tests.el Fix time-test error on machines with mail 2020-10-26 21:23:55 +01:00
timezone-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
version-tests.el Use lexical-binding in version.el and add tests 2020-04-28 23:35:52 +02:00
wdired-tests.el Fix bug in wdired-get-filename 2020-10-01 23:34:01 +02:00
whitespace-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
wid-edit-tests.el Allow moving members of editable-list widget, via delete+insert 2020-10-22 13:52:42 +02:00
xdg-tests.el Move more test data to follow our conventions 2020-10-23 21:07:26 +02:00
xml-tests.el Repurpose libxml test for obsolete argument 2020-09-26 11:48:09 +02:00
xt-mouse-tests.el Fix unit tests broken by changes to xt-mouse.el 2020-10-31 09:57:00 +02:00