فهرست منبع

HPCC-19119 Checking for signature should use isEmptyString

When checking a StringBuffer for the existence of a digital signature,
should is isEmptyString instead of  just checking for buffer ptr

Signed-off-by: Russ Whitehead <william.whitehead@lexisnexis.com>
Russ Whitehead 7 سال پیش
والد
کامیت
846b2ede4f
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      system/security/LdapSecurity/ldapsecurity.cpp
  2. 1 1
      system/security/plugins/htpasswdSecurity/htpasswdSecurity.cpp

+ 1 - 1
system/security/LdapSecurity/ldapsecurity.cpp

@@ -663,7 +663,7 @@ bool CLdapSecManager::authenticate(ISecUser* user)
         return true;
         return true;
     }
     }
 
 
-    if ((user->credentials().getSessionToken() != 0) || user->credentials().getSignature())//Already authenticated it token or signature exist
+    if ((user->credentials().getSessionToken() != 0) || !isEmptyString(user->credentials().getSignature()))//Already authenticated it token or signature exist
     {
     {
         user->setAuthenticateStatus(AS_AUTHENTICATED);
         user->setAuthenticateStatus(AS_AUTHENTICATED);
         if(m_permissionsCache->isCacheEnabled() && !m_usercache_off)
         if(m_permissionsCache->isCacheEnabled() && !m_usercache_off)

+ 1 - 1
system/security/plugins/htpasswdSecurity/htpasswdSecurity.cpp

@@ -158,7 +158,7 @@ protected:
 		if (0 == user.length())
 		if (0 == user.length())
 			throw MakeStringException(-1, "htpasswd User name is NULL");
 			throw MakeStringException(-1, "htpasswd User name is NULL");
 
 
-        if (sec_user.credentials().getSessionToken() != 0  || sec_user.credentials().getSignature())//Already authenticated it token or signature exist
+        if (sec_user.credentials().getSessionToken() != 0  || !isEmptyString(sec_user.credentials().getSignature()))//Already authenticated it token or signature exist
 		    return true;
 		    return true;
 
 
 		CriticalBlock block(crit);
 		CriticalBlock block(crit);