MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / TEST

Function TEST

tests/unit/test_http_pairing.cpp:242–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240);
241
242TEST(PairingTest, OutOfOrderCalls) {
243 boost::property_tree::ptree tree;
244
245 setup(PRIVATE_KEY, PUBLIC_CERT);
246
247 pair_session_t sess {};
248
249 clientchallenge(sess, tree, "test");
250 ASSERT_FALSE(tree.get<int>("root.paired") == 1);
251
252 serverchallengeresp(sess, tree, "test");
253 ASSERT_FALSE(tree.get<int>("root.paired") == 1);
254
255 auto add_cert = std::make_shared<safe::queue_t<crypto::x509_t>>(30);
256 clientpairingsecret(sess, add_cert, tree, "test");
257 ASSERT_FALSE(tree.get<int>("root.paired") == 1);
258
259 // This should work, it's the first time we call it
260 sess.async_insert_pin.salt = "ff5dc6eda99339a8a0793e216c4257c4";
261 getservercert(sess, tree, "test");
262 ASSERT_TRUE(tree.get<int>("root.paired") == 1);
263
264 // Calling it again should fail
265 getservercert(sess, tree, "test");
266 ASSERT_FALSE(tree.get<int>("root.paired") == 1);
267}

Callers

nothing calls this directly

Calls 5

setupFunction · 0.85
clientchallengeFunction · 0.85
serverchallengerespFunction · 0.85
clientpairingsecretFunction · 0.85
getservercertFunction · 0.85

Tested by

no test coverage detected