Esempio n. 1
0
Handshake::Handshake(Gateway& gateway,Handler& handler,Entity& entity) : ServerSession(0,0,Peer(handler),RTMFP_SYMETRIC_KEY,RTMFP_SYMETRIC_KEY,(Invoker&)handler),
	_gateway(gateway) {
	(bool&)checked=true;

	memcpy(_certificat,"\x01\x0A\x41\x0E",4);
	RandomInputStream().read((char*)&_certificat[4],64);
	memcpy(&_certificat[68],"\x02\x15\x02\x02\x15\x05\x02\x15\x0E",9);

	// Display far id flash side
	EVP_Digest(_certificat,sizeof(_certificat),(unsigned char *)entity.id,NULL,EVP_sha256(),NULL);
}
Esempio n. 2
0
Handshake::Handshake(Gateway& gateway,DatagramSocket& socket,ServerData& data) : Session(0,0,Peer(SocketAddress()),RTMFP_SYMETRIC_KEY,RTMFP_SYMETRIC_KEY,socket,data),
	_gateway(gateway),_signature("\x03\x1a\x00\x00\x02\x1e\x00\x81\x02\x0d\x02",11) {
	
	memcpy(_certificat,"\x01\x0A\x41\x0E",4);
	RandomInputStream().read((char*)&_certificat[4],64);
	memcpy(&_certificat[68],"\x02\x15\x02\x02\x15\x05\x02\x15\x0E",9);

	// Display far id flash side
	UInt8 id[32];
	EVP_Digest(_certificat,sizeof(_certificat),id,NULL,EVP_sha256(),NULL);

	INFO("Id of this cumulus server : %s",Util::FormatHex(id,32).c_str());
}
Esempio n. 3
0
ServerConnection::ServerConnection(Handler& handler,Session& handshake) : ServerSession(0,0,Peer(handler),NULL,NULL,(Invoker&)handler),_handshake(handshake),_connected(false) {
	RandomInputStream().read((char*)peer.id,ID_SIZE);
}