From 0cefaa948d9d310acd45135681d215966ecf989a Mon Sep 17 00:00:00 2001 From: Bhanu Singh Rao Date: Tue, 2 Apr 2013 12:14:13 +0530 Subject: [PATCH] Removed un-necessary error message Change-Id: Ib16957478d93d0c4193dce24b4b26d15d826b300 Signed-off-by: Bhanu Singh Rao --- .../cert/FSecCert_X509CertificateStoreImpl.cpp | 21 ++++++++++++++------- .../cert/FSecCert_X509CertificateStoreImpl.h | 3 +-- 2 files changed, 15 insertions(+), 9 deletions(-) mode change 100755 => 100644 src/security/cert/FSecCert_X509CertificateStoreImpl.cpp mode change 100755 => 100644 src/security/cert/FSecCert_X509CertificateStoreImpl.h diff --git a/src/security/cert/FSecCert_X509CertificateStoreImpl.cpp b/src/security/cert/FSecCert_X509CertificateStoreImpl.cpp old mode 100755 new mode 100644 index 353f52f..573165f --- a/src/security/cert/FSecCert_X509CertificateStoreImpl.cpp +++ b/src/security/cert/FSecCert_X509CertificateStoreImpl.cpp @@ -50,7 +50,10 @@ _X509CertificateStoreImpl::_X509CertificateStoreImpl(void) _X509CertificateStoreImpl::~_X509CertificateStoreImpl(void) { - __pCertServiceProxy->CloseCertificateStore(__certType); + if ((__certType > _CERT_TYPE_NOT_BOUNDED) && (__certType < _CERT_TYPE_MAX)) + { + __pCertServiceProxy->CloseCertificateStore(__certType); + } } result @@ -72,7 +75,10 @@ _X509CertificateStoreImpl::SetCertificateSelector(const Tizen::Security::Cert::I CertificateType certType = (const_cast< ICertificateSelector& >(selector)).GetType(); - __pCertServiceProxy->CloseCertificateStore(__certType); + if ((__certType > _CERT_TYPE_NOT_BOUNDED) && (__certType < _CERT_TYPE_MAX)) + { + __pCertServiceProxy->CloseCertificateStore(__certType); + } __curPos = 0; switch (certType) @@ -380,18 +386,19 @@ _X509CertificateStoreImpl::GetInstance(const X509CertificateStore& x509Certifica return x509CertificateStore.__pX509CertificateStoreImpl; } -int InsertPkcs12Content(const char* pPath, const char* pPassword) +int +InsertPkcs12Content(const char* pPath, const char* pPassword) { result r = E_SUCCESS; _X509CertificateStoreImpl store; String filePath; String password; - filePath.SetCapacity(strlen(pPath)+1); - password.SetCapacity(strlen(pPassword)+1); + filePath.SetCapacity(strlen(pPath) + 1); + password.SetCapacity(strlen(pPassword) + 1); - filePath.Format(strlen(pPath)+1, L"%s", pPath); - password.Format(strlen(pPassword)+1, L"%s", pPassword); + filePath.Format(strlen(pPath) + 1, L"%s", pPath); + password.Format(strlen(pPassword) + 1, L"%s", pPassword); r = store.InsertPkcs12(filePath, password, false); SysTryReturn(NID_SEC_CERT, !IsFailed(r), -1, r, "[%s] Failed to remove certificate.", GetErrorMessage(r)); diff --git a/src/security/cert/FSecCert_X509CertificateStoreImpl.h b/src/security/cert/FSecCert_X509CertificateStoreImpl.h old mode 100755 new mode 100644 index a686de8..237b199 --- a/src/security/cert/FSecCert_X509CertificateStoreImpl.h +++ b/src/security/cert/FSecCert_X509CertificateStoreImpl.h @@ -204,8 +204,7 @@ private: friend class X509CertificateStore; }; //X509CertificateStoreImpl -extern "C" _OSP_EXPORT_ int InsertPkcs12Content(const char* pPath, const char* pPassword); -//extern "C" _OSP_EXPORT_ int kkkkk(const char* pPath, const char* pPassword); +extern "C" _OSP_EXPORT_ int InsertPkcs12Content(const char* pPath, const char* pPassword); } } } //Tizen::Security::Cert -- 2.7.4