libalpm_sig(3)

πŸ“¦
version 7.0.0 Β· 4 versions
, in epel 10, fedora 43, fedora 44

🌸 libalpm_sig(3) β€” Library Functions Manual 🌸

okay so bestie, this is the signature-checking page from libalpm. It’s giving β€œtrust, but verify” and we are gonna verify everything πŸ’…βœ¨

πŸ’– NAME πŸ’–

libalpm_sig β€” Signature checking

  • Functions to check signatures

✨ SYNOPSIS ✨

πŸ“¦ Data Structures πŸ“¦

  • struct alpm_pgpkey_t β€” A PGP key.
  • struct alpm_sigresult_t β€” Signature result.
  • struct alpm_siglist_t β€” Signature list.

πŸ”’ Enumerations πŸ”’

enum alpm_siglevel_t { ALPM_SIG_PACKAGE = (1 << 0),
    ALPM_SIG_PACKAGE_OPTIONAL = (1 << 1), ALPM_SIG_PACKAGE_MARGINAL_OK =
    (1 << 2), ALPM_SIG_PACKAGE_UNKNOWN_OK = (1 << 3), ALPM_SIG_DATABASE
    = (1 << 10), ALPM_SIG_DATABASE_OPTIONAL = (1 << 11),
    ALPM_SIG_DATABASE_MARGINAL_OK = (1 << 12),
    ALPM_SIG_DATABASE_UNKNOWN_OK = (1 << 13), ALPM_SIG_USE_DEFAULT = (1
    << 30) }
enum alpm_sigstatus_t { ALPM_SIGSTATUS_VALID,
    ALPM_SIGSTATUS_KEY_EXPIRED, ALPM_SIGSTATUS_SIG_EXPIRED,
    ALPM_SIGSTATUS_KEY_UNKNOWN, ALPM_SIGSTATUS_KEY_DISABLED,
    ALPM_SIGSTATUS_INVALID }
enum alpm_sigvalidity_t { ALPM_SIGVALIDITY_FULL,
    ALPM_SIGVALIDITY_MARGINAL, ALPM_SIGVALIDITY_NEVER,
    ALPM_SIGVALIDITY_UNKNOWN }
  • enum alpm_siglevel_t β€” PGP signature verification options.
  • enum alpm_sigstatus_t β€” PGP signature verification status return codes.
  • enum alpm_sigvalidity_t β€” The trust level of a PGP key.

πŸ› οΈ Functions πŸ› οΈ

int alpm_pkg_check_pgp_signature (alpm_pkg_t *pkg, alpm_siglist_t
    *siglist)
int alpm_db_check_pgp_signature (alpm_db_t *db, alpm_siglist_t *siglist)
int alpm_siglist_cleanup (alpm_siglist_t *siglist)
int alpm_decode_signature (const char *base64_data, unsigned char
    **data, size_t *data_len)
int alpm_extract_keyid (alpm_handle_t *handle, const char *identifier,
    const unsigned char *sig, const size_t len, alpm_list_t **keys)
  • alpm_pkg_check_pgp_signature β€” Check the PGP signature for the given package file.
  • alpm_db_check_pgp_signature β€” Check the PGP signature for the given database.
  • alpm_siglist_cleanup β€” Clean up and free a signature result list.
  • alpm_decode_signature β€” Decode a loaded signature in base64 form.
  • alpm_extract_keyid β€” Extract the Issuer Key ID from a signature.

πŸ’¬ Detailed Description πŸ’¬

Functions to check signatures. That’s the whole vibe. 🫢

🧸 Data Structure Documentation 🧸

struct alpm_pgpkey_t β€” A PGP key.

Data Fields:

  • alpm_time_t created β€” When the key was created.
  • void * data β€” The actual key data.
  • char * email β€” Email of the key’s owner.
  • alpm_time_t expires β€” When the key expires.
  • char * fingerprint β€” The key’s fingerprint.
  • unsigned int length β€” The length of the key.
  • char * name β€” Name of the key’s owner.
  • char pubkey_algo β€” A character representing the encryption algorithm used by the public key. ? = unknown R = RSA D = DSA E = EDDSA
  • unsigned int revoked β€” has the key been revoked
  • char * uid β€” UID of the key.

struct alpm_sigresult_t β€” Signature result.

Contains the key, status, and validity of a given signature. πŸ’…

Data Fields:

  • alpm_pgpkey_t key β€” The key of the signature.
  • alpm_sigstatus_t status β€” The status of the signature.
  • alpm_sigvalidity_t validity β€” The validity of the signature.

