From b82a529ec2ee5ca2f86bd2f0d06d65c45ca1578a Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 17 Oct 2017 09:56:34 -0700 Subject: [PATCH] Cleanup to move the secret length to ssl.h so its accessible for the compatability layer as well. --- wolfssl/internal.h | 3 ++- wolfssl/openssl/ssl.h | 2 +- wolfssl/ssl.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 5c3a2f3f3..dcb06ecdc 100755 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -960,7 +960,8 @@ enum Misc { ZLIB_COMPRESSION = 221, /* wolfSSL zlib compression */ HELLO_EXT_SIG_ALGO = 13, /* ID for the sig_algo hello extension */ HELLO_EXT_EXTMS = 0x0017, /* ID for the extended master secret ext */ - SECRET_LEN = 48, /* pre RSA and all master */ + SECRET_LEN = WOLFSSL_MAX_MASTER_KEY_LENGTH, + /* pre RSA and all master */ #if defined(WOLFSSL_MYSQL_COMPATIBLE) ENCRYPT_LEN = 1024, /* allow larger static buffer with mysql */ #else diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index 937ca4c6e..a2bbe86f8 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -629,7 +629,7 @@ typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY; #define ASN1_STRFLGS_ESC_MSB 4 #define X509_V_ERR_CERT_REJECTED 28 -#define SSL_MAX_MASTER_KEY_LENGTH 48 /* SECRET_LEN from internal.h */ +#define SSL_MAX_MASTER_KEY_LENGTH WOLFSSL_MAX_MASTER_KEY_LENGTH #define SSL_alert_desc_string_long wolfSSL_alert_desc_string_long #define SSL_alert_type_string_long wolfSSL_alert_type_string_long diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 016755e65..3d93e7dd1 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -299,6 +299,8 @@ enum AlertLevel { alert_fatal = 2 }; +/* Maximum master key length (SECRET_LEN) */ +#define WOLFSSL_MAX_MASTER_KEY_LENGTH 48 typedef WOLFSSL_METHOD* (*wolfSSL_method_func)(void* heap); WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_server_method_ex(void* heap);