#include "oic_malloc.h"
#include "logger.h"
#include "pbkdf2.h"
-#include "global.h"
#include "base64.h"
#include "oxmmanufacturercert.h"
#include "ownershiptransfermanager.h"
return DoxmToCBORPayload(otmCtx->selectedDeviceInfo->doxm, payload, size, true);
}
+OCStackResult CreateConMCertificateBasedSelectOxmPayload(OTMContext_t* otmCtx, uint8_t **payload, size_t *size)
+{
+ if (!otmCtx || !otmCtx->selectedDeviceInfo || !payload || *payload || !size)
+ {
+ return OC_STACK_INVALID_PARAM;
+ }
+
+ otmCtx->selectedDeviceInfo->doxm->oxmSel = OIC_CON_MFG_CERT;
+
+ return DoxmToCBORPayload(otmCtx->selectedDeviceInfo->doxm, payload, size, true);
+}
+
OCStackResult CreateMCertificateBasedOwnerTransferPayload(OTMContext_t* otmCtx, uint8_t **payload, size_t *size)
{
if (!otmCtx || !otmCtx->selectedDeviceInfo || !payload || *payload || !size)
{
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");
}
OIC_LOG(INFO, TAG, "Anonymous cipher suite disabled.");
- caresult = CASelectCipherSuite(MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
+ caresult = CASelectCipherSuite(MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8,
otmCtx->selectedDeviceInfo->endpoint.adapter);
if (CA_STATUS_OK != caresult)
{
- OIC_LOG_V(ERROR, TAG, "Failed to select TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256");
+ OIC_LOG_V(ERROR, TAG, "Failed to select MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8");
return OC_STACK_ERROR;
}
- OIC_LOG(INFO, TAG, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 cipher suite selected.");
+ OIC_LOG(INFO, TAG, "MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 cipher suite selected.");
OCProvisionDev_t* selDevInfo = otmCtx->selectedDeviceInfo;
CAEndpoint_t *endpoint = (CAEndpoint_t *)OICCalloc(1, sizeof (CAEndpoint_t));