From 8ba9fa49164f17ec9a4156de8eb45d9515186459 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 11 Oct 2020 02:44:27 +0000 Subject: Make profile_name const in srtp_find_profile_by_name() There is no reason (and there never was any) for profile_name to be non-const, it was always just passed to strncmp(). Changing this allows removing an ugly instance of casting away const. ok guenther jsing --- src/lib/libssl/d1_srtp.c | 8 +++----- src/lib/libssl/ssl_locl.h | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib/libssl/d1_srtp.c b/src/lib/libssl/d1_srtp.c index 6d4a1661e1..1ea678a218 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.25 2020/10/11 01:16:31 guenther Exp $ */ +/* $OpenBSD: d1_srtp.c,v 1.26 2020/10/11 02:44:27 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -139,7 +139,7 @@ static const SRTP_PROTECTION_PROFILE srtp_known_profiles[] = { }; int -srtp_find_profile_by_name(char *profile_name, +srtp_find_profile_by_name(const char *profile_name, const SRTP_PROTECTION_PROFILE **pptr, unsigned int len) { const SRTP_PROTECTION_PROFILE *p; @@ -181,10 +181,8 @@ ssl_ctx_make_profiles(const char *profiles_string, STACK_OF(SRTP_PROTECTION_PROFILE) **out) { STACK_OF(SRTP_PROTECTION_PROFILE) *profiles; - char *col; - char *ptr = (char *)profiles_string; - + const char *ptr = profiles_string; const SRTP_PROTECTION_PROFILE *p; if (!(profiles = sk_SRTP_PROTECTION_PROFILE_new_null())) { diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index e341e9eda2..5d41417df8 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_locl.h,v 1.302 2020/10/11 02:22:27 jsing Exp $ */ +/* $OpenBSD: ssl_locl.h,v 1.303 2020/10/11 02:44:27 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1413,7 +1413,7 @@ void SSL_error_internal(const SSL *s, int r, char *f, int l); #ifndef OPENSSL_NO_SRTP -int srtp_find_profile_by_name(char *profile_name, +int srtp_find_profile_by_name(const char *profile_name, const SRTP_PROTECTION_PROFILE **pptr, unsigned int len); int srtp_find_profile_by_num(unsigned int profile_num, const SRTP_PROTECTION_PROFILE **pptr); -- cgit v1.2.3-55-g6feb