| 240 | ); |
| 241 | |
| 242 | TEST(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 | } |
nothing calls this directly
no test coverage detected