Convert to v2::security and adapt to ndn-cxx changes

Change-Id: I54f1b758cfb8f3f6cbc66a1aec5120ae1640b0ec
refs: #3964
diff --git a/.jenkins.d/01-ndn-cxx.sh b/.jenkins.d/01-ndn-cxx.sh
index 6eb84a5..c9e2a63 100755
--- a/.jenkins.d/01-ndn-cxx.sh
+++ b/.jenkins.d/01-ndn-cxx.sh
@@ -18,37 +18,29 @@
     fi
 fi
 
-## Uncomment when #3920 and #4119 merge.
-# if [[ -z $INSTALLED_VERSION ]]; then
-#     INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
-# fi
+if [[ -z $INSTALLED_VERSION ]]; then
+    INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
+fi
 
 sudo rm -Rf ndn-cxx-latest
-## Remove this when #3920 and #4119 merge
-sudo rm -Rf ndn-cxx-hotfix
-git clone git://github.com/named-data/ndn-cxx ndn-cxx-hotfix
 
-## Uncomment when #3920 and #4119 merge.
-# LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
+git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
 
-# if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
-#     sudo rm -Rf ndn-cxx
-#     mv ndn-cxx-latest ndn-cxx
-#     cp ndn-cxx ndn-cxx-hotfix
-# else
-#     sudo rm -Rf ndn-cxx-latest
-# fi
+LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
+
+if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
+    sudo rm -Rf ndn-cxx
+    mv ndn-cxx-latest ndn-cxx
+else
+    sudo rm -Rf ndn-cxx-latest
+fi
 
 sudo rm -f /usr/local/bin/ndnsec*
 sudo rm -fr /usr/local/include/ndn-cxx
 sudo rm -f /usr/local/lib/libndn-cxx*
 sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx.pc
 
-## Change to the hotfix directory instead of the normal ndn-cxx directory
-## Restore below line when #3920 and #4119 merge.
-#pushd ndn-cxx >/dev/null
-pushd ndn-cxx-hotfix >/dev/null
-git checkout b555b00c280b9c9ed46f24a1fbebc73b720601af
+pushd ndn-cxx >/dev/null
 
 ./waf configure --color=yes --enable-shared --disable-static --without-osx-keychain
 ./waf build --color=yes -j${WAF_JOBS:-1}
diff --git a/.jenkins.d/02-chronosync.sh b/.jenkins.d/02-chronosync.sh
index aa8c875..82145f6 100755
--- a/.jenkins.d/02-chronosync.sh
+++ b/.jenkins.d/02-chronosync.sh
@@ -18,30 +18,28 @@
     fi
 fi
 
-# if [[ -z $INSTALLED_VERSION ]]; then
-#     INSTALLED_VERSION=$(git -C ChronoSync rev-parse HEAD 2>/dev/null || echo NONE)
-# fi
+if [[ -z $INSTALLED_VERSION ]]; then
+    INSTALLED_VERSION=$(git -C ChronoSync rev-parse HEAD 2>/dev/null || echo NONE)
+fi
 
 sudo rm -Rf ChronoSync-latest
-## Remove line when #3920 and #4119 merge.
-sudo rm -rf ChronoSync-hotfix
-git clone git://github.com/named-data/ChronoSync ChronoSync-hotfix
 
-# LATEST_VERSION=$(git -C ChronoSync-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
+git clone --depth 1 git://github.com/named-data/ChronoSync ChronoSync-latest
 
-# if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
-#     sudo rm -Rf ChronoSync
-#     mv ChronoSync-latest ChronoSync
-# else
-#     sudo rm -Rf ChronoSync-latest
-# fi
+LATEST_VERSION=$(git -C ChronoSync-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
+
+if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
+    sudo rm -Rf ChronoSync
+    mv ChronoSync-latest ChronoSync
+else
+    sudo rm -Rf ChronoSync-latest
+fi
 
 sudo rm -fr /usr/local/include/ChronoSync
 sudo rm -f /usr/local/lib/libChronoSync*
 sudo rm -f /usr/local/lib/pkgconfig/ChronoSync*
 
-pushd ChronoSync-hotfix >/dev/null
-git checkout 097bb448f46b8bd9a5c1f431e824f8f6a169b650
+pushd ChronoSync >/dev/null
 
 if has FreeBSD10 $NODE_LABELS; then
     export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/