<div dir="ltr">Matt,<br>Thanks again! To be precise webrtc is using boringssl (Google's fork of openssl). From the commits it seems VERY recent but I'm unable to figure out the last openssl merge-in. You think this could be the issue? Should I try both with boringSSL (its kinda hard to compile webrtc with openSSL now since after the move to boringSSL)</div><br><div class="gmail_quote">On Fri, May 1, 2015 at 9:33 AM Matt Caswell <<a href="mailto:matt@openssl.org">matt@openssl.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 01/05/15 16:51, faraz khan wrote:<br>
> Matt,<br>
> Thanks for taking the time to go through this. Unfortunately this error<br>
> only happens when WebRTC is acting as the server in the dtls handshake<br>
> and no logs (at all) seem to be printed but I think that's because<br>
> openssl logging is done in a different way in native WebRTC which I'm<br>
> not handling. I'll try increasing logs and / or printing openssl errors.<br>
><br>
> The janus server gets the alert packet which I'm guessing is an error<br>
> produced by the server in the transaction above.<br>
<br>
Yes. You can see the following exchanges in the traces:<br>
<br>
Client                    Server<br>
------                    ------<br>
<br>
ClientHello ------------><br>
                          ServerHello<br>
                          Certificate<br>
                          CertificateRequest<br>
            <------------ ServerHelloDone<br>
Certificate<br>
ClientKeyExchange<br>
CertificateVerify<br>
ChangeCipherSpec<br>
[Finished (Encrypted)] --><br>
            <------------ Alert (Decrypt Error)<br>
<br>
If I understand your setup correctly (I'm not familiar with Janus or<br>
WebRTC), Janus is acting as the client here and WebRTC is the server,<br>
and both are using OpenSSL?<br>
<br>
><br>
> I'm assuming the problem is with the client reply that janus sent. Any<br>
> idea what it could have sent wrong that WebRTC didn't like? Could it<br>
> have encrypted the message with a wrong crypto or something or is this<br>
> negotiation wholly handled by openssl? I'm trying to understand if janus<br>
> is doing something wrong or is the dtls stuff completely handled by<br>
> libssl - in which case this might be a dtls bug?<br>
<br>
The server doesn't like something the Client sent in the last flight of<br>
messages, i.e. the Certificate, ClientKeyExchange, CertificateVerify,<br>
ChangeCipherSpec or Finished. It's unlikely to be the Certificate as, as<br>
far as I can tell, its the same Certificate in the "good" exchange<br>
versus the bad. So that means either the ClientKeyExchange,<br>
CertificateVerify or Finished messages (CCS is super simple so I don't<br>
think its that).<br>
<br>
Is WebRTC using 1.0.1 too (and if so which letter version)? Looking at<br>
the 1.0.1 code there are only a few places where a decrypt error can<br>
come from. Possible causes (in 1.0.1 code base):<br>
<br>
- digest check failed processing the Finished message<br>
- CRL signature failure processing the client Certificate<br>
- Bad RSA decrypt processing the CertificateVerify<br>
- Bad RSA signature processing the CertificateVerify<br>
<br>
There are a few other places that emit Decrypt Error alerts but none of<br>
them seem to apply here. Getting some additional logging might help us<br>
figure out which one of these is the cause.<br>
<br>
These are all quite low level issues though...deep in OpenSSL internals.<br>
<br>
Matt<br>
<br>
<br>
<br>
_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</blockquote></div>