mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
ack handshake for new node and encrypt both sides
This commit is contained in:
parent
5f5bca7632
commit
773337596b
19
crypto.cpp
19
crypto.cpp
@ -347,10 +347,25 @@ BOOST_AUTO_TEST_CASE(handshakeNew)
|
||||
nonceA.ref().copyTo(nonce);
|
||||
auth[auth.size() - 1] = 0x0;
|
||||
}
|
||||
bytes authcipher;
|
||||
encrypt(nodeB.pub(), &auth, authcipher);
|
||||
cnote << "initAuth:" << toHex(authcipher);
|
||||
|
||||
cnote << "initAuth:" << toHex(auth);
|
||||
ECDHE eB;
|
||||
bytes nBbytes(fromHex("0xBBBB"));
|
||||
h256 nonceB(sha3(nAbytes));
|
||||
bytes ack(h256::size * 2 + 1);
|
||||
{
|
||||
bytesConstRef epubk(&auth[0], Secret::size);
|
||||
bytesConstRef nonce(&auth[Secret::size], h256::size);
|
||||
|
||||
// bytes ack(h256::size * 2 + 1);
|
||||
eB.pubkey().ref().copyTo(epubk);
|
||||
nonceB.ref().copyTo(nonce);
|
||||
auth[auth.size() - 1] = 0x0;
|
||||
}
|
||||
bytes ackcipher;
|
||||
encrypt(nodeA.pub(), &ack, ackcipher);
|
||||
cnote << "ackAuth:" << toHex(ackcipher);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ecdhe_aes128_ctr_sha3mac)
|
||||
|
Loading…
Reference in New Issue
Block a user