summaryrefslogtreecommitdiffstats
path: root/PICA_security.h
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-08-24 05:05:29 +0400
committerAnton <anton@picapica.im>2026-08-24 05:05:29 +0400
commit5c5fe2b41da2f4f1da32b12909a9b982e5dec70a (patch)
tree8fd45b361da382ae689c0c2cf7c54f52eb9765ad /PICA_security.h
parent1f9da8f90605b844b635505b0379ee7732345948 (diff)
downloadpica-pica-5c5fe2b41da2f4f1da32b12909a9b982e5dec70a.tar.gz
pica-pica-5c5fe2b41da2f4f1da32b12909a9b982e5dec70a.zip
Build against OpenSSL 4.0: replace TLSv1_2_method()
TLSv1_2_method() was deprecated in OpenSSL 1.1.0 and is gone from 4.0, which is what MXE now builds, so the Windows cross build failed to link it. The replacement is TLS_method() plus an explicit version range. Pinning both ends of that range to 1.2 is not tidiness, it is what keeps the protocol where it was: PICA_TLS_CIPHERLIST and PICA_TLS_ANONDHCIPHERLIST both name TLS 1.2 suites, TLS 1.3 has no anonymous key exchange at all, and SSL_CTX_set_cipher_list() has no say over which 1.3 suites get used. Letting 1.3 be negotiated would quietly ignore the first list and leave the second with nothing to offer. The range lives in PICA_security.h with the other security parameters, so raising it later is a deliberate edit in one place rather than a side effect. Also carries a PICA_TIMETOLERANCE define that was already in the tree. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CBqDgvq3Ty6C6BjLFH16bw
Diffstat (limited to 'PICA_security.h')
-rw-r--r--PICA_security.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/PICA_security.h b/PICA_security.h
index df260b2..6678602 100644
--- a/PICA_security.h
+++ b/PICA_security.h
@@ -26,5 +26,31 @@
#define PICA_OPENSSL_SECURUTY_LEVEL 3
#define PICA_CERTDIGESTALGO "-sha256"
#define PICA_PRIVKEYENCALGO "-aes256"
+#define PICA_TIMETOLERANCE 600
+
+/* The TLS version range, pinned to exactly 1.2 at both ends.
+ *
+ * The upper end is deliberate and load bearing, not tidiness. Both cipher
+ * lists above name TLS 1.2 suites, and the anonymous one has no TLS 1.3
+ * counterpart at all - 1.3 dropped anonymous key exchange entirely. On top of
+ * that, SSL_CTX_set_cipher_list() has no say over which TLS 1.3 suites a
+ * connection ends up using; that is a separate call
+ * (SSL_CTX_set_ciphersuites). So letting 1.3 be negotiated would quietly
+ * ignore PICA_TLS_CIPHERLIST and leave PICA_TLS_ANONDHCIPHERLIST with nothing
+ * to offer.
+ *
+ * Moving the ceiling therefore means naming TLS 1.3 suites explicitly and
+ * finding another way to do the anonymous handshake - it is a protocol
+ * decision, not a configuration change.
+ *
+ * Applied with SSL_CTX_set_min_proto_version()/SSL_CTX_set_max_proto_version()
+ * on OpenSSL 1.1.0 and later. Those replaced TLSv1_2_method(), which was
+ * deprecated in 1.1.0 and removed in 4.0.
+ *
+ * These expand to <openssl/ssl.h> constants, so they are only usable in a
+ * translation unit that includes it.
+ */
+#define PICA_TLS_MINVERSION TLS1_2_VERSION
+#define PICA_TLS_MAXVERSION TLS1_2_VERSION
#endif