[IOT-1849] fixed null subject ID comparison logic
Issue description:
CTT sends requests over coap, but isRequestOverSecureChannel incorrectly concludes
that these requests arrived over a secured channel. That's because here:
if(memcmp(context->requestInfo->info.identity.id,
nullSubjectId.id, sizeof(context->requestInfo->info.identity.id)) != 0)
sizeof(context->requestInfo->info.identity.id) is larger than sizeof(nullSubjectId.id).
So, that compares a bunch of random bytes from the stack with the bytes from
context->requestInfo->info.identity.id.
This changes logic to compare like-sized objects.
patchset 2: resolved IOT-1849; created new IOT-1894 "Determine appropriate CA_MAX_ENDPOINT_IDENTITY_LEN" (see "TODO IOT-1894" comment).
patchset 3: comment typo fix
patchset 4: self review fixes
patchset 5: addressed Dan's feedback
patchset 6: addressed Phil's feedback
patchset 7: replaced if( with if ( throughout
Change-Id: I2781357c74a1e0c47a534bc6df2f2b790c0caae7
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17503
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>