tizen 2.4 release
[framework/security/key-manager.git] / src / manager / client / client-manager-impl.cpp
index b27e180..cae0973 100644 (file)
@@ -33,9 +33,8 @@
 
 namespace CKM {
 
-namespace {
 template <class T>
-int getCertChain(
+int ManagerImpl::getCertChain(
     ServiceConnection & serviceConnection,
     LogicCommand command,
     int counter,
@@ -61,8 +60,11 @@ int getCertChain(
 
         int retCommand;
         int retCounter;
+        bool retCCModeState;
         RawBufferVector rawBufferVector;
-        recv.Deserialize(retCommand, retCounter, retCode, rawBufferVector);
+        recv.Deserialize(retCommand, retCounter, retCode, rawBufferVector, retCCModeState);
+
+        LogDebug("CCModeState[" << (retCCModeState ? "TRUE" : "FALSE") << "]");
 
         if ((counter != retCounter) || (static_cast<int>(command) != retCommand)) {
             return CKM_API_ERROR_UNKNOWN;
@@ -79,12 +81,19 @@ int getCertChain(
             certificateChainVector.push_back(cert);
         }
 
+        if (retCCModeState) {
+            int ocspStatus;
+            retCode = ocspCheck(certificateChainVector, ocspStatus);
+
+            if ((retCode == CKM_API_SUCCESS) && (ocspStatus != CKM_API_OCSP_STATUS_GOOD)) {
+                retCode = CKM_API_ERROR_VERIFICATION_FAILED;
+            }
+        }
+
         return retCode;
     });
 }
 
-} // namespace anonymous
-
 ManagerImpl::ManagerImpl()
   : m_counter(0), m_storageConnection(SERVICE_SOCKET_CKM_STORAGE), m_ocspConnection(SERVICE_SOCKET_OCSP)
 {