Re: suspending and continuing handshake

2014-06-05 Thread DEXTER
Hi Steve, That is exactly what I needed. I've just tried it out with OpenSSL-1.0.2-beta1 and it works perfectly. Do you have any ETA on when the 1.0.2 will be released? Thank you! On Wed, Jun 4, 2014 at 4:29 PM, Dr. Stephen Henson wrote: > On Wed, Jun 04, 2014, DEXTER wrote: > > > > Well, th

Re: suspending and continuing handshake

2014-06-05 Thread DEXTER
On Wed, Jun 4, 2014 at 4:49 PM, Viktor Dukhovni wrote: > > Sounds like the requested feature is already implemented. That's some > fast work. :-) > > Indeed, it is some fast work. That's all that about the "itching" feature, low priority, and many years... > -- > Viktor. > _

RE: suspending and continuing handshake

2014-06-04 Thread Salz, Rich
It supports both, yet lots of complicated work to create a full event system. Well, okay :) As opposed to have the SNI callback block on a mutex while some other thread wakes up and does whatever work is needed. /r$ -- Principal Security Engineer Akamai Technologies, Cambridge, MA I

Re: suspending and continuing handshake

2014-06-04 Thread Viktor Dukhovni
On Wed, Jun 04, 2014 at 04:29:19PM +0200, Dr. Stephen Henson wrote: > In the server case the callback is called when the server certificate is > required. It has a feature where the callback can return -1 and this then sets > a special state SSL_ERROR_WANT_X509_LOOKUP and you can retry in the same

Re: suspending and continuing handshake

2014-06-04 Thread Dr. Stephen Henson
On Wed, Jun 04, 2014, DEXTER wrote: > > Well, that's not how it works. Normally when OpenSSL returns with > >> something like WANT_READ or WANT_WRITE, it is possible to later > >> determine whether the preconditions for moving forward are satisfied. > >> > >> In this case you're asking OpenSSL t

Re: suspending and continuing handshake

2014-06-04 Thread Viktor Dukhovni
On Wed, Jun 04, 2014 at 10:03:34AM -0400, Salz, Rich wrote: > > You could try the OpenSSL RT. I would suspect that such a feature would be > > relatively low on the priority list. > > Especially because OpenSSL's programming model is to use threads, not events. It supports both, in fact given t

RE: suspending and continuing handshake

2014-06-04 Thread Salz, Rich
> You could try the OpenSSL RT. I would suspect that such a feature would be > relatively low on the priority list. Especially because OpenSSL's programming model is to use threads, not events. /r$ -- Principal Security Engineer Akamai Technologies, Cambridge, MA IM: rs...@jabber.me;

Re: suspending and continuing handshake

2014-06-04 Thread Viktor Dukhovni
On Wed, Jun 04, 2014 at 12:04:14PM +0200, DEXTER wrote: > >> In this case you're asking OpenSSL to just wait for nothing in > >> particular. That feature does not exist. > > > > That's the problem. I'm asking kindly the devs of openssl to make this > > feature exist. > > Now that Openssl has two

Re: suspending and continuing handshake

2014-06-04 Thread DEXTER
> Well, that's not how it works. Normally when OpenSSL returns with >> something like WANT_READ or WANT_WRITE, it is possible to later >> determine whether the preconditions for moving forward are satisfied. >> >> In this case you're asking OpenSSL to just wait for nothing in >> particular. That

Re: suspending and continuing handshake

2014-05-27 Thread Viktor Dukhovni
On Tue, May 27, 2014 at 05:28:31PM +0200, DEXTER wrote: > On Tue, May 27, 2014 at 5:09 PM, Viktor Dukhovni > wrote: > > > On Tue, May 27, 2014 at 04:57:39PM +0200, DEXTER wrote: > > > > > Not now. Right now I'm sort of hacking the connection. I mean, I store > > > the client's data in a temp buf

Re: suspending and continuing handshake

2014-05-27 Thread DEXTER
On Tue, May 27, 2014 at 5:09 PM, Viktor Dukhovni wrote: > On Tue, May 27, 2014 at 04:57:39PM +0200, DEXTER wrote: > > > Not now. Right now I'm sort of hacking the connection. I mean, I store > > the client's data in a temp buffer, and when I got back to the client to > > continue the handshake wi

Re: suspending and continuing handshake

2014-05-27 Thread Viktor Dukhovni
On Tue, May 27, 2014 at 04:57:39PM +0200, DEXTER wrote: > > Do you instantiate the keypair in > > question in a new SSL_CTX that you associate with the SSL connection > > before returning from the SNI callback? > > Not now. Right now I'm sort of hacking the connection. I mean, I store > the client

Re: suspending and continuing handshake

2014-05-27 Thread DEXTER
On Tue, May 27, 2014 at 4:34 PM, Viktor Dukhovni wrote: > On Tue, May 27, 2014 at 03:20:22PM +0200, DEXTER wrote: > > So you are writing an MiTM proxy? Exactly. > When you "sign" the server > certificate, do you replace the public key with a new public key > whose private key you know? Yep.

Re: suspending and continuing handshake

2014-05-27 Thread Viktor Dukhovni
On Tue, May 27, 2014 at 03:20:22PM +0200, DEXTER wrote: > Before I know what certificate should I show to the client, I have to > connect to the server to get the certificate from it (and then copy it, > sign it, etc.). So you are writing an MiTM proxy? When you "sign" the server certificate, do

Re: suspending and continuing handshake

2014-05-27 Thread DEXTER
What do you mean by I have to register default certificates? There are no default certificates. Before I know what certificate should I show to the client, I have to connect to the server to get the certificate from it (and then copy it, sign it, etc.). But before connecting to the server I need th

Re: suspending and continuing handshake

2014-05-27 Thread Viktor Dukhovni
On Tue, May 27, 2014 at 12:03:05PM +0200, DEXTER wrote: > That is exactly what I thought first, to control it with BIOs. > Unfortunately even if I give openssl the exact amount of bytes (not more) > to be able to call the SNI callback, right after I return from the > callback, openssl's own state m

Re: suspending and continuing handshake

2014-05-27 Thread DEXTER
That is exactly what I thought first, to control it with BIOs. Unfortunately even if I give openssl the exact amount of bytes (not more) to be able to call the SNI callback, right after I return from the callback, openssl's own state machine goes into a state where it'll immediately say the: No sha

Re: suspending and continuing handshake

2014-05-26 Thread Kyle Hamilton
I would think that this could be done by handling BIO communications yourself via memory BIOs, then sending the content of those BIOs over the network as appropriate. But, this does appear to be something that needs attention (given the reactive nature of SNI's specification long after the origina

suspending and continuing handshake

2014-05-26 Thread DEXTER
Hi! In a proxying environment when the client connects to the proxy and it sends the SNI, you have to suspend the handshake with the client side, start the handshake on the serverside, get the certificate from the server, and send that certificate back to the client. This is only possible, if I ca