|
|
@ -455,12 +455,12 @@ BOOST_AUTO_TEST_CASE(ecies_interop_test_primitives) |
|
|
|
BOOST_AUTO_TEST_CASE(segmentedPacketFlush) |
|
|
|
{ |
|
|
|
ECDHE localEph; |
|
|
|
h256 localNonce = Nonce::get(); |
|
|
|
Secret localNonce = Nonce::get(); |
|
|
|
ECDHE remoteEph; |
|
|
|
h256 remoteNonce = Nonce::get(); |
|
|
|
Secret remoteNonce = Nonce::get(); |
|
|
|
bytes ackCipher{0}; |
|
|
|
bytes authCipher{1}; |
|
|
|
RLPXFrameCoder encoder(true, remoteEph.pubkey(), remoteNonce, localEph, localNonce, &ackCipher, &authCipher); |
|
|
|
RLPXFrameCoder encoder(true, remoteEph.pubkey(), remoteNonce.makeInsecure(), localEph, localNonce.makeInsecure(), &ackCipher, &authCipher); |
|
|
|
|
|
|
|
/// Test writing a 64byte RLPStream and drain with frame size that
|
|
|
|
/// forces packet to be pieced into 4 frames.
|
|
|
@ -506,7 +506,7 @@ BOOST_AUTO_TEST_CASE(segmentedPacketFlush) |
|
|
|
} |
|
|
|
|
|
|
|
// read and assemble dequed encframes
|
|
|
|
RLPXFrameCoder decoder(false, localEph.pubkey(), localNonce, remoteEph, remoteNonce, &ackCipher, &authCipher); |
|
|
|
RLPXFrameCoder decoder(false, localEph.pubkey(), localNonce.makeInsecure(), remoteEph, remoteNonce.makeInsecure(), &ackCipher, &authCipher); |
|
|
|
vector<RLPXPacket> packets; |
|
|
|
RLPXFrameReader r(0); |
|
|
|
for (size_t i = 0; i < encframes.size(); i++) |
|
|
@ -529,12 +529,12 @@ BOOST_AUTO_TEST_CASE(segmentedPacketFlush) |
|
|
|
BOOST_AUTO_TEST_CASE(coalescedPacketsPadded) |
|
|
|
{ |
|
|
|
ECDHE localEph; |
|
|
|
h256 localNonce = Nonce::get(); |
|
|
|
Secret localNonce = Nonce::get(); |
|
|
|
ECDHE remoteEph; |
|
|
|
h256 remoteNonce = Nonce::get(); |
|
|
|
Secret remoteNonce = Nonce::get(); |
|
|
|
bytes ackCipher{0}; |
|
|
|
bytes authCipher{1}; |
|
|
|
RLPXFrameCoder encoder(true, remoteEph.pubkey(), remoteNonce, localEph, localNonce, &ackCipher, &authCipher); |
|
|
|
RLPXFrameCoder encoder(true, remoteEph.pubkey(), remoteNonce.makeInsecure(), localEph, localNonce.makeInsecure(), &ackCipher, &authCipher); |
|
|
|
|
|
|
|
/// Test writing four 32 byte RLPStream packets such that
|
|
|
|
/// a single 1KB frame will incldue all four packets.
|
|
|
@ -559,7 +559,7 @@ BOOST_AUTO_TEST_CASE(coalescedPacketsPadded) |
|
|
|
BOOST_REQUIRE_EQUAL(expectedFrameSize, encframes[0].size()); |
|
|
|
|
|
|
|
// read and assemble dequed encframes
|
|
|
|
RLPXFrameCoder decoder(false, localEph.pubkey(), localNonce, remoteEph, remoteNonce, &ackCipher, &authCipher); |
|
|
|
RLPXFrameCoder decoder(false, localEph.pubkey(), localNonce.makeInsecure(), remoteEph, remoteNonce.makeInsecure(), &ackCipher, &authCipher); |
|
|
|
vector<RLPXPacket> packets; |
|
|
|
RLPXFrameReader r(0); |
|
|
|
bytesRef frameWithHeader(encframes[0].data(), encframes[0].size()); |
|
|
@ -587,12 +587,12 @@ BOOST_AUTO_TEST_CASE(coalescedPacketsPadded) |
|
|
|
BOOST_AUTO_TEST_CASE(singleFramePacketFlush) |
|
|
|
{ |
|
|
|
ECDHE localEph; |
|
|
|
h256 localNonce = Nonce::get(); |
|
|
|
Secret localNonce = Nonce::get(); |
|
|
|
ECDHE remoteEph; |
|
|
|
h256 remoteNonce = Nonce::get(); |
|
|
|
Secret remoteNonce = Nonce::get(); |
|
|
|
bytes ackCipher{0}; |
|
|
|
bytes authCipher{1}; |
|
|
|
RLPXFrameCoder encoder(true, remoteEph.pubkey(), remoteNonce, localEph, localNonce, &ackCipher, &authCipher); |
|
|
|
RLPXFrameCoder encoder(true, remoteEph.pubkey(), remoteNonce.makeInsecure(), localEph, localNonce.makeInsecure(), &ackCipher, &authCipher); |
|
|
|
|
|
|
|
/// Test writing four 32 byte RLPStream packets such that
|
|
|
|
/// a single 1KB frame will incldue all four packets.
|
|
|
@ -611,7 +611,7 @@ BOOST_AUTO_TEST_CASE(singleFramePacketFlush) |
|
|
|
BOOST_REQUIRE_EQUAL(dequeLen, encframes[0].size()); |
|
|
|
|
|
|
|
// read and assemble dequed encframes
|
|
|
|
RLPXFrameCoder decoder(false, localEph.pubkey(), localNonce, remoteEph, remoteNonce, &ackCipher, &authCipher); |
|
|
|
RLPXFrameCoder decoder(false, localEph.pubkey(), localNonce.makeInsecure(), remoteEph, remoteNonce.makeInsecure(), &ackCipher, &authCipher); |
|
|
|
vector<RLPXPacket> packets; |
|
|
|
RLPXFrameReader r(0); |
|
|
|
bytesRef frameWithHeader(encframes[0].data(), encframes[0].size()); |
|
|
|