From: Piotr Gregor Date: Tue, 27 Mar 2018 11:18:00 +0000 (+0100) Subject: FS-11063 Use compile time constants in dtls_state_setup X-Git-Tag: v1.8.1~3^2~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5090ae96ba2424478f446880e8d61e0de2406e0;p=thirdparty%2Ffreeswitch.git FS-11063 Use compile time constants in dtls_state_setup --- diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 3e637da509..74e147c8c2 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3072,16 +3072,16 @@ static const char *dtls_state_names(dtls_state_t s) #define dtls_set_state(_dtls, _state) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Changing %s DTLS state from %s to %s\n", rtp_type(rtp_session), dtls_state_names(_dtls->state), dtls_state_names(_state)); _dtls->new_state = 1; _dtls->last_state = _dtls->state; _dtls->state = _state +#define cr_keylen 16 +#define cr_saltlen 14 +#define cr_kslen 30 + static int dtls_state_setup(switch_rtp_t *rtp_session, switch_dtls_t *dtls) { X509 *cert; switch_secure_settings_t ssec; /* Used just to wrap over params in a call to switch_rtp_add_crypto_key. */ int r = 0; - const switch_size_t cr_kslen = SUITES[AES_CM_128_HMAC_SHA1_80].keysalt_len; - const switch_size_t cr_saltlen = SUITES[AES_CM_128_HMAC_SHA1_80].salt_len; - const switch_size_t cr_keylen = cr_kslen - cr_saltlen; - uint8_t raw_key_data[cr_kslen * 2]; unsigned char local_key_buf[cr_kslen]; unsigned char remote_key_buf[cr_kslen];