libalpm: improve error message for expired keys

If the user does not update their system for a while some of the package
keys may expire. Pacman gives this message:

error: simdjson: signature from "Bert Peters (packager key)
<bertptrs@archlinux.org>" is unknown trust

While this is technically true it masks the real issue of the key being
expired.

This commit changes that error message to:

error: simdjson: key  "Bert Peters (packager key) <bertptrs@archlinux.org>" (38100C24376CD5F6ED4FF4B46918400C2703040C)
This commit is contained in:
morganamilo 2025-08-01 05:16:16 +01:00
parent beb6bd80cd
commit f42b93dd7f
No known key found for this signature in database
GPG key ID: E48D0A8326DE47C5

View file

@ -821,8 +821,10 @@ int _alpm_check_pgp_helper(alpm_handle_t *handle, const char *path,
size_t num;
for(num = 0; !ret && num < siglist->count; num++) {
switch(siglist->results[num].status) {
case ALPM_SIGSTATUS_VALID:
case ALPM_SIGSTATUS_KEY_EXPIRED:
_alpm_log(handle, ALPM_LOG_DEBUG, "key is expired\n");
/* fallthrough */
case ALPM_SIGSTATUS_VALID:
_alpm_log(handle, ALPM_LOG_DEBUG, "signature is valid\n");
switch(siglist->results[num].validity) {
case ALPM_SIGVALIDITY_FULL:
@ -896,8 +898,12 @@ int _alpm_process_siglist(alpm_handle_t *handle, const char *identifier,
alpm_sigresult_t *result = siglist->results + i;
const char *name = result->key.uid ? result->key.uid : result->key.fingerprint;
switch(result->status) {
case ALPM_SIGSTATUS_VALID:
case ALPM_SIGSTATUS_KEY_EXPIRED:
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: key \"%s\" (%s) is expired\n"),
identifier, name, result->key.fingerprint);
break;
case ALPM_SIGSTATUS_VALID:
switch(result->validity) {
case ALPM_SIGVALIDITY_FULL:
break;