...Also, credUsage type must be 'oic.sec.cred.cert'...
Best regards, Aleksey Volkov
--------- Original Message --------- Sender : Oleksiy Volkov <a.vol...@samsung.com> Staff Engineer/Security Certification Part /SRK/Samsung Electronics Date : 2019-01-03 11:16 (GMT+2) Title : Re: [dev] Certificate-based credential (DTLS fails to find cipher suite)
Hi Khaled,
InitManufacturerCipherSuiteList callback used at the one step of the mfg otm process. In all other cases (yours also) should be used InitCipherSuiteList as g_getCredentialTypesCallback (Please check SRMInitSecureResources function). According to your log, InitCipherSuiteList is called successfully, so it's normal behavior, and there are no other issues than the lack of credentials. Could you share full log from the beginning and dat file of yours 3rd client, please?
Best regards, Aleksey Volkov
--------- Original Message --------- Sender : Khaled Elsayed <khaledi...@gmail.com> Date : 2019-01-02 23:44 (GMT+2) Title : Re: Re: [dev] Certificate-based credential (DTLS fails to find cipher suite)
Hi Aleksey,
Thanks for taking a close look at the log. You are absolutely right about the observation that InitCiherSuite comes back empty handed. The credentials are perfect and have credtype=8 and I check that the .dat files are read correctly by both the client and server codes.
There is a bug in the code either in the function SetupCipher or initialization of callbacks before invoking SetupCipher. It will not work currently as is. I will report this via jira. Here is why:
In SetupCipher, I added some logs for g_caSslContext->cipherFlag[0] and g_caSslContext->cipherFlag[1] both are false after calling g_getCredentialTypesCallback(g_caSslContext->cipherFlag, deviceId);
So, it will not be able to find any ciphersuite. There is a need to properly initialize the g_getCredentialTypesCallback to use the mfg_cert callback functions. Something like what is done in the function OTMSetOTCallback in ownershiptransfermanager.c where it calls PrepareMCertificateCallback to set the callbacks in case it identifies a certificate-based credential. There must be something like this before SetupCipher is called, otherwise no certificates will work. I tried to add some similar code to the function below but got all types of linking errors as I am not really into scons/sconscript :)
OCStackResult PrepareMCertificateCallback(OTMContext_t *otmCtx)
{
OIC_LOG(INFO, TAG, "IN PrepareMCertificateCallback");
if (!otmCtx || !otmCtx->selectedDeviceInfo)
{
return OC_STACK_INVALID_PARAM;
}
if (CA_STATUS_OK != CAregisterPkixInfoHandler(GetManufacturerPkixInfo))
{
OIC_LOG(ERROR, TAG, "Failed to register PkixInfohandler");
return OC_STACK_ERROR;
}
if (CA_STATUS_OK != CAregisterIdentityHandler(NULL))
{
OIC_LOG(ERROR, TAG, "Failed to register IdentityHandler");
return OC_STACK_ERROR;
}
if (CA_STATUS_OK != CAregisterGetCredentialTypesHandler(InitManufacturerCipherSuiteList))
{
OIC_LOG(ERROR, TAG, "Failed to register CredentialTypesHandler");
return OC_STACK_ERROR;
}
OIC_LOG(INFO, TAG, "OUT PrepareMCertificateCallback");
return OC_STACK_OK;
}
On Wed, Jan 2, 2019 at 3:46 PM Oleksiy Volkov <a.vol...@samsung.com> wrote:
_._,_._,_
Links: You receive all messages sent to this group.
View/Reply Online (#10120) |
Reply To Sender
| Reply To Group
|
Mute This Topic
| New Topic _._,_._,_
|
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed
- Re: [dev] Certificate-based credential (DTLS fails to... Gregg Reynolds
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed
- Re: [dev] Certificate-based credential (DTLS fails to... Aleksey Volkov
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed
- Re: [dev] Certificate-based credential (DTLS fails to... Aleksey Volkov
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed
- Re: [dev] Certificate-based credential (DTLS fails to... Aleksey Volkov
- Re: [dev] Certificate-based credential (DTLS fails to... Aleksey Volkov
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed
- Re: [dev] Certificate-based credential (DTLS fails to... Aleksey Volkov
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed
- Re: [dev] Certificate-based credential (DTLS fails to... Aleksey Volkov
- Re: [dev] Certificate-based credential (DTLS fails to... Nathan Heldt-Sheller
- Re: [dev] Certificate-based credential (DTLS fails to... Mats Wichmann
- Re: [dev] Certificate-based credential (DTLS fails to... Nathan Heldt-Sheller
- Re: [dev] Certificate-based credential (DTLS fails to... Gregg Reynolds
- Re: [dev] Certificate-based credential (DTLS fails to... Clarke Stevens
- Re: [dev] Certificate-based credential (DTLS fails to... Khaled Elsayed