debsig-verify(1)

✨ debsig-verify ✨

okay bestie, sit down, hydrate, and let me tell you about debsig-verify πŸ’– β€” it's the dpkg suite's little bouncer that checks IDs at the door of your Debian packages. no cap.


🌸 NAME 🌸

debsig-verify β€” verify signatures for a Debian format package 🫢


πŸŽ€ SYNOPSIS πŸŽ€

debsig-verify [option...] deb

πŸ’… DESCRIPTION πŸ’…

so this program is part of a whole security model that verifies the source and validity of a Debian format package β€” you know her, you love her, she's commonly called a deb πŸ¦‹

it implements the verification specs laid out in the document "Package Verification with dpkg: Implementation", which is the more complete reference for the whole verification procedure, iykyk.

generally it takes one argument β€” the deb file that needs verifying. then it:

  1. checks the origin signature of the deb
  2. finds its Public Key ID (long format, bestie, LONG)
  3. uses that ID as the name for a policy subdirectory

and if that subdirectory doesn't exist? πŸ’€ verification fails immediately. like, instantly. no second chances. periodt.

in that subdirectory, the program finds one or more files named with the .pol file extension β€” that's an XML format policy definition. this file has three main parts:

  • Origin β€” Information about the origin of this policy.
  • Selection β€” Rules used to decide if this policy is pertinent to this deb's verification.
  • Verification β€” Rules that are used to actually verify the deb.

the policy files reference OpenPGP keyrings by a filename, and those keyrings get looked up inside a subdirectory of the OpenPGP keyring directory. that subdirectory has the same name as the policy subdirectory (which, remember, was already determined by the Origin's Public Key ID ✨).

after it parses the entire file, the program checks the Origin ID against the Public Key ID of the origin signature in the deb. if those match β€” which they should, otherwise something is really wrong 😭 β€” it moves on to the Selection rules.

the Selection rules decide whether this policy is even suitable for verifying this deb. if they fail, the program just goes to the next policy, no drama. but if they pass? it commits to that policy for verification, and no other policies get referenced. main character policy energy, honestly πŸ‘‘

the last verification step rides on the Verification rules. they're similar in format to the Selection rules but usually way more constrained. if they fail β†’ program exits with a non-zero status. if they pass β†’ exits with a zero status. slay πŸ’…


🌈 OPTIONS 🌈

  • -q, --quiet β€” makes the program send no output at all, other than fatal errors. super useful when another program is calling it and you're only relying on the exit value, fr fr.
  • -v, --verbose β€” makes the program send more output while it runs, so you can follow along with every step it takes trying to verify the deb. it's giving commentary track πŸŽ€
  • -d, --debug β€” outputs even MORE info than -v. mainly for debugging, bestie.
  • --help β€” outputs the usage information for the program.
  • --version β€” outputs the version information for the program. this includes the policy format version. this option does not require any other arguments ✨
  • --list-policies β€” outputs a list of the policies that passed the Selection phase of the verification process. in other words, the ones that could potentially verify the deb. the output is one line showing the directory selected by the origin signature, and then a single line for any policy files in that directory that pass the Selection rules. > heads up: this option will NOT verify the deb. it's just window shopping πŸ›οΈ
  • --use-policy policy β€” takes one argument: the name of the policy file (as shown by the --list-policies option). note that this is just a file, not a full path β€” you cannot specify arbitrary policies. this option is useful if more than one policy applies to potentially verifying the deb. the program will then use this policy, and only this policy, to try and verify the deb.
  • --policies-dir directory β€” use a different directory when looking up for policies.
  • --keyrings-dir directory β€” use a different directory when looking up for OpenPGP keyrings.
  • --root directory β€” use a different root directory when looking up for policies and OpenPGP keyrings.

πŸ”₯ EXIT STATUS πŸ”₯

  • 0 β€” the requested operation completed successfully. πŸŽ‰ iconic.
  • 1 β€” general non-success exit value. this happens for non-verification operations.
  • 10 β€” either no signatures are contained in the deb, or no origin signature was found. πŸ’€
  • 11 β€” an origin signature was found, but it doesn't have a corresponding subdirectory in the policies directory. πŸ™ˆ
  • 12 β€” the origin was found, and it is present. however, no policies were found that passed the selection phase of the process. thus, no verification was performed.
  • 13 β€” the package failed the verification phase of the process. more than likely this happens because of a bad signature, or because not all criteria of the verification block of the policy were passed. 😭
  • 14 β€” an internal error occurred. this is an unrecoverable error. either the deb is corrupt, the OpenPGP backend failed abnormally, or some other uncontrollable failure. genuinely the worst timeline.

πŸ¦‹ ENVIRONMENT πŸ¦‹

  • DEBSIG_GNUPG_PROGRAM β€” the name (or pathname) of the GnuPG program to use.

🧚 FILES 🧚

  • /etc/debsig/policies/ β€” directory containing the policy (.pol) definitions.
  • /etc/debsig/policies/*/*.pol β€” XML format policy files.
  • /usr/share/debsig/keyrings/ β€” directory containing the OpenPGP keyrings (*.pgp) that coincide with the policies.
  • /usr/share/debsig/keyrings/*/*.pgp
  • /usr/share/debsig/keyrings/*/*.gpg β€” OpenPGP format keyrings for use by the policies.
note: the .gpg extensions are the legacy names, used because of the prevalence of one of the OpenPGP implementations. these keyrings must be in OpenPGP keyring format, and not some tool specific format (such as GnuPG keybox databases). no shortcuts, bestie πŸ™…β€β™€οΈ

⭐ SEE ALSO ⭐

debsigs(1), gpg(1), deb(5).


and that's the whole vibe check πŸ’œ this was debsig-verify(1) from the dpkg suite, version 0.34 β€” go forth and verify those debs, you gorgeous genius, you 🫢✨🌸

πŸ“¦ where this page comes from