krb5(3)
π NAME π
okay bestie, welcome to krb5(3) β this is the manual page for the Heimdal Kerberos 5 library, and it is a lot, but we're gonna get through it together. π«Ά
β¨ SYNOPSIS β¨
π Functions π
here's the whole entire lineup of functions this page covers β every single one, no skipping, no "etc." energy, all of them fr fr:
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_add_et_list (krb5_context context, void(*func)(struct et_list **))
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_password (krb5_context context, krb5_creds *creds, const char *newpw, krb5_principal targprinc, int *result_code, krb5_data *result_code_string, krb5_data *result_string)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_init_context (krb5_context *context)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_context (krb5_context context, krb5_context *out)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_context (krb5_context context)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_config_files (krb5_context context, char **filenames)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_prepend_config_files_default (const char *filelist, char ***pfilenames)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_default_config_files (char ***pfilenames)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_config_files (char **filenames)
KRB5_LIB_FUNCTION const krb5_enctype *KRB5_LIB_CALL krb5_kerberos_enctypes (krb5_context context)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_default_in_tkt_etypes (krb5_context context, const krb5_enctype *etypes)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_default_in_tkt_etypes (krb5_context context, krb5_pdu pdu_type, krb5_enctype **etypes)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_init_ets (krb5_context context)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_use_admin_kdc (krb5_context context, krb5_boolean flag)
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_get_use_admin_kdc (krb5_context context)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_add_extra_addresses (krb5_context context, krb5_addresses *addresses)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_extra_addresses (krb5_context context, const krb5_addresses *addresses)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_extra_addresses (krb5_context context, krb5_addresses *addresses)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_add_ignore_addresses (krb5_context context, krb5_addresses *addresses)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_ignore_addresses (krb5_context context, const krb5_addresses *addresses)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_ignore_addresses (krb5_context context, krb5_addresses *addresses)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_fcache_version (krb5_context context, int version)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_fcache_version (krb5_context context, int *version)
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_is_thread_safe (void)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_dns_canonicalize_hostname (krb5_context context, krb5_boolean flag)
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_get_dns_canonicalize_hostname (krb5_context context)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_kdc_sec_offset (krb5_context context, int32_t *sec, int32_t *usec)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_kdc_sec_offset (krb5_context context, int32_t sec, int32_t usec)
KRB5_LIB_FUNCTION time_t KRB5_LIB_CALL krb5_get_max_time_skew (krb5_context context)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_max_time_skew (krb5_context context, time_t t)
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_set_home_dir_access (krb5_context context, krb5_boolean allow)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_host_realm (krb5_context context, const krb5_realm *from, krb5_realm **to)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_free_cred_contents (krb5_context context, krb5_creds *c)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_creds_contents (krb5_context context, const krb5_creds *incred, krb5_creds *c)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_creds (krb5_context context, const krb5_creds *incred, krb5_creds **outcred)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_free_creds (krb5_context context, krb5_creds *c)
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_compare_creds (krb5_context context, krb5_flags whichfields, const krb5_creds *mcreds, const krb5_creds *creds)
KRB5_LIB_FUNCTION unsigned long KRB5_LIB_CALL krb5_creds_get_ticket_flags (krb5_creds *creds)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_data_zero (krb5_data *p)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_data_free (krb5_data *p)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_data (krb5_context context, krb5_data *p)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_data_alloc (krb5_data *p, int len)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_data_realloc (krb5_data *p, int len)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_data_copy (krb5_data *p, const void *data, size_t len)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_data (krb5_context context, const krb5_data *indata, krb5_data **outdata)
KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_data_cmp (const krb5_data *data1, const krb5_data *data2)
KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_data_ct_cmp (const krb5_data *data1, const krb5_data *data2)
KRB5_LIB_FUNCTION const char *KRB5_LIB_CALL krb5_get_err_text (krb5_context context, krb5_error_code code)
KRB5_DEPRECATED_FUNCTION('Use krb5_get_error_message instead')
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_krbhst_get_addrinfo (krb5_context context, krb5_krbhst_info *host, struct addrinfo **ai)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_free_ticket (krb5_context context, krb5_ticket *ticket)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_ticket (krb5_context context, const krb5_ticket *from, krb5_ticket **to)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ticket_get_client (krb5_context context, const krb5_ticket *ticket, krb5_principal *client)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ticket_get_server (krb5_context context, const krb5_ticket *ticket, krb5_principal *server)
KRB5_LIB_FUNCTION time_t KRB5_LIB_CALL krb5_ticket_get_endtime (krb5_context context, const krb5_ticket *ticket)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ticket_get_authorization_data_type (krb5_context context, krb5_ticket *ticket, int type, krb5_data *data)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_real_time (krb5_context context, krb5_timestamp sec, int32_t usec)
π Detailed Description π
not me checking the original for this section and finding... literally nothing, bestie. it's just the heading, sitting there, empty, living its best life. π¦ so we're not gonna invent anything β no vibes-only filler, no cap. straight on to the functions. π
π Function Documentation π
π krb5_add_et_list π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_add_et_list (krb5_context context, void(*)(struct et_list **) func)
okay so this one adds a specified list of error messages to the et list chillin' inside your context. it calls func β and yeah, that's probably a comerr-generated function, just so you know β and it hands func a pointer to the current et_list. β¨
π¬ Parameters
contextβ a kerberos context.funcβ the generated com_err et function.
π€ Returns
Returns 0 to indicate success. Otherwise a kerberos et error code is returned, see krb5_get_error_message(). π
π krb5_add_extra_addresses π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_add_extra_addresses (krb5_context context, krb5_addresses *addresses)
so bestie, this adds extra address(es) to the address list that the library is gonna tack onto the client's address list when it's talking to the KDC. iconic behavior honestly. π
π¬ Parameters
contextβ Kerberos 5 context.addressesβ addresses to add.
π€ Returns
Returns 0 to indicate success. Otherwise a kerberos et error code is returned, see krb5_get_error_message().
π krb5_add_ignore_addresses π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_add_ignore_addresses (krb5_context context, krb5_addresses *addresses)
this one adds extra addresses to ignore when it's fetching addresses from the underlying operating system. like a little blocklist, but make it Kerberos. π
π¬ Parameters
contextβ Kerberos 5 context.addressesβ addresses to ignore.
π€ Returns
Returns 0 to indicate success. Otherwise a kerberos et error code is returned, see krb5_get_error_message().
π krb5_compare_creds π
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_compare_creds (krb5_context context, krb5_flags whichfields, const krb5_creds *mcreds, const krb5_creds *creds)
okay so: this returns TRUE if mcreds and creds are equal β and whichfields is the thing that decides what "equal" even means here. the way that one flag changes the whole comparison... it's giving choose-your-own-adventure. π¦
the following flags, set in whichfields, affect the comparison:
KRB5_TC_MATCH_SRV_NAMEONLYβ consider all realms equal when comparing the service principal.KRB5_TC_MATCH_KEYTYPEβ compare enctypes.KRB5_TC_MATCH_FLAGS_EXACTβ make sure the ticket flags are identical.KRB5_TC_MATCH_FLAGSβ make sure that all ticket flags set inmcredsare also present increds.KRB5_TC_MATCH_TIMES_EXACTβ compares the ticket times exactly.KRB5_TC_MATCH_TIMESβ compares only the expiration times of the creds.KRB5_TC_MATCH_AUTHDATAβ compares the authdata fields.KRB5_TC_MATCH_2ND_TKTβ compares the second tickets (used by user-to-user authentication).KRB5_TC_MATCH_IS_SKEYβ compares the existence of the second ticket.
π¬ Parameters
contextβ Kerberos 5 context.whichfieldsβ which fields to compare.mcredsβ cred to compare with.credsβ cred to compare with.
π€ Returns
return TRUE if mcred and creds are equal, FALSE if not.
π krb5_copy_context π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_context (krb5_context context, krb5_context *out)
make a copy of the Kerberos 5 context! and listen β the new krb5_context shoud be freed with krb5_free_context(), don't leave it hanging bestie. π«Ά
π¬ Parameters
contextβ the Kerberos context to copy.outβ the copy of the Kerberos, set toNULLerror.
π€ Returns
Returns 0 to indicate success. Otherwise a kerberos et error code is returned, see krb5_get_error_message().
π krb5_copy_creds π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_creds (krb5_context context, const krb5_creds *incred, krb5_creds **outcred)
copy krb5_creds. that's it, that's the description. short queen. π
π¬ Parameters
contextβ Kerberos 5 context.incredβ source credential.outcredβ destination credential, free withkrb5_free_creds().
π€ Returns
Returns 0 to indicate success. Otherwise a kerberos et error code is returned, see krb5_get_error_message().
π krb5_copy_creds_contents π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_creds_contents (krb5_context context, const krb5_creds *incred, krb5_creds *c)
copy content of krb5_creds.
Parameters
contextβ Kerberos 5 context.incredβ source credentialcβ destination credential, free withkrb5_free_cred_contents().
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_copy_data β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_data (krb5_context context, const krb5_data * indata, krb5_data ** outdata)
Copy the data into a newly allocated krb5_data. It's giving duplication with β¨pizazzβ¨.
Parameters
contextβ Kerberos 5 context.indataβ thekrb5_datadata to copyoutdataβ newkrb5_dateto copy too. Free withkrb5_free_data().
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned.
β¨ krb5_copy_host_realm β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_host_realm (krb5_context context, const krb5_realm * from, krb5_realm ** to)
Copy the list of realms from from to to. Bestie, it's a whole realm list glow-up. π
Parameters
contextβ Kerberos 5 context.fromβ list of realms to copy from.toβ list of realms to copy to, free list ofkrb5_free_host_realm().
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_copy_ticket β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_copy_ticket (krb5_context context, const krb5_ticket * from, krb5_ticket ** to)
Copy ticket and content. ποΈβ¨
Parameters
contextβ a Kerberos 5 contextfromβ ticket to copytoβ new copy of ticket, free withkrb5_free_ticket()
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_creds_get_ticket_flags β¨
KRB5_LIB_FUNCTION unsigned long KRB5_LIB_CALL krb5_creds_get_ticket_flags (krb5_creds * creds)
Returns the ticket flags for the credentials in creds. See also krb5_ticket_get_flags(). π
Parameters
credsβ credential to get ticket flags from
Returns ticket flags
β¨ krb5_data_alloc β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_data_alloc (krb5_data * p, int len)
Allocate data of and krb5_data. (Yes, the original says "of and" β we keep it fr fr.) π
Parameters
pβkrb5_datato allocate.lenβ size to allocate.
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned.
β¨ krb5_data_cmp β¨
KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_data_cmp (const krb5_data * data1, const krb5_data * data2)
Compare to data. (Again, original phrasing.) It's a comparison moment. π
Parameters
data1βkrb5_datato comparedata2βkrb5_datato compare
Returns return the same way as memcmp(), useful when sorting.
β¨ krb5_data_copy β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_data_copy (krb5_data * p, const void * data, size_t len)
Copy the data of len into the krb5_data. π«Ά
Parameters
pβkrb5_datato copy into.dataβ data to copy..lenβ new size.
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned.
β¨ krb5_data_ct_cmp β¨
KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_data_ct_cmp (const krb5_data * data1, const krb5_data * data2)
Compare to data not exposing timing information from the checksum data. This is the sneaky-safe one, no timing leaks. π΅οΈβοΈ
Parameters
data1βkrb5_datato comparedata2βkrb5_datato compare
Returns returns zero for same data, otherwise non zero.
β¨ krb5_data_free β¨
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_data_free (krb5_data * p)
Free the content of krb5_data structure, its ok to free a zeroed structure (with memset() or krb5_data_zero()). When done, the structure will be zeroed. The same function is called krb5_free_data_contents() in MIT Kerberos. π§Ή
Parameters
pβkrb5_datato free.
β¨ krb5_data_realloc β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_data_realloc (krb5_data * p, int len)
Grow (or shrink) the content of krb5_data to a new size. It's giving flexible. π¦
Parameters
pβkrb5_datato free.lenβ new size.
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned.
β¨ krb5_data_zero β¨
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_data_zero (krb5_data * p)
Reset the (potentially uninitalized) krb5_data structure. Fresh start energy. β¨
Parameters
pβkrb5_datato reset.
β¨ krb5_free_config_files β¨
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_config_files (char ** filenames)
Free a list of configuration files. Bye bye configs. π
Parameters
filenamesβ list, terminated with aNULLpointer, to be freed.NULLis an valid argument.
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_free_context β¨
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_context (krb5_context context)
Frees the krb5_context allocated by krb5_init_context(). Clean up your room bestie. π§Ό
Parameters
contextβ context to be freed.
β¨ krb5_free_cred_contents β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_free_cred_contents (krb5_context context, krb5_creds * c)
Free content of krb5_creds. Not the whole creds, just the contents. π
Parameters
contextβ Kerberos 5 context.cβkrb5_credsto free.
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_free_creds β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_free_creds (krb5_context context, krb5_creds * c)
Free krb5_creds. The whole thing. Gone. π
Parameters
contextβ Kerberos 5 context.cβkrb5_credsto free.
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_free_data β¨
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_data (krb5_context context, krb5_data * p)
Free krb5_data (and its content). π«§
Parameters
contextβ Kerberos 5 context.pβkrb5_datato free.
β¨ krb5_free_ticket β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_free_ticket (krb5_context context, krb5_ticket * ticket)
Free ticket and content. ποΈβ‘οΈποΈ
Parameters
contextβ a Kerberos 5 contextticketβ ticket to free
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_get_default_config_files β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_default_config_files (char *** pfilenames)
Get the global configuration list. π
Parameters
pfilenamesβ return array of filenames, should be freed withkrb5_free_config_files().
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_get_default_in_tkt_etypes β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_default_in_tkt_etypes (krb5_context context, krb5_pdu pdu_type, krb5_enctype ** etypes)
Get the default encryption types that will be use in communcation with the KDC, clients and servers. π
Parameters
contextβ Kerberos 5 context.pdu_typeβ request type (AS, TGS or none)etypesβ Encryption types, array terminated withETYPE_NULL(0), caller should free array withkrb5_xfree():
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_get_dns_canonicalize_hostname β¨
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_get_dns_canonicalize_hostname (krb5_context context)
Get if the library uses DNS to canonicalize hostnames. π
Parameters
contextβ Kerberos 5 context.
Returns return non zero if the library uses DNS to canonicalize hostnames.
β¨ krb5_get_err_text β¨
KRB5_LIB_FUNCTION const char* KRB5_LIB_CALL krb5_get_err_text (krb5_context context, krb5_error_code code)
Return the error string for the error code. The caller must not free the string.
β οΈ This function is deprecated since its not threadsafe. β οΈ
Parameters
contextβ Kerberos 5 context.codeβ Kerberos error code.
Returns the error message matching code
β¨ krb5_get_extra_addresses β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_extra_addresses (krb5_context context, krb5_addresses * addresses)
Get extra address to the address list that the library will add to the client's address list when communicating with the KDC. π¬
Parameters
contextβ Kerberos 5 context.addressesβ addreses to set
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_get_fcache_version β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_fcache_version (krb5_context context, int * version)
Get version of fcache that the library should use. π¦
Parameters
contextβ Kerberos 5 context.versionβ version number.
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_get_ignore_addresses β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_ignore_addresses (krb5_context context, krb5_addresses * addresses)
Get extra addresses to ignore when fetching addresses from the underlaying operating system. π
Parameters
contextβ Kerberos 5 context.addressesβ list addreses ignored
Returns Returns 0 to indicate success. Otherwise an kerberos et error code is returned, see krb5_get_error_message().
β¨ krb5_get_kdc_sec_offset β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_get_kdc_sec_offset (krb5_context context, int32_t * sec, int32_t * usec)
Get current offset in time to the KDC. β°
Parameters
contextβ Kerberos 5 context.secβ seconds part of offset.usecβ micro seconds part of offset.
Returns returns zero
β¨ krb5_get_max_time_skew β¨
KRB5_LIB_FUNCTION time_t KRB5_LIB_CALL krb5_get_max_time_skew (krb5_context context)
Get max time skew allowed. β³
Parameters
contextβ Kerberos 5 context.
Returns timeskew in seconds.
β¨ krb5_get_use_admin_kdc β¨
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_get_use_admin_kdc (krb5_context context)
Make the kerberos library default to the admin KDC. π
Parameters
contextβ Kerberos 5 context.
Returns boolean flag to telling the context will use admin KDC as the default KDC.
β¨ krb5_init_context β¨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_init_context (krb5_context * context)
Initializes the context structure and reads the configuration file /etc/krb5.conf. The structure should be freed by calling krb5_free_context() when it is no longer being used. This is the main character init. π
Parameters
contextβ pointer to returned context
Returns Returns 0 to indicate success. Otherwise an errno code is returned. Failure means either that something bad happened during initialization (typically ENOMEM) or that Kerberos should not be used ENXIO. If the function returns HEIM_ERR_RANDOM_OFFLINE, the random source is not available and later Kerberos calls might fail.
krb5_init_context() will get one random byte to make sure our random is alive. Assumption is that once the non blocking source allows us to pull bytes, its all seeded and allows us to pull more bytes.
Most Kerberos users calls krb5_init_context(), so this is useful point where we can do the checking.
β¨ krb5_init_ets β¨
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_init_ets (krb5_context context)
Init the built-in ets in the Kerberos library. β¨
contextβ kerberos context to add the ets too
(ok bestie we're literally mid-parameter-list rn β that bullet above is the tail end of the function right before this one, so we're just picking the thread back up like nothing happened π )
krb5_is_thread_safe π§΅
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_is_thread_safe (void)
A lil runtime vibe check: was the Kerberos library complied with thread support? (yes, "complied", the original said it, we don't fix it, we respect it π)
Returns
TRUEif the library was compiled with thread support,FALSEif not.
krb5_kerberos_enctypes π
KRB5_LIB_FUNCTION const krb5_enctype* KRB5_LIB_CALL krb5_kerberos_enctypes (krb5_context context)
Hands you back the list of Kerberos encryption types, sorted from most preferred all the way down to least preferred encryption type. Obsessed with the ranking energy honestly.
Heads up though β some encryption types might be disabled, so you gotta check with krb5_enctype_valid() before you actually go using the encryption type. Don't skip the vibe check. π
Returns
- list of enctypes, terminated with
ETYPE_NULL. It's a static array compiled into the Kerberos library, so the content doesn't need to be freed. (Free real estate? No β free of charge to you. π)
krb5_krbhst_get_addrinfo π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_krbhst_get_addrinfo (krb5_context context, krb5_krbhst_info * host, struct addrinfo ** ai)
Returns you a struct addrinfo * for a KDC host. Iconic.
It returns the struct addrinfo in ai that corresponds to the info in host. And listen β free:ing is handled by krb5_krbhst_free, so the returned ai must not be released. Do not touch it. Not yours. Hands off. π
ββοΈ
krb5_prepend_config_files_default π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_prepend_config_files_default (const char * filelist, char *** pfilenames)
Prepend the filename to the global configuration list. Very "let me just slide in at the front of the queue" of it. β¨
Parameters
filelistβ a filename to add to the default list of filenamepfilenamesβ return array of filenames, should be freed withkrb5_free_config_files().
Returns
- Returns
0to indicate success. Otherwise an kerberos et error code is returned, seekrb5_get_error_message().
krb5_set_config_files ποΈ
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_config_files (krb5_context context, char ** filenames)
Reinit the context from a new set of filenames. Glow-up for your context, fr fr.
Parameters
contextβ context to add configuration too.filenamesβ array of filenames, end of list is indicated with aNULLfilename.
Returns
- Returns
0to indicate success. Otherwise an kerberos et error code is returned, seekrb5_get_error_message().
krb5_set_default_in_tkt_etypes ποΈ
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_default_in_tkt_etypes (krb5_context context, const krb5_enctype * etypes)
Set the default encryption types that will be use in communcation with the KDC, clients and servers. The whole squad. π
Parameters
contextβ Kerberos 5 context.etypesβ Encryption types, array terminated withETYPE_NULL(0). A value ofNULLresets the encryption types to the defaults set in the configuration file.
Returns
- Returns
0to indicate success. Otherwise an kerberos et error code is returned, seekrb5_get_error_message().
krb5_set_dns_canonicalize_hostname π¦
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_dns_canonicalize_hostname (krb5_context context, krb5_boolean flag)
Set if the library should use DNS to canonicalize hostnames. Toggle it, bestie.
Parameters
contextβ Kerberos 5 context.flagβ if its dns canonicalizion is used or not.
krb5_set_extra_addresses π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_extra_addresses (krb5_context context, const krb5_addresses * addresses)
Set extra address to the address list that the library will add to the client's address list when communicating with the KDC. Little extra sprinkle of addresses, as a treat. πΈ
Parameters
contextβ Kerberos 5 context.addressesβ addreses to set
Returns
- Returns
0to indicate success. Otherwise an kerberos et error code is returned, seekrb5_get_error_message().
krb5_set_fcache_version πΎ
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_fcache_version (krb5_context context, int version)
Set version of fcache that the library should use. Pick your fave, no judgment. π
Parameters
contextβ Kerberos 5 context.versionβ version number.
Returns
- Returns
0to indicate success. Otherwise an kerberos et error code is returned, seekrb5_get_error_message().
krb5_set_home_dir_access π
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_set_home_dir_access (krb5_context context, krb5_boolean allow)
Enable and disable home directory access on either the global state or the krb5_context state. By calling krb5_set_home_dir_access() with context set to NULL, the global state is configured β otherwise the state for the krb5_context is modified.
Important, bestie: for home directory access to be allowed, both the global state and the krb5_context state have to be allowed. Two yeses, zero nos. π«Ά
Parameters
contextβ a Kerberos 5 context orNULLallowβ allow ifTRUEhome directory
Returns
- the old value
krb5_set_ignore_addresses π«
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_ignore_addresses (krb5_context context, const krb5_addresses * addresses)
Set extra addresses to ignore when fetching addresses from the underlaying operating system. Blocked. Not on the guest list. π
Parameters
contextβ Kerberos 5 context.addressesβ addreses to ignore
Returns
- Returns
0to indicate success. Otherwise an kerberos et error code is returned, seekrb5_get_error_message().
krb5_set_kdc_sec_offset β°
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_kdc_sec_offset (krb5_context context, int32_t sec, int32_t usec)
Set current offset in time to the KDC. Time-zone drama, but make it Kerberos. β¨
Parameters
contextβ Kerberos 5 context.secβ seconds part of offset.usecβ micro seconds part of offset.
Returns
- returns zero
krb5_set_max_time_skew β³
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_max_time_skew (krb5_context context, time_t t)
Set max time skew allowed. How much clock drift are we tolerating today, bestie?
Parameters
contextβ Kerberos 5 context.tβ timeskew in seconds.
krb5_set_password ππ
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_password (krb5_context context, krb5_creds * creds, const char * newpw, krb5_principal targprinc, int * result_code, krb5_data * result_code_string, krb5_data * result_string)
Change password using creds. The main character moment of every password reset. π
Parameters
contextβ a Keberos contextcredsβ The initial kadmin/passwd for the principal or an admin principalnewpwβ The new password to settargprincβ if unset, the default principal is used.result_codeβ Result code,KRB5_KPASSWD_SUCCESSis when password is changed.result_code_stringβ binary message from the server, contains at least theresult_code.result_stringβ A message from the kpasswd service or the library in human printable form. The string isNULterminated.
Returns
- On sucess and
*result_codeisKRB5_KPASSWD_SUCCESS, the password is changed.
And then the source doc just... has a lonely little
@
sitting there all by itself. A whole stray character. She's just vibing. We keep her. π
krb5_set_real_time π°οΈ
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_real_time (krb5_context context, krb5_timestamp sec, int32_t usec)
Set the absolute time that the caller knows the kdc has, so the kerberos library can calculate the relative diffrence beteen the KDC time and local system time. (We said "diffrence" and "beteen" exactly how the source said it, no cap. π)
Parameters
contextβ Keberos 5 context.secβ The applications new of 'now' in secondsusecβ The applications new of 'now' in micro seconds
Returns
- Kerberos 5 error code, see
krb5_get_error_message().
Extra note, and it matters: if the caller passes in a negativeusec, it's assumed to be unknown and the function will use the current timeusec. So don't panic. π«Ά
krb5_set_use_admin_kdc π
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_use_admin_kdc (krb5_context context, krb5_boolean flag)
Make the kerberos library default to the admin KDC. Admin privileges, admin energy, admin KDC. Periodt.
Parameters
contextβ Kerberos 5 context.flagβ boolean flag to select if the use the admin KDC or not.
krb5_ticket_get_authorization_data_type π
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ticket_get_authorization_data_type (krb5_context context, krb5_ticket * ticket, int type, krb5_data * data)
Extract the authorization data type of type from the ticket. Store the field in data. This function is to use for kerberos applications. β¨
Parameters
contextβ a Kerberos 5 contextticketβ Kerberos tickettypeβ type to fetchdataβ returned data, free withkrb5_data_free()
krb5_ticket_get_client π§βπ»
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ticket_get_client (krb5_context context, const krb5_ticket * ticket, krb5_principal * client)
Return client principal in ticket. Who are you, per this ticket? π
Parameters
contextβ a Kerberos 5 contextticketβ ticket to copyclientβ client principal, free withkrb5_free_principal()
Returns
- Returns
0to indicate success. Otherwise an kerberos et error code is returned, seekrb5_get_error_message().
krb5_ticket_get_endtime β
KRB5_LIB_FUNCTION time_t KRB5_LIB_CALL krb5_ticket_get_endtime (krb5_context context, const krb5_ticket * ticket)
Return end time of ticket. When does this ticket's story end? π
Parameters
contextβ a Kerberos 5 contextticketβ ticket to copy
Returns
- end time of ticket
krb5_ticket_get_server π₯οΈ
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ticket_get_server (krb5_context context, const krb5_ticket * ticket, krb5_principal * server)
Return server principal in ticket. The other half of the ticket's little duo. π«Ά
Parameters
contextβ a Kerberos 5 contextticketβ ticket to copyserverβ server principal, free withkrb5_free_principal()
Returns
- Returns
0to indicate success. Otherwise an kerberos et error code is returned, seekrb5_get_error_message().
Author βοΈ
Generated automatically by Doxygen for Heimdal Kerberos 5 library from the source code. (Not me, not you, not a human β Doxygen did that. Slay, I guess. π€β¨)
And that's a wrap on the whole krb5(3) page, bestie!! ππ We did it, we made it to the end, and the footer says we're on Version 7.8.0, dated Tue Nov 15 2022, living in section krb5(3). So screenshot that, hydrate, and go use krb5_free_principal() on everything you've been holding onto. ππΈ
π¦ 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
- 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms