Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
1c20546e
Commit
1c20546e
authored
5 years ago
by
Friendly Automation
Committed by
Gerrit Code Review
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "pjproject: Configurable setting for cnonce to include hyphens or not"
parents
19045db3
0844d6b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
third-party/pjproject/patches/0020-patch_cnonce_only_digits_option.patch
+53
-0
53 additions, 0 deletions
...roject/patches/0020-patch_cnonce_only_digits_option.patch
with
53 additions
and
0 deletions
third-party/pjproject/patches/0020-patch_cnonce_only_digits_option.patch
0 → 100644
+
53
−
0
View file @
1c20546e
Index: pjsip/include/pjsip/sip_config.h
===================================================================
--- a/pjsip/include/pjsip/sip_config.h (revision 6050)
+++ b/pjsip/include/pjsip/sip_config.h (working copy)
@@ -1190,6 +1190,20 @@
# define PJSIP_AUTH_CACHED_POOL_MAX_SIZE (20 * 1024)
#endif
+
+/**
+ * Specify whether the cnonce used for SIP authentication contain digits only.
+ * The "cnonce" value is setup using GUID generator, i.e:
+ * pj_create_unique_string(), and the GUID string may contain hyphen character
+ * ("-"). Some SIP servers do not like this GUID format, so this option will
+ * strip any hyphens from the GUID string.
+ *
+ * Default is 1 (cnonce will only contain digit characters).
+ */
+#ifndef PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY
+# define PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY 1
+#endif
+
/*****************************************************************************
* SIP Event framework and presence settings.
*/
Index: pjsip/src/pjsip/sip_auth_client.c
===================================================================
--- a/pjsip/src/pjsip/sip_auth_client.c (revision 6050)
+++ b/pjsip/src/pjsip/sip_auth_client.c (working copy)
@@ -396,7 +396,23 @@
/* Create cnonce */
pj_create_unique_string( cached_auth->pool, &cached_auth->cnonce );
+#if defined(PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY) && \
+ PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY!=0
+ if (pj_strchr(&cached_auth->cnonce, '-')) {
+ /* remove hyphen character. */
+ int w, r, len = pj_strlen(&cached_auth->cnonce);
+ char *s = cached_auth->cnonce.ptr;
+ w = r = 0;
+ for (; r < len; r++) {
+ if (s[r] != '-')
+ s[w++] = s[r];
+ }
+ s[w] = '\0';
+ cached_auth->cnonce.slen = w;
+ }
+#endif
+
/* Initialize nonce-count */
cached_auth->nc = 1;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment