[rtmpdump] bug of HandShake(RTMP * r, int FP9HandShake) in handshake.h

Xspeed xspeed1989 at gmail.com
Tue Nov 27 04:43:46 CET 2012


static int
WriteN(RTMP *r, const char *buffer, int n)
{
  const char *ptr = buffer;
#ifdef CRYPTO
  char *encrypted = 0;
  char buf[RTMP_BUFFER_CACHE_SIZE];

  if (r->Link.rc4keyOut)
    {
      if (n > sizeof(buf))
encrypted = (char *)malloc(n);
      else
encrypted = (char *)buf;
      ptr = encrypted;
      RC4_encrypt2(r->Link.rc4keyOut, n, buffer, ptr);
    }
#endif

  while (n > 0)
    {
      int nBytes;

      if (r->Link.protocol & RTMP_FEATURE_HTTP)
        nBytes = HTTP_Post(r, RTMPT_SEND, ptr, n);
      else
        nBytes = RTMPSockBuf_Send(&r->m_sb, ptr, n);
      /*RTMP_Log(RTMP_LOGDEBUG, "%s: %d\n", __FUNCTION__, nBytes); */

      if (nBytes < 0)
{
  int sockerr = GetSockError();
  RTMP_Log(RTMP_LOGERROR, "%s, RTMP send error %d (%d bytes)", __FUNCTION__,
      sockerr, n);

  if (sockerr == EINTR && !RTMP_ctrlC)
    continue;

  RTMP_Close(r);
  n = 1;
  break;
}

      if (nBytes == 0)
break;

      n -= nBytes;
      ptr += nBytes;
    }

#ifdef CRYPTO
  if (encrypted && encrypted != buf)
    free(encrypted);
#endif

  return n == 0;
}

I think you need to initialize your key when you call the following
encryption function, but you didn't, which leads to my error.
RC4_encrypt2(r->Link.rc4keyOut, n, buffer, ptr);

2012/11/27 Xspeed <xspeed1989 at gmail.com>

> Actually the program is not using the library I compiled, but the one that
> exists in system
>
>
> 2012/11/27 Steven Penny <svnpenn at gmail.com>
>
>> Ok I'll bite. You say only success on Ubuntu, yet you have shown a working
>> command / output from working command. I will be skeptical until I see
>> this.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20121127/6661df78/attachment-0001.html>


More information about the rtmpdump mailing list