Commit 65874313 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[trac812] fixups to make cryptolink buildable with recent lib/util stuff

(with some non related cleanups)
parent 00e36b25
......@@ -100,7 +100,7 @@ public:
}
}
void sign(isc::dns::OutputBuffer& result, size_t len) {
void sign(isc::util::OutputBuffer& result, size_t len) {
try {
Botan::SecureVector<Botan::byte> b_result(hmac_->final());
......@@ -182,7 +182,7 @@ HMAC::update(const void* data, const size_t len) {
}
void
HMAC::sign(isc::dns::OutputBuffer& result, size_t len) {
HMAC::sign(isc::util::OutputBuffer& result, size_t len) {
impl_->sign(result, len);
}
......@@ -204,7 +204,7 @@ HMAC::verify(const void* sig, const size_t len) {
void
signHMAC(const void* data, size_t data_len, const void* secret,
size_t secret_len, const HashAlgorithm hash_algorithm,
isc::dns::OutputBuffer& result, size_t len)
isc::util::OutputBuffer& result, size_t len)
{
boost::scoped_ptr<HMAC> hmac(
CryptoLink::getCryptoLink().createHMAC(secret,
......
......@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <dns/buffer.h>
#include <util/buffer.h>
#include <boost/noncopyable.hpp>
......@@ -86,7 +86,7 @@ public:
/// value is smaller than the algorithms output size, the
/// result will be truncated. If this value is larger, or 0
/// (the default), it will be ignored
void sign(isc::dns::OutputBuffer& result, size_t len = 0);
void sign(isc::util::OutputBuffer& result, size_t len = 0);
/// \brief Calculate the final signature
///
......@@ -162,7 +162,7 @@ void signHMAC(const void* data,
const void* secret,
size_t secret_len,
const HashAlgorithm hash_algorithm,
isc::dns::OutputBuffer& result,
isc::util::OutputBuffer& result,
size_t len = 0);
/// \brief Verify an HMAC signature for the given data
......
......@@ -17,12 +17,6 @@
#include <botan/botan.h>
#include <boost/scoped_ptr.hpp>
using namespace std;
using namespace isc::dns;
namespace isc {
namespace cryptolink {
......
......@@ -16,7 +16,7 @@
#define _ISC_CRYPTO_H
#include <string>
#include <dns/buffer.h>
#include <util/buffer.h>
#include <exceptions/exceptions.h>
#include <boost/noncopyable.hpp>
......
......@@ -19,7 +19,7 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libcryptolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
endif
......
......@@ -18,12 +18,12 @@
#include <cryptolink/cryptolink.h>
#include <cryptolink/crypto_hmac.h>
#include <dns/buffer.h>
#include <util/buffer.h>
#include <exceptions/exceptions.h>
#include <boost/scoped_ptr.hpp>
using namespace isc::dns;
using namespace isc::util;
using namespace isc::cryptolink;
namespace {
......
......@@ -14,8 +14,6 @@
#include <gtest/gtest.h>
#include <dns/tests/unittest_util.h>
int
main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
......
......@@ -22,7 +22,7 @@
#include <cryptolink/cryptolink.h>
#include <dns/name.h>
#include <dns/util/base64.h>
#include <util/encode/base64.h>
#include <dns/tsigkey.h>
using namespace std;
......@@ -101,7 +101,7 @@ TSIGKey::TSIGKey(const std::string& str) : impl_(NULL) {
}
vector<uint8_t> secret;
decodeBase64(secret_str, secret);
util::encode::decodeBase64(secret_str, secret);
impl_ = new TSIGKeyImpl(Name(keyname_str), algo_name, &secret[0],
secret.size());
......@@ -158,7 +158,7 @@ TSIGKey::toText() const {
const vector<uint8_t> secret_v(static_cast<const uint8_t*>(getSecret()),
static_cast<const uint8_t*>(getSecret()) +
getSecretLength());
std::string secret_str = encodeBase64(secret_v);
std::string secret_str = util::encode::encodeBase64(secret_v);
return (getKeyName().toText() + ":" + secret_str + ":" +
getAlgorithmName().toText());
......
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