ASACORE-1158: TCP connections from the local machine need to be treated as desktop apps

Windows app isolation policies don't allow Windows Universal Applications to communicate
with Desktop Applications. We already enforce this policy for apps connecting through the
named pipe daemon transport, but we also need to enforce this for the TCP and UDP
transports. Finally, this needs to work for apps connecting directly to our router and
apps who use a bundled router but are still running on the same machine as our router.

The change continues to use the groupId to classify applications and our existing policydb
rules to filter out the disallowed communications. Since we are now using groupId in all
endpoints I moved the implementation of Get/SetUserId() and Get/SetGroupId() to
BusEndpoint.h. The methods already had a default implementation in this class, now we
don't have to redefine these methods in all the various subclasses. I also removed the
implementations that already existed in subclasses so they will use the default.

Next I modified the connection steps for the TCP and UDP transports and added a new check:
when a client connects the transport will compare the remote IP address with the local
machine's IP addresses. If there is a match then we know the endpoint is running on the
same PC and therefore should be treated as a desktop application so the groupId will be
set accordingly.

The next step was to ensure endpoints connecting through a bundled router are also treated
as desktop apps. This was accomplished by changing VirtualEndpoints to inherit the user
and group ID from their bus-to-bus endpoint since that is the machine they are connecting
through.

While these changes can execute on all platforms and shouldn't cause any issues, they only
have value on the Windows platforms, so I have encased most of them in #ifdef
QCC_OS_GROUP_WINDOWS statements. I don't like adding #ifdefs to the code, but I couldn't
think of a better way to isolation this code. The easy alternative would be to run this
logic on all platforms, and I can make that change if you'd like. Please let me know if
you have any suggestions for how this change can cleanly implemented for Windows only
without ifdefs.

Change-Id: I70ce813eca475b490fcac23d4f0f22529e738e15
Signed-off-by: Rob Smith (WINDOWS) <robs@microsoft.com>
AJCORE-1261 Fixed issues found using static analysis tool

Added private copy and assignement constructors to cng crypto
files.

Change-Id: I57f4ab090bb6313413c24e2f7caa54ac88582eea
Signed-off-by: George Nash <georgen@qce.qualcomm.com>
ASACORE-835 Fix ping from service to client
	    in session.

If an app makes a Ping to a remote app, the routing node will perform
a DBus ping to the remote app if a session exists.

Also, do not allow more than one ping in progress for local apps.

Change-Id: I8af75cd0b0796cd8eaf6173c7f7cbeb45df5aba5
Signed-off-by: Sheshambika Venkateshwaran <sheshamb@qce.qualcomm.com>
AJCORE-1261 Resolved issues found using static analysis tool

- add explicit check verfying the member variable aod was set.
  before this the code was relying on the fact that if the announceflag
  was set then the aod was also set since both are done in the same code.
  this adds an explicit check.
- add check making sure jsessionListener is not null.
- the baCommonLock would never have been released if the jSessionListener
  was NULL. Code path added to release the lock.
- fixed memory leak in PropertyStoreImplTest

Change-Id: I621e5fec33d8cdba39157d5fdc2c666f5f5fccab
Signed-off-by: George Nash <georgen@qce.qualcomm.com>
AJCORE-1300: Resolved issues found using static analysis tool

Fixed warning about possible dereference of an iterator that could
point to the end of the container.

Change-Id: Iec3afdab692b09a14e170fde92b538a69b7462a9
Signed-off-by: Steve Kinneberg <stevek@qce.qualcomm.com>
AJCORE-1299: Fix issue found by static analysis tool

Add private copy constructor and assignment operator.

Change-Id: Ic83bc48c08ca01bfba5b828a93f611b3e6fb3a6f
Signed-off-by: Phil Nguyen <philn@qce.qualcomm.com>
ASACORE-1243 skip assert checks in

    RunListenMachin when shutting down

Change-Id: I680447751bc3e6f783ed59b8d6a7a75a0fd529c5
Signed-off-by: Eric Rongo <erongo@qce.qualcomm.com>
ASACORE-1258: Fix bogus error when adding multiple Prop Changed Listeners

Change-Id: Ie2dbe75ba5f6a8ee20b5360faf6ee411456e6b7a
Signed-off-by: Steve Kinneberg <stevek@qce.qualcomm.com>
AJCORE-1296 Fixed issues found using static analysis tool

- Fixed posible situations that a mutex lock could be locked
  but not unlocked.
- Add check to make sure iterators were not equal to end().
  In all cases the iterators should never be equal end() since
  the count was set using the min function. The extra check
  does not hurt.
- The post increment operator ++ has higher precedence than the
  the dereference operator *.  I think this confused the static
  analysis tool so I split the code to two lines.
- asserts are compiled out in release code so a return had to be
  added after the assert.

Change-Id: Ida1db1258a9260f23e65b3a9274290a2bebed10e
Signed-off-by: George Nash <georgen@qce.qualcomm.com>
ASACORE-1241 connection string prevents Bus attachment

ASACORE-1241 UNIX-specific connection string in
             DeskTopSharedKSClientC.c prevents Bus attachment on
             non-UNIX platforms

Removed the connectArgs variable from line 167 (and suspect connection
string), inlined NULL as a replacement, and replaced connectArgs with
the status code in case of a failure.

Change-Id: I0ed99305a7da0e9968398f7ca5f0eef5fbd50e97
Signed-off-by: Braeden Petruk <braedenp@microsoft.com>
ASACORE-1013 C Language Binding for About Service

Change-Id: Ib80ffc1b24323848dfdd278f19a1c427ebcd5782
Signed-off-by: Marius Niculescu <mariusni@microsoft.com>
Merge "AJCORE-1299: Fix issue found by static analysis tool" into RB14.12
Merge "AJCORE-1261 Resolved issues found using static analysis tool" into RB14.12
Merge "AJCORE-1296 Fixed issues found using static analysis tool" into RB14.12
Merge "AJCORE-1261 Fixed issues found using static analysis tool" into RB14.12
Merge "ASACORE-1241 connection string prevents Bus attachment" into RB14.12
Merge "ASACORE-1258: Fix bogus error when adding multiple Prop Changed Listeners" into RB14.12
Merge "ASACORE-835 Fix ping from service to client 	    in session." into RB14.12
Merge "AJCORE-1300: Resolved issues found using static analysis tool" into RB14.12
Merge "ASACORE-1243 skip assert checks in" into RB14.12