KRB5_MK_SAFE(3)
π KRB5_MK_SAFE(3) π
okay bestie, so this one is from the Library Functions Manual, and it's giving krb5_mk_safe and its chaotic sibling krb5_mk_priv. two functions, one manpage, zero chill. let's get into it π«Ά
β¨ NAME β¨
krb5_mk_safe, krb5_mk_priv β generates integrity protected and/or encrypted messages
likeβ¦ it literally makes messages that are safe. and/or private. the naming team ate fr fr π₯
π LIBRARY π
Kerberos 5 Library (libkrb5, -lkrb5)
so you gotta link against libkrb5 with -lkrb5, no cap. the Kerberos 5 Library is the main character here π
πΈ SYNOPSIS πΈ
#include <krb5.h>
krb5_error_code
krb5_mk_priv(krb5_context context, krb5_auth_context auth_context,
const krb5_data *userdata, krb5_data *outbuf,
krb5_replay_data *outdata);
krb5_error_code
krb5_mk_safe(krb5_context context, krb5_auth_context auth_context,
const krb5_data *userdata, krb5_data *outbuf,
krb5_replay_data *outdata);
not me including <krb5.h> obviously, like where else would these live π
both of them return a krb5_error_code and take the exact same five args. twins. iconic behaviour.
π¦ DESCRIPTION π¦
so krb5_mk_safe() and krb5_mk_priv() format KRB-SAFE (integrity protected) and KRB-PRIV (also encrypted) messages into outbuf. that's the whole glow-up: safe = protected, priv = protected and encrypted. pick your fighter β¨
the actual message data is taken from userdata. that's your stuff, your payload, your little data baby, and it goes in as a const krb5_data *.
now here's the spicy part πΆοΈ β if the KRB5_AUTH_CONTEXT_DO_SEQUENCE or KRB5_AUTH_CONTEXT_DO_TIME flags are set in the auth_context, then sequence numbers and time stamps get generated. so like, if you flipped those flags on, the function's gonna do the extra work for you, periodt.
and if the KRB5_AUTH_CONTEXT_RET_SEQUENCE or KRB5_AUTH_CONTEXT_RET_TIME flags are set, then those are also returned in the outdata parameter. so it's not just generating them, it's handing them back to you in outdata. you get the receipts π§Ύ
lowkey important:DO_flags = generate them.RET_flags = give them back to me. that's the whole vibe check on these four flags, iykyk.
π SEE ALSO π
like yeah go read the read-side ones too, rd is the reverse of mk, you're gonna need both if you're actually doing the thing π
and that's the whole page bestie!! π this one's from HEIMDAL, dated May 1, 2006 β yes she's an elder but she still serves π go forth and protect your messages, you've got this ππβ¨
π¦ where this page comes from
- alpine 3.22: heimdal-doc 7.8.0-r4 Β· BSD-3-Clause
- alpine 3.23: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- alpine 3.24: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- debian bookworm: heimdal-dev 7.8.git20221117.28daf24+dfsg-2 Β· BSD-3-Clause
- debian trixie: heimdal-dev 7.8.git20221117.28daf24+dfsg-9+deb13u1 Β· BSD-3-Clause
- epel 10: heimdal-devel 7.8.0-26.el10_2 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- epel 9: heimdal-devel 7.8.0-5.el9 Β· BSD and MIT
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- freebsd 14.5: base 14.5
- nixpkgs unstable: heimdal 7.8.0-unstable-2024-09-10
- ubuntu jammy: heimdal-dev 7.7.0+dfsg-3ubuntu1 Β· BSD-3-Clause
- ubuntu noble: heimdal-dev 7.8.git20221117.28daf24+dfsg-5ubuntu3 Β· BSD-3-Clause
- ubuntu questing: heimdal-dev 7.8.git20221117.28daf24+dfsg-9ubuntu1
- ubuntu resolute: heimdal-dev 7.8.git20221117.28daf24+dfsg-11ubuntu1 Β· BSD-3-Clause
- ubuntu stonking: heimdal-dev 7.8.git20240113.1b4565a+dfsg-2ubuntu1 Β· BSD-3-Clause
- Copyright (c) 2003 Kungliga Tekniska HΓΆgskolan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms