]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
keylog: move some constants to header file
authorYedaya Katsman <yedaya.ka@gmail.com>
Mon, 21 Oct 2024 20:26:08 +0000 (23:26 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 27 Mar 2025 07:47:43 +0000 (08:47 +0100)
This allows TLS implementations to use the constants for defining sizes
and verification.

lib/vtls/keylog.c
lib/vtls/keylog.h

index ca86c1560823a9cb6bba9662eb8d44314c78ddef..32ccd38cc7b891734977ee6bac868313d50729e1 100644 (file)
 #include "curl_memory.h"
 #include "memdebug.h"
 
-#define KEYLOG_LABEL_MAXLEN (sizeof("CLIENT_HANDSHAKE_TRAFFIC_SECRET") - 1)
-
-#define CLIENT_RANDOM_SIZE  32
-
-/*
- * The master secret in TLS 1.2 and before is always 48 bytes. In TLS 1.3, the
- * secret size depends on the cipher suite's hash function which is 32 bytes
- * for SHA-256 and 48 bytes for SHA-384.
- */
-#define SECRET_MAXLEN       48
-
-
 /* The fp for the open SSLKEYLOGFILE, or NULL if not open */
 static FILE *keylog_file_fp;
 
index eff5bf38f3518a15d00839cb06ca9d3957440954..c87e5492790de3a509dc970bd2539950b923ea1c 100644 (file)
  ***************************************************************************/
 #include "curl_setup.h"
 
+#define KEYLOG_LABEL_MAXLEN (sizeof("CLIENT_HANDSHAKE_TRAFFIC_SECRET") - 1)
+
+#define CLIENT_RANDOM_SIZE  32
+
+/*
+ * The master secret in TLS 1.2 and before is always 48 bytes. In TLS 1.3, the
+ * secret size depends on the cipher suite's hash function which is 32 bytes
+ * for SHA-256 and 48 bytes for SHA-384.
+ */
+#define SECRET_MAXLEN       48
+
 /*
  * Opens the TLS key log file if requested by the user. The SSLKEYLOGFILE
  * environment variable specifies the output file.