瀏覽代碼

[FIX] Check for zero signature length

 - If the length of the client signature is zero, then the server
   should return Bad_ApplicationSignatureInvalid

Signed-off-by: Jayanth Velusamy <jayanth.v@kalycito.com>
Jayanth Velusamy 5 年之前
父節點
當前提交
217eed40cf
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/server/ua_services_session.c

+ 5 - 0
src/server/ua_services_session.c

@@ -213,6 +213,11 @@ checkSignature(const UA_Server *server, const UA_SecureChannel *channel,
        channel->securityMode != UA_MESSAGESECURITYMODE_SIGNANDENCRYPT)
         return UA_STATUSCODE_GOOD;
 
+    /* Check for zero signature length in client signature */
+    if(request->clientSignature.signature.length == 0) {
+        return UA_STATUSCODE_BADAPPLICATIONSIGNATUREINVALID;
+    }
+
     if(!channel->securityPolicy)
         return UA_STATUSCODE_BADINTERNALERROR;
     const UA_SecurityPolicy *securityPolicy = channel->securityPolicy;