]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3036] Initialize Botan library using cryptolink.
authorMarcin Siodelski <marcin@isc.org>
Tue, 20 Aug 2013 03:57:30 +0000 (05:57 +0200)
committerMarcin Siodelski <marcin@isc.org>
Tue, 20 Aug 2013 03:59:24 +0000 (05:59 +0200)
src/lib/dhcp_ddns/Makefile.am
src/lib/dhcp_ddns/ncr_msg.cc
src/lib/dhcp_ddns/tests/Makefile.am

index 0e1990ec23e8ef2c9396b795f8b964edc224e847..9dcd0383d22d6bc9b46f0422edb276f9c587f245 100644 (file)
@@ -39,6 +39,7 @@ libb10_dhcp_ddns_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
 libb10_dhcp_ddns_la_LDFLAGS  = $(AM_LDFLAGS)
 libb10_dhcp_ddns_la_LDFLAGS += ${BOTAN_LDFLAGS}
 libb10_dhcp_ddns_la_LIBADD  =
+libb10_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libb10-cryptolink.la
 libb10_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la
 libb10_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/log/libb10-log.la
 libb10_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/util/libb10-util.la
index 88325797198d26367743333b468213671b7187f6..3c7a18eceaabfba35a3541c854b1d791d0c7c5e2 100644 (file)
@@ -15,6 +15,7 @@
 #include <dhcp_ddns/ncr_msg.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_error.h>
+#include <cryptolink/cryptolink.h>
 
 #include <botan/sha2_32.h>
 
@@ -86,6 +87,11 @@ D2Dhcid::fromDUID(const isc::dhcp::DUID& duid,
     data.insert(data.end(), wire_fqdn.begin(), wire_fqdn.end());
 
     // Use the DUID and FQDN to compute the digest (see RFC4701, section 3).
+
+    // The getCryptoLink is a common function to initialize the Botan library.
+    cryptolink::CryptoLink::getCryptoLink();
+    // @todo The code below, which calculates the SHA-256 may need to be moved
+    // to the cryptolink library.
     Botan::SecureVector<Botan::byte> secure;
     try {
         Botan::SHA_256 sha;
index 1a03833c9dd65433f729030d2fa48b5cb713ba0f..78effc77698e21f702a9a30efc311f8dc4fb600e 100644 (file)
@@ -27,13 +27,8 @@ if HAVE_GTEST
 TESTS += libdhcp_ddns_unittests
 
 libdhcp_ddns_unittests_SOURCES  = run_unittests.cc
-libdhcp_ddns_unittests_SOURCES += ../dhcp_ddns_log.cc ../dhcp_ddns_log.h
-libdhcp_ddns_unittests_SOURCES += ../ncr_io.cc ../ncr_io.h
-libdhcp_ddns_unittests_SOURCES += ../ncr_msg.cc ../ncr_msg.h
-libdhcp_ddns_unittests_SOURCES += ../ncr_udp.cc ../ncr_udp.h
 libdhcp_ddns_unittests_SOURCES += ncr_unittests.cc
 libdhcp_ddns_unittests_SOURCES += ncr_udp_unittests.cc
-nodist_libdhcp_ddns_unittests_SOURCES = ../dhcp_ddns_messages.h ../dhcp_ddns_messages.cc
 
 libdhcp_ddns_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
 
@@ -50,7 +45,9 @@ endif
 libdhcp_ddns_unittests_LDADD = $(top_builddir)/src/lib/log/libb10-log.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
+libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libb10-cryptolink.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la
+libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libb10-dhcp_ddns.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/cc/libb10-cc.la