TPS auth special characters fix.
    
    Ticket #1636.
    Smartcard token enroll/format fails when the ldap user has special 
characters in userid or password
    
    Tested with both esc and tpsclient. The problem was when using a real card 
because the client uri encodes
    the authentication creds and the server needs to decode them.
From e6bcb9f1fac9c7db95a1aa4767cdfe6ac4ccbd16 Mon Sep 17 00:00:00 2001
From: Jack Magne <jma...@dhcp-16-206.sjc.redhat.com>
Date: Wed, 27 Apr 2016 13:52:10 -0700
Subject: [PATCH] TPS auth special characters fix.

Ticket #1636.
Smartcard token enroll/format fails when the ldap user has special characters in userid or password

Tested with both esc and tpsclient. The problem was when using a real card because the client uri encodes
the authentication creds and the server needs to decode them.
---
 base/common/src/org/dogtagpki/tps/msg/TPSMessage.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java b/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
index 84e991e..f622b9b 100644
--- a/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
+++ b/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
@@ -456,17 +456,17 @@ public class TPSMessage {
             break;
         case MSG_EXTENDED_LOGIN_RESPONSE:
             result =
-                new ExtendedLoginResponseMsg(op_val,
-                    get(UID_NAME),
-                    get(PASSWORD_NAME),
-                    extsMap);
+                    new ExtendedLoginResponseMsg(op_val,
+                            Util.uriDecode(get(UID_NAME)),
+                            Util.uriDecode(get(PASSWORD_NAME)),
+                            extsMap);
             break;
         case MSG_LOGIN_REQUEST:
             break;
         case MSG_LOGIN_RESPONSE:
             result =
-                new LoginResponseMsg(get(SCREEN_NAME_NAME),
-                    get(PASSWORD_NAME_1));
+                    new LoginResponseMsg(Util.uriDecode(get(SCREEN_NAME_NAME)),
+                            Util.uriDecode(get(PASSWORD_NAME_1)));
             break;
         case MSG_NEW_PIN_REQUEST:
             break;
-- 
2.5.0

_______________________________________________
Pki-devel mailing list
Pki-devel@redhat.com
https://www.redhat.com/mailman/listinfo/pki-devel

Reply via email to