]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3513] added static getVersion for cryptolink
authorFrancis Dupont <fdupont@isc.org>
Sat, 16 May 2015 23:29:03 +0000 (01:29 +0200)
committerFrancis Dupont <fdupont@isc.org>
Sat, 16 May 2015 23:29:03 +0000 (01:29 +0200)
src/lib/cryptolink/botan_link.cc
src/lib/cryptolink/cryptolink.h
src/lib/cryptolink/openssl_link.cc
src/lib/cryptolink/tests/crypto_unittests.cc

index ede4f33124c5c2c1d22bba357c6248d97ad02d15..01f192f3ea8eaaf72f86eba47310b4b6e0188968 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011, 2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2014, 2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -43,6 +43,11 @@ CryptoLink::initialize() {
     }
 }
 
+std::string
+CryptoLink::getVersion() {
+    return (Botan::version_string());
+}
+
 } // namespace cryptolink
 } // namespace isc
 
index 69e1cc2d97e5a1257646c7077c6b81c60b776d0c..b9490e7c777bb70abe6634c31aa36764b8640ca7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011, 2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2014, 2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -161,6 +161,9 @@ public:
     ///
     static void initialize();
 
+    /// \brief Get version string
+    static std::string getVersion();
+
     /// \brief Factory function for Hash objects
     ///
     /// CryptoLink objects cannot be constructed directly. This
index dd6a732e3ff7868f9140addbbcb658cd26472a80..af47b0b30ee5290737d32a80c5e154b1dc22c5f4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014, 2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -16,6 +16,8 @@
 #include <cryptolink/crypto_hash.h>
 #include <cryptolink/crypto_hmac.h>
 
+#include <openssl/crypto.h>
+
 namespace isc {
 namespace cryptolink {
 
@@ -46,6 +48,11 @@ CryptoLink::initialize() {
     }
 }
 
+std::string
+CryptoLink::getVersion() {
+    return (SSLeay_version(SSLEAY_VERSION));
+}
+
 } // namespace cryptolink
 } // namespace isc
 
index fa5b429c72544fd17bbf653414668f5905b49f41..d08a8250c9901d81fad2703d9f5ce47a59d13738 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011, 2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2014, 2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 
 using namespace isc::cryptolink;
 
+// Test get version
+TEST(CryptoLinkTest, Version) {
+    EXPECT_NO_THROW(CryptoLink::getVersion());
+}
+
 // Tests whether getCryptoLink() returns a singleton instance
 TEST(CryptoLinkTest, Singleton) {
     const CryptoLink& c1 = CryptoLink::getCryptoLink();