CAResult_t CASetSslExportKeysCallback(SslExportKeysCallback_t exportKeysCb,
CASslEkcbProtocol_t protocol, CASslEkcbRole_t role);
-
+/**
+ * API to set certificate verification callback.
+ */
void CAsetCertificateVerificationCallback(CertificateVerificationCallback_t noCertCallback);
+/**
+ * API to unset certificate verification callback.
+ */
+void CAunsetCertificateVerificationCallback();
+
#endif //__WITH_TLS__ or __WITH_DTLS__
OIC_LOG_V(DEBUG, NET_SSL_TAG, "Out %s", __func__);
}
+void CAunsetCertificateVerificationCallback()
+{
+ OIC_LOG_V(DEBUG, NET_SSL_TAG, "In %s", __func__);
+ g_CertificateVerificationCallback = NULL;
+ OIC_LOG_V(DEBUG, NET_SSL_TAG, "Out %s", __func__);
+}
+
static int GetAdapterIndex(CATransportAdapter_t adapter)
{
switch (adapter)
*/
OCStackResult SetNumberOfSubOwner(size_t maxSubOwner);
-
#ifdef __cplusplus
}
#endif
typedef OCStackResult (*InputStateCallback)(void * ctx);
/**
+ * Function pointer to notify user selected OXM
+ */
+typedef void (*InformOxmSelectedCallback_t)(OicSecOxm_t oxmSel);
+
+/**
* Context for displaying verification PIN
*/
typedef struct DisplayNumContext
void SetVerifyOption(VerifyOptionBitmask_t verifyOption);
/**
+ * Set notify selected OXM callback
+ */
+void SetInformOxmSelCB(InformOxmSelectedCallback_t informOxmSelCB);
+
+/**
+ * Set notify selected OXM callback
+ */
+void UnsetInformOxmSelCB();
+
+/**
* Call the Callback for Verifying Ownership Transfer process.
*/
OCStackResult VerifyOwnershipTransfer(uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN],
OCStackResult OCSetPeerCertCallback(void *ctx, PeerCertCallback peerCertCallback);\r
\r
/*\r
- * Callback for selecting OTM.\r
+ * Set selecting OTM callback.\r
*/\r
void SetSelectOTMCB(OTMSelectMethodCallback selectOTMcb);\r
\r
+/*\r
+ * Unset selecting OTM callback.\r
+ */\r
+void UnsetSelectOTMCB();\r
+\r
#endif // __WITH_DTLS__ || __WITH_TLS__\r
\r
\r
return;
}
+void informOxmSelCB(OicSecOxm_t oxmSel)\r
+{\r
+ printf(" > OXM selected: 0x%x\n", oxmSel);\r
+}\r
+\r
FILE* server_fopen(const char *path, const char *mode)
{
(void)path;
OCPersistentStorage ps = {server_fopen, fread, fwrite, fclose, unlink, NULL, NULL};
SetUserConfirmCB(NULL, confirmCB);
+ SetInformOxmSelCB(informOxmSelCB);
CAsetCertificateVerificationCallback(confirmNoCertCB);
OCRegisterPersistentStorageHandler(&ps);
return;
}
+void UnsetSelectOTMCB()
+{
+ g_selectOTMCB = NULL;
+ return;
+}
+
/**
* Internal API to convert OxM value to index of oxm allow table.
*/
static oc_mutex g_mutexDoxm = NULL;
static bool g_isDoxmNull = false;
static OCResourceHandle gDoxmHandle = NULL;
+static InformOxmSelectedCallback_t g_InformOxmSelectedCallback = NULL;
static OicSecOxm_t gOicSecDoxmJustWorks = OIC_JUST_WORKS;
static OicSecDoxm_t gDefaultDoxm =
return isValidOxmsel;
}
+void SetInformOxmSelCB(InformOxmSelectedCallback_t informOxmSelCB)
+{
+ OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
+ g_InformOxmSelectedCallback = informOxmSelCB;
+ OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
+}
+
+void UnsetInformOxmSelCB()
+{
+ OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
+ g_InformOxmSelectedCallback = NULL;
+ OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
+}
+
static OCEntityHandlerResult HandleDoxmPostRequest(OCEntityHandlerRequest * ehRequest)
{
OIC_LOG (DEBUG, TAG, "Doxm EntityHandle processing POST request");
ehRet = OC_EH_NOT_ACCEPTABLE;
goto exit;
}
+ if (g_InformOxmSelectedCallback)
+ {
+ g_InformOxmSelectedCallback(newDoxm->oxmSel);
+ }
#if defined (__WITH_TLS__) || defined(__WITH_DTLS__)
if (memcmp(&(newDoxm->owner), &emptyOwner, sizeof(OicUuid_t)) == 0)