netlogon_creds_cli: Use data_blob_cmp in netlogon_creds_cli_validate
authorVolker Lendecke <vl@samba.org>
Mon, 21 Aug 2017 10:00:23 +0000 (12:00 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 16 Sep 2017 06:36:18 +0000 (08:36 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
libcli/auth/netlogon_creds_cli.c

index a124a1c03da78552354407c7281a94d2ee750e39..dc05316ac134b50c6232aeb0b54fd1c4c0d5a1f4 100644 (file)
@@ -669,19 +669,11 @@ bool netlogon_creds_cli_validate(struct netlogon_creds_cli_context *context,
                return false;
        }
 
-       if (blob1.length != blob2.length) {
-               TALLOC_FREE(frame);
-               return false;
-       }
-
-       cmp = memcmp(blob1.data, blob2.data, blob1.length);
-       if (cmp != 0) {
-               TALLOC_FREE(frame);
-               return false;
-       }
+       cmp = data_blob_cmp(&blob1, &blob2);
 
        TALLOC_FREE(frame);
-       return true;
+
+       return (cmp == 0);
 }
 
 NTSTATUS netlogon_creds_cli_store(struct netlogon_creds_cli_context *context,