[Asterisk-code-review] pjsip: Increase maximum number of usable ciphers & other cle... (asterisk[master])
Jenkins2
asteriskteam at digium.com
Thu May 3 07:41:34 CDT 2018
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8908 )
Change subject: pjsip: Increase maximum number of usable ciphers & other cleanups
......................................................................
pjsip: Increase maximum number of usable ciphers & other cleanups
* Increase maximum number of ciphers from 100 to 256 (or whatever
PJ_SSL_SOCK_MAX_CIPHERS is #define'd to)
* Simplify logic in cipher_name_to_id()
* Make signed/unsigned comparison consistent
Re: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897412
Reported by: Ondřej Holas
Change-Id: Iea620f03915a1b873e79743154255c3148a514e7
---
M res/res_pjsip/config_transport.c
1 file changed, 8 insertions(+), 13 deletions(-)
Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/res/res_pjsip/config_transport.c b/res/res_pjsip/config_transport.c
index dd7c704..20324ed 100644
--- a/res/res_pjsip/config_transport.c
+++ b/res/res_pjsip/config_transport.c
@@ -977,27 +977,22 @@
/*! \brief Helper function which turns a cipher name into an identifier */
static pj_ssl_cipher cipher_name_to_id(const char *name)
{
- pj_ssl_cipher ciphers[100];
- pj_ssl_cipher id = 0;
+ pj_ssl_cipher ciphers[PJ_SSL_SOCK_MAX_CIPHERS];
unsigned int cipher_num = PJ_ARRAY_SIZE(ciphers);
- int pos;
- const char *pos_name;
+ unsigned int pos;
if (pj_ssl_cipher_get_availables(ciphers, &cipher_num)) {
return 0;
}
for (pos = 0; pos < cipher_num; ++pos) {
- pos_name = pj_ssl_cipher_name(ciphers[pos]);
- if (!pos_name || strcmp(pos_name, name)) {
- continue;
+ const char *pos_name = pj_ssl_cipher_name(ciphers[pos]);
+ if (pos_name && !strcmp(pos_name, name)) {
+ return ciphers[pos];
}
-
- id = ciphers[pos];
- break;
}
- return id;
+ return 0;
}
/*!
@@ -1072,7 +1067,7 @@
static void cipher_to_str(char **buf, const pj_ssl_cipher *ciphers, unsigned int cipher_num)
{
struct ast_str *str;
- int idx;
+ unsigned int idx;
str = ast_str_create(128);
if (!str) {
@@ -1106,7 +1101,7 @@
static char *handle_pjsip_list_ciphers(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- pj_ssl_cipher ciphers[100];
+ pj_ssl_cipher ciphers[PJ_SSL_SOCK_MAX_CIPHERS];
unsigned int cipher_num = PJ_ARRAY_SIZE(ciphers);
char *buf;
--
To view, visit https://gerrit.asterisk.org/8908
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iea620f03915a1b873e79743154255c3148a514e7
Gerrit-Change-Number: 8908
Gerrit-PatchSet: 3
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180503/3b459b0d/attachment.html>
More information about the asterisk-code-review
mailing list