/*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
#ifndef OPENSSL_TRACE_H
# define OPENSSL_TRACE_H
+# pragma once
# include <stdarg.h>
# define OSSL_TRACE_CATEGORY_STORE 14
# define OSSL_TRACE_CATEGORY_DECODER 15
# define OSSL_TRACE_CATEGORY_ENCODER 16
-# define OSSL_TRACE_CATEGORY_NUM 17
+# define OSSL_TRACE_CATEGORY_REF_COUNT 17
+/* Count of available categories. */
+# define OSSL_TRACE_CATEGORY_NUM 18
/* Returns the trace category number for the given |name| */
int OSSL_trace_get_category_num(const char *name);
* call OSSL_TRACE_CANCEL(category).
*/
-# ifndef OPENSSL_NO_TRACE
+# if !defined OPENSSL_NO_TRACE && !defined FIPS_MODULE
# define OSSL_TRACE_BEGIN(category) \
do { \
* ...
* }
*/
-# ifndef OPENSSL_NO_TRACE
+# if !defined OPENSSL_NO_TRACE && !defined FIPS_MODULE
# define OSSL_TRACE_ENABLED(category) \
OSSL_trace_enabled(OSSL_TRACE_CATEGORY_##category)
* 42, "What do you get when you multiply six by nine?");
*/
-# define OSSL_TRACEV(category, args) \
+# if !defined OPENSSL_NO_TRACE && !defined FIPS_MODULE
+
+# define OSSL_TRACEV(category, args) \
OSSL_TRACE_BEGIN(category) \
BIO_printf args; \
OSSL_TRACE_END(category)
+# else
+
+# define OSSL_TRACEV(category, args) ((void)0)
+
+# endif
+
# define OSSL_TRACE(category, text) \
OSSL_TRACEV(category, (trc_out, "%s", text))
OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7))
# define OSSL_TRACE8(category, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8))
-# define OSSL_TRACE9(category, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
+# define OSSL_TRACE9(category, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9))
# ifdef __cplusplus