diff options
| author | tb <> | 2020-10-11 02:44:27 +0000 |
|---|---|---|
| committer | tb <> | 2020-10-11 02:44:27 +0000 |
| commit | 09963b386d8339b5425e43c4cb8e5fd53a761101 (patch) | |
| tree | b4c654a1b989295114bd40c5e379457740b4cacc /src | |
| parent | 150cbe098c23a1b8bc365cfc6dac81de86cd0992 (diff) | |
| download | openbsd-09963b386d8339b5425e43c4cb8e5fd53a761101.tar.gz openbsd-09963b386d8339b5425e43c4cb8e5fd53a761101.tar.bz2 openbsd-09963b386d8339b5425e43c4cb8e5fd53a761101.zip | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libssl/d1_srtp.c | 8 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | /* $OpenBSD: d1_srtp.c,v 1.25 2020/10/11 01:16:31 guenther Exp $ */ | 1 | /* $OpenBSD: d1_srtp.c,v 1.26 2020/10/11 02:44:27 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -139,7 +139,7 @@ static const SRTP_PROTECTION_PROFILE srtp_known_profiles[] = { | |||
| 139 | }; | 139 | }; |
| 140 | 140 | ||
| 141 | int | 141 | int |
| 142 | srtp_find_profile_by_name(char *profile_name, | 142 | srtp_find_profile_by_name(const char *profile_name, |
| 143 | const SRTP_PROTECTION_PROFILE **pptr, unsigned int len) | 143 | const SRTP_PROTECTION_PROFILE **pptr, unsigned int len) |
| 144 | { | 144 | { |
| 145 | const SRTP_PROTECTION_PROFILE *p; | 145 | const SRTP_PROTECTION_PROFILE *p; |
| @@ -181,10 +181,8 @@ ssl_ctx_make_profiles(const char *profiles_string, | |||
| 181 | STACK_OF(SRTP_PROTECTION_PROFILE) **out) | 181 | STACK_OF(SRTP_PROTECTION_PROFILE) **out) |
| 182 | { | 182 | { |
| 183 | STACK_OF(SRTP_PROTECTION_PROFILE) *profiles; | 183 | STACK_OF(SRTP_PROTECTION_PROFILE) *profiles; |
| 184 | |||
| 185 | char *col; | 184 | char *col; |
| 186 | char *ptr = (char *)profiles_string; | 185 | const char *ptr = profiles_string; |
| 187 | |||
| 188 | const SRTP_PROTECTION_PROFILE *p; | 186 | const SRTP_PROTECTION_PROFILE *p; |
| 189 | 187 | ||
| 190 | if (!(profiles = sk_SRTP_PROTECTION_PROFILE_new_null())) { | 188 | 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 @@ | |||
| 1 | /* $OpenBSD: ssl_locl.h,v 1.302 2020/10/11 02:22:27 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.303 2020/10/11 02:44:27 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -1413,7 +1413,7 @@ void SSL_error_internal(const SSL *s, int r, char *f, int l); | |||
| 1413 | 1413 | ||
| 1414 | #ifndef OPENSSL_NO_SRTP | 1414 | #ifndef OPENSSL_NO_SRTP |
| 1415 | 1415 | ||
| 1416 | int srtp_find_profile_by_name(char *profile_name, | 1416 | int srtp_find_profile_by_name(const char *profile_name, |
| 1417 | const SRTP_PROTECTION_PROFILE **pptr, unsigned int len); | 1417 | const SRTP_PROTECTION_PROFILE **pptr, unsigned int len); |
| 1418 | int srtp_find_profile_by_num(unsigned int profile_num, | 1418 | int srtp_find_profile_by_num(unsigned int profile_num, |
| 1419 | const SRTP_PROTECTION_PROFILE **pptr); | 1419 | const SRTP_PROTECTION_PROFILE **pptr); |
