Path: blob/main/crypto/krb5/src/plugins/preauth/spake/trace.h
34907 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* plugins/preauth/spake/internal.h - SPAKE internal function declarations */2/*3* Copyright (C) 2015 by the Massachusetts Institute of Technology.4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9*10* * Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12*13* * Redistributions in binary form must reproduce the above copyright14* notice, this list of conditions and the following disclaimer in15* the documentation and/or other materials provided with the16* distribution.17*18* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS21* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE22* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,23* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES24* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR25* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)26* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,27* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)28* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED29* OF THE POSSIBILITY OF SUCH DAMAGE.30*/3132#ifndef TRACE_H33#define TRACE_H3435#include "k5-int.h"3637/*38* Possible improvements at the cost of more code:39* - Groups could be displayed by name instead of number40* - We could display the group list when tracing support messages41*/4243#define TRACE_SPAKE_CLIENT_THASH(c, thash) \44TRACE(c, "SPAKE final transcript hash: {hexdata}", thash)45#define TRACE_SPAKE_DERIVE_KEY(c, n, kb) \46TRACE(c, "SPAKE derived K'[{int}] = {keyblock}", n, kb)47#define TRACE_SPAKE_KDC_THASH(c, thash) \48TRACE(c, "SPAKE final transcript hash: {hexdata}", thash)49#define TRACE_SPAKE_KEYGEN(c, pubkey) \50TRACE(c, "SPAKE key generated with pubkey {hexdata}", pubkey)51#define TRACE_SPAKE_RECEIVE_CHALLENGE(c, group, pubkey) \52TRACE(c, "SPAKE challenge received with group {int}, pubkey {hexdata}", \53group, pubkey)54#define TRACE_SPAKE_RECEIVE_RESPONSE(c, pubkey) \55TRACE(c, "SPAKE response received with pubkey {hexdata}", pubkey)56#define TRACE_SPAKE_RECEIVE_SUPPORT(c, group) \57TRACE(c, "SPAKE support message received, selected group {int}", group)58#define TRACE_SPAKE_REJECT_CHALLENGE(c, group) \59TRACE(c, "SPAKE challenge with group {int} rejected", (int)group)60#define TRACE_SPAKE_REJECT_SUPPORT(c) \61TRACE(c, "SPAKE support message rejected")62#define TRACE_SPAKE_RESULT(c, result) \63TRACE(c, "SPAKE algorithm result: {hexdata}", result)64#define TRACE_SPAKE_SEND_CHALLENGE(c, group) \65TRACE(c, "Sending SPAKE challenge with group {int}", group)66#define TRACE_SPAKE_SEND_RESPONSE(c) \67TRACE(c, "Sending SPAKE response")68#define TRACE_SPAKE_SEND_SUPPORT(c) \69TRACE(c, "Sending SPAKE support message")70#define TRACE_SPAKE_UNKNOWN_GROUP(c, name) \71TRACE(c, "Unrecognized SPAKE group name: {str}", name)7273#endif /* TRACE_H */747576