PQS: Post Quantum Shell Protocol 1.1.0.0a (A2)
A quantum secure secure shell protocol
pqslogger.h
Go to the documentation of this file.
1/* 2025-2026 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE:
5 * This software and all accompanying materials are the exclusive property of
6 * Quantum Resistant Cryptographic Solutions Corporation (QRCS). The intellectual
7 * and technical concepts contained herein are proprietary to QRCS and are
8 * protected under applicable Canadian, U.S., and international copyright,
9 * patent, and trade secret laws.
10 *
11 * CRYPTOGRAPHIC ALGORITHMS AND IMPLEMENTATIONS:
12 * - This software includes implementations of cryptographic primitives and
13 * algorithms that are standardized or in the public domain, such as AES
14 * and SHA-3, which are not proprietary to QRCS.
15 * - This software also includes cryptographic primitives, constructions, and
16 * algorithms designed by QRCS, including but not limited to RCS, SCB, CSX, QMAC, and
17 * related components, which are proprietary to QRCS.
18 * - All source code, implementations, protocol compositions, optimizations,
19 * parameter selections, and engineering work contained in this software are
20 * original works of QRCS and are protected under this license.
21 *
22 * LICENSE AND USE RESTRICTIONS:
23 * - This software is licensed under the Quantum Resistant Cryptographic Solutions
24 * Public Research and Evaluation License (QRCS-PREL), 2025-2026.
25 * - Permission is granted solely for non-commercial evaluation, academic research,
26 * cryptographic analysis, interoperability testing, and feasibility assessment.
27 * - Commercial use, production deployment, commercial redistribution, or
28 * integration into products or services is strictly prohibited without a
29 * separate written license agreement executed with QRCS.
30 * - Licensing and authorized distribution are solely at the discretion of QRCS.
31 *
32 * EXPERIMENTAL CRYPTOGRAPHY NOTICE:
33 * Portions of this software may include experimental, novel, or evolving
34 * cryptographic designs. Use of this software is entirely at the user's risk.
35 *
36 * DISCLAIMER:
37 * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38 * IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
39 * FOR A PARTICULAR PURPOSE, SECURITY, OR NON-INFRINGEMENT. QRCS DISCLAIMS ALL
40 * LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
41 * ARISING FROM THE USE OR MISUSE OF THIS SOFTWARE.
42 *
43 * FULL LICENSE:
44 * This software is subject to the Quantum Resistant Cryptographic Solutions
45 * Public Research and Evaluation License (QRCS-PREL), 2025-2026. The complete license terms
46 * are provided in the accompanying LICENSE file or at https://www.qrcscorp.ca.
47 *
48 * Written by: John G. Underhill
49 * Contact: contact@qrcscorp.ca
50 */
51
52#ifndef PQS_LOGGER_H
53#define PQS_LOGGER_H
54
55#include "pqscommon.h"
56
61
65#define PQS_LOGGER_LINE_MAX 1536U
66
70#define PQS_LOGGER_USER_MAX 64U
71
75#define PQS_LOGGER_DETAIL_MAX 384U
76
89
93PQS_EXPORT_API typedef enum pqs_log_event
94{
145
149PQS_EXPORT_API void pqs_logger_dispose(void);
150
159PQS_EXPORT_API bool pqs_logger_initialize(const char* path, pqs_log_level level);
160
166PQS_EXPORT_API bool pqs_logger_is_initialized(void);
167
173PQS_EXPORT_API bool pqs_logger_failure_occurred(void);
174
183PQS_EXPORT_API bool pqs_logger_verify_chain(const char* path, uint64_t* records);
184
196PQS_EXPORT_API bool pqs_logger_write(pqs_log_level level, pqs_log_event event, const char* user, const char* peer, const char* detail);
197
198#endif
pqs_log_level
The PQS log severity levels.
Definition pqslogger.h:81
@ pqs_log_level_debug
Definition pqslogger.h:87
@ pqs_log_level_error
Definition pqslogger.h:83
@ pqs_log_level_info
Definition pqslogger.h:85
@ pqs_log_level_audit
Definition pqslogger.h:86
@ pqs_log_level_warning
Definition pqslogger.h:84
@ pqs_log_level_none
Definition pqslogger.h:82
PQS_EXPORT_API bool pqs_logger_initialize(const char *path, pqs_log_level level)
Initialize the PQS file logger.
Definition pqslogger.c:535
PQS_EXPORT_API bool pqs_logger_write(pqs_log_level level, pqs_log_event event, const char *user, const char *peer, const char *detail)
Write a structured PQS log event.
Definition pqslogger.c:656
PQS_EXPORT_API bool pqs_logger_failure_occurred(void)
Test whether a logger write failure has occurred since initialization.
Definition pqslogger.c:576
PQS_EXPORT_API bool pqs_logger_verify_chain(const char *path, uint64_t *records)
Verify the tamper-evident PQS audit-log chain.
Definition pqslogger.c:581
pqs_log_event
The PQS structured log event identifiers.
Definition pqslogger.h:94
@ pqs_log_event_protocol_error
Definition pqslogger.h:137
@ pqs_log_event_connection_refused
Definition pqslogger.h:102
@ pqs_log_event_key_generated
Definition pqslogger.h:99
@ pqs_log_event_user_removed
Definition pqslogger.h:112
@ pqs_log_event_admin_allowed
Definition pqslogger.h:139
@ pqs_log_event_admin_denied
Definition pqslogger.h:140
@ pqs_log_event_user_database_created
Definition pqslogger.h:110
@ pqs_log_event_auth_lockout
Definition pqslogger.h:108
@ pqs_log_event_shell_database_loaded
Definition pqslogger.h:114
@ pqs_log_event_command_received
Definition pqslogger.h:103
@ pqs_log_event_connection_open
Definition pqslogger.h:100
@ pqs_log_event_policy_removed
Definition pqslogger.h:122
@ pqs_log_event_policy_database_created
Definition pqslogger.h:120
@ pqs_log_event_shell_updated
Definition pqslogger.h:118
@ pqs_log_event_user_updated
Definition pqslogger.h:113
@ pqs_log_event_sandbox_violation
Definition pqslogger.h:131
@ pqs_log_event_user_added
Definition pqslogger.h:111
@ pqs_log_event_hostkey_loaded
Definition pqslogger.h:126
@ pqs_log_event_command_timeout
Definition pqslogger.h:132
@ pqs_log_event_command_complete
Definition pqslogger.h:104
@ pqs_log_event_audit_chain_start
Definition pqslogger.h:143
@ pqs_log_event_application_stop
Definition pqslogger.h:97
@ pqs_log_event_shell_database_created
Definition pqslogger.h:115
@ pqs_log_event_policy_updated
Definition pqslogger.h:123
@ pqs_log_event_hostkey_pinned
Definition pqslogger.h:127
@ pqs_log_event_auth_success
Definition pqslogger.h:106
@ pqs_log_event_key_loaded
Definition pqslogger.h:98
@ pqs_log_event_auth_failure
Definition pqslogger.h:107
@ pqs_log_event_hostkey_verified
Definition pqslogger.h:128
@ pqs_log_event_admin_complete
Definition pqslogger.h:141
@ pqs_log_event_none
Definition pqslogger.h:95
@ pqs_log_event_command_output_limit
Definition pqslogger.h:133
@ pqs_log_event_connection_close
Definition pqslogger.h:101
@ pqs_log_event_policy_denied
Definition pqslogger.h:125
@ pqs_log_event_command_failed
Definition pqslogger.h:105
@ pqs_log_event_sandbox_enabled
Definition pqslogger.h:130
@ pqs_log_event_policy_added
Definition pqslogger.h:121
@ pqs_log_event_policy_allowed
Definition pqslogger.h:124
@ pqs_log_event_admin_failed
Definition pqslogger.h:142
@ pqs_log_event_hostkey_changed
Definition pqslogger.h:129
@ pqs_log_event_policy_database_loaded
Definition pqslogger.h:119
@ pqs_log_event_user_database_loaded
Definition pqslogger.h:109
@ pqs_log_event_file_transfer_start
Definition pqslogger.h:134
@ pqs_log_event_file_transfer_complete
Definition pqslogger.h:135
@ pqs_log_event_application_start
Definition pqslogger.h:96
@ pqs_log_event_admin_request
Definition pqslogger.h:138
@ pqs_log_event_file_transfer_failed
Definition pqslogger.h:136
@ pqs_log_event_shell_added
Definition pqslogger.h:116
@ pqs_log_event_shell_removed
Definition pqslogger.h:117
PQS_EXPORT_API bool pqs_logger_is_initialized(void)
Test if the logger has been initialized.
Definition pqslogger.c:571
PQS_EXPORT_API void pqs_logger_dispose(void)
Dispose of the PQS logger state.
Definition pqslogger.c:525