count = g_variant_iter_n_children(iter);
while (g_variant_iter_loop(iter, "(us)", &handle, &name) == true)
{
- SECURE_LOGD("Reader : name [%s], handle [%08x]", name, handle);
-
/* add readers */
reader = new Reader((void *)this->handle, name, GUINT_TO_POINTER(handle));
if (reader == NULL)
return result;
}
- void AccessRule::printAccessRules() const
- {
- if (listFilters.size() > 0)
- {
- vector<pair<ByteArray, ByteArray> >::const_iterator item;
-
- _DBG(" +---- Granted APDUs");
-
- for (item = listFilters.begin(); item != listFilters.end(); item++)
- {
- _DBG(" +----- APDU : %s, Mask : %s", item->first.toString().c_str(), item->second.toString().c_str());
- }
- }
- else
- {
- _DBG(" +---- APDU Access ALLOW : %s", apduRule ? "ALWAYS" : "NEVER");
- }
-
- _DBG(" +---- NFC Access ALLOW : %s", nfcRule ? "ALWAYS" : "NEVER");
- }
-
bool AccessRule::isAuthorizedNFCAccess(void) const
{
return nfcRule;
return result;
}
- void AccessCondition::printAccessConditions() const
- {
- _DBG(" +-- Access Condition");
-
- if (mapRules.size() > 0)
- {
- map<ByteArray, AccessRule>::const_iterator item;
-
- for (item = mapRules.begin(); item != mapRules.end(); item++)
- {
- ByteArray temp = item->first;
-
- _DBG(" +--- hash : %s", (temp == AccessControlList::ALL_DEVICE_APPS) ? "All device applications" : temp.toString().c_str());
- item->second.printAccessRules();
- }
- }
- else
- {
- _DBG(" +--- permission : %s", permission ? "granted all" : "denied all");
- }
- }
-
void AccessCondition::setAPDUAccessRule(const ByteArray &certHash,
bool rule)
{
END :
return result;
}
-
- void AccessControlList::printAccessControlList() const
- {
- ByteArray temp;
- map<ByteArray, AccessCondition>::const_iterator iterMap;
-
- _DBG("========================== Access Control Rules ============================");
- for (iterMap = mapConditions.begin(); iterMap != mapConditions.end(); iterMap++)
- {
- temp = iterMap->first;
-
- _DBG("+ aid : %s", (temp == DEFAULT_SE_APP) ? "Default Application" : (temp == ALL_SE_APPS) ? "All SE Applications" : temp.toString().c_str());
-
- iterMap->second.printAccessConditions();
- }
- _DBG("============================================================================");
- }
-
} /* namespace smartcard_service_api */
{
_INFO("access rules are not changed. skip update");
}
-
- printAccessControlList();
} else {
_ERR("transmitSync failed, %x", result);
}
result = loadAccessControl(channel, dodf);
if (result == SCARD_ERROR_OK)
{
- printAccessControlList();
}
else
{
bool nfcRule;
vector<pair<ByteArray, ByteArray> > listFilters;
- void printAccessRules() const;
-
public :
AccessRule() : apduRule(true), nfcRule(true) {}
ByteArray aid;
map<ByteArray, AccessRule> mapRules;
- void printAccessConditions() const;
-
public :
AccessCondition() : permission(false) {}
AccessRule *getAccessRule(const ByteArray &certHash);
const AccessRule *getAccessRule(const ByteArray &certHash) const;
-
friend class AccessControlList;
};
const ByteArray &hash) const;
AccessCondition &getAccessCondition(const ByteArray &aid);
- void printAccessControlList() const;
-
public:
static ByteArray ALL_SE_APPS;
static ByteArray DEFAULT_SE_APP;
snprintf(fullPath, sizeof(fullPath),
"%s/%s", OMAPI_SE_PATH, entry->d_name);
- SCARD_DEBUG("se name [%s]", fullPath);
-
result = appendSELibrary(fullPath);
}
}
snprintf(fullPath, sizeof(fullPath), "%s/%s", OMAPI_SE_PATH, entry->d_name);
- SCARD_DEBUG("se name [%s]", fullPath);
-
result = appendSELibrary(fullPath);
}
}