summaryrefslogtreecommitdiff
path: root/src/manager/service/encryption-service.cpp
diff options
context:
space:
mode:
authorsangwan.kwon <sangwan.kwon@samsung.com>2015-12-10 13:49:43 +0900
committersangwan.kwon <sangwan.kwon@samsung.com>2015-12-22 16:24:22 +0900
commitfa221dbbd5ecc2b439932755c56a9e5ad2d7c23b (patch)
tree33824b7a92543eb0e5a26d5362b3d37d83932644 /src/manager/service/encryption-service.cpp
parent37c8ad2ece096d99ee2699db4ace43192ef4d721 (diff)
downloadkey-manager-fa221dbbd5ecc2b439932755c56a9e5ad2d7c23b.tar.gz
key-manager-fa221dbbd5ecc2b439932755c56a9e5ad2d7c23b.tar.bz2
key-manager-fa221dbbd5ecc2b439932755c56a9e5ad2d7c23b.zip
Apply coding rule
covered Tizen C++ coding rule list - [R06] : Do not unnecessarily use braces where a single statement will do. - Exception: if one branch of a conditional statement is a single statement, use braces in both branches. - [M08] : Keywords have following space rules - Put a space after (most) keywords - example: if, switch, case, for, do, while - Do not put a space after function like keywords - example: sizeof, typeof, alignof, __attribute__ - [M09] : Operators have following space rules - Put a space around(on each side of) most binary and ternary operators - Example : = + -< > * / % | & ^ <= >= == != ? : - Do not put a space after unary operators - Example: & * + -~ ! - Unary "++" and unary "--" are allowed no space on one side - Do not put a space around the "." and "->" structure member operators. - Do not put a space after cast operator - [M10] : Seperators have following space rules - Put a space after closing brace when it has anything on the line. - Exception : comma after closing brace '},‘ - Put a space after comma - Do not put space inside parenthesis '(', ')‘ - Do not put space before open square bracket '[‘ and inside square bracket '[', ']‘ - [M12] : Functions have the opening brace at the beginning of the next line. - [M13] : The open brace last on the line. The closing brace is empty on a line of its own - Exception : else, whileshould follow close brace '}’ - [M14] : Open braces for enum, union and structgo on the same line Change-Id: I6e59513ba121a25222e6e626792b3e115ebec1d3 Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
Diffstat (limited to 'src/manager/service/encryption-service.cpp')
-rwxr-xr-x[-rw-r--r--]src/manager/service/encryption-service.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/manager/service/encryption-service.cpp b/src/manager/service/encryption-service.cpp
index f5de2718..e2ea7c69 100644..100755
--- a/src/manager/service/encryption-service.cpp
+++ b/src/manager/service/encryption-service.cpp
@@ -33,7 +33,8 @@ const CKM::InterfaceID SOCKET_ID_ENCRYPTION = 0;
namespace CKM {
-EncryptionService::EncryptionService() : m_logic(*this)
+EncryptionService::EncryptionService() :
+ m_logic(*this)
{
}
@@ -58,7 +59,7 @@ void EncryptionService::RequestKey(const CryptoRequest& request)
{
MsgKeyRequest kReq(request.msgId, request.cred, request.name, request.label, request.password);
if (!m_commMgr->SendMessage(kReq))
- throw std::runtime_error("No listener found"); // TODO
+ throw std::runtime_error("No listener found");// TODO
}
GenericSocketService::ServiceDescriptionVector EncryptionService::GetServiceDescription()
@@ -68,11 +69,13 @@ GenericSocketService::ServiceDescriptionVector EncryptionService::GetServiceDesc
};
}
-void EncryptionService::Start() {
+void EncryptionService::Start()
+{
Create();
}
-void EncryptionService::Stop() {
+void EncryptionService::Stop()
+{
Join();
}
@@ -89,7 +92,7 @@ bool EncryptionService::ProcessOne(
ConnectionInfo &info,
bool /*allowed*/)
{
- LogDebug ("process One");
+ LogDebug("process One");
try {
if (!info.buffer.Ready())
return false;
@@ -130,14 +133,16 @@ void EncryptionService::ProcessEncryption(const ConnectionID &conn,
m_logic.Crypt(req);
}
-void EncryptionService::CustomHandle(const ReadEvent &event) {
+void EncryptionService::CustomHandle(const ReadEvent &event)
+{
LogDebug("Read event");
auto &info = m_connectionInfoMap[event.connectionID.counter];
info.buffer.Push(event.rawBuffer);
- while(ProcessOne(event.connectionID, info, true));
+ while (ProcessOne(event.connectionID, info, true));
}
-void EncryptionService::CustomHandle(const SecurityEvent &/*event*/) {
+void EncryptionService::CustomHandle(const SecurityEvent &/*event*/)
+{
LogError("This should not happend! SecurityEvent was called on EncryptionService!");
}