-
Notifications
You must be signed in to change notification settings - Fork 0
feat!: the OpenSSL stream asks a credentials source for its material #799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DavidCozens
merged 9 commits into
feature/tls-rework
from
feat/openssl-pem-file-credentials
Sep 1, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e6f63f8
feat: draw a PEM-file credentials instance from the pool
DavidCozens 89050a5
feat: report a NULL PEM-file credentials configuration
DavidCozens d3aaffb
feat: report pool exhaustion and an unknown destroy for PEM-file cred…
DavidCozens d4ec3d6
feat: install trust anchors from a PEM file, and report one that will…
DavidCozens 60e9b00
feat: present a PEM-file client credential, and report one that will …
DavidCozens 3825e0d
feat!: the OpenSSL stream takes its credentials from the credentials …
DavidCozens 81056bb
docs: describe where the OpenSSL adapter's credentials come from
DavidCozens f3e90de
refactor: name the PEM-file credentials downcast, as every other clas…
DavidCozens f340fdd
fix: correct the OpenSSL setup page, and the stale MISRA suppression …
DavidCozens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Platform/OpenSsl/Interface/SolidSyslogOpenSslPemFileCredentials.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited | ||
| * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial | ||
| */ | ||
|
|
||
| /** @file | ||
| * An OpenSSL credentials backend that names its material by file path, and | ||
| * hands those paths to OpenSSL to open and parse. This library performs no | ||
| * file handling of its own: it neither opens, reads, parses nor buffers the | ||
| * PEM, so key bytes never pass through it. | ||
| * | ||
| * Paths are re-read on every connection, so a device issued new credentials | ||
| * while it is running uses them on its next connect without a restart. */ | ||
| #ifndef SOLIDSYSLOGOPENSSLPEMFILECREDENTIALS_H | ||
| #define SOLIDSYSLOGOPENSSLPEMFILECREDENTIALS_H | ||
|
|
||
| #include "SolidSyslogExternC.h" | ||
|
|
||
| SOLIDSYSLOG_EXTERN_C_BEGIN | ||
|
|
||
| struct SolidSyslogOpenSslCredentials; | ||
|
|
||
| /** Where this backend's material lives. Every member is a path the caller | ||
| * owns and must keep valid for the lifetime of the credentials. */ | ||
| struct SolidSyslogOpenSslPemFileCredentialsConfig | ||
| { | ||
| /** PEM file of trust anchors the peer certificate must chain to; NULL | ||
| * installs none, which leaves the peer authorised only if the stream | ||
| * has another means to do it. */ | ||
| const char* CaBundlePath; | ||
| /** PEM leaf certificate (plus intermediates) for mutual TLS; NULL means | ||
| * no client credential. Certificate and key are all-or-nothing - | ||
| * supplying one without the other is reported. */ | ||
| const char* ClientCertChainPath; | ||
| /** PEM private key matching ClientCertChainPath; NULL means no client | ||
| * credential. */ | ||
| const char* ClientKeyPath; | ||
| }; | ||
|
|
||
| /** Draw a credentials instance from the pool. A NULL config is reported and | ||
| * falls back to the shared Null credentials, as does an exhausted pool. */ | ||
| struct SolidSyslogOpenSslCredentials* SolidSyslogOpenSslPemFileCredentials_Create( | ||
| const struct SolidSyslogOpenSslPemFileCredentialsConfig* config | ||
| ); | ||
| /** Release the pool slot. */ | ||
| void SolidSyslogOpenSslPemFileCredentials_Destroy(struct SolidSyslogOpenSslCredentials * base); | ||
|
|
||
| SOLIDSYSLOG_EXTERN_C_END | ||
|
|
||
| #endif /* SOLIDSYSLOGOPENSSLPEMFILECREDENTIALS_H */ | ||
39 changes: 39 additions & 0 deletions
39
Platform/OpenSsl/Interface/SolidSyslogOpenSslPemFileCredentialsErrors.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited | ||
| * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial | ||
| */ | ||
|
|
||
| /** @file | ||
| * Error codes and Source identity for the OpenSslPemFileCredentials backend. */ | ||
| #ifndef SOLIDSYSLOGOPENSSLPEMFILECREDENTIALSERRORS_H | ||
| #define SOLIDSYSLOGOPENSSLPEMFILECREDENTIALSERRORS_H | ||
|
|
||
| #include "SolidSyslogExternC.h" | ||
|
|
||
| SOLIDSYSLOG_EXTERN_C_BEGIN | ||
|
|
||
| struct SolidSyslogErrorSource; | ||
|
|
||
| /** Detail codes for events whose Source is OpenSslPemFileCredentialsErrorSource. | ||
| * A handler reads these off event->Detail after matching event->Source; the | ||
| * members name their own fault. */ | ||
| enum SolidSyslogOpenSslPemFileCredentialsErrors | ||
| { | ||
| SOLIDSYSLOG_OPENSSL_PEM_FILE_CREDENTIALS_ERROR_POOL_EXHAUSTED, | ||
| SOLIDSYSLOG_OPENSSL_PEM_FILE_CREDENTIALS_ERROR_UNKNOWN_DESTROY, | ||
| SOLIDSYSLOG_OPENSSL_PEM_FILE_CREDENTIALS_ERROR_NULL_CONFIG, | ||
| SOLIDSYSLOG_OPENSSL_PEM_FILE_CREDENTIALS_ERROR_TRUST_ANCHORS_NOT_LOADED, | ||
| SOLIDSYSLOG_OPENSSL_PEM_FILE_CREDENTIALS_ERROR_CLIENT_CREDENTIAL_INCOMPLETE, | ||
| SOLIDSYSLOG_OPENSSL_PEM_FILE_CREDENTIALS_ERROR_CLIENT_CREDENTIAL_MISMATCHED, | ||
| SOLIDSYSLOG_OPENSSL_PEM_FILE_CREDENTIALS_ERROR_CLIENT_CREDENTIAL_NOT_INSTALLED, | ||
| SOLIDSYSLOG_OPENSSL_PEM_FILE_CREDENTIALS_ERROR_MAX /**< One past the last code; never emitted. Bounds the range for iteration. */ | ||
| }; | ||
|
|
||
| /** Identity for events raised by an OpenSslPemFileCredentials. A handler | ||
| * matches by address (event->Source == &OpenSslPemFileCredentialsErrorSource), | ||
| * then reads event->Detail as an enum | ||
| * SolidSyslogOpenSslPemFileCredentialsErrors. */ | ||
| extern const struct SolidSyslogErrorSource OpenSslPemFileCredentialsErrorSource; | ||
|
|
||
| SOLIDSYSLOG_EXTERN_C_END | ||
|
|
||
| #endif /* SOLIDSYSLOGOPENSSLPEMFILECREDENTIALSERRORS_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.