further clean up
Change-Id: I79a541209d6fd852aaf0f4e8f6fef3f61682a5a9
diff --git a/src/detail/crypto-helpers.cpp b/src/detail/crypto-helpers.cpp
index 46bca46..b3b9520 100644
--- a/src/detail/crypto-helpers.cpp
+++ b/src/detail/crypto-helpers.cpp
@@ -113,12 +113,6 @@
const std::vector<uint8_t>&
ECDHState::deriveSecret(const std::vector<uint8_t>& peerKey)
{
- return deriveSecret(peerKey.data(), peerKey.size());
-}
-
-const std::vector<uint8_t>&
-ECDHState::deriveSecret(const uint8_t* peerKey, size_t peerKeySize)
-{
// prepare self private key
auto privECKey = EVP_PKEY_get1_EC_KEY(m_privkey);
if (privECKey == nullptr) {
@@ -131,7 +125,7 @@
if (peerPoint == nullptr) {
NDN_THROW(std::runtime_error("TBD"));
}
- if (EC_POINT_oct2point(group, peerPoint, peerKey, peerKeySize, nullptr) == 0) {
+ if (EC_POINT_oct2point(group, peerPoint, peerKey.data(), peerKey.size(), nullptr) == 0) {
EC_POINT_free(peerPoint);
NDN_THROW(std::runtime_error("Cannot convert peer's key into a EC point when calling EC_POINT_oct2point()"));
}
diff --git a/src/detail/crypto-helpers.hpp b/src/detail/crypto-helpers.hpp
index 3eee553..4461475 100644
--- a/src/detail/crypto-helpers.hpp
+++ b/src/detail/crypto-helpers.hpp
@@ -39,9 +39,6 @@
~ECDHState();
const std::vector<uint8_t>&
- deriveSecret(const uint8_t* peerkey, size_t peerKeySize);
-
- const std::vector<uint8_t>&
deriveSecret(const std::vector<uint8_t>& peerkey);
const std::vector<uint8_t>&
diff --git a/tests/unit-tests/crypto-helper.t.cpp b/tests/unit-tests/crypto-helper.t.cpp
index 63f7c11..ba644ae 100644
--- a/tests/unit-tests/crypto-helper.t.cpp
+++ b/tests/unit-tests/crypto-helper.t.cpp
@@ -49,8 +49,8 @@
ECDHState aliceState;
auto alicePub = aliceState.getSelfPubKey();
BOOST_CHECK(!alicePub.empty());
- uint8_t fakePub[] = {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b};
- BOOST_CHECK_THROW(aliceState.deriveSecret(fakePub, sizeof(fakePub)), std::runtime_error);
+ std::vector<uint8_t> fakePub(10, 0x0b);
+ BOOST_CHECK_THROW(aliceState.deriveSecret(fakePub), std::runtime_error);
}
BOOST_AUTO_TEST_CASE(HmacSha256)