summaryrefslogtreecommitdiff
path: root/lib/libssl/d1_srtp.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2020-10-11 01:16:32 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2020-10-11 01:16:32 +0000
commitc864d8e9bf809fdda8de12174defbfbb6d7d4e31 (patch)
tree8dd8c12699c9c4bb837fb64a82b10b8ee779541a /lib/libssl/d1_srtp.c
parentb180c6dffc7009129417d7691fa3a00c7fe8b424 (diff)
Constipate srtp_known_profiles, pushing it into .data.rel.ro
ok tb@ jsing@
Diffstat (limited to 'lib/libssl/d1_srtp.c')
-rw-r--r--lib/libssl/d1_srtp.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/libssl/d1_srtp.c b/lib/libssl/d1_srtp.c
index 70e9a4f127b..6d4a1661e12 100644
--- a/lib/libssl/d1_srtp.c
+++ b/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