summaryrefslogtreecommitdiffstats
path: root/libtransport/src/test/test_auth.cc
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2022-09-21 17:11:22 +0200
committerJordan Augé <jordan.auge+fdio@cisco.com>2022-09-30 09:17:13 +0200
commit3476dd9ddecc87d9212c3bf56a5be52079e27def (patch)
tree3c7ea2664e8f99fc4fd4588b9e4493f0dc9bbb93 /libtransport/src/test/test_auth.cc
parent29647f687c8dadc90e2ba4d3a772eee09a1a4f1b (diff)
feat: support for new packet format in hicn-light
Ref: HICN-792 Change-Id: I3204006bd2dd2be6504c33035c6578ec0292455a Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'libtransport/src/test/test_auth.cc')
-rw-r--r--libtransport/src/test/test_auth.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/libtransport/src/test/test_auth.cc b/libtransport/src/test/test_auth.cc
index 5b9b04c5c..2ee3c0776 100644
--- a/libtransport/src/test/test_auth.cc
+++ b/libtransport/src/test/test_auth.cc
@@ -88,7 +88,7 @@ TEST_F(AuthTest, AsymmetricRSA) {
std::shared_ptr<Verifier> verifier =
std::make_shared<AsymmetricVerifier>(pubKey);
- EXPECT_EQ(packet.getFormat().as_u32, HICN_PACKET_FORMAT_IPV6_TCP_AH.as_u32);
+ EXPECT_EQ(packet.getFormat(), HICN_PACKET_FORMAT_IPV6_TCP_AH);
EXPECT_EQ(signer->getHashType(), CryptoHashType::SHA256);
EXPECT_EQ(signer->getSuite(), CryptoSuite::RSA_SHA256);
EXPECT_EQ(signer->getSignatureSize(), 256u);
@@ -202,7 +202,7 @@ TEST_F(AuthTest, AsymmetricVerifierDSA) {
std::shared_ptr<Verifier> verifier =
std::make_shared<AsymmetricVerifier>(cert);
- EXPECT_EQ(packet.getFormat().as_u32, HICN_PACKET_FORMAT_IPV6_TCP_AH.as_u32);
+ EXPECT_EQ(packet.getFormat(), HICN_PACKET_FORMAT_IPV6_TCP_AH);
EXPECT_EQ(signer->getHashType(), CryptoHashType::SHA256);
EXPECT_EQ(signer->getSuite(), CryptoSuite::DSA_SHA256);
EXPECT_EQ(verifier->verifyPackets(&packet), VerificationPolicy::ACCEPT);
@@ -269,7 +269,7 @@ TEST_F(AuthTest, AsymmetricVerifierECDSA) {
packet.appendPayload(buffer, 256);
signer->signPacket(&packet);
- EXPECT_EQ(packet.getFormat().as_u32, HICN_PACKET_FORMAT_IPV6_TCP_AH.as_u32);
+ EXPECT_EQ(packet.getFormat(), HICN_PACKET_FORMAT_IPV6_TCP_AH);
EXPECT_EQ(signer->getHashType(), CryptoHashType::SHA256);
EXPECT_EQ(signer->getSuite(), CryptoSuite::ECDSA_SHA256);
EXPECT_EQ(verifier->verifyPackets(&packet), VerificationPolicy::ACCEPT);
@@ -314,7 +314,7 @@ TEST_F(AuthTest, HMACVerifier) {
std::shared_ptr<Verifier> verifier =
std::make_shared<SymmetricVerifier>(PASSPHRASE);
- EXPECT_EQ(packet.getFormat().as_u32, HICN_PACKET_FORMAT_IPV6_TCP_AH.as_u32);
+ EXPECT_EQ(packet.getFormat(), HICN_PACKET_FORMAT_IPV6_TCP_AH);
EXPECT_EQ(signer->getHashType(), CryptoHashType::SHA256);
EXPECT_EQ(signer->getSuite(), CryptoSuite::HMAC_SHA256);
EXPECT_EQ(signer->getSignatureSize(), 32u);