Check the integrity of first root CA certificate
authorso.yu <so.yu@samsung.com>
Fri, 28 Jun 2013 00:14:46 +0000 (09:14 +0900)
committerso.yu <so.yu@samsung.com>
Fri, 28 Jun 2013 00:15:09 +0000 (09:15 +0900)
Change-Id: I8d354b9c69ff2aaf8f679e819ac30d174d80bc25
Signed-off-by: so.yu <so.yu@samsung.com>
src/security/cert/FSecCert_CertManager.cpp

index 09a009f..f4a2a7f 100644 (file)
@@ -1260,7 +1260,7 @@ _CertManager::CheckRootCaIntegrity(void)
        r = pCaCertDbStore->GetFirstRecordByConditions(reinterpret_cast< byte* >(condition), &certRecord);
        SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Failed to get first certificate record.", GetErrorMessage(r));
 
-       while ((pCaCertDbStore->GetNextRecordByCondition(reinterpret_cast< byte* >(condition), &certRecord, certRecord.certId)) == E_SUCCESS)
+       do
        {
                std::unique_ptr< File > pFile(null);
                std::unique_ptr< ByteBuffer > pBuffer(null);
@@ -1309,8 +1309,9 @@ _CertManager::CheckRootCaIntegrity(void)
                r = File::Remove(certPath);
                SysTryLog(NID_SEC_CERT, !IsFailed(r), "[%s] Propagating.", GetErrorMessage(r));
        }
+       while ((pCaCertDbStore->GetNextRecordByCondition(reinterpret_cast< byte* >(condition), &certRecord, certRecord.certId)) == E_SUCCESS);
 
-       return r;
+       return E_SUCCESS;
 }