-
Notifications
You must be signed in to change notification settings - Fork 0
feat: S3.7 walking skeleton — SolidSyslogTlsStream (OpenSSL) + TLS BDD #170
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
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4ff6ec1
S3.7 phase 1 — BDD TLS infrastructure
DavidCozens 1c6868e
S3.7 series A: Stream gains Read
DavidCozens 39743ab
S3.7 series A hardening: recv arg capture + fd reset on Destroy
DavidCozens 089b278
S3.7 cycle A5: Destroy closes an open socket
DavidCozens 96e8fc5
S3.7 series B: StreamFake for TLS-transport-under-test injection
DavidCozens c6186f0
S3.7 series C cycles 1-7: TlsStream skeleton in Platform/OpenSsl
DavidCozens f77abb5
S3.7 series C cycles 8-10: BIO-based TLS I/O + handshake
DavidCozens 37809b8
S3.7 series C cycles 11-15: hostname, SNI, BIO callbacks
DavidCozens eb5e9e9
S3.7 series C cycles 16-18: Send, Close, Destroy on TlsStream
DavidCozens a68b5f6
S3.7 fake + test hardening: every arg captured, every chain verified
DavidCozens c39d8b0
S3.7 error-path cycles E1-E3: Open+Send failure handling
DavidCozens bd75228
S3.7 phase 3: Example/Threaded wires TLS, links real libssl
DavidCozens 1d45bde
S3.7 cycle P7: invoke-and-assert tests for BIO ctrl + create
DavidCozens c1c7608
S3.7 final gauntlet: BDD un-wip + preset fixes
DavidCozens 790da74
S3.7: address CodeRabbit review
DavidCozens 3a8ef91
S3.7: propagate OPENSSL_INCLUDE_DIR to test code
DavidCozens f51d18b
S3.7: split OpenSslFake into its own library
DavidCozens a816598
S3.7: compile SolidSyslogStream.c when either POSIX or OpenSSL is on
DavidCozens 0e3f306
S3.7: CodeRabbit follow-ups — CMake fail-fast + uint16_t ports
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| @tls @buffered | ||
| Feature: TLS message delivery | ||
| The threaded example sends messages via TLS transport (RFC 5425) — | ||
| RFC 6587 octet-counting framing over TLS — to syslog-ng. | ||
|
|
||
| Scenario: Message delivered over TLS | ||
| Given syslog-ng is running | ||
| When the threaded example sends a syslog message with transport tls | ||
| Then syslog-ng receives 1 message over tls | ||
| And syslog-ng receives a message with priority "134" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # BDD TLS test material | ||
|
|
||
| **TEST ONLY.** These keys and certificates exist solely to drive the BDD TLS | ||
| scenarios (`Bdd/features/tls_transport.feature` et al.) against syslog-ng | ||
| running in a BDD compose container. They must never be used for any purpose | ||
| that touches real data. | ||
|
|
||
| | File | Role | | ||
| |---|---| | ||
| | `ca.key` | Test CA private key. Signs the server cert. | | ||
| | `ca.pem` | Test CA certificate. Bundled into the example binary via `--tls-ca`. | | ||
| | `server.key` | syslog-ng server private key. | | ||
| | `server.pem` | syslog-ng server certificate, signed by the test CA. SANs: `syslog-ng`, `localhost`, `127.0.0.1`. | | ||
|
|
||
| Validity is 10 years from generation, so these effectively never expire for | ||
| test purposes. | ||
|
|
||
| ## Regenerating | ||
|
|
||
| Run `./generate.sh` from this directory (or the repo root). Commit the | ||
| regenerated files — the BDD suite pins them. |
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,27 @@ | ||
| -----BEGIN RSA PRIVATE KEY----- | ||
| MIIEowIBAAKCAQEAx7LsZX3e+F+FyFqO2epTfguBgXfS1uPwiQOesW5WSBDLuhsk | ||
| FC2THwM/c7vxRQvIZ9hnOpJgi3e8of4lX+rSNg0viYxkrsk/S3SyKp/Qhzu7Eee8 | ||
| Cc+NfD+no8uF43gw3XfzX17NWVMTGBJOj3eC4xl/c9u0fApoljYv92Ifsc7TCaud | ||
| OHkUBlEBrR9b6bpy+GPDCe26rtG76NwKf+6B0t8IawNjbLDCovFCC9k8ymlTIktt | ||
| v9P32J1FgZ18M0FBowA1CrLyCoGNa9loyfUz4Qhje3CG/fUeMLoAOvIWsixBVH3X | ||
| MHlGyyJSpK1soBMgs9o+YBnwZatNvl+PQcm3XwIDAQABAoIBAG5Bw3Nlw62uT9cG | ||
| 6Mg4MFDvWVl6JtaukyeS8BNWsByp6VGfmpPpdckxqd7kbZmJn+R1/si/+L4IJgXq | ||
| pAgJRnbBYPW4pf467s9iZtxR0HhZ6jdAkvl3ts5a9tvgitPEkHY2vBBz7zzaOTiZ | ||
| IvbjLUjl0xDMxSGXPZdx45nae1VXuLIpvFVGcSs9830TqjK/hGu/rIoO2JC/MfUe | ||
| 3roal/xYOatCjGtEM86zO3xdxmMnCP8Ei8xsRBY+ygDAzi+9D6L7l3rjp4gPkixC | ||
| EL6zueOJpYulYWoIQTV9pKfB00MlZdUs5oMkuZcmP5/Mxx5nzILpHBV2Yj9xY26n | ||
| n7lFO4ECgYEA/VqXPAWzREnlHnKxe+gLRNPcRFASvrNFT65JhMRzeUAwvEBCBV15 | ||
| 1a2ECeBwU2wvGP23usIkYzJD8C4PZ9dne0PTR9lnEFipZ7DyBj9ODBcuP3QRax3c | ||
| XPWgTHbU9A++65XBaLb31khKE/4Wzc20+3qjqnQPLekDnoePcQe/cJcCgYEAycjf | ||
| L8s7fjh+dhUxUY598cjPF2tiaJmiBlGovSLvca+aDIY/P0jimUixAqESS3LZEqZv | ||
| Dy9SwPMT4kM8BIHOWJ/1jgC2NxPEms69hb27EwWKKGf3YfMosWYfzL6w5T7On2tm | ||
| 8KdFlImjRrOhuLjK2kQ12WE+Cn87nY4C5j5OgHkCgYEAuS8hQgcsnGqi5VmSL25R | ||
| 5lIxO2GIAgoJTI+pPzlU6jioJsGVQFSt/CijTZDWqbN2zX6OcBz9+d/A1urj6dQB | ||
| 2JCf+3GGKuWTla45iaV2B9JdxJWzMaeW7f+/1oQ5bdeghpRk1YR/rQoT038y7eVB | ||
| N1vSC4JfogAi3BpcF5NBNCsCgYAfSpIpxDdmnHYn86NhRVqMixpqRFHPbLuuhS1I | ||
| n0lIdPXLqWnXc4MISDiC8t12a8nz1XF1hl4r48YamViOTl7kaXHX4o5fPiaH5zWG | ||
| ruR6z6ocF/tJ6j5OPEsEIjImarX6DNq6yQXGQg3a4fJbRfTXIirDmgvX7uEczq/u | ||
| ao0b6QKBgHRDraREe/cLd05y2X30b7HeBK1SCweHYsOU3TdtHP6Nyn12kgy/Il9w | ||
| e50GEcRci16Km0wfclFtj8QsOqOYcr2P180INoXqeZgnHi2MmoeXTV7LJUEpYSOC | ||
| mPWTDihHP0q0x/RAzd8ynm51qK4Pghs8C5SWOY9Azl9dSKHDBOSe | ||
| -----END RSA PRIVATE KEY----- |
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,19 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIDJTCCAg2gAwIBAgIUa9bOdOquPzUXvg4/X1St4bHQuRAwDQYJKoZIhvcNAQEL | ||
| BQAwIjEgMB4GA1UEAwwXU29saWRTeXNsb2cgQkREIFRlc3QgQ0EwHhcNMjYwNDIw | ||
| MTcwODQxWhcNMzYwNDE3MTcwODQxWjAiMSAwHgYDVQQDDBdTb2xpZFN5c2xvZyBC | ||
| REQgVGVzdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMey7GV9 | ||
| 3vhfhchajtnqU34LgYF30tbj8IkDnrFuVkgQy7obJBQtkx8DP3O78UULyGfYZzqS | ||
| YIt3vKH+JV/q0jYNL4mMZK7JP0t0siqf0Ic7uxHnvAnPjXw/p6PLheN4MN13819e | ||
| zVlTExgSTo93guMZf3PbtHwKaJY2L/diH7HO0wmrnTh5FAZRAa0fW+m6cvhjwwnt | ||
| uq7Ru+jcCn/ugdLfCGsDY2ywwqLxQgvZPMppUyJLbb/T99idRYGdfDNBQaMANQqy | ||
| 8gqBjWvZaMn1M+EIY3twhv31HjC6ADryFrIsQVR91zB5RssiUqStbKATILPaPmAZ | ||
| 8GWrTb5fj0HJt18CAwEAAaNTMFEwHQYDVR0OBBYEFKvZn0img6757QgOS6J9X79x | ||
| 79NZMB8GA1UdIwQYMBaAFKvZn0img6757QgOS6J9X79x79NZMA8GA1UdEwEB/wQF | ||
| MAMBAf8wDQYJKoZIhvcNAQELBQADggEBAKfFmKPcsrVxmJZNuWwXPM4M5okzcpNP | ||
| 2PQt+lGC7x60FLlfySAKtnyyYSddHRPgNQELmcKYulpDJj5eYrhWUwdqukra1B2s | ||
| bv4bz8UUIYPrc4hvLdLKs5+iLmM9rzioKI9Dq5+r5dlxR5hK2CfOnzyjPb6/rzIy | ||
| nxSRsVrAkGUqfi1BH4poWAtwY00A3zxehcYZNtwgNKqVrj9rE0gLl0DSR3W6dABa | ||
| q0whWUJQsB9cRSLwxrxiLAU95NzdOmgdcrswYptSZHtSXYdS8mBf31cQNHvjAvn8 | ||
| yR1xGaLsJ0E6F+z70kx22KzTkvwavcx4mukm6PVJisqVDulz579+7C4= | ||
| -----END CERTIFICATE----- |
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,42 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Regenerates the test-only self-signed CA + syslog-ng server cert used by the | ||
| # TLS BDD scenarios. Keys in this directory are FOR TESTING ONLY — never use | ||
| # them for anything that touches real data. | ||
| # | ||
| # Run from the repo root: ./Bdd/syslog-ng/tls/generate.sh | ||
| # Or from this directory: ./generate.sh | ||
| # | ||
| # Validity is 10 years so the certs effectively never expire for test purposes. | ||
| # If you regenerate, commit the changes — the BDD suite pins these files. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| cd "$(dirname "$0")" | ||
|
|
||
| DAYS=3650 | ||
| SUBJECT_CA="/CN=SolidSyslog BDD Test CA" | ||
| SUBJECT_SRV="/CN=syslog-ng" | ||
| SAN="subjectAltName = DNS:syslog-ng, DNS:localhost, IP:127.0.0.1" | ||
|
|
||
| # 1. CA key + self-signed CA cert | ||
| openssl genrsa -out ca.key 2048 | ||
| openssl req -x509 -new -nodes -key ca.key -sha256 -days "$DAYS" \ | ||
| -subj "$SUBJECT_CA" -out ca.pem | ||
|
|
||
| # 2. Server key + CSR | ||
| openssl genrsa -out server.key 2048 | ||
| openssl req -new -key server.key -subj "$SUBJECT_SRV" -out server.csr | ||
|
|
||
| # 3. Sign server cert with the CA, carrying the SAN | ||
| openssl x509 -req -in server.csr -CA ca.pem -CAkey ca.key -CAcreateserial \ | ||
| -out server.pem -days "$DAYS" -sha256 \ | ||
| -extfile <(printf "%s\n" "$SAN") | ||
|
|
||
| # Remove the CSR and CA serial — only the keys + certs need to be committed | ||
| rm -f server.csr ca.srl | ||
|
|
||
| chmod 0644 ca.pem server.pem | ||
| chmod 0600 ca.key server.key | ||
|
|
||
| echo "Regenerated test certs in $(pwd)" |
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,27 @@ | ||
| -----BEGIN RSA PRIVATE KEY----- | ||
| MIIEpAIBAAKCAQEAshK+rIthQABR1DRYVf9E4yV9nGC3S4VPd2jK64/O0dnqAf1m | ||
| MozRGecilyA9kWO/lOUlK7FniaLMcBzn4CuaCGjDhN6uCVxgfaGPe0NIB6weBbr6 | ||
| RcBaqHu2A3ZKqxdF5vNU//Ty8UFVLksHIEd9xY+hN534YcvGEpm4e9C7TKUzf++4 | ||
| an0Ow+7utfh/vXIlz1wir3nwHe9b02gUhnl+q2olM1/jLuH4Sjh3Gwga0Mgtxm2R | ||
| ChUIDxBpzTKKA2h0OS+Puz/EiAraHkE6hE1yOtTkMm17LD0t3cMr47m+cLzOZgsK | ||
| nfS7H2UeOJVDFAcxoF9K7IM24KC5rSAD+b0iqQIDAQABAoIBAQCkzBov/rGalHEm | ||
| TOcvdxVejbSowwz+1DnNzWp2BFmn9d7NxqAMyis9qJ1ndQvlgIWtmz8CJ6UlSEeg | ||
| ve+Nk2xyudmwHpC70wTtX1Y1AfgoOY5zSS4S3UhJQmwY2iGSIvCrIqiYVC19PjRB | ||
| qmfG5MKt0hWmLgjPINGHJ0IHPA4KiBFnCKtNHn5QakpaplxFblLtAJMv6Mzfsnnm | ||
| amzflHA+QvFy0mWYK5GAe6LYSYUm2TikqzJbq4h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VATE KEY----- |
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,18 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIC7TCCAdWgAwIBAgIUCMEuhoivc1mANtoLz0SkTUUTbKUwDQYJKoZIhvcNAQEL | ||
| BQAwIjEgMB4GA1UEAwwXU29saWRTeXNsb2cgQkREIFRlc3QgQ0EwHhcNMjYwNDIw | ||
| MTcwODQxWhcNMzYwNDE3MTcwODQxWjAUMRIwEAYDVQQDDAlzeXNsb2ctbmcwggEi | ||
| MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCyEr6si2FAAFHUNFhV/0TjJX2c | ||
| YLdLhU93aMrrj87R2eoB/WYyjNEZ5yKXID2RY7+U5SUrsWeJosxwHOfgK5oIaMOE | ||
| 3q4JXGB9oY97Q0gHrB4FuvpFwFqoe7YDdkqrF0Xm81T/9PLxQVUuSwcgR33Fj6E3 | ||
| nfhhy8YSmbh70LtMpTN/77hqfQ7D7u61+H+9ciXPXCKvefAd71vTaBSGeX6raiUz | ||
| X+Mu4fhKOHcbCBrQyC3GbZEKFQgPEGnNMooDaHQ5L4+7P8SICtoeQTqETXI61OQy | ||
| bXssPS3dwyvjub5wvM5mCwqd9LsfZR44lUMUBzGgX0rsgzbgoLmtIAP5vSKpAgMB | ||
| AAGjKTAnMCUGA1UdEQQeMByCCXN5c2xvZy1uZ4IJbG9jYWxob3N0hwR/AAABMA0G | ||
| CSqGSIb3DQEBCwUAA4IBAQBKz2+40sPa5jKdzFW0T/k1zHvGDAffv7zeNonw1g6B | ||
| D/ORXfE7EQzYGXkZPVo7DD5eqVk+4t0ToCAf8kC6/5StcaW3D5ERoeq5hYOkvGdF | ||
| FpHyNrTwwkE3kqdfxTdOH5g2Gzb+XosG9UebpxrGxVbcrqyjBn2LJhM8Kj2zBu6D | ||
| ACdtsU5knHvgXy7cnwRrrjFxr8yognWHK6pRxGwDXmMFa2qOrBpIX74OXoei7eYQ | ||
| k4hHdFvk/GKqR6lonXfCEaAAAtBqThLbq+bZHVaLWZ+HA1qBU/+KdGYzDl8P022o | ||
| VFuAZgp6ffabfyWgFu3a3d+jphjoFKGIfp/0wR7DNq1s | ||
| -----END CERTIFICATE----- |
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
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.