#include "cainterface.h"
#include "ocrandom.h"
#include "oic_malloc.h"
+#include "oic_string.h"
#include "logger.h"
#include "pbkdf2.h"
-#include "global.h"
#include "base64.h"
#include "oxmpreconfpin.h"
#include "ownershiptransfermanager.h"
#include "pinoxmcommon.h"
#include "srmresourcestrings.h"
-#define TAG "OXM_PreconfigPIN"
+#define TAG "OIC_OXM_PreconfigPIN"
-OCStackResult CreatePreconfPinBasedSelectOxmPayload(OTMContext_t* otmCtx, uint8_t **payload, size_t *size)
+OCStackResult CreatePreconfigPinBasedSelectOxmPayload(OTMContext_t *otmCtx, uint8_t **payload, size_t *size)
{
if(!otmCtx || !otmCtx->selectedDeviceInfo || !payload || *payload || !size)
{
return DoxmToCBORPayload(otmCtx->selectedDeviceInfo->doxm, payload, size, true);
}
-OCStackResult CreatePreconfPinBasedOwnerTransferPayload(OTMContext_t* otmCtx, uint8_t **payload, size_t *size)
+OCStackResult CreatePreconfigPinBasedOwnerTransferPayload(OTMContext_t *otmCtx, uint8_t **payload, size_t *size)
{
if(!otmCtx || !otmCtx->selectedDeviceInfo || !payload || *payload || !size)
{
return DoxmToCBORPayload(otmCtx->selectedDeviceInfo->doxm, payload, size, true);
}
-OCStackResult LoadPreconfPinCodeCallback(OTMContext_t *otmCtx)
+OCStackResult LoadPreconfigPinCodeCallback(OTMContext_t *otmCtx)
{
- OIC_LOG(INFO, TAG, "IN LoadPreconfPinCodeCallback");
+ OIC_LOG(INFO, TAG, "IN LoadPreconfigPinCodeCallback");
OCStackResult res = OC_STACK_ERROR;
OicSecCred_t* cred = GetCredResourceData(&otmCtx->selectedDeviceInfo->doxm->deviceID);
if(NULL == cred)
res = OC_STACK_ERROR;
}
}
-#ifdef _ENABLE_MULTIPLE_OWNER_
+#ifdef MULTIPLE_OWNER
//in case of MOT
else if(true == otmCtx->selectedDeviceInfo->doxm->owned &&
otmCtx->selectedDeviceInfo->doxm->mom &&
res = OC_STACK_ERROR;
}
}
-#endif //_ENABLE_MULTIPLE_OWNER_
+#endif //MULTIPLE_OWNER
//Set the device id to derive temporal PSK
SetUuidForPinBasedOxm(&(otmCtx->selectedDeviceInfo->doxm->deviceID));
- OIC_LOG(INFO, TAG, "OUT LoadPreconfPinCodeCallback");
+ OIC_LOG(INFO, TAG, "OUT LoadPreconfigPinCodeCallback");
return res;
}
-OCStackResult CreateSecureSessionPreconfPinCallback(OTMContext_t* otmCtx)
+OCStackResult CreateSecureSessionPreconfigPinCallback(OTMContext_t* otmCtx)
{
- OIC_LOG(INFO, TAG, "IN CreateSecureSessionPreconfPinCallback");
+ OIC_LOG(INFO, TAG, "IN CreateSecureSessionPreconfigPinCallback");
if (!otmCtx || !otmCtx->selectedDeviceInfo)
{
}
OIC_LOG(INFO, TAG, "Anonymous cipher suite disabled.");
- caresult = CASelectCipherSuite(TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA_256, otmCtx->selectedDeviceInfo->endpoint.adapter);
+ caresult = CASelectCipherSuite(MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, otmCtx->selectedDeviceInfo->endpoint.adapter);
if (CA_STATUS_OK != caresult)
{
- OIC_LOG_V(ERROR, TAG, "Failed to select TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA_256");
+ OIC_LOG_V(ERROR, TAG, "Failed to select TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256");
return OC_STACK_ERROR;
}
- OIC_LOG(INFO, TAG, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA_256 cipher suite selected.");
+ OIC_LOG(INFO, TAG, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 cipher suite selected.");
OCProvisionDev_t* selDevInfo = otmCtx->selectedDeviceInfo;
CAEndpoint_t *endpoint = (CAEndpoint_t *)OICCalloc(1, sizeof (CAEndpoint_t));
return OC_STACK_ERROR;
}
- OIC_LOG(INFO, TAG, "OUT CreateSecureSessionPreconfPinCallback");
+ OIC_LOG(INFO, TAG, "OUT CreateSecureSessionPreconfigPinCallback");
return OC_STACK_OK;
}