return;
}
+ OIC_LOG_V(INFO, TAG, "Cert Buf Length: %lu", *crtBufLen);
+ OIC_LOG(INFO, TAG, "[Cert Buf] : ");
+ OIC_LOG_BUFFER(INFO, TAG, crtBuf, *crtBufLen);
+
mbedtls_x509_crt deviceCert;
int ret = 0;
{
OIC_LOG_V(INFO, TAG, "In %s", __func__);
- if (NULL == getHwKeyContext || NULL == freeHwKeyContext
- || NULL == getOwnCertCb || NULL == setupPkContextCb)
+ if (NULL == getHwKeyContext && NULL == freeHwKeyContext
+ && NULL == getOwnCertCb && NULL == setupPkContextCb)
+ {
+ OIC_LOG(INFO, TAG, "Unregistering callbacks");
+ }
+ else if (NULL == getHwKeyContext || NULL == freeHwKeyContext
+ || NULL == getOwnCertCb || NULL == setupPkContextCb)
{
OIC_LOG(ERROR, TAG, "NULL Passed");
OIC_LOG(ERROR, TAG, "Callback function parameters can not be null");
gHwPkixCtx.getOwnCertCb = getOwnCertCb;
gHwPkixCtx.setupPkContextCb = setupPkContextCb;
- if (gHwPkixCtx.hwKeyCtx)
+ if (gHwPkixCtx.hwKeyCtx && NULL != freeHwKeyContext)
{
gHwPkixCtx.freeHwKeyContext(gHwPkixCtx.hwKeyCtx);
}