security: Store all incoming credentials 67/21867/4
authorDan Mihai <Daniel.Mihai@microsoft.com>
Fri, 11 Aug 2017 04:00:07 +0000 (21:00 -0700)
committerNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Tue, 15 Aug 2017 03:09:57 +0000 (03:09 +0000)
commit502543e5457054a86bae8d71deed1aefc0ca6e12
tree99140ecf81abe2156398426d3791091b5491d8a5
parent64a8b46f17147eca2425f2dd6a0b27a408039646
security: Store all incoming credentials

CBORPayloadToCred returns a list of creds, but list entries other
than the head were being ignored (and leaked) by HandlePostRequest.

Also, go back to LL_APPEND in AddCredential(). Commit
0d511009c8c2e0082ed66359c11cc1f1967b5896 changed that recently to
LL_PREPEND, but the gCred->rownerID update below LL_PREPEND
dosn't make sense anymore (because gCred points to newCred).

The remaining gCred->rownerID updates still look fragile, so it's
very possible those still don't work well.

This patch allows CT1.7.8.5 to find a common ciphersuite with
the target device, when trying to connect using cert credentials.
The target device did not have proper cert creds before this patch -
and therefore the ciphersuites did not match.

CT1.7.8.5 still fails later on, during DTLS handshake - to be
investigated later.

Change-Id: I8205925ca5d30619fdd306847847026a32c8b749
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
bug: https://jira.iotivity.org/browse/IOT-2606
Reviewed-on: https://gerrit.iotivity.org/gerrit/21867
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
resource/csdk/security/src/credresource.c