if (command.size() == offset) {
result = true;
} else {
- _ERR("command stream is not correct, command.size() [%d], offset [%d]", command.size(), offset);
+ _ERR("command stream is not correct, command.size() [%zu], offset [%d]", command.size(), offset);
}
return result;
_INFO("no rule found, aid [%s]", aid.toString().c_str());
for (i = 0; i < certHashes.size(); i++) {
- _INFO(" hash[%d] [%s]", i, certHashes[i].toString().c_str());
+ _INFO(" hash[%zu] [%s]", i, certHashes[i].toString().c_str());
}
END :
_INFO("no rule found, aid [%s]", aid.toString().c_str());
for (i = 0; i < certHashes.size(); i++) {
- _INFO(" hash[%d] [%s]", i, certHashes[i].toString().c_str());
+ _INFO(" hash[%zu] [%s]", i, certHashes[i].toString().c_str());
}
END :
return result;
if (offset >= length)
{
- _ERR("buffer overflow, offset [%d], length [%d]", offset, length);
+ _ERR("buffer overflow, offset [%zu], length [%zu]", offset, length);
return NULL;
}
if (offset >= length)
{
- _ERR("buffer overflow, offset [%d], length [%d]", offset, length);
+ _ERR("buffer overflow, offset [%zu], length [%zu]", offset, length);
return NULL;
}
{
if (index >= length)
{
- _ERR("buffer overflow, index [%d], length [%d]", index, length);
+ _ERR("buffer overflow, index [%zu], length [%zu]", index, length);
if (length > 0) {
return buffer[length - 1];
} else {
{
if (index >= length)
{
- _ERR("buffer underflow, index [%d], length [%d]", index, length);
+ _ERR("buffer underflow, index [%zu], length [%zu]", index, length);
if (length > 0) {
return buffer[0];
} else {
{
if (index >= length)
{
- _ERR("buffer overflow, index [%d], length [%d]", index, length);
+ _ERR("buffer overflow, index [%zu], length [%zu]", index, length);
if (length > 0) {
return buffer[length -1];
} else {
fflush(file);
fclose(file);
- SECURE_LOGD("file has written, file [%s], length[%d]", filePath, length);
+ SECURE_LOGD("file has written, file [%s], length[%zu]", filePath, length);
} else {
_ERR("file open failed, [%d]", errno);
}
setSelectResponse(result);
} else {
- _ERR("select apdu is failed, rv [%d], length [%d]",
+ _ERR("select apdu is failed, rv [%d], length [%zu]",
ret, result.size());
ret = ERROR_ILLEGAL_STATE;
ret = resp.getStatus();
if (ret >= 0) {
- _DBG("response [%d] : %s", response.size(), response.toString().c_str());
+ _DBG("response [%zu] : %s", response.size(), response.toString().c_str());
result = Record(recordId, resp.getDataField());
} else {
_ERR("status word [ %02X %02X ]", resp.getSW1(), resp.getSW2());
}
} else {
- _ERR("select apdu is failed, rv [%d], length [%d]", ret, response.size());
+ _ERR("select apdu is failed, rv [%d], length [%zu]", ret, response.size());
}
return ret;
ResponseHelper resp(response);
if (resp.getStatus() >= 0) {
- _DBG("response [%d] : %s", response.size(), response.toString().c_str());
+ _DBG("response [%zu] : %s", response.size(), response.toString().c_str());
result = resp.getDataField();
_ERR("status word [ %02X %02X ]", resp.getSW1(), resp.getSW2());
}
} else {
- _ERR("select apdu is failed, rv [%d], length [%d]", ret, response.size());
+ _ERR("select apdu is failed, rv [%d], length [%zu]", ret, response.size());
}
return ret;
ResponseHelper resp(response);
if (resp.getStatus() >= 0) {
- _DBG("response [%d] : %s", response.size(), response.toString().c_str());
+ _DBG("response [%zu] : %s", response.size(), response.toString().c_str());
ret = SUCCESS;
} else {
_ERR("status word [ %02X %02X ]", resp.getSW1(), resp.getSW2());
}
} else {
- _ERR("select apdu is failed, rv [%d], length [%d]", ret, response.size());
+ _ERR("select apdu is failed, rv [%d], length [%zu]", ret, response.size());
}
return ret;
for (i = 0; i < length; i += 8) {
temp.assign(tlv.getValue().getBuffer(i), 8);
- _DBG("apdu rule[%d] : %s", temp.size(), temp.toString().c_str());
+ _DBG("apdu rule[%zu] : %s", temp.size(), temp.toString().c_str());
apduRule.push_back(temp);
}
} else if (length == 1){
result = ResponseHelper::getStatus(resp);
if (result >= SCARD_ERROR_OK) {
response = ResponseHelper::getDataField(resp);
- _DBG("response[%d] : %s", response.size(), response.toString().c_str());
+ _DBG("response[%zu] : %s", response.size(), response.toString().c_str());
} else {
_ERR("transmit returns error, [%d]", result);
}
helper.getBuffer(cmd);
- _DBG("command[%d] : %s", cmd.size(), cmd.toString().c_str());
+ _DBG("command[%zu] : %s", cmd.size(), cmd.toString().c_str());
result = doTransmit(channel, cmd, response);
}
}
- _DBG("data[%d] : %s", data.size(), data.toString().c_str());
+ _DBG("data[%zu] : %s", data.size(), data.toString().c_str());
} else if (length == 0) {
_INFO("Response-ALL-AR-DO is empty");
data.clear();
break;
}
}
- _DBG("data[%d] : %s", data.size(), data.toString().c_str());
+ _DBG("data[%zu] : %s", data.size(), data.toString().c_str());
} else {
_INFO("Response-ALL-AR-DO is empty");
data.clear();
tlv.size() == 8) {
tag = tlv.getValue();
result = SCARD_ERROR_OK;
- _DBG("refreshTag[%d] : %s", tag.size(), tag.toString().c_str());
+ _DBG("refreshTag[%zu] : %s", tag.size(), tag.toString().c_str());
} else {
_ERR("decodeTLV failed, %s", response.toString().c_str());
result = SCARD_ERROR_ILLEGAL_PARAM;
case (unsigned int)0x80 : /* length : INTEGER */
cert->length = NumberStream::getBigEndianNumber(tlv.getValue());
- _DBG("length : %d", cert->length);
+ _DBG("length : %zu", cert->length);
break;
}
}
if (result >= SCARD_ERROR_OK) {
result = file.readBinary(0, cert->length, cert->certificate);
if (result >= SCARD_ERROR_OK) {
- _DBG("certificate[%d] : %s", cert->certificate.size(), cert->certificate.toString().c_str());
+ _DBG("certificate[%zu] : %s", cert->certificate.size(), cert->certificate.toString().c_str());
} else {
_ERR("readBinary failed, [%x]", result);
}
listCertType.push_back(cert);
}
- _INFO("listCertType.size() = %d", listCertType.size());
+ _INFO("listCertType.size() = %zu", listCertType.size());
return (listCertType.size() > 0);
}
}
}
- _INFO("dataList.size() = %d", mapOID.size());
+ _INFO("dataList.size() = %zu", mapOID.size());
return result;
}
}
}
- _INFO("dataList.size() = %d", dataList.size());
+ _INFO("dataList.size() = %zu", dataList.size());
return result;
}
dodf = NULL;
}
} else {
- _ERR("[%02X] is not found. total [%d]", TAG_DODF, dataList.size());
+ _ERR("[%02X] is not found. total [%zu]", TAG_DODF, dataList.size());
}
}
cdf = NULL;
}
} else {
- _ERR("[%02X] is not found. total [%d]", TAG_CDF, dataList.size());
+ _ERR("[%02X] is not found. total [%zu]", TAG_CDF, dataList.size());
}
}
if (value != NULL && strlen(value) > 0) {
OpensslHelper::decodeBase64String(value, result, false);
if (result.size() > 0) {
- _DBG("type [%d] hash [%d] : %s", type, result.size(), result.toString().c_str());
+ _DBG("type [%d] hash [%zu] : %s", type, result.size(), result.toString().c_str());
break;
}
}
if (decodeValue.size() > 0) {
OpensslHelper::digestBuffer("sha1", decodeValue.getBuffer(), decodeValue.size(), hash);
if(hash.size() > 0) {
- _DBG("type [%d] hash [%d] : %s", type, hash.size(), hash.toString().c_str());
+ _DBG("type [%d] hash [%zu] : %s", type, hash.size(), hash.toString().c_str());
certHashes.push_back(hash);
}
}
################################################################################
Name: smartcard-service
Summary: Smartcard Service FW
-Version: 0.1.55
+Version: 0.1.56
Release: 0
Group: Network & Connectivity
Requires: %{name}-common = %{version}-%{release}
/* close channel */
command = apdu.generateAPDU(APDUHelper::COMMAND_CLOSE_LOGICAL_CHANNEL, channelNum, ByteArray::EMPTY);
- _DBG("command [%d] : %s", command.size(), command.toString().c_str());
+ _DBG("command [%zu] : %s", command.size(), command.toString().c_str());
rv = terminal->transmitSync(command, result);
_ERR("status word [ %02X %02X ]", resp.getSW1(), resp.getSW2());
}
} else {
- _ERR("select apdu is failed, rv [%d], length [%d]", rv, result.size());
+ _ERR("select apdu is failed, rv [%d], length [%zu]", rv, result.size());
}
channelNum = -1;
helper.setChannel(APDUCommand::CLA_CHANNEL_STANDARD, channelNum);
helper.getBuffer(cmd);
- _DBG("command [%d] : %s", cmd.size(), cmd.toString().c_str());
+ _DBG("command [%zu] : %s", cmd.size(), cmd.toString().c_str());
ret = terminal->transmitSync(cmd, result);
syncLock();
q.push(make_pair(cb, params));
- _INFO("request pushed, count [%d]", q.size());
+ _INFO("request pushed, count [%zu]", q.size());
if (q.size() == 1) {
/* start dispatch */
dispatcher->syncLock();
dispatcher->q.pop();
- /* LCOV_EXCL_START */
+ /* LCOV_EXCL_START */
if (dispatcher->q.size() > 0) {
- _INFO("remaining messages : %d", dispatcher->q.size());
+ _INFO("remaining messages : %zu", dispatcher->q.size());
result = true;
- /* LCOV_EXCL_STOP */
+ /* LCOV_EXCL_STOP */
} else {
_INFO("dispatch finished");
}
/* open channel */
command = APDUHelper::generateAPDU(APDUHelper::COMMAND_OPEN_LOGICAL_CHANNEL, 0, ByteArray::EMPTY);
- _DBG("command [%d] : %s", command.size(), command.toString().c_str());
+ _DBG("command [%zu] : %s", command.size(), command.toString().c_str());
rv = terminal->transmitSync(command, response);
if (rv == 0 && response.size() >= 2) {
result = resp.getStatus();
}
} else {
- _ERR("transmitSync failed, rv [%d], length [%d]", rv, response.size());
+ _ERR("transmitSync failed, rv [%d], length [%zu]", rv, response.size());
}
return result;
/* open channel */
command = APDUHelper::generateAPDU(APDUHelper::COMMAND_CLOSE_LOGICAL_CHANNEL, channelNum, ByteArray::EMPTY);
- _DBG("command [%d] : %s", command.size(), command.toString().c_str());
+ _DBG("command [%zu] : %s", command.size(), command.toString().c_str());
rv = terminal->transmitSync(command, response);
if (rv == 0 && response.size() >= 2) {
_ERR("status word [ %02X %02X ]", resp.getSW1(), resp.getSW2());
}
} else {
- _ERR("select apdu is failed, rv [%d], length [%d]", rv, response.size());
+ _ERR("select apdu is failed, rv [%d], length [%zu]", rv, response.size());
}
return result;
OpensslHelper::digestBuffer("SHA1", type->certificate, hash);
- _INFO("cdf[%d] = %s", i, hash.toString().c_str());
+ _INFO("cdf[%zu] = %s", i, hash.toString().c_str());
condition.addAccessRule(hash);
}