struct alpm_siglist_t β€” Signature list.

Contains the number of signatures found and a pointer to an array of results. The array is of size count. πŸŽ€

Data Fields:

  • size_t count β€” The amount of results in the array.
  • alpm_sigresult_t * results β€” An array of sigresults.

πŸ” Enumeration Type Documentation πŸ”

enum alpm_siglevel_t β€” PGP signature verification options.

Enumerator

  • ALPM_SIG_PACKAGE β€” Packages require a signature.
  • ALPM_SIG_PACKAGE_OPTIONAL β€” Packages do not require a signature, but check packages that do have signatures.
  • ALPM_SIG_PACKAGE_MARGINAL_OK β€” it’s in the enum values above; the original enumerator docs don’t give it its own description, bestie πŸ’…
  • ALPM_SIG_PACKAGE_UNKNOWN_OK β€” Allow packages with signatures that are unknown trust.
  • ALPM_SIG_DATABASE β€” Databases require a signature.
  • ALPM_SIG_DATABASE_OPTIONAL β€” Databases do not require a signature, but check databases that do have signatures.
  • ALPM_SIG_DATABASE_MARGINAL_OK β€” Allow databases with signatures that are marginal trust.
  • ALPM_SIG_DATABASE_UNKNOWN_OK β€” Allow databases with signatures that are unknown trust.
  • ALPM_SIG_USE_DEFAULT β€” The Default siglevel.

enum alpm_sigstatus_t β€” PGP signature verification status return codes.

Enumerator

  • ALPM_SIGSTATUS_VALID β€” Signature is valid.
  • ALPM_SIGSTATUS_KEY_EXPIRED β€” The key has expired.
  • ALPM_SIGSTATUS_SIG_EXPIRED β€” The signature has expired.
  • ALPM_SIGSTATUS_KEY_UNKNOWN β€” The key is not in the keyring.
  • ALPM_SIGSTATUS_KEY_DISABLED β€” The key has been disabled.
  • ALPM_SIGSTATUS_INVALID β€” The signature is invalid.

enum alpm_sigvalidity_t β€” The trust level of a PGP key.

Enumerator

  • ALPM_SIGVALIDITY_FULL β€” The signature is fully trusted.
  • ALPM_SIGVALIDITY_MARGINAL β€” The signature is marginally trusted.
  • ALPM_SIGVALIDITY_NEVER β€” The signature is never trusted.
  • ALPM_SIGVALIDITY_UNKNOWN β€” The signature has unknown trust.

πŸ› οΈ Function Documentation πŸ› οΈ

int alpm_db_check_pgp_signature (alpm_db_t * db, alpm_siglist_t * siglist)

Check the PGP signature for the given database.

Parameters:

  • db β€” the database to check
  • siglist β€” a pointer to storage for signature results

Returns: 0 if valid, -1 if an error occurred or signature is invalid

int alpm_decode_signature (const char * base64_data, unsigned char ** data, size_t * data_len)

Decode a loaded signature in base64 form.

Parameters:

  • base64_data β€” the signature to attempt to decode
  • data β€” the decoded data; must be freed by the caller
  • data_len β€” the length of the returned data

Returns: 0 on success, -1 on failure to properly decode

int alpm_extract_keyid (alpm_handle_t * handle, const char * identifier, const unsigned char * sig, const size_t len, alpm_list_t ** keys)

Extract the Issuer Key ID from a signature.

Parameters:

  • handle β€” the context handle
  • identifier β€” the identifier of the key. This may be the name of the package or the path to the package.
  • sig β€” PGP signature
  • len β€” length of signature
  • keys β€” a pointer to storage for key IDs

Returns: 0 on success, -1 on error

int alpm_pkg_check_pgp_signature (alpm_pkg_t * pkg, alpm_siglist_t * siglist)

Check the PGP signature for the given package file.

Parameters:

  • pkg β€” the package to check
  • siglist β€” a pointer to storage for signature results

Returns: 0 if valid, -1 if an error occurred or signature is invalid

int alpm_siglist_cleanup (alpm_siglist_t * siglist)

Clean up and free a signature result list. Important: this does not free the siglist object itself in case that was allocated on the stack; this is the responsibility of the caller. 🫢

Parameters:

  • siglist β€” a pointer to storage for signature results

Returns: 0 on success, -1 on error

✍️ Author ✍️

Generated automatically by Doxygen for libalpm from the source code.


source/version: libalpm Β· page: libalpm_sig(3) Β· date: the footer didn’t list one, so we’re not inventing it, bestie πŸ˜­πŸ’–

πŸ“¦ where this page comes from