#include "oic_string.h"
#include "base64.h"
#include "doxmresource.h"
+#include "credresource.h"
#include "pstatresource.h"
#include "cacommon.h"
#include "casecurityinterface.h"
return OXM_RANDOM_DEVICE_PIN;
case OIC_MANUFACTURER_CERTIFICATE:
return OXM_MANUFACTURER_CERTIFICATE;
+ case OIC_RAW_PUB_KEY:
+ return OXM_RAW_PUBLIC_KEY;
#ifdef MULTIPLE_OWNER
case OIC_PRECONFIG_PIN:
return OXM_PRECONF_PIN;
//Restore Pkix handler to initial state
CAregisterPkixInfoHandler(GetPkixInfo);
CAregisterGetCredentialTypesHandler(InitCipherSuiteList);
+ CAregisterPskCredentialsHandler(GetDtlsPskCredentials);
break;
default:
OIC_LOG_V(ERROR, TAG, "Unknow OTM event : %d", event);
}
OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
}
+
+const OicUuid_t THE_NIL_UUID = {.id={0000000000000000}};
+
+/**
+ * Compares two OicUuid_t structs.
+ *
+ * @return true if the two OicUuid_t structs are equal, else false.
+ */
+bool UuidCmp(const OicUuid_t *firstId, const OicUuid_t *secondId)
+{
+ bool ret = false;
+ VERIFY_NON_NULL(TAG, firstId, ERROR);
+ VERIFY_NON_NULL(TAG, secondId, ERROR);
+
+ if (0 == memcmp(firstId, secondId, sizeof(OicUuid_t)))
+ {
+ ret = true;
+ }
+
+exit:
+ OIC_LOG_V(DEBUG, TAG, "%s: returning %s.", __func__, ret?"true":"false");
+ return ret;
+}
+
+/**
+ * Compares OicUuid_t to Nil UUID {.id={0000000000000000}}
+ *
+ * @return true if the OicUuid_t is the Nil UUID.
+ */
+bool IsNilUuid(const OicUuid_t *uuid)
+{
+#if !defined(NDEBUG)
+ char *strUuid = NULL;
+ ConvertUuidToStr(uuid, &strUuid);
+ if (strUuid)
+ {
+ OIC_LOG_V(DEBUG, TAG, "%s: uuid: %s.", __func__, strUuid);
+ OICFree(strUuid);
+ }
+#endif
+ return UuidCmp(uuid, &THE_NIL_UUID);
+}
+
#endif