restrict_link_by_signature(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, we're deep in the Kernel API Manual and this one is literally about keeping your keyring safe from fakes. no cap. it's giving bouncer energy for public keys. πŸŽ€


✨ NAME ✨

restrict_link_by_signature β€” bestie, this is the function that restricts (aka gatekeeps) additions to a ring of public keys. periodt. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

int restrict_link_by_signature (struct key *dest_keyring , const struct
key_type *type , const union key_payload *payload , struct key
*trust_keyring );

like, here's the whole vibe of what you're calling. exact same signature, i would never touch it. πŸ’–


🌸 ARGUMENTS 🌸

  • dest_keyring β€” the keyring that's literally being linked to. main character of this operation ngl. πŸ”₯
  • type β€” the type of key being added. gotta know what you're working with bestie. ✨
  • payload β€” the payload of the new key. the actual goods. πŸŽ€
  • trust_keyring β€” a ring of keys that can be used to vouch for the new cert. like, they're the mutuals who go "oh yeah i know her" for the new cert. 🫢

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: this function checks the new certificate against the ones in the trust keyring. if one of those is the signing key and validates the new certificate, THEN we mark the new certificate as being trusted. it's a whole vibe check for certs, honestly. 🧚

and now the return values, bestie, listen up because this is where the plot thickens: it returns 0 if the new certificate was accepted (slay πŸ’…), -ENOKEY if we couldn't find a matching parent certificate in the trusted list (rip no mutuals 😭), -EKEYREJECTED if the signature check fails OR the key is blacklisted (not iconic πŸ’€), -ENOPKG if the signature uses unsupported crypto (unsupported?? in THIS economy?? πŸ™ˆ), or some other error if there is a matching certificate but the signature check cannot be performed. fr fr, read these carefully. πŸ“–

lowkey important: this function does NOT mess around. if the signature check fails or the key is blacklisted, it's -EKEYREJECTED, no debate, no exceptions. πŸ’€

⭐ SEE ALSO ⭐


and that's the whole page bestie!! no skips, no summarising, we ate that. πŸ“

this diva lives at ./crypto/asymmetric_keys and the version date is October 2026 β€” mark your calendars and follow for more kernel lore, iykyk πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from