restrict_link_by_digsig(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, you clicked on restrict_link_by_digsig from the Kernel API Manual and honestly? you're about to understand keyrings better than half the people who wrote them. this is the vibe: it's a function that decides who gets to join the group chat (the keyring) based on whether their ID card has the right sticker on it. let's go πŸŽ€


✨ NAME ✨

restrict_link_by_digsig β€” the bouncer at the door of a ring of digsig keys. restricts additions to that ring, no cap. πŸ”₯


✨ SYNOPSIS ✨

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

literally the whole signature, character for character, don't @ me πŸ’…


✨ ARGUMENTS ✨

  • dest_keyring β€” the keyring being linked to. this is the group chat we're trying to add somebody to 🫢
  • type β€” the type of key being added. what kind of member is this, bestie
  • payload β€” the payload of the new key. the actual content, the main character energy ✨
  • trust_keyring β€” a ring of keys that can be used to vouch for the new cert. these are the references we call, iykyk πŸ‘‘

✨ DESCRIPTION ✨

so here's the whole plan, and it's giving very methodical:

First, check if the new certificate has digitalSignature usage set. if it does, then mark the new certificate as being ok to link. iconic, honestly πŸ¦‹

Afterwards, verify the new certificate against the ones in the trust_keyring. like, the new cert said it's cool, but do the trusted friends actually recognise it? that's the vibe check.

Now for the return values, bestie β€” read these carefully, this is the important part 🌸:

  • Returns 0 if the new certificate was accepted. slay, they're in πŸ’–
  • -ENOKEY if the certificate is not a digsig. not the right kind of key, sorry bestie πŸ’€
  • -ENOPKG if the signature uses unsupported crypto. like, we literally don't have the package for that, can't help you 🧚
  • or some other error if there is a matching certificate but the signature check cannot be performed. so close and yet so far 😭
ngl, "some other error" is the most ominous vibe in this whole page β€” if you hit that branch, the cert matched but the check itself couldn't run. don't assume it's a yes. πŸ™ˆ

✨ SEE ALSO ✨


and that's the whole page, no notes πŸ’… this little cutie lives in ./crypto/asymmetric_keys, and the source/version line says October 2026 β€” so mark your calendar, she's from the future πŸ‘‘βœ¨ stay restricted, stay iconic, periodt. 🫢

πŸ“¦ where this page comes from