Commit dbb8141b authored by Francis Dupont's avatar Francis Dupont

[3513] added static getVersion for cryptolink

parent e6586db0
// 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
// 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
......
// 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
// 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
......@@ -22,6 +22,11 @@
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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment