瀏覽代碼

improve code docs in ua_accesscontrol_default.c

Mark 7 年之前
父節點
當前提交
8753f464a1
共有 1 個文件被更改,包括 5 次插入1 次删除
  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 */