KRB5_MK_REQ(3)
β¨ NAME β¨
okay bestie, gather round β this is the whole squad:
krb5_mk_reqkrb5_mk_req_exactkrb5_mk_req_extendedkrb5_rd_reqkrb5_rd_req_with_keyblockkrb5_mk_repkrb5_mk_rep_exactkrb5_mk_rep_extendedkrb5_rd_repkrb5_build_ap_reqkrb5_verify_ap_req
and what do they do? they create and read application authentication request π
π LIBRARY π
Kerberos 5 Library, aka libkrb5, link it with -lkrb5. slay.
π¦ SYNOPSIS π¦
#include <krb5.h>
krb5_error_code
krb5_mk_req(krb5_context context, krb5_auth_context *auth_context,
const krb5_flags ap_req_options, const char *service,
const char *hostname, krb5_data *in_data, krb5_ccache ccache,
krb5_data *outbuf);
krb5_error_code
krb5_mk_req_extended(krb5_context context,
krb5_auth_context *auth_context, const krb5_flags ap_req_options,
krb5_data *in_data, krb5_creds *in_creds, krb5_data *outbuf);
krb5_error_code
krb5_rd_req(krb5_context context, krb5_auth_context *auth_context,
const krb5_data *inbuf, krb5_const_principal server,
krb5_keytab keytab, krb5_flags *ap_req_options,
krb5_ticket **ticket);
krb5_error_code
krb5_build_ap_req(krb5_context context, krb5_enctype enctype,
krb5_creds *cred, krb5_flags ap_options, krb5_data authenticator,
krb5_data *retdata);
krb5_error_code
krb5_verify_ap_req(krb5_context context,
krb5_auth_context *auth_context, krb5_ap_req *ap_req,
krb5_const_principal server, krb5_keyblock *keyblock,
krb5_flags flags, krb5_flags *ap_req_options, krb5_ticket **ticket);
like, look at those signatures. so clean. so structured. iconic. β¨
π DESCRIPTION π
so the functions in this manual page? they document the functions that facilitate the exchange between a Kerberos client and a server. and ngl, they're the core functions used in the authentication exchange between the client and the server. main character energy fr fr π
πΈ making the request
krb5_mk_req and krb5_mk_req_extended create the Kerberos message KRB_AP_REQ, which gets sent from the client to the server as the first packet in a client/server exchange. the result you should send over to the server is stored in outbuf. π
auth_context should be allocated with krb5_auth_con_init(), or you can pass in NULL β and in that case it will be allocated and freed internally. so convenient bestie, no cap.
the input data in in_data will have a checksum calculated over it, and that checksum gets transported in the message to the server. π§Ύ
π the flags, the moment you've been waiting for
ap_req_options can be set to one or more of the following flags:
AP_OPTS_USE_SESSION_KEYβ use the session key when creating the request, and this one is used for user to user authentication.AP_OPTS_MUTUAL_REQUIREDβ mark the request as mutual authenticate required, so that the receiver returns a mutual authentication packet. reciprocal bestie behaviour π«Ά
π¦ reading the request
krb5_rd_req reads the AP_REQ in inbuf, verifies it and extracts the content. if server is specified, that server will be fetched from the keytab and used unconditionally. if server is NULL, the keytab will be searched for a matching principal. π
the keytab argument specifies what keytab to search for receiving principals. and the arguments ap_req_options and ticket return the content.
when the AS-REQ is a user to user request, neitherkeytabnorprincipalare used β insteadkrb5_rd_req()expects the session key to be set inauth_context. not me dropping that little plot twist π
π the "don't touch this" corner
krb5_verify_ap_req and krb5_build_ap_req both construct and verify the AP_REQ message β and they should not be used by external code. like, hands off, bestie, that's internal business π
β SEE ALSO β
and that's the whole page, periodt π this was the HEIMDAL version, dated August 27, 2005, filed under KRB5_MK_REQ(3) β go forth and authenticate responsibly, mwah πβ¨
π¦ 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) 2005 Kungliga Tekniska HΓΆgskolan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms