Path: blob/main/crypto/krb5/src/include/k5-trace.h
34879 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* include/k5-trace.h */2/*3* Copyright (C) 2010 by the Massachusetts Institute of Technology.4* All rights reserved.5*6* Export of this software from the United States of America may7* require a specific license from the United States Government.8* It is the responsibility of any person or organization contemplating9* export to obtain such a license before exporting.10*11* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and12* distribute this software and its documentation for any purpose and13* without fee is hereby granted, provided that the above copyright14* notice appear in all copies and that both that copyright notice and15* this permission notice appear in supporting documentation, and that16* the name of M.I.T. not be used in advertising or publicity pertaining17* to distribution of the software without specific, written prior18* permission. Furthermore if you modify this software you must label19* your software as modified software and not distribute it in such a20* fashion that it might be confused with the original M.I.T. software.21* M.I.T. makes no representations about the suitability of22* this software for any purpose. It is provided "as is" without express23* or implied warranty.24*/2526/*27* This header contains trace macro definitions, which map trace points within28* the code to krb5int_trace() calls with descriptive text strings.29*30* A new trace macro must be defined in this file for each new location to31* be traced; the TRACE() macro should never be used directly. This keeps32* the tracing logic centralized in one place, to facilitate integration with33* alternate tracing backends such as DTrace.34*35* Trace logging is intended to aid power users in diagnosing configuration36* problems by showing what's going on behind the scenes of complex operations.37* Although trace logging is sometimes useful to developers, it is not intended38* as a replacement for a debugger, and it is not desirable to drown the user39* in output. Observe the following guidelines when adding trace points:40*41* - Avoid mentioning function or variable names in messages.42*43* - Try to convey what decisions are being made and what external inputs44* they are based on, not the process of making decisions.45*46* - It is generally not necessary to trace before returning an unrecoverable47* error. If an error code is unclear by itself, make it clearer with48* krb5_set_error_message().49*50* - Keep macros simple. Add format specifiers to krb5int_trace's formatter51* as necessary (and document them here) instead of transforming macro52* arguments.53*54* - Like printf, the trace formatter interface is not type-safe. Check your55* formats carefully. Cast integral arguments to the appropriate type if56* they do not already patch.57*58* The following specifiers are supported by the formatter (see the59* implementation in lib/krb5/os/trace.c for details):60*61* {int} int, in decimal62* {long} long, in decimal63* {str} const char *, display as C string64* {lenstr} size_t and const char *, as a counted string65* {hexlenstr} size_t and const char *, as hex bytes66* {hashlenstr} size_t and const char *, as four-character hex hash67* {raddr} struct remote_address *, show socket type, address, port68* {data} krb5_data *, display as counted string69* {hexdata} krb5_data *, display as hex bytes70* {errno} int, display as number/errorstring71* {kerr} krb5_error_code, display as number/errorstring72* {keyblock} const krb5_keyblock *, display enctype and hash of key73* {key} krb5_key, display enctype and hash of key74* {cksum} const krb5_checksum *, display cksumtype and hex checksum75* {princ} krb5_principal, unparse and display76* {ptype} krb5_int32, krb5_principal type, display name77* {patype} krb5_preauthtype, a single padata type number78* {patypes} krb5_pa_data **, display list of padata type numbers79* {etype} krb5_enctype, display shortest name of enctype80* {etypes} krb5_enctype *, display list of enctypes81* {ccache} krb5_ccache, display type:name82* {keytab} krb5_keytab, display name83* {creds} krb5_creds *, display clientprinc -> serverprinc84*/8586#ifndef K5_TRACE_H87#define K5_TRACE_H8889#ifdef DISABLE_TRACING90#define TRACE(ctx, ...)91#else9293void krb5int_trace(krb5_context context, const char *fmt, ...);9495/* Try to optimize away argument evaluation and function call when we're not96* tracing, if this source file knows the internals of the context. */97#ifdef _KRB5_INT_H98#define TRACE(ctx, ...) \99do { if (ctx->trace_callback != NULL) \100krb5int_trace(ctx, __VA_ARGS__); } while (0)101#else102#define TRACE(ctx, ...) krb5int_trace(ctx, __VA_ARGS__)103#endif104105#endif /* DISABLE_TRACING */106107#define TRACE_CC_CACHE_MATCH(c, princ, ret) \108TRACE(c, "Matching {princ} in collection with result: {kerr}", \109princ, ret)110#define TRACE_CC_DESTROY(c, cache) \111TRACE(c, "Destroying ccache {ccache}", cache)112#define TRACE_CC_GEN_NEW(c, cache) \113TRACE(c, "Generating new unique ccache based on {ccache}", cache)114#define TRACE_CC_GET_CONFIG(c, cache, princ, key, data) \115TRACE(c, "Read config in {ccache} for {princ}: {str}: {data}", \116cache, princ, key, data)117#define TRACE_CC_INIT(c, cache, princ) \118TRACE(c, "Initializing {ccache} with default princ {princ}", \119cache, princ)120#define TRACE_CC_MOVE(c, src, dst) \121TRACE(c, "Moving ccache {ccache} to {ccache}", src, dst)122#define TRACE_CC_NEW_UNIQUE(c, type) \123TRACE(c, "Resolving unique ccache of type {str}", type)124#define TRACE_CC_REMOVE(c, cache, creds) \125TRACE(c, "Removing {creds} from {ccache}", creds, cache)126#define TRACE_CC_RETRIEVE(c, cache, creds, ret) \127TRACE(c, "Retrieving {creds} from {ccache} with result: {kerr}", \128creds, cache, ret)129#define TRACE_CC_RETRIEVE_REF(c, cache, creds, ret) \130TRACE(c, "Retrying {creds} with result: {kerr}", creds, ret)131#define TRACE_CC_SET_CONFIG(c, cache, princ, key, data) \132TRACE(c, "Storing config in {ccache} for {princ}: {str}: {data}", \133cache, princ, key, data)134#define TRACE_CC_STORE(c, cache, creds) \135TRACE(c, "Storing {creds} in {ccache}", creds, cache)136#define TRACE_CC_STORE_TKT(c, cache, creds) \137TRACE(c, "Also storing {creds} based on ticket", creds)138139#define TRACE_CCSELECT_VTINIT_FAIL(c, ret) \140TRACE(c, "ccselect module failed to init vtable: {kerr}", ret)141#define TRACE_CCSELECT_INIT_FAIL(c, name, ret) \142TRACE(c, "ccselect module {str} failed to init: {kerr}", name, ret)143#define TRACE_CCSELECT_MODCHOICE(c, name, server, cache, princ) \144TRACE(c, "ccselect module {str} chose cache {ccache} with client " \145"principal {princ} for server principal {princ}", name, cache, \146princ, server)147#define TRACE_CCSELECT_MODNOTFOUND(c, name, server, princ) \148TRACE(c, "ccselect module {str} chose client principal {princ} " \149"for server principal {princ} but found no cache", name, princ, \150server)151#define TRACE_CCSELECT_MODFAIL(c, name, ret, server) \152TRACE(c, "ccselect module {str} yielded error {kerr} for server " \153"principal {princ}", name, ret, server)154#define TRACE_CCSELECT_NOTFOUND(c, server) \155TRACE(c, "ccselect can't find appropriate cache for server " \156"principal {princ}", server)157#define TRACE_CCSELECT_DEFAULT(c, cache, server) \158TRACE(c, "ccselect choosing default cache {ccache} for server " \159"principal {princ}", cache, server)160161#define TRACE_DNS_SRV_ANS(c, host, port, prio, weight) \162TRACE(c, "SRV answer: {int} {int} {int} \"{str}\"", prio, weight, \163port, host)164#define TRACE_DNS_SRV_NOTFOUND(c) \165TRACE(c, "No SRV records found")166#define TRACE_DNS_SRV_SEND(c, domain) \167TRACE(c, "Sending DNS SRV query for {str}", domain)168#define TRACE_DNS_URI_ANS(c, uri, prio, weight) \169TRACE(c, "URI answer: {int} {int} \"{str}\"", prio, weight, uri)170#define TRACE_DNS_URI_NOTFOUND(c) \171TRACE(c, "No URI records found")172#define TRACE_DNS_URI_SEND(c, domain) \173TRACE(c, "Sending DNS URI query for {str}", domain)174175#define TRACE_FAST_ARMOR_CCACHE(c, ccache_name) \176TRACE(c, "FAST armor ccache: {str}", ccache_name)177#define TRACE_FAST_ARMOR_CCACHE_KEY(c, keyblock) \178TRACE(c, "Armor ccache session key: {keyblock}", keyblock)179#define TRACE_FAST_ARMOR_KEY(c, keyblock) \180TRACE(c, "FAST armor key: {keyblock}", keyblock)181#define TRACE_FAST_CCACHE_CONFIG(c) \182TRACE(c, "Using FAST due to armor ccache negotiation result")183#define TRACE_FAST_DECODE(c) \184TRACE(c, "Decoding FAST response")185#define TRACE_FAST_ENCODE(c) \186TRACE(c, "Encoding request body and padata into FAST request")187#define TRACE_FAST_NEGO(c, avail) \188TRACE(c, "FAST negotiation: {str}available", (avail) ? "" : "un")189#define TRACE_FAST_PADATA_UPGRADE(c) \190TRACE(c, "Upgrading to FAST due to presence of PA_FX_FAST in reply")191#define TRACE_FAST_REPLY_KEY(c, keyblock) \192TRACE(c, "FAST reply key: {keyblock}", keyblock)193#define TRACE_FAST_REQUIRED(c) \194TRACE(c, "Using FAST due to KRB5_FAST_REQUIRED flag")195196#define TRACE_GET_CREDS_FALLBACK(c, hostname) \197TRACE(c, "Falling back to canonicalized server hostname {str}", hostname)198199#define TRACE_GIC_PWD_CHANGED(c) \200TRACE(c, "Getting initial TGT with changed password")201#define TRACE_GIC_PWD_CHANGEPW(c, tries) \202TRACE(c, "Attempting password change; {int} tries remaining", tries)203#define TRACE_GIC_PWD_EXPIRED(c) \204TRACE(c, "Principal expired; getting changepw ticket")205206#define TRACE_GSS_CLIENT_KEYTAB_FAIL(c, ret) \207TRACE(c, "Unable to resolve default client keytab: {kerr}", ret)208209#define TRACE_ENCTYPE_LIST_UNKNOWN(c, profvar, name) \210TRACE(c, "Unrecognized enctype name in {str}: {str}", profvar, name)211212#define TRACE_HOSTREALM_VTINIT_FAIL(c, ret) \213TRACE(c, "hostrealm module failed to init vtable: {kerr}", ret)214#define TRACE_HOSTREALM_INIT_FAIL(c, name, ret) \215TRACE(c, "hostrealm module {str} failed to init: {kerr}", name, ret)216217#define TRACE_INIT_CREDS(c, princ) \218TRACE(c, "Getting initial credentials for {princ}", princ)219#define TRACE_INIT_CREDS_AS_KEY_GAK(c, keyblock) \220TRACE(c, "AS key obtained from gak_fct: {keyblock}", keyblock)221#define TRACE_INIT_CREDS_AS_KEY_PREAUTH(c, keyblock) \222TRACE(c, "AS key determined by preauth: {keyblock}", keyblock)223#define TRACE_INIT_CREDS_DECRYPTED_REPLY(c, keyblock) \224TRACE(c, "Decrypted AS reply; session key is: {keyblock}", keyblock)225#define TRACE_INIT_CREDS_ERROR_REPLY(c, code) \226TRACE(c, "Received error from KDC: {kerr}", code)227#define TRACE_INIT_CREDS_GAK(c, salt, s2kparams) \228TRACE(c, "Getting AS key, salt \"{data}\", params \"{data}\"", \229salt, s2kparams)230#define TRACE_INIT_CREDS_IDENTIFIED_REALM(c, realm) \231TRACE(c, "Identified realm of client principal as {data}", realm)232#define TRACE_INIT_CREDS_KEYTAB_LOOKUP(c, princ, etypes) \233TRACE(c, "Found entries for {princ} in keytab: {etypes}", princ, etypes)234#define TRACE_INIT_CREDS_KEYTAB_LOOKUP_FAILED(c, code) \235TRACE(c, "Couldn't lookup etypes in keytab: {kerr}", code)236#define TRACE_INIT_CREDS_PREAUTH(c) \237TRACE(c, "Preauthenticating using KDC method data")238#define TRACE_INIT_CREDS_PREAUTH_DECRYPT_FAIL(c, code) \239TRACE(c, "Decrypt with preauth AS key failed: {kerr}", code)240#define TRACE_INIT_CREDS_PREAUTH_MORE(c, patype) \241TRACE(c, "Continuing preauth mech {patype}", patype)242#define TRACE_INIT_CREDS_PREAUTH_NONE(c) \243TRACE(c, "Sending unauthenticated request")244#define TRACE_INIT_CREDS_PREAUTH_OPTIMISTIC(c) \245TRACE(c, "Attempting optimistic preauth")246#define TRACE_INIT_CREDS_PREAUTH_TRYAGAIN(c, patype, code) \247TRACE(c, "Recovering from KDC error {int} using preauth mech {patype}", \248patype, (int)code)249#define TRACE_INIT_CREDS_PRIMARY(c) \250TRACE(c, "Retrying AS request with primary KDC")251#define TRACE_INIT_CREDS_RESTART_FAST(c) \252TRACE(c, "Restarting to upgrade to FAST")253#define TRACE_INIT_CREDS_RESTART_PREAUTH_FAILED(c) \254TRACE(c, "Restarting due to PREAUTH_FAILED from FAST negotiation")255#define TRACE_INIT_CREDS_REFERRAL(c, realm) \256TRACE(c, "Following referral to realm {data}", realm)257#define TRACE_INIT_CREDS_RETRY_TCP(c) \258TRACE(c, "Request or response is too big for UDP; retrying with TCP")259#define TRACE_INIT_CREDS_SALT_PRINC(c, salt) \260TRACE(c, "Salt derived from principal: {data}", salt)261#define TRACE_INIT_CREDS_SERVICE(c, service) \262TRACE(c, "Setting initial creds service to {str}", service)263264#define TRACE_KADM5_AUTH_VTINIT_FAIL(c, ret) \265TRACE(c, "kadm5_auth module failed to init vtable: {kerr}", ret)266#define TRACE_KADM5_AUTH_INIT_FAIL(c, name, ret) \267TRACE(c, "kadm5_auth module {str} failed to init: {kerr}", ret)268#define TRACE_KADM5_AUTH_INIT_SKIP(c, name) \269TRACE(c, "kadm5_auth module {str} declined to initialize", name)270271#define TRACE_KT_GET_ENTRY(c, keytab, princ, vno, enctype, err) \272TRACE(c, "Retrieving {princ} from {keytab} (vno {int}, enctype {etype}) " \273"with result: {kerr}", princ, keytab, (int) vno, enctype, err)274275#define TRACE_LOCALAUTH_INIT_CONFLICT(c, type, oldname, newname) \276TRACE(c, "Ignoring localauth module {str} because it conflicts " \277"with an2ln type {str} from module {str}", newname, type, oldname)278#define TRACE_LOCALAUTH_VTINIT_FAIL(c, ret) \279TRACE(c, "localauth module failed to init vtable: {kerr}", ret)280#define TRACE_LOCALAUTH_INIT_FAIL(c, name, ret) \281TRACE(c, "localauth module {str} failed to init: {kerr}", name, ret)282283#define TRACE_MK_REP(c, ctime, cusec, subkey, seqnum) \284TRACE(c, "Creating AP-REP, time {long}.{int}, subkey {keyblock}, " \285"seqnum {int}", (long) ctime, (int) cusec, subkey, (int) seqnum)286287#define TRACE_MK_REQ(c, creds, seqnum, subkey, sesskeyblock) \288TRACE(c, "Creating authenticator for {creds}, seqnum {int}, " \289"subkey {key}, session key {keyblock}", creds, (int) seqnum, \290subkey, sesskeyblock)291#define TRACE_MK_REQ_ETYPES(c, etypes) \292TRACE(c, "Negotiating for enctypes in authenticator: {etypes}", etypes)293294#define TRACE_MSPAC_VERIFY_FAIL(c, err) \295TRACE(c, "PAC checksum verification failed: {kerr}", err)296#define TRACE_MSPAC_DISCARD_UNVERF(c) \297TRACE(c, "Filtering out unverified MS PAC")298299#define TRACE_NEGOEX_INCOMING(c, seqnum, typestr, info) \300TRACE(c, "NegoEx received [{int}]{str}: {str}", (int)seqnum, typestr, info)301#define TRACE_NEGOEX_OUTGOING(c, seqnum, typestr, info) \302TRACE(c, "NegoEx sending [{int}]{str}: {str}", (int)seqnum, typestr, info)303304#define TRACE_PLUGIN_LOAD_FAIL(c, modname, err) \305TRACE(c, "Error loading plugin module {str}: {kerr}", modname, err)306#define TRACE_PLUGIN_LOOKUP_FAIL(c, modname, err) \307TRACE(c, "Error initializing module {str}: {kerr}", modname, err)308309#define TRACE_PREAUTH_CONFLICT(c, name1, name2, patype) \310TRACE(c, "Preauth module {str} conflicts with module {str} for pa " \311"type {patype}", name1, name2, patype)312#define TRACE_PREAUTH_COOKIE(c, len, data) \313TRACE(c, "Received cookie: {lenstr}", (size_t) len, data)314#define TRACE_PREAUTH_ENC_TS_KEY_GAK(c, keyblock) \315TRACE(c, "AS key obtained for encrypted timestamp: {keyblock}", keyblock)316#define TRACE_PREAUTH_ENC_TS(c, sec, usec, plain, enc) \317TRACE(c, "Encrypted timestamp (for {long}.{int}): plain {hexdata}, " \318"encrypted {hexdata}", (long) sec, (int) usec, plain, enc)319#define TRACE_PREAUTH_ENC_TS_DISABLED(c) \320TRACE(c, "Ignoring encrypted timestamp because it is disabled")321#define TRACE_PREAUTH_ETYPE_INFO(c, etype, salt, s2kparams) \322TRACE(c, "Selected etype info: etype {etype}, salt \"{data}\", " \323"params \"{data}\"", etype, salt, s2kparams)324#define TRACE_PREAUTH_INFO_FAIL(c, patype, code) \325TRACE(c, "Preauth builtin info function failure, type={patype}: {kerr}", \326patype, code)327#define TRACE_PREAUTH_INPUT(c, padata) \328TRACE(c, "Processing preauth types: {patypes}", padata)329#define TRACE_PREAUTH_OUTPUT(c, padata) \330TRACE(c, "Produced preauth for next request: {patypes}", padata)331#define TRACE_PREAUTH_PROCESS(c, name, patype, real, code) \332TRACE(c, "Preauth module {str} ({int}) ({str}) returned: " \333"{kerr}", name, (int) patype, real ? "real" : "info", code)334#define TRACE_PREAUTH_SAM_KEY_GAK(c, keyblock) \335TRACE(c, "AS key obtained for SAM: {keyblock}", keyblock)336#define TRACE_PREAUTH_SALT(c, salt, patype) \337TRACE(c, "Received salt \"{data}\" via padata type {patype}", salt, \338patype)339#define TRACE_PREAUTH_SKIP(c, name, patype) \340TRACE(c, "Skipping previously used preauth module {str} ({int})", \341name, (int) patype)342#define TRACE_PREAUTH_TRYAGAIN_INPUT(c, patype, padata) \343TRACE(c, "Preauth tryagain input types ({int}): {patypes}", patype, padata)344#define TRACE_PREAUTH_TRYAGAIN(c, name, patype, code) \345TRACE(c, "Preauth module {str} ({int}) tryagain returned: {kerr}", \346name, (int)patype, code)347#define TRACE_PREAUTH_TRYAGAIN_OUTPUT(c, padata) \348TRACE(c, "Followup preauth for next request: {patypes}", padata)349#define TRACE_PREAUTH_WRONG_CONTEXT(c) \350TRACE(c, "Wrong context passed to krb5_init_creds_free(); leaking " \351"modreq objects")352353#define TRACE_PROFILE_ERR(c,subsection, section, retval) \354TRACE(c, "Bad value of {str} from [{str}] in conf file: {kerr}", \355subsection, section, retval)356357#define TRACE_RD_REP(c, ctime, cusec, subkey, seqnum) \358TRACE(c, "Read AP-REP, time {long}.{int}, subkey {keyblock}, " \359"seqnum {int}", (long) ctime, (int) cusec, subkey, (int) seqnum)360#define TRACE_RD_REP_DCE(c, ctime, cusec, seqnum) \361TRACE(c, "Read DCE-style AP-REP, time {long}.{int}, seqnum {int}", \362(long) ctime, (int) cusec, (int) seqnum)363364#define TRACE_RD_REQ_DECRYPT_ANY(c, princ, keyblock) \365TRACE(c, "Decrypted AP-REQ with server principal {princ}: " \366"{keyblock}", princ, keyblock)367#define TRACE_RD_REQ_DECRYPT_SPECIFIC(c, princ, keyblock) \368TRACE(c, "Decrypted AP-REQ with specified server principal {princ}: " \369"{keyblock}", princ, keyblock)370#define TRACE_RD_REQ_DECRYPT_FAIL(c, err) \371TRACE(c, "Failed to decrypt AP-REQ ticket: {kerr}", err)372#define TRACE_RD_REQ_NEGOTIATED_ETYPE(c, etype) \373TRACE(c, "Negotiated enctype based on authenticator: {etype}", \374etype)375#define TRACE_RD_REQ_SUBKEY(c, keyblock) \376TRACE(c, "Authenticator contains subkey: {keyblock}", keyblock)377#define TRACE_RD_REQ_TICKET(c, client, server, keyblock) \378TRACE(c, "AP-REQ ticket: {princ} -> {princ}, session key {keyblock}", \379client, server, keyblock)380381#define TRACE_SENDTO_KDC_ERROR_SET_MESSAGE(c, raddr, err) \382TRACE(c, "Error preparing message to send to {raddr}: {errno}", \383raddr, err)384#define TRACE_SENDTO_KDC(c, len, rlm, primary, tcp) \385TRACE(c, "Sending request ({int} bytes) to {data}{str}{str}", len, \386rlm, (primary) ? " (primary)" : "", (tcp) ? " (tcp only)" : "")387#define TRACE_SENDTO_KDC_K5TLS_LOAD_ERROR(c, ret) \388TRACE(c, "Error loading k5tls module: {kerr}", ret)389#define TRACE_SENDTO_KDC_RESOLVING(c, hostname) \390TRACE(c, "Resolving hostname {str}", hostname)391#define TRACE_SENDTO_KDC_RESPONSE(c, len, raddr) \392TRACE(c, "Received answer ({int} bytes) from {raddr}", len, raddr)393#define TRACE_SENDTO_KDC_HTTPS_ERROR_CONNECT(c, raddr) \394TRACE(c, "HTTPS error connecting to {raddr}", raddr)395#define TRACE_SENDTO_KDC_HTTPS_ERROR_RECV(c, raddr) \396TRACE(c, "HTTPS error receiving from {raddr}", raddr)397#define TRACE_SENDTO_KDC_HTTPS_ERROR_SEND(c, raddr) \398TRACE(c, "HTTPS error sending to {raddr}", raddr)399#define TRACE_SENDTO_KDC_HTTPS_SEND(c, raddr) \400TRACE(c, "Sending HTTPS request to {raddr}", raddr)401#define TRACE_SENDTO_KDC_HTTPS_ERROR(c, errs) \402TRACE(c, "HTTPS error: {str}", errs)403#define TRACE_SENDTO_KDC_TCP_CONNECT(c, raddr) \404TRACE(c, "Initiating TCP connection to {raddr}", raddr)405#define TRACE_SENDTO_KDC_TCP_DISCONNECT(c, raddr) \406TRACE(c, "Terminating TCP connection to {raddr}", raddr)407#define TRACE_SENDTO_KDC_TCP_ERROR_CONNECT(c, raddr, err) \408TRACE(c, "TCP error connecting to {raddr}: {errno}", raddr, err)409#define TRACE_SENDTO_KDC_TCP_ERROR_RECV(c, raddr, err) \410TRACE(c, "TCP error receiving from {raddr}: {errno}", raddr, err)411#define TRACE_SENDTO_KDC_TCP_ERROR_RECV_LEN(c, raddr, err) \412TRACE(c, "TCP error receiving from {raddr}: {errno}", raddr, err)413#define TRACE_SENDTO_KDC_TCP_ERROR_SEND(c, raddr, err) \414TRACE(c, "TCP error sending to {raddr}: {errno}", raddr, err)415#define TRACE_SENDTO_KDC_TCP_SEND(c, raddr) \416TRACE(c, "Sending TCP request to {raddr}", raddr)417#define TRACE_SENDTO_KDC_UDP_ERROR_RECV(c, raddr, err) \418TRACE(c, "UDP error receiving from {raddr}: {errno}", raddr, err)419#define TRACE_SENDTO_KDC_UDP_ERROR_SEND_INITIAL(c, raddr, err) \420TRACE(c, "UDP error sending to {raddr}: {errno}", raddr, err)421#define TRACE_SENDTO_KDC_UDP_ERROR_SEND_RETRY(c, raddr, err) \422TRACE(c, "UDP error sending to {raddr}: {errno}", raddr, err)423#define TRACE_SENDTO_KDC_UDP_SEND_INITIAL(c, raddr) \424TRACE(c, "Sending initial UDP request to {raddr}", raddr)425#define TRACE_SENDTO_KDC_UDP_SEND_RETRY(c, raddr) \426TRACE(c, "Sending retry UDP request to {raddr}", raddr)427428#define TRACE_SEND_TGS_ETYPES(c, etypes) \429TRACE(c, "etypes requested in TGS request: {etypes}", etypes)430#define TRACE_SEND_TGS_SUBKEY(c, keyblock) \431TRACE(c, "Generated subkey for TGS request: {keyblock}", keyblock)432433#define TRACE_TGS_REPLY(c, client, server, keyblock) \434TRACE(c, "TGS reply is for {princ} -> {princ} with session key " \435"{keyblock}", client, server, keyblock)436#define TRACE_TGS_REPLY_DECODE_SESSION(c, keyblock) \437TRACE(c, "TGS reply didn't decode with subkey; trying session key " \438"({keyblock)}", keyblock)439440#define TRACE_TLS_ERROR(c, errs) \441TRACE(c, "TLS error: {str}", errs)442#define TRACE_TLS_NO_REMOTE_CERTIFICATE(c) \443TRACE(c, "TLS server certificate not received")444#define TRACE_TLS_CERT_ERROR(c, depth, namelen, name, err, errs) \445TRACE(c, "TLS certificate error at {int} ({lenstr}): {int} ({str})", \446depth, namelen, name, err, errs)447#define TRACE_TLS_SERVER_NAME_MISMATCH(c, hostname) \448TRACE(c, "TLS certificate name mismatch: server certificate is " \449"not for \"{str}\"", hostname)450#define TRACE_TLS_SERVER_NAME_MATCH(c, hostname) \451TRACE(c, "TLS certificate name matched \"{str}\"", hostname)452453#define TRACE_TKT_CREDS(c, creds, cache) \454TRACE(c, "Getting credentials {creds} using ccache {ccache}", \455creds, cache)456#define TRACE_TKT_CREDS_ADVANCE(c, realm) \457TRACE(c, "Received TGT for {data}; advancing current realm", realm)458#define TRACE_TKT_CREDS_CACHED_INTERMEDIATE_TGT(c, tgt) \459TRACE(c, "Found cached TGT for intermediate realm: {creds}", tgt)460#define TRACE_TKT_CREDS_CACHED_SERVICE_TGT(c, tgt) \461TRACE(c, "Found cached TGT for service realm: {creds}", tgt)462#define TRACE_TKT_CREDS_CLOSER_REALM(c, realm) \463TRACE(c, "Trying next closer realm in path: {data}", realm)464#define TRACE_TKT_CREDS_COMPLETE(c, princ) \465TRACE(c, "Received creds for desired service {princ}", princ)466#define TRACE_TKT_CREDS_FALLBACK(c, realm) \467TRACE(c, "Local realm referral failed; trying fallback realm {data}", \468realm)469#define TRACE_TKT_CREDS_LOCAL_TGT(c, tgt) \470TRACE(c, "Starting with TGT for client realm: {creds}", tgt)471#define TRACE_TKT_CREDS_NON_TGT(c, princ) \472TRACE(c, "Received non-TGT referral response ({princ}); trying " \473"again without referrals", princ)474#define TRACE_TKT_CREDS_OFFPATH(c, realm) \475TRACE(c, "Received TGT for offpath realm {data}", realm)476#define TRACE_TKT_CREDS_REFERRAL(c, princ) \477TRACE(c, "Following referral TGT {princ}", princ)478#define TRACE_TKT_CREDS_REFERRAL_REALM(c, princ) \479TRACE(c, "Server has referral realm; starting with {princ}", princ)480#define TRACE_TKT_CREDS_RESPONSE_CODE(c, code) \481TRACE(c, "TGS request result: {kerr}", code)482#define TRACE_TKT_CREDS_RETRY_TCP(c) \483TRACE(c, "Request or response is too big for UDP; retrying with TCP")484#define TRACE_TKT_CREDS_SAME_REALM_TGT(c, realm) \485TRACE(c, "Received TGT referral back to same realm ({data}); trying " \486"again without referrals", realm)487#define TRACE_TKT_CREDS_SERVICE_REQ(c, princ, referral) \488TRACE(c, "Requesting tickets for {princ}, referrals {str}", princ, \489(referral) ? "on" : "off")490#define TRACE_TKT_CREDS_TARGET_TGT(c, princ) \491TRACE(c, "Received TGT for service realm: {princ}", princ)492#define TRACE_TKT_CREDS_TARGET_TGT_OFFPATH(c, princ) \493TRACE(c, "Received TGT for service realm: {princ}", princ)494#define TRACE_TKT_CREDS_TGT_REQ(c, next, cur) \495TRACE(c, "Requesting TGT {princ} using TGT {princ}", next, cur)496#define TRACE_TKT_CREDS_WRONG_ENCTYPE(c) \497TRACE(c, "Retrying TGS request with desired service ticket enctypes")498499#define TRACE_TXT_LOOKUP_NOTFOUND(c, host) \500TRACE(c, "TXT record {str} not found", host)501#define TRACE_TXT_LOOKUP_SUCCESS(c, host, realm) \502TRACE(c, "TXT record {str} found: {str}", host, realm)503504#define TRACE_CHECK_REPLY_SERVER_DIFFERS(c, request, reply) \505TRACE(c, "Reply server {princ} differs from requested {princ}", \506reply, request)507508#define TRACE_GET_CRED_VIA_TKT_EXT(c, request, reply, kdcoptions) \509TRACE(c, "Get cred via TGT {princ} after requesting {princ} " \510"(canonicalize {str})", \511reply, request, (kdcoptions & KDC_OPT_CANONICALIZE) ? "on" : "off")512#define TRACE_GET_CRED_VIA_TKT_EXT_RETURN(c, ret) \513TRACE(c, "Got cred; {kerr}", ret)514515#define TRACE_KDCPOLICY_VTINIT_FAIL(c, ret) \516TRACE(c, "KDC policy module failed to init vtable: {kerr}", ret)517#define TRACE_KDCPOLICY_INIT_SKIP(c, name) \518TRACE(c, "kadm5_auth module {str} declined to initialize", name)519520#endif /* K5_TRACE_H */521522523