RET_IF_FAIL(__pluginHandle->process != NULL, NULL);
RET_IF_FAIL(__pluginHandle->process->process != NULL, NULL);
+ _INFO("");
+
TlvEncodable<GetInfoReq> encodableReq;
encodableReq.setEncoder(EID_UAFV1_GETINFO_REQ);
+ _INFO("");
TlvEncodable<GetAuthInfoResp> encodableResp;
encodableResp.setEncoder(EID_UAFV1_GETINFO_RESP);
+ _INFO("");
Buffer *authReq = encodableReq.encode();
unsigned char *authRespRaw = NULL;
+ _INFO("");
__pluginHandle->process->process(authReq->data, &authRespRaw);
+ _INFO("");
__cachedData = encodableResp.decode(authRespRaw);
/*Map AuthIndex*/
/*TODO: Find Device ID logic used by IoTCon*/
+ _INFO("");
if (__cachedData->authList != NULL) {
+ _INFO("");
GList *authListIter = g_list_first(__cachedData->authList);
while (authListIter != NULL) {
+ _INFO("");
AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(authListIter->data);
/*TODO: Find Device ID logic used by IoTCon*/
_INFO("Before calling getMappedIndex");
_INFO("After calling getMappedIndex");
authInfo->__devId = strdup(AsmCrypto::getDeviceId().c_str());
+ _INFO("");
authInfo->__isUserEnrolled = isEnrolled();
authInfo->__isRoamingAuthenticator = false;
+ _INFO("");
authListIter = authListIter->next;
}
}
+ _INFO("");
/*Fill-up additional data*/
__cachedData->attach_hint = ATTACHMENT_HINT_INTERNAL;
/*__cachedData->attach_hint = __pluginHandle->conn->attach_hint();*/
/*__cachedData->description = __pluginHandle->conn->description();*/
}
+ /*Resetting fields altered during last RA operation*/
+ else if (__cachedData->authList != NULL) {
+ _INFO("");
+ GList *authListIter = g_list_first(__cachedData->authList);
+ while (authListIter != NULL) {
+ AuthenticatorInfo *authInfo = (AuthenticatorInfo*)(authListIter->data);
+ authInfo->__isRoamingAuthenticator = false;
+ authListIter = authListIter->next;
+ }
+ }
+
_INFO("Returning __cachedData");
return __cachedData;
}
default:
/*Rest are not supported for Roaming operations*/
+ /*https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-asm-api-v1.0-ps-20141208.html#access-control-for-asm-apis*/
_ERR("");
delete asmReq;
return NULL;
signAuthReq->khHList = storedKhList;
_INFO("Matched khlist count =[%d]", g_list_length(signAuthReq->khHList));
} else {
- signAuthReq->khHList = NULL;
- _ERR("NO Matched khlist");
+ _ERR("NO Matched khlist, trying with direct keyid");
+
+ /*Temp fix to not use b64 encode of keyid*/
+
+
+ IStorageParcel *searchParcel = new AsmStorageParcel();
+ std::string appIdStr(signAuthReq->appId);
+ searchParcel->setString(STR_PROP_APP_ID, appIdStr);
+
+ GList *storedKhList = NULL;
+ GList *recvdKhListIter = g_list_first(signAuthReq->khHList);
+
+ while (recvdKhListIter != NULL) {
+
+ char *recvKh = (char*)(recvdKhListIter->data);
+ /*unsigned char *recvKhDec = AsmCrypto::ToBase64Url((unsigned char*)recvKh, strlen(recvKh));*/
+ if (recvKh != NULL) {
+
+ std::string kIdStr((char*)recvKh);
+ searchParcel->setString(STR_PROP_KEY_ID, kIdStr);
+ _INFO("search=[%s][%s]", appIdStr.c_str(), kIdStr.c_str());
+
+ std::vector<IStorageParcel*> *searchRes = AsmStorage::getInstance()->searchData(searchParcel);
+ if (searchRes != NULL) {
+
+ int recFound = searchRes->size();
+ _INFO("Records found in database corresponding to appId = [%d]", recFound);
+ if (recFound <= 0) {
+ _INFO("No key registered for this app");
+ }
+
+ std::vector<IStorageParcel*>::iterator searchResIter = searchRes->begin();
+
+ for (; searchResIter != searchRes->end(); ++searchResIter) {
+
+ IStorageParcel *parcel = *searchResIter;
+ char *kh = NULL;
+ int res = parcel->getString(STR_PROP_KEY_HANDLE, &kh);
+
+ if (res == 0) {
+ _INFO("Length of b64 encoded keyHandle : [%d]", strlen(kh));
+ storedKhList = g_list_append(storedKhList, kh);
+ }
+ }
+ }
+ }
+
+ recvdKhListIter = recvdKhListIter->next;
+ }
+
+ if (storedKhList == NULL) {
+ _ERR("No matching keyid found");
+ return -1;
+ }
+
+ storedKhList = g_list_first(storedKhList);
+ signAuthReq->khHList = storedKhList;
+ _INFO("Matched khlist count =[%d]", g_list_length(signAuthReq->khHList));
+
}
}
if(deleteRecord == -1)
return -1;
+ /*Temp fix: try to delete b64enc keyid too*/
+ _INFO("About to delete non-b64-enc too=[%s][%s]", deRegAuthReq->appId, deRegAuthReq->keyId);
+ deleteRecord = deleteAsmRecord(deRegAuthReq->appId, deRegAuthReq->keyId);
+
DeregResp *stubResp = authStub->processDeregister(deRegAuthReq);
RET_IF_FAIL(stubResp != NULL, -1);
- echo "User::Pkg::org.tizen.fido-syspopup" >> /etc/auth-fw/client-whitelist
6. Install rademotv from IDE
If IDE does not recognize TM1 then:
-sdb push org.example.rademotv-1.0.0-arm.tpk /opt/usr/home/owner/apps_rw/tmp
+sdb push org.example.rademotv-1.0.0-arm.tpk /opt/usr/home/owner/apps_rw/tmp/
sdb shell tpk-backend -i /opt/usr/home/owner/apps_rw/tmp/org.example.rademotv-1.0.0-arm.tpk
-sdb shell tpk-backend -i /opt/usr/home/owner/apps_rw/tmp/org.example.rademotv-1.0.0-arm.tpk --preload
6. Reboot