summaryrefslogtreecommitdiffstats
path: root/libtransport/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/test')
-rw-r--r--libtransport/src/test/test_auth.cc24
-rw-r--r--libtransport/src/test/test_core_manifest.cc2
2 files changed, 9 insertions, 17 deletions
diff --git a/libtransport/src/test/test_auth.cc b/libtransport/src/test/test_auth.cc
index d7fd55433..0c47dd958 100644
--- a/libtransport/src/test/test_auth.cc
+++ b/libtransport/src/test/test_auth.cc
@@ -117,13 +117,11 @@ TEST_F(AuthTest, AsymmetricBufferRSA) {
std::vector<uint8_t> buffer(payload.begin(), payload.end());
signer->signBuffer(buffer);
- std::vector<uint8_t> sig = signer->getSignature();
+ utils::MemBuf::Ptr sig = signer->getSignature();
std::shared_ptr<AsymmetricVerifier> verif =
std::make_shared<AsymmetricVerifier>(pubKey);
- bool res = verif->verifyBuffer(
- buffer, std::vector<uint8_t>(sig.data(), sig.data() + sig.size()),
- CryptoHashType::SHA256);
+ bool res = verif->verifyBuffer(buffer, sig, CryptoHashType::SHA256);
EXPECT_EQ(res, true);
}
@@ -157,13 +155,11 @@ TEST_F(AuthTest, AsymmetricBufferDSA) {
std::vector<uint8_t> buffer(payload.begin(), payload.end());
signer->signBuffer(buffer);
- std::vector<uint8_t> sig = signer->getSignature();
+ utils::MemBuf::Ptr sig = signer->getSignature();
std::shared_ptr<AsymmetricVerifier> verif =
std::make_shared<AsymmetricVerifier>(pubKey);
- bool res = verif->verifyBuffer(
- buffer, std::vector<uint8_t>(sig.data(), sig.data() + sig.size()),
- CryptoHashType::SHA256);
+ bool res = verif->verifyBuffer(buffer, sig, CryptoHashType::SHA256);
EXPECT_EQ(res, true);
}
@@ -233,13 +229,11 @@ TEST_F(AuthTest, AsymmetricBufferECDSA) {
std::vector<uint8_t> buffer(payload.begin(), payload.end());
signer->signBuffer(buffer);
- std::vector<uint8_t> sig = signer->getSignature();
+ utils::MemBuf::Ptr sig = signer->getSignature();
std::shared_ptr<AsymmetricVerifier> verif =
std::make_shared<AsymmetricVerifier>(pubKey);
- bool res = verif->verifyBuffer(
- buffer, std::vector<uint8_t>(sig.data(), sig.data() + sig.size()),
- CryptoHashType::SHA256);
+ bool res = verif->verifyBuffer(buffer, sig, CryptoHashType::SHA256);
EXPECT_EQ(res, true);
} // namespace auth
@@ -290,11 +284,9 @@ TEST_F(AuthTest, HMACbuffer) {
std::string payload = "bonjour";
std::vector<uint8_t> buffer(payload.begin(), payload.end());
signer->signBuffer(buffer);
- std::vector<uint8_t> sig = signer->getSignature();
+ utils::MemBuf::Ptr sig = signer->getSignature();
SymmetricVerifier hmac(PASSPHRASE);
- bool res = hmac.verifyBuffer(
- buffer, std::vector<uint8_t>(sig.data(), sig.data() + sig.size()),
- CryptoHashType::SHA256);
+ bool res = hmac.verifyBuffer(buffer, sig, CryptoHashType::SHA256);
EXPECT_EQ(res, true);
}
diff --git a/libtransport/src/test/test_core_manifest.cc b/libtransport/src/test/test_core_manifest.cc
index 23fd5e342..b998ce96b 100644
--- a/libtransport/src/test/test_core_manifest.cc
+++ b/libtransport/src/test/test_core_manifest.cc
@@ -173,7 +173,7 @@ TEST_F(ManifestTest, SetParamsRTC) {
.timestamp = 1,
.prod_rate = 2,
.prod_seg = 3,
- .support_fec = 1,
+ .fec_type = protocol::fec::FECType::UNKNOWN,
};
manifest1_.setParamsRTC(params);