diff options
author | Hugo Landau <hlandau@openssl.org> | 2024-02-01 08:45:15 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2024-02-02 10:10:12 +0100 |
commit | 89dd87e1e86ee23a1582ec558abd2eb27d68505d (patch) | |
tree | 64928b8b23b11c526949aa3f988fb2089edc8eb7 /ssl/d1_srtp.c | |
parent | Add atexit configuration option to using atexit() in libcrypto at build-time. (diff) | |
download | openssl-89dd87e1e86ee23a1582ec558abd2eb27d68505d.tar.xz openssl-89dd87e1e86ee23a1582ec558abd2eb27d68505d.zip |
libssl: Make some global mutable structures constant
x
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23450)
Diffstat (limited to 'ssl/d1_srtp.c')
-rw-r--r-- | ssl/d1_srtp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c index 5ca135d970..f21d12b872 100644 --- a/ssl/d1_srtp.c +++ b/ssl/d1_srtp.c @@ -20,7 +20,7 @@ #ifndef OPENSSL_NO_SRTP -static SRTP_PROTECTION_PROFILE srtp_known_profiles[] = { +static const SRTP_PROTECTION_PROFILE srtp_known_profiles[] = { { "SRTP_AES128_CM_SHA1_80", SRTP_AES128_CM_SHA1_80, @@ -73,9 +73,9 @@ static SRTP_PROTECTION_PROFILE srtp_known_profiles[] = { }; static int find_profile_by_name(char *profile_name, - SRTP_PROTECTION_PROFILE **pptr, size_t len) + const SRTP_PROTECTION_PROFILE **pptr, size_t len) { - SRTP_PROTECTION_PROFILE *p; + const SRTP_PROTECTION_PROFILE *p; p = srtp_known_profiles; while (p->name) { @@ -98,7 +98,7 @@ static int ssl_ctx_make_profiles(const char *profiles_string, char *col; char *ptr = (char *)profiles_string; - SRTP_PROTECTION_PROFILE *p; + const SRTP_PROTECTION_PROFILE *p; if ((profiles = sk_SRTP_PROTECTION_PROFILE_new_null()) == NULL) { ERR_raise(ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES); @@ -110,12 +110,14 @@ static int ssl_ctx_make_profiles(const char *profiles_string, if (!find_profile_by_name(ptr, &p, col ? (size_t)(col - ptr) : strlen(ptr))) { - if (sk_SRTP_PROTECTION_PROFILE_find(profiles, p) >= 0) { + if (sk_SRTP_PROTECTION_PROFILE_find(profiles, + (SRTP_PROTECTION_PROFILE *)p) >= 0) { ERR_raise(ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); goto err; } - if (!sk_SRTP_PROTECTION_PROFILE_push(profiles, p)) { + if (!sk_SRTP_PROTECTION_PROFILE_push(profiles, + (SRTP_PROTECTION_PROFILE *)p)) { ERR_raise(ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES); goto err; } |