Explorar o código

improve code docs in ua_accesscontrol_default.c

Mark %!s(int64=7) %!d(string=hai) anos
pai
achega
8753f464a1
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      plugins/ua_accesscontrol_default.c

+ 5 - 1
plugins/ua_accesscontrol_default.c

@@ -56,7 +56,11 @@ activateSession_default(const UA_NodeId *sessionId,
        &UA_TYPES[UA_TYPES_USERNAMEIDENTITYTOKEN]) {
         const UA_UserNameIdentityToken *token =
             (UA_UserNameIdentityToken*)userIdentityToken->content.decoded.data;
-        if(!UA_String_equal(&token->policyId, &username_policy) || token->encryptionAlgorithm.length > 0)
+        if(!UA_String_equal(&token->policyId, &username_policy))
+            return UA_STATUSCODE_BADIDENTITYTOKENINVALID;
+
+        /* TODO: Support encrypted username/password over unencrypted SecureChannels */
+        if(token->encryptionAlgorithm.length > 0)
             return UA_STATUSCODE_BADIDENTITYTOKENINVALID;
 
         /* Empty username and password */