restrict_link_by_ca(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to the kernel API manual, and today's main character is restrict_link_by_ca. yes she's a real function, yes she's from the kernel docs, and yes we're gonna read her together. grab a boba πŸ§‹


✨ NAME ✨

restrict_link_by_ca β€” the vibe-checker that restricts additions to a ring of CA keys πŸ”


🌸 SYNOPSIS 🌸

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

like, look at that signature. it's giving "I return an int and I mean it" πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • dest_keyring β€” the keyring that's being linked to. she's the destination, the moment, the place where things get added 🫢
  • type β€” the type of the key being added. literally just telling you what kind of key we're dealing with ✨
  • payload β€” the payload of this new key. the actual contents, the inner world, the lore 🌸
  • trust_keyring β€” unused. not used. sitting there. we don't touch her πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the whole plot: this function checks if the new certificate is a CA. that's it, that's the quest πŸ—ΊοΈ

if it is a CA? slay. then the new certificate gets marked as being ok to link. she's accepted, she's in, she's part of the group chat πŸ‘‘

now the return values, and pay attention because this is the important part:

  • returns 0 if the new certificate was accepted πŸ’–
  • -ENOKEY if the certificate is not a CA 😭 (she's just not that girl, no cap)
  • -ENOPKG if the signature uses unsupported crypto πŸ’€
  • or some other error if there is a matching certificate but the signature check cannot be performed πŸ™ƒ
ngl bestie, that last one is the shady one β€” matching cert exists but we can't even run the signature check, so you get "some other error" and you'll just have to deal. it's giving mysterious. it's giving iykyk.

πŸ”₯ SEE ALSO πŸ”₯

like the whole friendship group of restrict functions. iconic lineup honestly ⭐


and that's the page, bestie πŸŽ€ this little gem lives in ./crypto/asymmetric_keys and it's dated October 2026 β€” so mark your calendar, screenshot it, send it to the group chat, periodt πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from