- declare virtual function for some overriding function.
- fix the access control instance is passed null.
- adjust log format
- get rid of a parameter no longer used.
Change-Id: I1baec4cbe898cbb4853ab25c7296759877c330b4
{
vector<pair<ByteArray, ByteArray> >::iterator item;
- _DBG(" +---- Granted APDUs");
+ _DBG(" +---- Granted APDUs");
for (item = listFilters.begin(); item != listFilters.end(); item++)
{
- _DBG(" +----- APDU : %s, Mask : %s", item->first.toString(), item->second.toString());
+ _DBG(" +----- APDU : %s, Mask : %s", item->first.toString(), item->second.toString());
}
}
else
{
- _DBG(" +---- APDU Access ALLOW : %s", apduRule ? "ALWAYS" : "NEVER");
+ _DBG(" +---- APDU Access ALLOW : %s", apduRule ? "ALWAYS" : "NEVER");
}
- _DBG(" +---- NFC Access ALLOW : %s", nfcRule ? "ALWAYS" : "NEVER");
+ _DBG(" +---- NFC Access ALLOW : %s", nfcRule ? "ALWAYS" : "NEVER");
}
bool AccessRule::isAuthorizedNFCAccess(void)
int updateACL(Channel *channel) { return loadACL(channel); }
void releaseACL();
- bool isAuthorizedAccess(ByteArray &aid,
+ virtual bool isAuthorizedAccess(ByteArray &aid,
ByteArray &certHash);
- bool isAuthorizedAccess(unsigned char *aidBuffer,
+ virtual bool isAuthorizedAccess(unsigned char *aidBuffer,
unsigned int aidLength, unsigned char *certHashBuffer,
unsigned int certHashLength);
- bool isAuthorizedAccess(ByteArray &aid,
+ virtual bool isAuthorizedAccess(ByteArray &aid,
vector<ByteArray> &certHashes);
- bool isAuthorizedAccess(ByteArray &aid,
+ virtual bool isAuthorizedAccess(ByteArray &aid,
vector<ByteArray> &certHashes, ByteArray &command);
- bool isAuthorizedNFCAccess(ByteArray &aid,
+ virtual bool isAuthorizedNFCAccess(ByteArray &aid,
vector<ByteArray> &certHashes);
};
return result;
}
- bool ServerResource::_isAuthorizedAccess(ServerChannel *channel, int pid, ByteArray aid, vector<ByteArray> &hashes)
+ bool ServerResource::_isAuthorizedAccess(ServerChannel *channel, ByteArray aid, vector<ByteArray> &hashes)
{
bool result = true;
AccessControlList *acList = NULL;
}
else
{
- _ERR("acList is null");
- result = false;
+ acList->loadACL(channel);
}
if (acList != NULL)
channel = service->getChannel(result);
/* check */
- if (_isAuthorizedAccess(channel, service->getParent()->getPID(),
- aid, service->getParent()->getCertificationHashes()) == true)
+ if (_isAuthorizedAccess(channel, aid,
+ service->getParent()->getCertificationHashes()) == true)
{
int rv = 0;
if (acl == NULL) {
/* load access control defined by Global Platform */
- GPACE *acl = new GPACE();
+ acl = new GPACE();
if (acl != NULL) {
int ret;
acl->updateACL(channel);
}
- delete channel;
-
if (acl != NULL) {
result = acl->isAuthorizedNFCAccess(aid, hashes);
+ } else {
+ _ERR("acl is null");
}
+
+ delete channel;
+ } else {
+ _ERR("alloc failed");
}
+ } else {
+ _ERR("_openLogicalChannel failed");
}
return result;
int _openLogicalChannel(Terminal *terminal);
int _closeLogicalChannel(Terminal *terminal, int channelNum);
- bool _isAuthorizedAccess(ServerChannel *channel, int pid, ByteArray aid, vector<ByteArray> &hashes);
+ bool _isAuthorizedAccess(ServerChannel *channel, ByteArray aid, vector<ByteArray> &hashes);
unsigned int _createChannel(Terminal *terminal, ServiceInstance *service, int channelType, unsigned int sessionID, ByteArray aid)
throw(ExceptionBase &);