verify: signature must be checked against the key named in signed_with #18

Closed
opened 2026-11-06 16:36:12 +01:00 by michael · 1 comment
Owner

Problem

verify.lua reads signed_with from the manifest but only checks that this
key-id exists in the keyring. The signature itself is then checked with
sig.verify_file(), which tries every key of the keyring and accepts the first
one that validates.

Result: a package whose manifest says signed_with: good is accepted when it
was signed with any other key of the keyring (found with a test that signs
with a second keyring key).

Scope

  • sig.verify_file() gets a way to check against exactly one key-id
    (optional fourth parameter or a separate function)
  • verify.verify() passes manifest.signed_with
  • if the key-id is not in the keyring, the existing unknown_key_id error
    stays as it is

Acceptance criteria

  • package signed with keyring key B but naming key A in signed_with
    is rejected with signature_invalid
  • package signed with key A and naming key A is accepted
  • sig.verify_file() without the new parameter behaves as before
  • new tests for both cases in test_sig.lua and test_verify.lua
  • make test passes under Lua 5.1 and 5.4
## Problem `verify.lua` reads `signed_with` from the manifest but only checks that this key-id exists in the keyring. The signature itself is then checked with `sig.verify_file()`, which tries every key of the keyring and accepts the first one that validates. Result: a package whose manifest says `signed_with: good` is accepted when it was signed with any other key of the keyring (found with a test that signs with a second keyring key). ## Scope - `sig.verify_file()` gets a way to check against exactly one key-id (optional fourth parameter or a separate function) - `verify.verify()` passes `manifest.signed_with` - if the key-id is not in the keyring, the existing `unknown_key_id` error stays as it is ## Acceptance criteria - [ ] package signed with keyring key B but naming key A in `signed_with` is rejected with `signature_invalid` - [ ] package signed with key A and naming key A is accepted - [ ] `sig.verify_file()` without the new parameter behaves as before - [ ] new tests for both cases in test_sig.lua and test_verify.lua - [ ] make test passes under Lua 5.1 and 5.4
Author
Owner

Done in v2.0.0: verify() passes manifest.signed_with to sig.verify_file(file, sig, keyring, key_id); with a key id only that key counts, without it the behaviour is as before. Tests in test_sig.lua and test_verify.lua (a signature made with another key of the keyring is refused).

Done in v2.0.0: verify() passes manifest.signed_with to sig.verify_file(file, sig, keyring, key_id); with a key id only that key counts, without it the behaviour is as before. Tests in test_sig.lua and test_verify.lua (a signature made with another key of the keyring is refused).
michael 2026-11-14 20:40:56 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-module-manager#18
No description provided.