mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants
mkdir -p %{buildroot}/usr/lib/systemd/system/sockets.target.wants
ln -s ../central-key-manager.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/central-key-manager.service
-ln -s ../central-key-manager-echo.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/central-key-manager-echo.socket
ln -s ../central-key-manager-api-control.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-control.socket
ln -s ../central-key-manager-api-storage.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-storage.socket
ln -s ../central-key-manager-api-ocsp.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-ocsp.socket
%attr(-,root,root) /usr/lib/systemd/system/multi-user.target.wants/central-key-manager.service
%attr(-,root,root) /usr/lib/systemd/system/central-key-manager.service
%attr(-,root,root) /usr/lib/systemd/system/central-key-manager.target
-%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/central-key-manager-echo.socket
-%attr(-,root,root) /usr/lib/systemd/system/central-key-manager-echo.socket
%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-control.socket
%attr(-,root,root) /usr/lib/systemd/system/central-key-manager-api-control.socket
%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-storage.socket
%{_includedir}/ckm/ckm/ckm-certificate.h
%{_includedir}/ckm/ckm/ckm-control.h
%{_includedir}/ckm/ckm/ckm-error.h
-%{_includedir}/ckm/ckm/ckm-echo.h
%{_includedir}/ckm/ckm/ckm-key.h
%{_includedir}/ckm/ckm/ckm-password.h
%{_includedir}/ckm/ckm/ckm-raw-buffer.h
${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
${KEY_MANAGER_PATH}/main/socket-manager.cpp
${KEY_MANAGER_PATH}/main/key-manager-main.cpp
- ${KEY_MANAGER_PATH}/service/echo.cpp
${KEY_MANAGER_PATH}/service/ckm-service.cpp
${KEY_MANAGER_PATH}/service/ckm-logic.cpp
${KEY_MANAGER_PATH}/service/key-provider.cpp
SET(KEY_MANAGER_CLIENT_SOURCES
${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
- ${KEY_MANAGER_CLIENT_SRC_PATH}/client-echo.cpp
${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
- ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-echo.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- *
- * @file ckm-manager.h
- * @version 1.0
- * @brief This file contains APIs of the Central Key Manager
-*/
-#ifndef KEY_MANAGER_ECHO_H
-#define KEY_MANAGER_ECHO_H
-/*
- * This function was created mainly for testing ckm-manager client/service
- * proper behaviour. It sends a message and returns message from service,
- * which should be a pure echo.
- *
- * \param[in] Message for service
- * \param[out] Response from service
- *
- * \return CKM_API_ERROR_INPUT_PARAM when trying to pass NULL message
- * \return CKM_API_SUCCESS on success
- */
-namespace CKM {
-
-int key_manager_echo(const char* echo, char** oche);
-
-} // namespace CKM
-
-#endif
-
+++ /dev/null
-/* Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- *
- *
- * @file client-echo.cpp
- * @author Zofia Abramowska (z.abramowska@samsung.com)
- * @version 1.0
- * @brief This file contains example of ckm-manager client implementation
- */
-
-#include <dpl/log/log.h>
-#include <dpl/exception.h>
-
-#include <message-buffer.h>
-#include <client-common.h>
-#include <protocols.h>
-
-#include <ckm/ckm-error.h>
-#include <ckm/ckm-echo.h>
-
-KEY_MANAGER_API
-int key_manager_echo(const char *echo, char** oche) {
- using namespace CKM;
-
- if(echo == NULL){
- LogDebug("Echo message is null");
- return CKM_API_ERROR_INPUT_PARAM;
- }
-
- MessageBuffer send, recv;
- Serialization::Serialize(send, std::string(echo));
-
- int retCode = sendToServer(SERVICE_SOCKET_ECHO, send.Pop(), recv);
-
- if(retCode != CKM_API_SUCCESS)
- return retCode;
-
- std::string response;
- Deserialization::Deserialize(recv, response);
-
- *oche = strdup(response.c_str());
-
- return CKM_API_SUCCESS;
-}
#include <socket-manager.h>
-#include <echo.h>
#include <ckm-service.h>
#include <ocsp-service.h>
LogInfo("Start!");
CKM::SocketManager manager;
- REGISTER_SOCKET_SERVICE(manager, CKM::EchoService);
REGISTER_SOCKET_SERVICE(manager, CKM::CKMService);
REGISTER_SOCKET_SERVICE(manager, CKM::OCSPService);
+++ /dev/null
-/*
- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Contact: Bumjin Im <bj.im@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-/*
- * @file server-main2.h
- * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
- * @version 1.0
- * @brief Implementation of sample service.
- */
-
-#include <dpl/log/log.h>
-
-#include <protocols.h>
-#include <echo.h>
-
-namespace CKM {
-
-GenericSocketService::ServiceDescriptionVector EchoService::GetServiceDescription() {
- return ServiceDescriptionVector {{SERVICE_SOCKET_ECHO, "*"}};
-}
-
-void EchoService::accept(const AcceptEvent &event) {
- LogDebug("Accept event. ConnectionID: " << event.connectionID.sock
- << " ServiceID: " << event.interfaceID);
-}
-
-void EchoService::write(const WriteEvent &event) {
- LogDebug("WriteEvent. ConnectionID: " << event.connectionID.sock <<
- " Size: " << event.size << " Left: " << event.left);
- if (event.left == 0)
- m_serviceManager->Close(event.connectionID);
-}
-
-void EchoService::process(const ReadEvent &event) {
- LogDebug("ReadEvent. ConnectionID: " << event.connectionID.sock <<
- " Buffer size: " << event.rawBuffer.size());
- m_serviceManager->Write(event.connectionID, event.rawBuffer);
- LogDebug("Write completed");
-}
-
-void EchoService::close(const CloseEvent &event) {
- LogDebug("CloseEvent. ConnectionID: " << event.connectionID.sock);
-}
-
-} // namespace CKM
-
+++ /dev/null
-/*
- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Contact: Bumjin Im <bj.im@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-/*
- * @file echo.h
- * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
- * @version 1.0
- * @brief Sample service implementation.
- */
-
-#ifndef _SECURITY_SERVER_ECHO_
-#define _SECURITY_SERVER_ECHO_
-
-#include <service-thread.h>
-#include <generic-socket-manager.h>
-
-#include <dpl/serialization.h>
-
-#include <message-buffer.h>
-
-namespace CKM {
-
-class EchoService
- : public CKM::GenericSocketService
- , public CKM::ServiceThread<EchoService>
-{
-public:
- ServiceDescriptionVector GetServiceDescription();
-
- DECLARE_THREAD_EVENT(AcceptEvent, accept)
- DECLARE_THREAD_EVENT(WriteEvent, write)
- DECLARE_THREAD_EVENT(ReadEvent, process)
- DECLARE_THREAD_EVENT(CloseEvent, close)
-
- void accept(const AcceptEvent &event);
- void write(const WriteEvent &event);
- void process(const ReadEvent &event);
- void close(const CloseEvent &event);
-};
-
-} // namespace CKM
-
-#endif // _SECURITY_SERVER_ECHO_
${CMAKE_SOURCE_DIR}/systemd/central-key-manager-api-control.socket
${CMAKE_SOURCE_DIR}/systemd/central-key-manager-api-storage.socket
${CMAKE_SOURCE_DIR}/systemd/central-key-manager-api-ocsp.socket
- ${CMAKE_SOURCE_DIR}/systemd/central-key-manager-echo.socket
DESTINATION
/usr/lib/systemd/system
)
+++ /dev/null
-[Socket]
-ListenStream=/tmp/.central-key-manager-echo.sock
-SockMode=0777
-SmackLabelIPIn=*
-SmackLabelIPOut=@
-
-Service=central-key-manager.service
-
-[Unit]
-Wants=central-key-manager.target
-Before=central-key-manager.target
-
-[Install]
-WantedBy=sockets.target
[Service]
Type=notify
ExecStart=/usr/bin/key-manager
-Sockets=central-key-manager-echo.socket
Sockets=central-key-manager-api-storage.socket
Sockets=central-key-manager-api-control.socket
Sockets=central-key-manager-api-ocsp.socket