summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMandeep Shetty <mandeep.shetty@intel.com>2015-07-16 21:40:00 -0700
committerErich Keane <erich.keane@intel.com>2015-07-17 19:42:34 +0000
commit0ec3a09a026edd6cbb5b8e5a6d2eb460a9c1b075 (patch)
treebcb59dd29998c6b6c28bbc77f9312985084bb26e
parent503a35f05766433f23357708101e1788e33efeec (diff)
Removed libsafec dependency since source for libsafec was taken down.
The sourceforge site taken down. Removed the dependancy since the xmpp lib was needed for remote access. This issue is tracked in IOT-617. Change-Id: I709871b06bd7bd957654f94361812519abd2305c Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com> Reviewed-on: https://gerrit.iotivity.org/gerrit/1705 Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org> Reviewed-by: Charlie Lenahan <charlie.lenahan@intel.com> Reviewed-by: Erich Keane <erich.keane@intel.com>
-rw-r--r--build_common/SConscript.py2
-rw-r--r--external/SConscript.py8
-rw-r--r--ra_xmpp/SConscript.py2
-rw-r--r--ra_xmpp/c_init_test/SConscript.py2
-rw-r--r--ra_xmpp/ra_xmpp.c18
-rw-r--r--ra_xmpp/test/SConscript.py2
-rw-r--r--src/common/bufferencrypt.cpp7
-rw-r--r--src/common/buffers.cpp6
-rw-r--r--src/xml/portabledom.cpp6
-rw-r--r--test/SConscript.py2
-rw-r--r--test/ping_tests.cpp2
-rw-r--r--test/pubsub_tests.cpp2
-rw-r--r--test/register_tests.cpp2
-rw-r--r--test/servicedisc_tests.cpp2
-rw-r--r--test/xmpp_compliance_tests.cpp2
-rw-r--r--test/xmpp_dummy_server.cpp6
-rw-r--r--test/xmpp_tests.cpp2
17 files changed, 48 insertions, 25 deletions
diff --git a/build_common/SConscript.py b/build_common/SConscript.py
index 9518e13..ab8e026 100644
--- a/build_common/SConscript.py
+++ b/build_common/SConscript.py
@@ -233,7 +233,7 @@ def versionSufficient(sourceVer, requiredVer):
if 'linux' in env['HOST']:
# Check g++ version (GCC C-version shouldn't matter as much, but can be checked too
# here if needed)
- REQUIRED_VER = "4.6.2"
+ REQUIRED_VER = "4.6"
# Check gcc version
if not versionSufficient(env['CXXVERSION'], REQUIRED_VER):
print "g++ version is insufficient to compile the client. Required:", REQUIRED_VER, " Found:", env['CXXVERSION']
diff --git a/external/SConscript.py b/external/SConscript.py
index b1de481..3660aba 100644
--- a/external/SConscript.py
+++ b/external/SConscript.py
@@ -21,10 +21,10 @@
Import('env')
# Windows does not require safec, as the functions used are present in its C standard library
-if env['PLATFORM'] not in ['win']:
- SConscript([
- 'safec/SConscript.py',
- ], duplicate = 0)
+# if env['PLATFORM'] not in ['win']:
+# SConscript([
+# 'safec/SConscript.py',
+# ], duplicate = 0)
SConscript([
'asio/SConscript.py',
diff --git a/ra_xmpp/SConscript.py b/ra_xmpp/SConscript.py
index 342d275..0d0e2cb 100644
--- a/ra_xmpp/SConscript.py
+++ b/ra_xmpp/SConscript.py
@@ -53,7 +53,7 @@ if target_os not in ['windows', 'winrt']:
],
LIBS = ['strophe'])
ra_xmpp_env.Append(
- LIBS = ['ccfxmpp','safec-1.0','pthread'],
+ LIBS = ['ccfxmpp','pthread'],
LIBPATH = ['#src']
)
diff --git a/ra_xmpp/c_init_test/SConscript.py b/ra_xmpp/c_init_test/SConscript.py
index f1ca616..7621ce9 100644
--- a/ra_xmpp/c_init_test/SConscript.py
+++ b/ra_xmpp/c_init_test/SConscript.py
@@ -46,7 +46,7 @@ if target_os not in ['windows', 'winrt']:
],
LIBS = ['strophe'])
ra_xmpp_test_env.Append(
- LIBS = ['ra_xmpp', 'ccfxmpp', 'safec-1.0', 'curl']
+ LIBS = ['ra_xmpp', 'ccfxmpp', 'curl']
)
ra_xmpp_test_env.AppendUnique(
LIBPATH = [
diff --git a/ra_xmpp/ra_xmpp.c b/ra_xmpp/ra_xmpp.c
index f9c217e..3398339 100644
--- a/ra_xmpp/ra_xmpp.c
+++ b/ra_xmpp/ra_xmpp.c
@@ -53,8 +53,10 @@
#include <errno.h>
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
+#endif
#else
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -247,7 +249,7 @@ char *const clone_c_str(const char *const str)
char *const cloned_str = malloc(str_len + 1);
if (cloned_str)
{
- memmove_s(cloned_str, str_len, str, str_len);
+ memmove(cloned_str, str, str_len);
cloned_str[str_len] = 0;
return cloned_str;
@@ -284,9 +286,9 @@ void xmpp_context_init(xmpp_context_t *const context)
if (context)
{
#if (defined(__STDC_WANT_LIB_EXT1__) && (__STDC_WANT_LIB_EXT1__ >= 1))
- memset_s(context, sizeof(*context), 0, sizeof(*context));
+ memset_s(context, sizeof (*context), 0, sizeof(*context));
#else
- memset_s(context, sizeof(*context), 0);
+ memset(context, 0, sizeof(*context));
#endif
context->cb = sizeof(*context);
}
@@ -303,7 +305,7 @@ xmpp_context_t *clone_context(const xmpp_context_t *context)
xmpp_context_t *cloned_context = calloc(1, sizeof(*context));
if (cloned_context)
{
- memmove_s(cloned_context, sizeof(*cloned_context), context, sizeof(*context));
+ memmove(cloned_context, context, sizeof(*context));
}
return cloned_context;
}
@@ -318,7 +320,7 @@ void xmpp_host_init(xmpp_host_t *const host, const char *const host_name,
#if (defined(__STDC_WANT_LIB_EXT1__) && (__STDC_WANT_LIB_EXT1__ >= 1))
memset_s(host, sizeof(*host), 0, sizeof(*host));
#else
- memset_s(host, sizeof(*host), 0);
+ memset(host, 0, sizeof(*host));
#endif
host->cb = sizeof(*host);
@@ -353,9 +355,9 @@ void xmpp_identity_init(xmpp_identity_t *const identity, const char *const user_
if (identity)
{
#if (defined(__STDC_WANT_LIB_EXT1__) && (__STDC_WANT_LIB_EXT1__ >= 1))
- memset_s(identity, sizeof(*identity), 0, sizeof(*identity));
+ memset_s(identity, sizeof (*identity), 0, sizeof(*identity));
#else
- memset_s(identity, sizeof(*identity), 0);
+ memset(identity, 0, sizeof(*identity));
#endif
identity->cb = sizeof(*identity);
@@ -392,7 +394,7 @@ void xmpp_proxy_init(xmpp_proxy_t *const proxy, const char *const host,
#if (defined(__STDC_WANT_LIB_EXT1__) && (__STDC_WANT_LIB_EXT1__ >= 1))
memset_s(proxy, sizeof(*proxy), 0, sizeof(*proxy));
#else
- memset_s(proxy, sizeof(*proxy), 0);
+ memset(proxy, 0, sizeof(*proxy));
#endif
diff --git a/ra_xmpp/test/SConscript.py b/ra_xmpp/test/SConscript.py
index d211357..c8984aa 100644
--- a/ra_xmpp/test/SConscript.py
+++ b/ra_xmpp/test/SConscript.py
@@ -47,7 +47,7 @@ if target_os not in ['windows', 'winrt']:
],
LIBS = ['strophe'])
ra_xmpp_test_env.Append(
- LIBS = ['ra_xmpp', 'ccfxmpp', 'gtest', 'safec-1.0', 'pthread', 'curl']
+ LIBS = ['ra_xmpp', 'ccfxmpp', 'gtest', 'pthread', 'curl']
)
ra_xmpp_test_env.AppendUnique(
LIBPATH = [
diff --git a/src/common/bufferencrypt.cpp b/src/common/bufferencrypt.cpp
index 15edc80..8fdbab1 100644
--- a/src/common/bufferencrypt.cpp
+++ b/src/common/bufferencrypt.cpp
@@ -29,15 +29,18 @@
#include "rand_helper.h"
#include <openssl/evp.h>
#include <stdint.h>
+#include <string.h>
#include <limits>
#include <algorithm>
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
#endif
+#endif
}
#ifdef _WIN32
@@ -225,7 +228,7 @@ namespace Iotivity
// Otherwise clear out the memory.
::SecureZeroMemory(ptr(), allocatedSize());
# else
- ::memset_s(ptr(), allocatedSize(), 0);
+ ::memset(ptr(), 0, allocatedSize());
# endif
#endif
@@ -278,7 +281,7 @@ namespace Iotivity
newBufferRealSize - DEBUG_BYTE_BUFFER_GUARD_REGION_SIZE,
ptr(), std::min(newBufferRealSize, allocatedSize()));
#else
- ::memmove_s(newPtr, newBufferRealSize, ptr(), std::min(newBufferRealSize, allocatedSize()));
+ ::memmove(newPtr, ptr(), std::min(newBufferRealSize, allocatedSize()));
#endif
freeBufferSecure();
diff --git a/src/common/buffers.cpp b/src/common/buffers.cpp
index c7cd141..8c5c016 100644
--- a/src/common/buffers.cpp
+++ b/src/common/buffers.cpp
@@ -48,9 +48,11 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
#endif
+#endif
}
#ifdef WINCE
@@ -777,7 +779,7 @@ namespace Iotivity
if (buf && size && m_position < this->size())
{
bytesRead = std::min(size, this->size() - m_position);
- memcpy_s(buf, size, &((unsigned char *)ptr())[m_position], bytesRead);
+ memcpy(buf, &((unsigned char *)ptr())[m_position], bytesRead);
m_position += bytesRead;
}
return bytesRead;
@@ -814,7 +816,7 @@ namespace Iotivity
// the position.
if (buf)
{
- memcpy_s(&((unsigned char *)ptr())[m_position], size, buf, size);
+ memcpy(&((unsigned char *)ptr())[m_position], buf, size);
}
m_position += size;
appended = true;
diff --git a/src/xml/portabledom.cpp b/src/xml/portabledom.cpp
index 39cffb5..8e5009b 100644
--- a/src/xml/portabledom.cpp
+++ b/src/xml/portabledom.cpp
@@ -45,9 +45,11 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
#endif
+#endif
}
using namespace std;
@@ -602,7 +604,7 @@ namespace Iotivity
m_sourceStr = m_sourceDoc.allocate_string(0, size + 1);
if (m_sourceStr)
{
- memcpy_s(m_sourceStr, size, (const void *)utf8SrcBuffer, size);
+ memcpy(m_sourceStr, (const void *)utf8SrcBuffer, size);
m_sourceStr[size] = 0;
m_sourceDoc.parse(m_sourceStr, bytesRead, parse_stop_at_next_sibling);
outNode = documentElement();
@@ -627,7 +629,7 @@ namespace Iotivity
m_sourceStr = m_sourceDoc.allocate_string(0, size + 1);
if (m_sourceStr)
{
- memcpy_s(m_sourceStr, size, (const void *)utf8SrcBuffer, size);
+ memcpy(m_sourceStr, (const void *)utf8SrcBuffer, size);
m_sourceStr[size] = 0;
m_sourceDoc.parse(m_sourceStr, ending == EndingTest::IgnoreEnding ?
parse_default : parse_validate_closing_tags);
diff --git a/test/SConscript.py b/test/SConscript.py
index 128fb11..a63d6b0 100644
--- a/test/SConscript.py
+++ b/test/SConscript.py
@@ -51,7 +51,7 @@ if target_os not in ['windows', 'winrt']:
# We use append rather than appendunique to force certain dynamic libraries to appear
# after the static libraries. This does result in duplication on the command line.
ccfxmpp_tests_env.Append(
- LIBS = [ccfxmpplib, 'gmock', 'gtest', 'curl', 'ssl', 'pthread', 'crypto', 'safec-1.0'],
+ LIBS = [ccfxmpplib, 'gmock', 'gtest', 'curl', 'ssl', 'pthread', 'crypto'],
)
ccfxmpp_tests_env.AppendUnique(
LIBPATH = [
diff --git a/test/ping_tests.cpp b/test/ping_tests.cpp
index 3b240c7..6ac367f 100644
--- a/test/ping_tests.cpp
+++ b/test/ping_tests.cpp
@@ -37,8 +37,10 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
+#endif
#endif //WIN32
}
diff --git a/test/pubsub_tests.cpp b/test/pubsub_tests.cpp
index 9a16056..b4c8bdc 100644
--- a/test/pubsub_tests.cpp
+++ b/test/pubsub_tests.cpp
@@ -33,8 +33,10 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
+#endif
#endif //WIN32
}
diff --git a/test/register_tests.cpp b/test/register_tests.cpp
index d0b89f0..e1f39d9 100644
--- a/test/register_tests.cpp
+++ b/test/register_tests.cpp
@@ -36,9 +36,11 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
#endif
+#endif
}
diff --git a/test/servicedisc_tests.cpp b/test/servicedisc_tests.cpp
index 4e90060..6213502 100644
--- a/test/servicedisc_tests.cpp
+++ b/test/servicedisc_tests.cpp
@@ -36,9 +36,11 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
#endif
+#endif
}
diff --git a/test/xmpp_compliance_tests.cpp b/test/xmpp_compliance_tests.cpp
index 4733d36..a26e130 100644
--- a/test/xmpp_compliance_tests.cpp
+++ b/test/xmpp_compliance_tests.cpp
@@ -41,9 +41,11 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
#endif
+#endif
}
using namespace std;
diff --git a/test/xmpp_dummy_server.cpp b/test/xmpp_dummy_server.cpp
index 44b4e0b..7478158 100644
--- a/test/xmpp_dummy_server.cpp
+++ b/test/xmpp_dummy_server.cpp
@@ -46,9 +46,11 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
#endif
+#endif
}
@@ -166,7 +168,7 @@ void SegmentedDummyTCPConnect::async_receive(std::shared_ptr<ByteBuffer> buffer,
// smaller too, but this should not affect normal operation.
throw runtime_error("Insufficient buffer for simulated read request");
}
- memcpy_s(buffer->get(), buffer->size(), currentData.c_str(), currentData.size());
+ memcpy(buffer->get(), currentData.c_str(), buffer->size());
nextAction();
f(connect_error::SUCCESS, currentData.size());
}
@@ -269,7 +271,7 @@ void SegmentedDummyTCPConnect::async_receive(std::shared_ptr<ByteBuffer> buffer,
{
throw runtime_error("Insufficient buffer for simulated read request");
}
- memcpy_s(buffer->get(), buffer->size(), currentData.c_str(), currentData.size());
+ memcpy(buffer->get(), currentData.c_str(), buffer->size());
nextAction();
f(connect_error::SUCCESS, currentData.size());
#else
diff --git a/test/xmpp_tests.cpp b/test/xmpp_tests.cpp
index 0a2b393..715ad80 100644
--- a/test/xmpp_tests.cpp
+++ b/test/xmpp_tests.cpp
@@ -51,9 +51,11 @@
extern "C"
{
#if !defined(_WIN32)
+#ifdef WITH_SAFE
#include <safe_mem_lib.h>
#include <safe_str_lib.h>
#endif
+#endif
}