[vlc-devel] [PATCH 5/5] chromecast: add an experimental sout module that connects to a ChromeCast device and streams using the HTTP access output

Adrien Maglo magsoft at videolan.org
Fri Aug 22 14:38:06 CEST 2014


Le 20/08/2014 18:08, Adrien Maglo a écrit :
>>> +vlc_tls_t *chromecast_ClientSessionCreate(vlc_tls_creds_t *crd, int fd,
>>> +                                          const char *host, const
>>> char *service)
>>> +{
>>> +    vlc_tls_t *session = vlc_tls_SessionCreate(crd, fd, host);
>>> +    if (session == NULL)
>>> +        return NULL;
>>> +
>>> +    mtime_t deadline = mdate();
>>> +    deadline += var_InheritInteger(crd, "ipv4-timeout") * 1000;
>>> +
>>> +    struct pollfd ufd[1];
>>> +    ufd[0].fd = fd;
>>> +
>>> +    int val;
>>> +    while ((val = vlc_tls_SessionHandshake(session, host, service))
>>> > 0)
>>> +    {
>>> +        mtime_t now = mdate ();
>>> +        if( now > deadline )
>>> +            now = deadline;
>>> +
>>> +        ufd[0] .events = (val == 1) ? POLLIN : POLLOUT;
>>> +
>>> +        if (poll(ufd, 1, (deadline - now) / 1000) == 0)
>>> +        {
>>> +            msg_Err( session, "TLS client session handshake timeout" );
>>> +            val = -1;
>>> +            break;
>>> +        }
>>> +    }
>>> +
>>> +    msg_Warn(session, "TLS client session is NOT trusted (%i)", val);
>>> +
>>> +    return session;
>>> +}
>>
>> This looks like cut&paste of tls.c...
>
> Yes, I'll check with the initial author of that part for the reasons.

I was told that the issue here is that we can't trust the certificate 
delivered by the Chromecast.
Adding a second vlc_tls_ClientSessionCreate() function that trust any 
certificate would be a better solution?

Best regards,


-- 
MagSoft




More information about the vlc-devel mailing list