result r = E_SUCCESS;
Integer* pColumnType = null;
int nColumnType = DB_COLUMNTYPE_UNDEFINED;
+ char* pDateTimeStr;
SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
"Wrong column index.");
E_TYPE_MISMATCH, "Type mismatch");
unique_ptr<_DataItem>pItem(new (std::nothrow) _DataItem());
- unique_ptr<String> pString(new (std::nothrow) String(_StringConverter::CopyToCharArrayN(value.ToString())));
+ pDateTimeStr = _StringConverter::CopyToCharArrayN(value.ToString());
+ unique_ptr<String> pString(new (std::nothrow) String(pDateTimeStr));
+ delete pDateTimeStr;
SysTryReturnResult(NID_IO, pItem != null && pString != null, E_OUT_OF_MEMORY,
"The memory is insufficient.");
}
pStr = (String*)pDataItem->pObj;
+ r = DateTime::Parse(*pStr, value);
}
- r = DateTime::Parse(*pStr, value);
-
// fall thru
CATCH:
return r;
return r;
}
+Tizen::Base::String
+Pkcs08Attribute::GetAttributeType(void) const
+{
+ ClearLastResult();
+
+ SysAssertf(__pPkcs08AttributeImpl != null, "Not yet constructed. Reconstructor the object.");
+
+ return __pPkcs08AttributeImpl->GetAttributeType();
+
+}
+
const Tizen::Base::Collection::ArrayList&
Pkcs08Attribute::GetAttributeValues(void) const
{
return __attributeValues.Remove(value);
}
+Tizen::Base::String
+_Pkcs08AttributeImpl::GetAttributeType(void) const
+{
+ SysAssertf(__attributeType.GetLength() > 0, "Not yet constructed. Construct () should be called before use.");
+
+ return __attributeType;
+
+}
+
+
const Tizen::Base::Collection::ArrayList&
_Pkcs08AttributeImpl::GetAttributeValues(void) const
{
_PkcsUtility::IsParameterSupported(Tizen::Base::String algorithm)
{
if (algorithm == OID_PBKDF2 || algorithm == OID_PBES2 || algorithm == OID_PBMAC1 || algorithm == OID_DES_CBC || algorithm == OID_DES_CBC_EDE3
- || algorithm == OID_AES_128_CBC || algorithm == OID_AES_192_CBC || algorithm == OID_AES_256_CBC || algorithm == OID_RC2_CBC)
+ || algorithm == OID_AES_128_CBC || algorithm == OID_AES_192_CBC || algorithm == OID_AES_256_CBC || algorithm == OID_RC2_CBC)
{
return true;
}
}
}
- return pOutBuffer.release();
+ return pOutBuffer.release();
case _OID_TYPE_RSA_ENCRYPTION:
{
}
}
- return pOutBuffer.release();
+ return pOutBuffer.release();
default:
r = E_UNSUPPORTED_ALGORITHM;
memset(pOut.get(), 0, tempLen);
+ if (dataLen % pCipherAlgorithm->block_size != 0)
+ {
+ // set padding
+ ret = EVP_CIPHER_CTX_set_padding(&cipherCtx, static_cast< int >(true));
+ SysTryCatch(NID_SEC_CRYPTO, ret == 1, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The method cannot proceed due to a severe system error.");
+ }
+
//cipher update operation
ret = EVP_CipherUpdate(&cipherCtx, pOut.get(), static_cast< int* >(&outLen), pData, dataLen);
SysTryCatch(NID_SEC_CRYPTO, ret == 1, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The method cannot proceed due to a severe system error.");
pOutBuffer->Flip();
-CATCH:
+ CATCH:
if (IsFailed(r))
{
PBKDF2PARAM_free(pKdf);
return pKeyfunc;
-CATCH:
+ CATCH:
PBKDF2PARAM_free(pKdf);
X509_ALGOR_free(pKeyfunc);
switch (oidValue)
{
case _OID_TYPE_DES_CBC:
- // fall through
+ // fall through
case _OID_TYPE_DES_CBC_EDE3:
- // fall through
+ // fall through
case _OID_TYPE_AES_128_CBC:
- // fall through
+ // fall through
case _OID_TYPE_AES_192_CBC:
- // fall through
+ // fall through
case _OID_TYPE_AES_256_CBC:
{
X509_ALGOR_get0(&pAlgoObj->algorithm, &pType, &pVal, pAlgoObj);
break;
case _OID_TYPE_HMAC_SHA1:
- // fall through
+ // fall through
case _OID_TYPE_HMAC_SHA2_224:
- // fall through
+ // fall through
case _OID_TYPE_HMAC_SHA2_256:
- // fall through
+ // fall through
case _OID_TYPE_HMAC_SHA2_384:
- // fall through
+ // fall through
case _OID_TYPE_HMAC_SHA2_512:
- // fall through
+ // fall through
case _OID_TYPE_RSA_ENCRYPTION:
{
pAlgoParams = null;
switch (oidValue)
{
case _OID_TYPE_DES_CBC:
- // fall through
+ // fall through
case _OID_TYPE_DES_CBC_EDE3:
- // fall through
+ // fall through
case _OID_TYPE_AES_128_CBC:
- // fall through
+ // fall through
case _OID_TYPE_AES_192_CBC:
- // fall through
+ // fall through
case _OID_TYPE_AES_256_CBC:
{
SysTryReturn(NID_SEC_CRYPTO, pAlgoParam != null, null, E_INVALID_ARG, "[E_INVALID_ARG] The specified input parameter is invalid.");
break;
case _OID_TYPE_HMAC_SHA1:
- // fall through
+ // fall through
case _OID_TYPE_HMAC_SHA2_224:
- // fall through
+ // fall through
case _OID_TYPE_HMAC_SHA2_256:
- // fall through
+ // fall through
case _OID_TYPE_HMAC_SHA2_384:
- // fall through
+ // fall through
case _OID_TYPE_RSA_ENCRYPTION:
- // fall through
+ // fall through
case _OID_TYPE_HMAC_SHA2_512:
{
ret = X509_ALGOR_set0(pAlgoObj, OBJ_nid2obj(algoNid), V_ASN1_NULL, NULL);
FSys_EnvironmentImpl.cpp
FSys_DeviceEventListenerContainer.cpp
FSys_SettingClient.cpp
+ FSys_SystemClient.cpp
)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// 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 FSys_SettingClient.cpp
+ * @brief This is the implementation file for _SettingClient class.
+ */
+
+#include <unique_ptr.h>
+
+#include "FSys_SystemClient.h"
+
+#include <FBaseSysLog.h>
+
+#include <FIo_AppServiceIpcMessages.h>
+#include "FSys_CommunicationDispatcherClient.h"
+
+using namespace std;
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Runtime;
+using namespace Tizen::Io;
+
+namespace Tizen { namespace System
+{
+
+static const wchar_t* _SYSTEM_SERVICE_ID = L"osp.system.service";
+static const wchar_t* _SYSTEM_COMMAND_SUPPORTED = L"osp.system.command.system.get.bool";
+
+static const wchar_t* _SYSTEM_OK = L"osp.system.result.ok";
+static const wchar_t* _SYSTEM_INVALID_ARG = L"osp.system.result.invalid_arg";
+static const wchar_t* _SYSTEM_ERROR = L"osp.system.result.error";
+
+_SystemClient* _SystemClient::__pSystemClient = null;
+
+_SystemClient*
+_SystemClient::GetInstance(void)
+{
+ if(__pSystemClient == null)
+ {
+ __pSystemClient = new (std::nothrow) _SystemClient();
+ }
+ return __pSystemClient;
+}
+
+_SystemClient::_SystemClient()
+ :__pIpcClient(null)
+{
+ result r = E_SUCCESS;
+ _CommunicationDispatcherClient* pCommunicationDispatcherClient = _CommunicationDispatcherClient::GetInstance();
+ r = pCommunicationDispatcherClient->RegisterCommunicationListener(_SYSTEM_SERVICE_ID, *this);
+ __pIpcClient = pCommunicationDispatcherClient->GetIpcClient();
+}
+
+_SystemClient::~_SystemClient()
+{
+}
+
+result
+_SystemClient::ConvertResultCode(String code)
+{
+ result r = E_SYSTEM;
+ if(code == _SYSTEM_OK)
+ {
+ r = E_SUCCESS;
+ }
+ else if(code == _SYSTEM_INVALID_ARG)
+ {
+ r = E_INVALID_ARG;
+ }
+ return r;
+}
+
+result
+_SystemClient::GetValue(const Tizen::Base::String& key, bool& value)
+{
+ result r = E_SUCCESS;
+ String requestKey(key);
+ String serviceId(_SYSTEM_SERVICE_ID);
+ String commandId(_SYSTEM_COMMAND_SUPPORTED);
+
+ _CommunicationDispatcherClient* pCommunicationDispatcherClient = _CommunicationDispatcherClient::GetInstance();
+
+ __pIpcClient = pCommunicationDispatcherClient->GetIpcClient();
+
+ ArrayList requestMessages;
+ ArrayList responseMessages;
+
+ requestMessages.Construct();
+ responseMessages.Construct();
+
+ requestMessages.Add(serviceId);
+ requestMessages.Add(commandId);
+ requestMessages.Add(requestKey);
+
+ unique_ptr<IoService_Request> pMsg(new (std::nothrow) IoService_Request(requestMessages, &responseMessages));
+
+ r = __pIpcClient->SendRequest(*pMsg);
+ SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to send request by IPC [%s]", GetErrorMessage(r));
+
+ String* pResult = (String*)responseMessages.GetAt(2);
+ SysTryReturnResult(NID_SYS, pResult != null, E_SYSTEM, "There is no result code.");
+
+ r = ConvertResultCode(*pResult);
+ SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, "Error is occured.");
+
+ String* pValue = (String*)responseMessages.GetAt(3);
+ SysTryReturnResult(NID_SYS, pValue != null, E_SYSTEM, "There is no result value.");
+ if(pValue->GetPointer() == L"1")
+ {
+ value = true;
+ }
+ else
+ {
+ value = false;
+ }
+
+ responseMessages.RemoveAll(true);
+ return r;
+}
+
+void
+_SystemClient::OnDataReceived(const Tizen::Base::Collection::ArrayList& data)
+{
+}
+
+} } // Tizen::System
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// 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 FSys_SystemClient.h
+ * @brief This is the header file for _SystemClient class.
+ */
+
+#ifndef _FSYSTEM_INTERNAL_SYSTEM_CLIENT_H_
+#define _FSYSTEM_INTERNAL_SYSTEM_CLIENT_H_
+
+#include <FIo_IpcClient.h>
+
+#include <FBaseColArrayList.h>
+#include <FBaseObject.h>
+#include <FBaseString.h>
+#include <FBaseInteger.h>
+#include <FSys_ICommunicationDispatcherListener.h>
+
+namespace Tizen { namespace System
+{
+
+class _SystemClient
+ : public Tizen::Base::Object
+ , public Tizen::System::_ICommunicationDispatcherListener
+{
+private:
+ _SystemClient(void);
+ virtual ~_SystemClient(void);
+
+public:
+ result GetValue(const Tizen::Base::String& key, bool& value);
+ static _SystemClient* GetInstance(void);
+
+private:
+ void OnDataReceived(const Tizen::Base::Collection::ArrayList& data);
+ result ConvertResultCode(Tizen::Base::String code);
+private:
+ Tizen::Io::_IpcClient* __pIpcClient;
+ static _SystemClient* __pSystemClient;
+};
+
+} } // Tizen::System
+
+#endif //_FSYSTEM_INTERNAL_SYSTEM_CLIENT_H_
#include <FSys_SystemInfoImpl.h>
#include <FIo_AppServiceIpcMessages.h>
#include <FIo_IpcClient.h>
-#include <FSys_Types.h>
+
+#include "FSys_Types.h"
+#include "FSys_SystemClient.h"
using namespace std;
}
else if(code == _KEYBOARD_TYPE)
{
- code == _INPUT_KEYBOARD_LAYOUT;
+ code = _INPUT_KEYBOARD_LAYOUT;
}
else if(code == _SCREEN_BITS_PER_PIXEL)
{
if(pValue != null)
{
value = *pValue;
+ r = E_SUCCESS;
}
if (key == _NETWORK_TYPE) //Compatibility
value.Append(L"CDMA");
}
-
+ r = E_SUCCESS;
}
else if (key == _OPENGL_ES_VERSION)
{
value.Append(L"2.0");
}
+ r = E_SUCCESS;
}
else if(key == _BLUETOOTH_SUPPORTED)
{
value = _SUPPORTED;
else
value = _UNSUPPORTED;
+ r = E_SUCCESS;
}
else if (key == _GPS_SUPPORTED)
{
value = _SUPPORTED;
else
value = _UNSUPPORTED;
+ r = E_SUCCESS;
}
else if (key == _WIFI_SUPPORTED)
{
value = _SUPPORTED;
else
value = _UNSUPPORTED;
+ r = E_SUCCESS;
}
else if (key == _WAC_VERSION)
{
result
_SystemInfoImpl::GetFromRegistry(const String& key, bool& value)
{
+/*
+ _SystemClient* pSystemClient = _SystemClient::GetInstance();
+ pSystemClient->GetValue(key, value);
+*/
result r = E_SUCCESS;
_RegistryImpl _reg;
String valStr;
}
return E_SUCCESS;
}
+
_SystemInfoImpl*
_SystemInfoImpl::GetInstance(SystemInfo& systeminfo)
{