From f42b93dd7f23e63e06a7ccc197189602bfae4a09 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Fri, 1 Aug 2025 05:16:16 +0100 Subject: [PATCH] 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) " 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) " (38100C24376CD5F6ED4FF4B46918400C2703040C) --- lib/libalpm/signing.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index e5ddd2d0..d6526514 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -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;