Line data Source code
1 : /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited
2 : * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial
3 : */
4 :
5 : #ifndef SOLIDSYSLOGMBEDTLSHMACSHA256POLICYPRIVATE_H
6 : #define SOLIDSYSLOGMBEDTLSHMACSHA256POLICYPRIVATE_H
7 :
8 : #include <stdbool.h>
9 : #include <stdint.h>
10 :
11 : #include "SolidSyslogError.h"
12 : #include "SolidSyslogMbedTlsHmacSha256Policy.h"
13 : #include "SolidSyslogMbedTlsHmacSha256PolicyErrors.h"
14 : #include "SolidSyslogPrival.h"
15 : #include "SolidSyslogSecurityPolicyDefinition.h"
16 :
17 : struct SolidSyslogMbedTlsHmacSha256Policy
18 : {
19 : struct SolidSyslogSecurityPolicy Base;
20 : struct SolidSyslogMbedTlsHmacSha256PolicyConfig Config;
21 : bool FaultReported; /* A run of faults is reported once; a verdict re-arms it. */
22 : };
23 :
24 : void SolidSyslogMbedTlsHmacSha256Policy_Initialise(
25 : struct SolidSyslogSecurityPolicy* base,
26 : const struct SolidSyslogMbedTlsHmacSha256PolicyConfig* config
27 : );
28 : void SolidSyslogMbedTlsHmacSha256Policy_Cleanup(struct SolidSyslogSecurityPolicy* base);
29 :
30 29 : static inline void MbedTlsHmacSha256Policy_Report(
31 : enum SolidSyslogSeverity severity,
32 : uint16_t category,
33 : enum SolidSyslogHmacSha256PolicyErrors code
34 : )
35 : {
36 29 : SolidSyslog_Error(severity, &SolidSyslogMbedTlsHmacSha256PolicyErrorSource, category, (int32_t) code);
37 29 : }
38 :
39 : #endif /* SOLIDSYSLOGMBEDTLSHMACSHA256POLICYPRIVATE_H */
|