#1070664 emacs: Emacs 28.2: ELPA key expired

#1070664#5
Date:
2024-05-06 19:49:45 UTC
From:
To:
Dear Maintainer,

The key for signing the GNU Emacs packages in the official GNU ELPA
archive has changed.  The key included in this GNU Emacs version has
expired.  This disables the download of the archive list as well as
any package from elpa.

In order to allow GNU ELPA packages to be downloaded again, the key
needs to be updated manually.  A possible solution is to run the
following ELisp snippet from within Emacs:

(let ((package-check-signature nil))
  (package-refresh-contents)
  (package-install 'gnu-elpa-keyring-update))

After restarting GNU Emacs, downloading and installing packages from
GNU ELPA works again.

If possible, they key included with the Emacs package itself should be
updated in order to avoid having to resort to similar workarounds.

Thank you for your attention.

#1070664#10
Date:
2024-05-31 23:05:50 UTC
From:
To:
Dear Maintainer,

Just to confirm that this bug is distracting (especially for new users…):

- if we install GNU Emacs on Debian 12,
- assuming ~/.emacs and ~/.emacs.d are empty,
- running emacs and `M-x package-refresh-contents` just raises the error:

    "Failed to download ‘nongnu’ archive."

    Failed to verify signature archive-contents.sig:
    No public key for 645357D2883A0966 created at 2024-05-31T23:05:08+0200 using EDDSA
    Command output:
    gpg: Signature made ven. 31 mai 2024 23:05:08 CEST
    gpg:                using EDDSA key 0327BE68D64D9A1A66859F15645357D2883A0966
    gpg: Can't check signature: No public key

Sure, we can find workarounds in https://emacs.stackexchange.com/q/233
or add in one's init.el a snippet similar to inasprecali's suggestion:

    (unless (package-installed-p 'gnu-elpa-keyring-update)
      (let ((package-check-signature nil))
        (package-refresh-contents)
        (package-install 'gnu-elpa-keyring-update)))

But it'd be way better to benefit from a (security?) update to
properly fix this issue with the obsolete public key.

Thanks for your time
Best,
Erik

#1070664#15
Date:
2024-06-01 02:47:29 UTC
From:
To:
Thanks Erik, indeed the problem is that the GPG keys distributed with
Emacs-28 are expired, so it would be great to release a new stable
version of the `emacs` package, still built from Emacs-28 except using
Emacs-29's `etc/package-keyring.gpg`.


        Stefan

#1070664#20
Date:
2024-06-11 01:05:53 UTC
From:
To:
This is a minimal recipe to reproduce the problem:

    $ mmdebstrap bookworm /dev/null --include=emacs-nox,ca-certificates,gnupg --customize-hook='chroot $1 emacs -Q -f package-list-packages'

Inside the emacs that starts, you'll see (after a couple of seconds):

    Failed to verify signature archive-contents.sig:
    No public key for 645357D2883A0966 created at 2024-06-10T21:10:04+0000 using EDDSA
    Command output:
    gpg: Signature made Mon Jun 10 21:10:04 2024 UTC
    gpg:                using EDDSA key 0327BE68D64D9A1A66859F15645357D2883A0966
    gpg: Can't check signature: No public key

You will need a controlling terminal better than TERM=dumb.
If you don't have a terminal (e.g. you're a CI/CD script), this variant hook works:

    bash5$ D12_shell --quiet --include=emacs-nox,ca-certificates,gnupg --customize-hook='chroot $1 emacs --batch -Q -f package-list-packages -f package--download-and-read-archives'
    Contacting host: elpa.gnu.org:443
    Contacting host: elpa.gnu.org:443
    Failed to download ‘gnu’ archive.
    Debugger entered--Lisp error: (bad-signature "archive-contents.sig")
      signal(bad-signature ("archive-contents.sig"))
      package--check-signature-content("\210u\4\0\26\10\0\35\26!\4\3'\276h\326M\232\32f\205\237\25dSW\322\210:\11f\5\2fgk\254\0\n\11\20dSW\322\210:\11f\346..." "(1\n (adoc-mode .\n\11    [(0 7 0)\n\11     ((emacs\n\11    ..." "archive-contents.sig")
      #f(compiled-function () #<bytecode -0xe41cb77d185892b>)()
      #f(compiled-function (status) #<bytecode 0xf5987e8eb8f468e>)((:peer (:certificates ((:version 3 :serial-number "04:dd:78:56:c7:1c:b9:a5:4d:6b:b6:ee:e1:5b:8f:6a:4b..." :issuer "C=US,O=Let's Encrypt,CN=R3" :valid-from "2024-06-03" :valid-to "2024-09-01" :subject "CN=elpa.nongnu.org" :public-key-algorithm "RSA" :certificate-security-level "Medium" :signature-algorithm "RSA-SHA256" :public-key-id "sha1:8b:16:cb:f9:32:f1:7d:1f:ec:8a:14:d2:91:ff:3f:..." :certificate-id "sha1:0c:09:41:11:91:e6:fd:59:a3:26:24:60:90:e4:bd:..." :pem "-----BEGIN CERTIFICATE-----\nMIIE6zCCA9OgAwIBAgISBN...") (:version 3 :serial-number "00:91:2b:08:4a:cf:0c:18:a7:53:f6:d6:2e:25:a7:5f:5a" :issuer "C=US,O=Internet Security Research Group,CN=ISRG Ro..." :valid-from "2020-09-04" :valid-to "2025-09-15" :subject "C=US,O=Let's Encrypt,CN=R3" :public-key-algorithm "RSA" :certificate-security-level "Medium" :signature-algorithm "RSA-SHA256" :public-key-id "sha1:8a:93:82:f4:c8:04:08:34:5e:5b:c2:f8:d7:55:d3:..." :certificate-id "sha1:a0:53:37:5b:fe:84:e8:b7:48:78:2c:7c:ee:15:82:..." :pem "-----BEGIN CERTIFICATE-----\nMIIFFjCCAv6gAwIBAgIRAJ...")) :certificate (:version 3 :serial-number "04:dd:78:56:c7:1c:b9:a5:4d:6b:b6:ee:e1:5b:8f:6a:4b..." :issuer "C=US,O=Let's Encrypt,CN=R3" :valid-from "2024-06-03" :valid-to "2024-09-01" :subject "CN=elpa.nongnu.org" :public-key-algorithm "RSA" :certificate-security-level "Medium" :signature-algorithm "RSA-SHA256" :public-key-id "sha1:8b:16:cb:f9:32:f1:7d:1f:ec:8a:14:d2:91:ff:3f:..." :certificate-id "sha1:0c:09:41:11:91:e6:fd:59:a3:26:24:60:90:e4:bd:..." :pem "-----BEGIN CERTIFICATE-----\nMIIE6zCCA9OgAwIBAgISBN...") :key-exchange "ECDHE-RSA" :protocol "TLS1.3" :cipher "AES-256-GCM" :mac "AEAD" :encrypt-then-mac nil)))
      apply(#f(compiled-function (status) #<bytecode 0xf5987e8eb8f468e>) (:peer (:certificates ((:version 3 :serial-number "04:dd:78:56:c7:1c:b9:a5:4d:6b:b6:ee:e1:5b:8f:6a:4b..." :issuer "C=US,O=Let's Encrypt,CN=R3" :valid-from "2024-06-03" :valid-to "2024-09-01" :subject "CN=elpa.nongnu.org" :public-key-algorithm "RSA" :certificate-security-level "Medium" :signature-algorithm "RSA-SHA256" :public-key-id "sha1:8b:16:cb:f9:32:f1:7d:1f:ec:8a:14:d2:91:ff:3f:..." :certificate-id "sha1:0c:09:41:11:91:e6:fd:59:a3:26:24:60:90:e4:bd:..." :pem "-----BEGIN CERTIFICATE-----\nMIIE6zCCA9OgAwIBAgISBN...") (:version 3 :serial-number "00:91:2b:08:4a:cf:0c:18:a7:53:f6:d6:2e:25:a7:5f:5a" :issuer "C=US,O=Internet Security Research Group,CN=ISRG Ro..." :valid-from "2020-09-04" :valid-to "2025-09-15" :subject "C=US,O=Let's Encrypt,CN=R3" :public-key-algorithm "RSA" :certificate-security-level "Medium" :signature-algorithm "RSA-SHA256" :public-key-id "sha1:8a:93:82:f4:c8:04:08:34:5e:5b:c2:f8:d7:55:d3:..." :certificate-id "sha1:a0:53:37:5b:fe:84:e8:b7:48:78:2c:7c:ee:15:82:..." :pem "-----BEGIN CERTIFICATE-----\nMIIFFjCCAv6gAwIBAgIRAJ...")) :certificate (:version 3 :serial-number "04:dd:78:56:c7:1c:b9:a5:4d:6b:b6:ee:e1:5b:8f:6a:4b..." :issuer "C=US,O=Let's Encrypt,CN=R3" :valid-from "2024-06-03" :valid-to "2024-09-01" :subject "CN=elpa.nongnu.org" :public-key-algorithm "RSA" :certificate-security-level "Medium" :signature-algorithm "RSA-SHA256" :public-key-id "sha1:8b:16:cb:f9:32:f1:7d:1f:ec:8a:14:d2:91:ff:3f:..." :certificate-id "sha1:0c:09:41:11:91:e6:fd:59:a3:26:24:60:90:e4:bd:..." :pem "-----BEGIN CERTIFICATE-----\nMIIE6zCCA9OgAwIBAgISBN...") :key-exchange "ECDHE-RSA" :protocol "TLS1.3" :cipher "AES-256-GCM" :mac "AEAD" :encrypt-then-mac nil)))
      url-http-activate-callback()
      url-http-content-length-after-change-function(288 408 120)
      url-http-wait-for-headers-change-function(1 419 418)
      url-http-generic-filter(#<process elpa.nongnu.org> "HTTP/1.1 200 OK\15\nDate: Tue, 11 Jun 2024 00:51:19 G...")
      accept-process-output(nil 0.05)
      url-retrieve-synchronously("https://elpa.nongnu.org/nongnu/archive-contents")
      package--with-response-buffer-1("https://elpa.nongnu.org/nongnu/" #f(compiled-function () #<bytecode 0x45308209f3a0e3a>) :file "archive-contents" :async nil :error-function #f(compiled-function () #<bytecode -0xb2279de53cccd7d>) :noerror nil)
      package--download-one-archive(("nongnu" . "https://elpa.nongnu.org/nongnu/") "archive-contents" nil)
      package--download-and-read-archives()
      command-line-1(("-f" "package-list-packages" "-f" "package--download-and-read-archives"))
      command-line()
      normal-top-level()

    umount: /tmp/mmdebstrap.3ylx2Gj6Gt/dev/null: target is busy.
    W: umount ./dev/null failed: 8192
    W: cannot unlink ./dev/null: Device or resource busy
    E: setup failed: E: command failed: chroot $1 emacs --batch -Q -f package-list-packages -f package--download-and-read-archives
    I: main() received signal PIPE: waiting for setup...
    I: removing tempdir /tmp/mmdebstrap.3ylx2Gj6Gt...
    E: mmdebstrap failed to run

This issue is not reproducible on Debian 13 (testing / trixie):

    bash5$ D13_shell --quiet --include=emacs-nox,ca-certificates,gnupg --customize-hook='chroot $1 emacs --batch -Q -f package-list-packages -f package--download-and-read-archives'
    Contacting host: elpa.gnu.org:443
    Contacting host: elpa.gnu.org:443
    Package refresh done
    Package refresh done
    Contacting host: elpa.nongnu.org:443
    Package refresh done
    I: running --customize-hook in shell: sh -c 'env -i TERM=screen PATH=/bin:/sbin chroot $1 bash; false' exec /tmp/mmdebstrap.IGMUZRQL75

This issue is not reproducible on Debian 12 with backported emacs:

    bash5$ mmdebstrap bookworm /dev/null --quiet --include=emacs-nox,ca-certificates,gnupg --customize-hook='chroot $1 emacs --batch -Q -f package-list-packages -f package--download-and-read-archives' --essential-hook='(echo Package: src:emacs; echo Pin: release a=stable-backports; echo Pin-Priority: 500) >>"$1/etc/apt/preferences.d/fuck"' 'deb https://deb.debian.org/debian-security bookworm-security main' 'deb http://deb.debian.org/debian bookworm main' 'deb http://deb.debian.org/debian bookworm-updates main' 'deb http://deb.debian.org/debian bookworm-proposed-updates main' 'deb http://deb.debian.org/debian bookworm-backports main'
    Contacting host: elpa.gnu.org:443
    Contacting host: elpa.gnu.org:443
    Contacting host: elpa.nongnu.org:443
    Package refresh done
    Package refresh done
    umount: /tmp/mmdebstrap.LxIijFjees/dev/null: target is busy.

Note that if GPG isn't installed, package.el silently ignores the problem and allows MITM attacks:

    bash5$ D12_shell --quiet --include=emacs-nox,ca-certificates --customize-hook='chroot $1 emacs --batch -Q -f package-list-packages -f package--download-and-read-archives'
    Contacting host: elpa.gnu.org:443
    Contacting host: elpa.nongnu.org:443
    Package refresh done
    Package refresh done
    Package refresh done
    I: running --customize-hook in shell: sh -c 'env -i TERM=screen PATH=/bin:/sbin chroot $1 bash; false' exec /tmp/mmdebstrap.TOmuTk5OVd

Note that by default package.el ALSO allows MITM attacks simply by
having the attacker supply a downgraded repo, without signatures:

    (defcustom package-check-signature 'allow-unsigned ⋯) ; should be t!

#1070664#25
Date:
2024-06-15 21:17:08 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
emacs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1070664@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Rob Browning <rlb@defaultvalue.org> (supplier of updated emacs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 08 Jun 2024 17:12:26 -0500
Source: emacs
Architecture: source
Version: 1:28.2+1-15+deb12u2
Distribution: bookworm
Urgency: high
Maintainer: Rob Browning <rlb@defaultvalue.org>
Changed-By: Rob Browning <rlb@defaultvalue.org>
Closes: 942413 1067630 1070664
Changes:
 emacs (1:28.2+1-15+deb12u2) bookworm; urgency=medium
 .
   * debian/rules: fix override_dh_auto_install indentation.
 .
   * Update package-keyring.gpg to deb/emacs/v/29.3+1-3 version.  The
     existing keyring has expired.  Replace it with the upstream version
     from our latest 29.3 package, retrieved from our repository via "git
     show deb/emacs/v/29.3+1-3:etc/package-keyring.gpg >
     debian/replace/etc/package-keyring.gpg". (Closes: 1070664, 942413)
 .
 emacs (1:28.2+1-15+deb12u1) bookworm; urgency=high
 .
   * Fix CVE-2024-30202, CVE-2024-30203, CVE-2024-30204 & CVE-2024-30205
     (Closes: #1067630).
Checksums-Sha1:
 e64351a688a28470b7c687d0d82f5353727c04dc 3064 emacs_28.2+1-15+deb12u2.dsc
 4d3c7621f055b59eb601802cc2b14e0e9158aa22 132000 emacs_28.2+1-15+deb12u2.debian.tar.xz
Checksums-Sha256:
 bddc14bbe1ca94ade9d40033faa880aea43809349efbebc539c44bbc533d4eb6 3064 emacs_28.2+1-15+deb12u2.dsc
 584c2d8469267ddf1a5bd7c05644920b4804de439300266032bfbaae1146b5bb 132000 emacs_28.2+1-15+deb12u2.debian.tar.xz
Files:
 48a2db0f1fbf1b550dbb3929054d438e 3064 editors optional emacs_28.2+1-15+deb12u2.dsc
 df5a709a42d3074de8b2109ad22b08b2 132000 editors optional emacs_28.2+1-15+deb12u2.debian.tar.xz
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEPTFSABe5ruOuhW+97vEWxVpaQvEFAmZo89gVHHJsYkBkZWZh
dWx0dmFsdWUub3JnAAoJEO7xFsVaWkLxg20P+gMXIXclOpPrAiiMhXXxA6BmhCZF
xoJ9xnIJVub9OLrK7B8nF7X70mLJ3znvLHFyYb4Mvo34BsXvw4SSDE8VSDTB7GoR
DR3jI7KTQy0awQcl9RtmK2KHjf4xwR87vka9fEIwbKVXd5HPAfkQ61e5sNNLuEWx
Y95bR7S7NLDzH707niRu0HsSMvKyedqEqD4NsOW6xPgVpVCL5M7oiGAeZAQYEB30
aCweyn3kYUVMxlumr1DjQdBbCINmbU3nD7CHGs2nxHylVJrvJ/x5Titwmo2AVvG/
3+jKhXXhzfOC6Ff3ZDNc7Falhb1hs8O0d356/jXT08FS3V7CWe2vjZKNED5XyRbV
404h5/xVcFOrjLSV87P1afI9BF63M0mFFyBqDnI8gHueU+Dw1fD+30cD77JP6trm
wLXKRHkylZvqYamZdgMHfmZQMzrS+OHHgE7yMspTXGy19tJn4nCLfWBxAft244qk
z6d0PubQvUrUP1xcrjdu3AKQIQcELuA/q2mcBMZFpwkxXtloMkt6W2tBt1NTF4KE
IU0rXkHbt43bdX11xWaIr4mDF1RF9sVmAuCbIdTwO1h9RyLrjQNfJYvDg1LTaYcZ
/wa9kO5SPa+YebPXpjKohxJ5kpocreRSDZQNl0G1mSNuAZAd8L5qOLh0Q8VRQ8BP
f3SKSsJ2BXDDnqJD
=18fM
-----END PGP SIGNATURE-----

#1070664#30
Date:
2025-03-11 21:13:01 UTC
From:
To:
Dear Maintainer,

Regretfully, it seems that the key has expired once again for Emacs 28.2
as of today.  Exactly as originally described, running the following
Lisp code:

(let ((package-check-signature nil))
   (package-refresh-contents)
   (package-install 'gnu-elpa-keyring-update))

seems an appropriate workaround for the time being.

#1070664#35
Date:
2026-05-17 21:13:31 UTC
From:
To:
Dear Maintainer,

The key provided with the version of Emacs in stable at the time of
writing (30.1) is once again out of date.

As shown in the original message, running the following Lisp code:

(let ((package-check-signature nil))
  (package-refresh-contents)
  (package-install 'gnu-elpa-keyring-update))

fixes the issue.  However, this is meant to be a workaround until an
update fixing the issue is provided.

Thank you for your attention.