diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2020-10-11 02:44:28 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2020-10-11 02:44:28 +0000 |
commit | 206d5f436b336df22845ab746e1dd1a338bf1607 (patch) | |
tree | 218190f70ad35089c0df8bacec5e1450a609886a | |
parent | a3e313ba890b9dd5ca457eb5f3316cd267994a92 (diff) |
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
-rw-r--r-- | lib/libssl/d1_srtp.c | 8 | ||||
-rw-r--r-- | lib/libssl/ssl_locl.h | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/libssl/d1_srtp.c b/lib/libssl/d1_srtp.c index 6d4a1661e12..1ea678a2185 100644 --- a/lib/libssl/d1_srtp.c +++ b/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/lib/libssl/ssl_locl.h b/lib/libssl/ssl_locl.h index e341e9eda2e..5d41417df82 100644 --- a/lib/libssl/ssl_locl.h +++ b/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); |