restrict_link_by_signature(9)
π restrict_link_by_signature(9) π
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 β
- Kernel file
./crypto/asymmetric_keys/restrict.cβ like, the whole source file bestie, go look! restrict_link_by_ca(9)β the CA-based sister function πrestrict_link_by_digsig(9)β digital signature version β¨restrict_link_by_key_or_keyring(9)β the "key OR keyring" one πrestrict_link_by_key_or_keyring_chain(9)β and its chain counterpart π¦
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms