typedef DefineException<CKM_API_ERROR_SERVER_ERROR,
Stringify, PrintError> InternalError;
typedef DefineException<CKM_API_ERROR_INPUT_PARAM,
- Stringify, PrintError> InputParam;
+ StringifyDebug, PrintDebug> InputParam;
typedef DefineException<CKM_API_ERROR_DB_LOCKED,
Stringify, PrintError> DatabaseLocked;
typedef DefineException<CKM_API_ERROR_FILE_SYSTEM,
Stringify, PrintError> FileSystemFailed;
typedef DefineException<CKM_API_ERROR_AUTHENTICATION_FAILED,
- Stringify, PrintError> AuthenticationFailed;
+ StringifyDebug, PrintDebug> AuthenticationFailed;
} // namespace Exc
} // namespace CKM
}
template <typename... Args>
- std::string operator()(const Args&... args){
+ std::string operator()(const Args&...){
return std::string();
}
};
{
// verify name and label are correct
if (!isNameValid(name) || !isLabelValid(ownerLabel)) {
- LogWarning("Invalid parameter passed to key-manager");
+ LogDebug("Invalid parameter passed to key-manager");
return CKM_API_ERROR_INPUT_PARAM;
}
int access_ec = m_accessControl.canSave(cred, ownerLabel);
if( access_ec != CKM_API_SUCCESS)
{
- LogWarning("label " << cred.smackLabel << " can not save rows using label " << ownerLabel);
+ LogDebug("label " << cred.smackLabel << " can not save rows using label " << ownerLabel);
return access_ec;
}
output_key = CKM::Key::create(input_data);
if(output_key.get() == NULL)
{
- LogError("provided binary data is not valid key data");
+ LogDebug("provided binary data is not valid key data");
return CKM_API_ERROR_INPUT_PARAM;
}
output_data = output_key->getDER();
CertificateShPtr cert = CKM::Certificate::create(input_data, DataFormat::FORM_DER);
if(cert.get() == NULL)
{
- LogError("provided binary data is not valid certificate data");
+ LogDebug("provided binary data is not valid certificate data");
return CKM_API_ERROR_INPUT_PARAM;
}
output_data = cert->getDER();
// use client label if not explicitly provided
const Label &ownerLabel = label.empty() ? cred.smackLabel : label;
if (!isNameValid(name) || !isLabelValid(ownerLabel)) {
- LogError("Invalid label or name format");
+ LogDebug("Invalid label or name format");
return CKM_API_ERROR_INPUT_PARAM;
}
if(erased)
transaction.commit();
else {
- LogError("No row for given name and label");
+ LogDebug("No row for given name and label");
return CKM_API_ERROR_DB_ALIAS_UNKNOWN;
}
}
if(!row_optional) {
- LogError("No row for given name, label and type");
+ LogDebug("No row for given name, label and type");
return CKM_API_ERROR_DB_ALIAS_UNKNOWN;
} else {
row = *row_optional;
}
if(!output.size()) {
- LogError("No row for given name, label and type");
+ LogDebug("No row for given name, label and type");
return CKM_API_ERROR_DB_ALIAS_UNKNOWN;
}
try {
uids.push_back(static_cast<uid_t>(std::stoi((pDirEntry->d_name)+CKM_KEY_PREFIX.size())));
} catch (const std::invalid_argument) {
- LogError("Error in extracting uid from db file. Error=std::invalid_argument."
+ LogDebug("Error in extracting uid from db file. Error=std::invalid_argument."
"This will be ignored.File=" << pDirEntry->d_name << "");
} catch(const std::out_of_range) {
- LogError("Error in extracting uid from db file. Error=std::out_of_range."
+ LogDebug("Error in extracting uid from db file. Error=std::out_of_range."
"This will be ignored. File="<< pDirEntry->d_name << "");
}
}
if (unlink(getDBPath().c_str())) {
retCode = -1;
err = errno;
- LogError("Error in unlink user database: " << getDBPath()
+ LogDebug("Error in unlink user database: " << getDBPath()
<< "Errno: " << errno << " " << GetErrnoString(err));
}
if (unlink(getDKEKPath().c_str())) {
retCode = -1;
err = errno;
- LogError("Error in unlink user DKEK: " << getDKEKPath()
+ LogDebug("Error in unlink user DKEK: " << getDKEKPath()
<< "Errno: " << errno << " " << GetErrnoString(err));
}
if (unlink(getDBDEKPath().c_str())) {
retCode = -1;
err = errno;
- LogError("Error in unlink user DBDEK: " << getDBDEKPath()
+ LogDebug("Error in unlink user DBDEK: " << getDBDEKPath()
<< "Errno: " << errno << " " << GetErrnoString(err));
}
if (unlink(getRemovedAppsPath().c_str())) {
retCode = -1;
err = errno;
- LogError("Error in unlink user's Removed Apps File: " << getRemovedAppsPath()
+ LogDebug("Error in unlink user's Removed Apps File: " << getRemovedAppsPath()
<< "Errno: " << errno << " " << GetErrnoString(err));
}