From a469319598f615fb88220394b3effc445c6cbb5e Mon Sep 17 00:00:00 2001 From: "jc815.lee" Date: Mon, 2 Sep 2013 16:30:49 +0900 Subject: [PATCH] Remove Logs when install certificates [model] [binary_type] [customer] [issue#] [problem] [cause] [solution] [team] [request] [horizontal_expansion] Change-Id: I2dd306f0de9e698007fc16965094be0184918117 Signed-off-by: jc815.lee --- src/security/cert/FSecCert_CertDbManager.cpp | 7 ++++++- src/security/cert/FSecCert_CertDbStore.cpp | 5 ++++- src/security/cert/FSecCert_CertFileStore.cpp | 2 -- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/security/cert/FSecCert_CertDbManager.cpp b/src/security/cert/FSecCert_CertDbManager.cpp index 5428061..08f5916 100755 --- a/src/security/cert/FSecCert_CertDbManager.cpp +++ b/src/security/cert/FSecCert_CertDbManager.cpp @@ -280,9 +280,14 @@ _CertDbManager::InsertCaCertificateFromBuffer(_CaCertType certType, _CertFormat } r = __caCertDbStore.CheckDuplicateCertificate(certType, reinterpret_cast< byte* >(subjectName), lenSubjectName); - SysTryReturnResult(NID_SEC_CERT, IsFailed(r), E_FILE_ALREADY_EXIST, "File already exists."); + if(!IsFailed(r)) + { + return E_FILE_ALREADY_EXIST; + } + SysTryReturnResult(NID_SEC_CERT, r==E_DATA_NOT_FOUND, r, "Failed to check duplicate"); + //Get the last installed certificate id from db table __caCertDbStore.GetCurrentCertId(certId); //Calculate the new (std::nothrow) certificate id for installation diff --git a/src/security/cert/FSecCert_CertDbStore.cpp b/src/security/cert/FSecCert_CertDbStore.cpp index 1e760da..0e2ee04 100644 --- a/src/security/cert/FSecCert_CertDbStore.cpp +++ b/src/security/cert/FSecCert_CertDbStore.cpp @@ -564,7 +564,10 @@ _CaCertDbStore::CheckDuplicateCertificate(_CaCertType certType, byte* pSubjectNa std::unique_ptr< DbEnumerator > pEnum(pDatabase->QueryN(statement)); r = GetLastResult(); SysTryReturnResult(NID_SEC_CERT, !IsFailed(r) , r, "Failed to get query result."); - SysTryReturnResult(NID_SEC_CERT, pEnum != null , E_DATA_NOT_FOUND, "No certificate found in database."); + if(pEnum == null) + { + r = E_DATA_NOT_FOUND; + } return r; } diff --git a/src/security/cert/FSecCert_CertFileStore.cpp b/src/security/cert/FSecCert_CertFileStore.cpp index 4547675..9ff66dd 100644 --- a/src/security/cert/FSecCert_CertFileStore.cpp +++ b/src/security/cert/FSecCert_CertFileStore.cpp @@ -225,8 +225,6 @@ _CertFileStore::GetFileNameFromHandle(CertIdNo hCert, _CertPathType pathType, St fileName.Append(tempStr); fileName.Append(extn); - SysSecureLog(NID_SEC_CERT, "GetFileNameFromHandle(Handle = %d): File name = %ls.", - hCert, fileName.GetPointer()); return E_SUCCESS; } -- 2.7.4