Commit af0ba144 authored by Kevin DuBois's avatar Kevin DuBois Committed by Rémi Duraffort

RTMP handshake compliance for clients

The spec says that the 2nd round of packets need to have the 1st 4 bytes be the
timestamp (potentially zero) and the next 4 bytes be zero. The bytes after that
should be random. (not necessarily cryptographically secure, just for
establishing a unique echo response in the 3rd round of packets).
Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent 3b03fae9
......@@ -339,7 +339,14 @@ rtmp_handshake_active( vlc_object_t *p_this, int fd )
p_write[0] = RTMP_HANDSHAKE;
for( i = 0; i < RTMP_HANDSHAKE_BODY_SIZE; i++ )
p_write[i + 1] = i & 0xFF;
{
if (i < 8)
{
p_write[i + 1] = 0x00;
} else {
p_write[i + 1] = rand() & 0xFF;
}
}
/* Send handshake*/
i_ret = net_Write( p_this, fd, NULL, p_write, RTMP_HANDSHAKE_BODY_SIZE + 1 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment