PIN_PASSWORD, ASYMMETRIC_ENCRYPTION_KEY
};
+#ifdef MULTIPLE_OWNER
+static const char *DOXM_MOM_STRING[OIC_NUMBER_OF_MOM_TYPE] =
+{
+ "OIC_MULTIPLE_OWNER_DISABLE", "OIC_MULTIPLE_OWNER_ENABLE", "OIC_MULTIPLE_OWNER_TIMELY_ENABLE"
+};
+
+static const unsigned int DOXM_MOM_NUMBER[OIC_NUMBER_OF_MOM_TYPE] =
+{
+ OIC_MULTIPLE_OWNER_DISABLE, OIC_MULTIPLE_OWNER_ENABLE, OIC_MULTIPLE_OWNER_TIMELY_ENABLE
+};
+#endif //MULTIPLE_OWNER
+
typedef enum DoxmModifyType
{
DOXM_EDIT_OXM = 1,
DOXM_EDIT_OXMSEL,
DOXM_EDIT_SCT,
+#ifdef MULTIPLE_OWNER
+ DOXM_EDIT_MOM,
+#endif //MULTIPLE_OWNER
DOXM_EDIT_OWNED,
DOXM_EDIT_DEVICEID,
DOXM_EDIT_OWNER,
- DOXM_EDIT_ROWNERID = 7,
+ DOXM_EDIT_ROWNERID,
DOXM_SAVE = 98,
DOXM_CANCEL = 99
} DoxmModifyType;
return 0;
}
+#ifdef MULTIPLE_OWNER
+static int InputMom(OicSecMomType_t *mom_mode)
+{
+ unsigned int sel = 0;
+ OicSecMomType_t tmpMom = 0;
+ bool isFirstEntry = false;
+ PRINT_PROG("\nInput the Supported Mom Types\n");
+ for (;;)
+ {
+ for (size_t i = 0; i < OIC_NUMBER_OF_MOM_TYPE; i++)
+ {
+ ((tmpMom == DOXM_MOM_NUMBER[i]) && isFirstEntry) ? PRINT_DATA("\t%zu. %s\n", i, DOXM_MOM_STRING[i]) :
+ PRINT_NORMAL("\t%zu. %s\n", i, DOXM_MOM_STRING[i]);
+ isFirstEntry = true;
+ }
+ PRINT_NORMAL("\t%d. Save\n", DOXM_SAVE);
+ PRINT_NORMAL("\t%d. Cancel\n", DOXM_CANCEL);
+ sel = InputNumber("Select number: ");
+ if (sel < OIC_NUMBER_OF_MOM_TYPE)
+ {
+ tmpMom ^= DOXM_MOM_NUMBER[sel];
+ }
+ else if (DOXM_SAVE == sel)
+ {
+ break;
+ }
+ else if (DOXM_CANCEL == sel)
+ {
+ return -1;
+ }
+ else
+ {
+ PRINT_WARN("Wrong number.");
+ }
+ }
+ *mom_mode = tmpMom;
+ return 0;
+}
+#endif //MULTIPLE_OWNER
+
static bool InputOwned(void)
{
char ans = 0;
return NULL;
}
+#ifdef MULTIPLE_OWNER
+ ret = InputMom(&(doxm->mom->mode));
+ if (0 != ret)
+ {
+ PRINT_ERR("Failed InputMom\n");
+ DeleteDoxmBinData(doxm);
+ return NULL;
+ }
+#endif //MULTIPLE_OWNER
+
doxm->owned = InputOwned();
PRINT_PROG(
PRINT_DATA("\t%2d. Edit oxms\n", DOXM_EDIT_OXM);
PRINT_DATA("\t%2d. Edit oxmSel\n", DOXM_EDIT_OXMSEL);
PRINT_DATA("\t%2d. Edit sct\n", DOXM_EDIT_SCT);
+#ifdef MULTIPLE_OWNER
+ PRINT_DATA("\t%2d. Edit mom\n", DOXM_EDIT_MOM);
+#endif //MULTIPLE_OWNER
PRINT_DATA("\t%2d. Edit owned\n", DOXM_EDIT_OWNED);
PRINT_DATA("\t%2d. Edit deviceID\n", DOXM_EDIT_DEVICEID);
PRINT_DATA("\t%2d. Edit owner\n", DOXM_EDIT_OWNER);
return -1;
}
break;
+#ifdef MULTIPLE_OWNER
+ case DOXM_EDIT_MOM:
+ if (0 != InputMom(&(g_doxm->mom->mode)))
+ {
+ PRINT_ERR("Failed InputMom");
+ return -1;
+ }
+ break;
+#endif
case DOXM_EDIT_OWNED:
g_doxm->owned = InputOwned();
break;