From b6bb75f4585006b28ebc729355536e9e77226c3d Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sun, 11 Oct 2020 01:16:31 +0000 Subject: Constipate srtp_known_profiles, pushing it into .data.rel.ro ok tb@ jsing@ --- src/lib/libssl/d1_srtp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/lib/libssl/d1_srtp.c') diff --git a/src/lib/libssl/d1_srtp.c b/src/lib/libssl/d1_srtp.c index 70e9a4f127..6d4a1661e1 100644 --- a/src/lib/libssl/d1_srtp.c +++ b/src/lib/libssl/d1_srtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srtp.c,v 1.24 2020/03/16 15:25:13 tb Exp $ */ +/* $OpenBSD: d1_srtp.c,v 1.25 2020/10/11 01:16:31 guenther Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -126,7 +126,7 @@ #include "bytestring.h" #include "srtp.h" -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, @@ -139,10 +139,10 @@ static SRTP_PROTECTION_PROFILE srtp_known_profiles[] = { }; int -srtp_find_profile_by_name(char *profile_name, SRTP_PROTECTION_PROFILE **pptr, - unsigned int len) +srtp_find_profile_by_name(char *profile_name, + const SRTP_PROTECTION_PROFILE **pptr, unsigned int len) { - SRTP_PROTECTION_PROFILE *p; + const SRTP_PROTECTION_PROFILE *p; p = srtp_known_profiles; while (p->name) { @@ -160,9 +160,9 @@ srtp_find_profile_by_name(char *profile_name, SRTP_PROTECTION_PROFILE **pptr, int srtp_find_profile_by_num(unsigned int profile_num, - SRTP_PROTECTION_PROFILE **pptr) + const SRTP_PROTECTION_PROFILE **pptr) { - SRTP_PROTECTION_PROFILE *p; + const SRTP_PROTECTION_PROFILE *p; p = srtp_known_profiles; while (p->name) { @@ -185,7 +185,7 @@ 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())) { SSLerrorx(SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES); @@ -245,7 +245,8 @@ SSL_get_srtp_profiles(SSL *s) SRTP_PROTECTION_PROFILE * SSL_get_selected_srtp_profile(SSL *s) { - return s->internal->srtp_profile; + /* XXX cast away the const */ + return (SRTP_PROTECTION_PROFILE *)s->internal->srtp_profile; } #endif -- cgit v1.2.3-55-g6feb