<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12765">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
George Joseph: Looks good to me, approved
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjproject: Configurable setting for cnonce to include hyphens or not<br><br>NEC SIP Station interface with authenticated registration only supports cnonce<br>up to 32 characters. In Linux, PJSIP would generate 36 character cnonce<br>which included hyphens. Teluu developed this patch adding a compile time<br>setting to default to not include the hyphens. They felt it best to still<br>generate the UUID and strip the hyphens.<br>They have indicated it will be part of PJSIP 2.10.<br><br>ASTERISK-28509<br>Reported-by: Dan Cropp<br><br>Change-Id: Ibdfcf845d4f8c0a14df09fd983b11f2d72c5f470<br>---<br>A third-party/pjproject/patches/0020-patch_cnonce_only_digits_option.patch<br>1 file changed, 53 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/third-party/pjproject/patches/0020-patch_cnonce_only_digits_option.patch b/third-party/pjproject/patches/0020-patch_cnonce_only_digits_option.patch</span><br><span>new file mode 100644</span><br><span>index 0000000..ecf6c94</span><br><span>--- /dev/null</span><br><span>+++ b/third-party/pjproject/patches/0020-patch_cnonce_only_digits_option.patch</span><br><span>@@ -0,0 +1,53 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Index: pjsip/include/pjsip/sip_config.h</span><br><span style="color: hsl(120, 100%, 40%);">+===================================================================</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjsip/include/pjsip/sip_config.h (revision 6050)</span><br><span>++++ b/pjsip/include/pjsip/sip_config.h (working copy)</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -1190,6 +1190,20 @@</span><br><span style="color: hsl(120, 100%, 40%);">+ # define PJSIP_AUTH_CACHED_POOL_MAX_SIZE (20 * 1024)</span><br><span style="color: hsl(120, 100%, 40%);">+ #endif</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">++</span><br><span style="color: hsl(120, 100%, 40%);">++/**</span><br><span style="color: hsl(120, 100%, 40%);">++ * Specify whether the cnonce used for SIP authentication contain digits only.</span><br><span style="color: hsl(120, 100%, 40%);">++ * The "cnonce" value is setup using GUID generator, i.e:</span><br><span style="color: hsl(120, 100%, 40%);">++ * pj_create_unique_string(), and the GUID string may contain hyphen character</span><br><span style="color: hsl(120, 100%, 40%);">++ * ("-"). Some SIP servers do not like this GUID format, so this option will</span><br><span style="color: hsl(120, 100%, 40%);">++ * strip any hyphens from the GUID string.</span><br><span style="color: hsl(120, 100%, 40%);">++ *</span><br><span style="color: hsl(120, 100%, 40%);">++ * Default is 1 (cnonce will only contain digit characters).</span><br><span style="color: hsl(120, 100%, 40%);">++ */</span><br><span style="color: hsl(120, 100%, 40%);">++#ifndef PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY</span><br><span style="color: hsl(120, 100%, 40%);">++# define PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY 1</span><br><span style="color: hsl(120, 100%, 40%);">++#endif</span><br><span style="color: hsl(120, 100%, 40%);">++</span><br><span style="color: hsl(120, 100%, 40%);">+ /*****************************************************************************</span><br><span style="color: hsl(120, 100%, 40%);">+ * SIP Event framework and presence settings.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+Index: pjsip/src/pjsip/sip_auth_client.c</span><br><span style="color: hsl(120, 100%, 40%);">+===================================================================</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjsip/src/pjsip/sip_auth_client.c (revision 6050)</span><br><span>++++ b/pjsip/src/pjsip/sip_auth_client.c (working copy)</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -396,7 +396,23 @@</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Create cnonce */</span><br><span style="color: hsl(120, 100%, 40%);">+ pj_create_unique_string( cached_auth->pool, &cached_auth->cnonce );</span><br><span style="color: hsl(120, 100%, 40%);">++#if defined(PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY) && \</span><br><span style="color: hsl(120, 100%, 40%);">++ PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY!=0</span><br><span style="color: hsl(120, 100%, 40%);">++ if (pj_strchr(&cached_auth->cnonce, '-')) {</span><br><span style="color: hsl(120, 100%, 40%);">++ /* remove hyphen character. */</span><br><span style="color: hsl(120, 100%, 40%);">++ int w, r, len = pj_strlen(&cached_auth->cnonce);</span><br><span style="color: hsl(120, 100%, 40%);">++ char *s = cached_auth->cnonce.ptr;</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">++ w = r = 0;</span><br><span style="color: hsl(120, 100%, 40%);">++ for (; r < len; r++) {</span><br><span style="color: hsl(120, 100%, 40%);">++ if (s[r] != '-')</span><br><span style="color: hsl(120, 100%, 40%);">++ s[w++] = s[r];</span><br><span style="color: hsl(120, 100%, 40%);">++ }</span><br><span style="color: hsl(120, 100%, 40%);">++ s[w] = '\0';</span><br><span style="color: hsl(120, 100%, 40%);">++ cached_auth->cnonce.slen = w;</span><br><span style="color: hsl(120, 100%, 40%);">++ }</span><br><span style="color: hsl(120, 100%, 40%);">++#endif</span><br><span style="color: hsl(120, 100%, 40%);">++</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Initialize nonce-count */</span><br><span style="color: hsl(120, 100%, 40%);">+ cached_auth->nc = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12765">change 12765</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/12765"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Ibdfcf845d4f8c0a14df09fd983b11f2d72c5f470 </div>
<div style="display:none"> Gerrit-Change-Number: 12765 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Dan Cropp <dan@amtelco.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>