//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
result r = E_SUCCESS;
result ret = E_SUCCESS;
- Tizen::Io::_IpcBuffer certBufferIpc;
+ Tizen::Base::ByteBuffer certBufferIpc;
ClearLastResult();
SysTryReturnResult(NID_SEC_CERT, certType > _CERT_TYPE_NOT_BOUNDED, E_INVALID_ARG, "Invalid certificate type.");
SysTryReturnResult(NID_SEC_CERT, certType < _CERT_TYPE_MAX, E_INVALID_ARG, "Invalid certificate type.");
- certBufferIpc.pBuffer = null;
- certBufferIpc.size = 0;
-
std::unique_ptr< IPC::Message > pMessage(new (std::nothrow) CertServer_GetNextCertificate(certType, curPos, bufferLen, &certBufferIpc, &curPos, &ret));
SysTryReturnResult(NID_SEC_CERT, pMessage != null, E_OUT_OF_MEMORY, "Failed to allocate memory.");
SysTryReturn(NID_SEC_CERT, !IsFailed(r), r, r, "[%s] Failed to send message.", GetErrorMessage(r));
SysTryReturn(NID_SEC_CERT, !IsFailed(ret), ret, ret, "[%s] Stub function failed on service side.", GetErrorMessage(ret));
- memcpy(pBuffer, certBufferIpc.pBuffer, certBufferIpc.size);
- bufferLen = certBufferIpc.size;
+ memcpy(pBuffer, certBufferIpc.GetPointer(), certBufferIpc.GetRemaining());
+ bufferLen = certBufferIpc.GetRemaining();
return r;
}
}
result
-_CertServiceProxy::InsertPkcs12Content(char* pPkcs12FilePath, char* pPkcs12ImportPassword)
+_CertServiceProxy::InsertPkcs12Content(char* pPkcs12FilePath, char* pPkcs12ImportPassword, bool checkPrivilege)
{
result r = E_SUCCESS;
result ret = E_SUCCESS;
pkcs12PasswdBufferIpc.pBuffer = pPkcs12ImportPassword;
pkcs12PasswdBufferIpc.size = strlen(reinterpret_cast< char* >(pPkcs12ImportPassword)) + 1;
- std::unique_ptr< IPC::Message > pMessage(new (std::nothrow) CertServer_InstallPkcs12Content(pkcs12FileBufferIpc, pkcs12PasswdBufferIpc, &ret));
+ std::unique_ptr< IPC::Message > pMessage(new (std::nothrow) CertServer_InstallPkcs12Content(pkcs12FileBufferIpc, pkcs12PasswdBufferIpc, checkPrivilege, &ret));
SysTryReturnResult(NID_SEC_CERT, pMessage != null, E_OUT_OF_MEMORY, "Failed to allocate memory.");
r = __pIpcClient->SendRequest(pMessage.get());
return r;
}
+
+void
+_CertServiceProxy::RestoreRootCaIntegrity(void)
+{
+ result r = E_SUCCESS;
+
+ ClearLastResult();
+
+ SysTryReturnVoidResult(NID_SEC_CERT, __pIpcClient != null, E_SYSTEM, "[%s] IPC instance is not constructed.", GetErrorMessage(E_SYSTEM));
+
+ std::unique_ptr< IPC::Message > pMessage(new (std::nothrow) CertServer_RestoreRootCaIntegrity());
+ SysTryReturnVoidResult(NID_SEC_CERT, pMessage != null, E_OUT_OF_MEMORY, "[%s] Failed to allocate memory.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ r = __pIpcClient->SendRequest(pMessage.get());
+ SysTryReturnVoidResult(NID_SEC_CERT, !IsFailed(r), r, "[%s] Failed to send message.", GetErrorMessage(r));
+}
+
} } }