[cpp-sp] branch dev/4.0.0 updated: Allow for escaped name characters.

Scott Cantor cantor.2 at osu.edu
Thu May 20 14:25:13 UTC 2021


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch dev/4.0.0
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=31e5f1e909db34d14fe4d5f5df33837a9013c659

The following commit(s) were added to refs/heads/dev/4.0.0 by this push:
       new  31e5f1e9  Allow for escaped name characters.
31e5f1e9 is described below

commit 31e5f1e909db34d14fe4d5f5df33837a9013c659
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu May 20 10:25:06 2021 -0400

    Allow for escaped name characters.
---
 shibsp/remoting/impl/ddf.cpp | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/shibsp/remoting/impl/ddf.cpp b/shibsp/remoting/impl/ddf.cpp
index 72e654a5..973f4ee4 100644
--- a/shibsp/remoting/impl/ddf.cpp
+++ b/shibsp/remoting/impl/ddf.cpp
@@ -955,7 +955,27 @@ DDF deserialize(istream& is)
 
     DDF obj(nullptr);
     if (name != ".") {
-        obj.name(name.c_str());
+        if (name.find('%') != string::npos) {
+            char* dup = strdup(name.c_str());
+            if (!dup) {
+                return obj;
+            }
+            // Walk the string and decode any %XX sequences.
+            register int x,y;
+            for(x=0,y=0; dup[y]; ++x,++y) {
+                if((dup[x] = dup[y]) == '%' && isxdigit(dup[y+1]) && isxdigit(dup[y+2])) {
+                    dup[x] = x2c(&dup[y+1]);
+                    y+=2;
+                }
+            }
+            dup[x] = '\0';
+
+            obj.name(dup);
+            free(dup);
+        }
+        else {
+            obj.name(name.c_str());
+        }
     }
 
     // Type is next and should match enums.
@@ -990,7 +1010,7 @@ DDF deserialize(istream& is)
                     return obj;
                 }
 
-                // Walk the string and decode any %XX sequences and plus to space.
+                // Walk the string and decode any %XX sequences.
                 register int x,y;
                 for(x=0,y=0; dup[y]; ++x,++y) {
                     if((dup[x] = dup[y]) == '%' && isxdigit(dup[y+1]) && isxdigit(dup[y+2])) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list