SSL thoughts

2014-07-02 Thread Jeff MAURY
Hello, I have spent some times reviewing the SSL code in order to add support client handshake start. I have seen several problems that I'd like to share: - messages sent are encrypted when they are submitted: I see two problems with that: if a message is submitted before the handshake is

Re: SSL thoughts

2014-07-02 Thread Emmanuel Lécharny
Le 03/07/2014 00:42, Jeff MAURY a écrit : > Hello, > > I have spent some times reviewing the SSL code in order to add support > client handshake start. > I have seen several problems that I'd like to share: > >- messages sent are encrypted when they are submitted: I see two >problems with t

Re: SSL thoughts

2014-07-02 Thread Jeff MAURY
On Thu, Jul 3, 2014 at 1:19 AM, Emmanuel Lécharny wrote: > Le 03/07/2014 00:42, Jeff MAURY a écrit : > > Hello, > > > > I have spent some times reviewing the SSL code in order to add support > > client handshake start. > > I have seen several problems that I'd like to share: > > > >- messages

Re: SSL thoughts

2014-07-03 Thread Emmanuel Lécharny
Le 03/07/2014 07:56, Jeff MAURY a écrit : > On Thu, Jul 3, 2014 at 1:19 AM, Emmanuel Lécharny > wrote: > >> Le 03/07/2014 00:42, Jeff MAURY a écrit : >>> Hello, >>> >>> I have spent some times reviewing the SSL code in order to add support >>> client handshake start. >>> I have seen several proble

Re: SSL thoughts

2014-07-17 Thread Jeff MAURY
Hello, back to work, I have the following thoughts: - encrypting just before we write to the socket may lead to other problems: if the resulting message is greater than the send buffer, then we would need to wait for the rest of the buffer. If between, we receive an handshake, we may

Re: SSL thoughts

2014-07-17 Thread Emmanuel Lécharny
Le 17/07/2014 17:15, Jeff MAURY a écrit : > Hello, > > back to work, I have the following thoughts: > >- encrypting just before we write to the socket may lead to other >problems: if the resulting message is greater than the send buffer, then we >would need to wait for the rest of the b

Re: SSL thoughts

2014-07-17 Thread Jeff MAURY
On Thu, Jul 17, 2014 at 5:53 PM, Emmanuel Lécharny wrote: > Le 17/07/2014 17:15, Jeff MAURY a écrit : > > Hello, > > > > back to work, I have the following thoughts: > > > >- encrypting just before we write to the socket may lead to other > >problems: if the resulting message is greater t

Re: SSL thoughts

2014-07-17 Thread Emmanuel Lécharny
Le 17/07/2014 18:01, Jeff MAURY a écrit : > On Thu, Jul 17, 2014 at 5:53 PM, Emmanuel Lécharny > wrote: > >> Le 17/07/2014 17:15, Jeff MAURY a écrit : >>> Hello, >>> >>> back to work, I have the following thoughts: >>> >>>- encrypting just before we write to the socket may lead to other >>>

Re: SSL thoughts

2014-07-17 Thread Bernd Fondermann
Hi, just wanted to add my 2 eurocent, don't know if it really makes sense in the discussed context. In Vysper, a state machine is maintained which tracks the connection status between connected, started, authenticated, encrypted, etc. Depending on the connection state, Vysper will reject messages

Re: SSL thoughts

2014-07-17 Thread Emmanuel Lécharny
Le 17/07/2014 23:34, Bernd Fondermann a écrit : > Hi, > > just wanted to add my 2 eurocent, don't know if it really makes sense > in the discussed context. > > In Vysper, a state machine is maintained which tracks the connection > status between connected, started, authenticated, encrypted, etc. >

Re: SSL thoughts

2014-07-18 Thread Bernd Fondermann
On 18.07.14 00:35, Emmanuel Lécharny wrote: Le 17/07/2014 23:34, Bernd Fondermann a écrit : Hi, just wanted to add my 2 eurocent, don't know if it really makes sense in the discussed context. In Vysper, a state machine is maintained which tracks the connection status between connected, started

Re: SSL thoughts

2014-07-18 Thread Emmanuel Lécharny
Le 18/07/2014 11:23, Bernd Fondermann a écrit : > On 18.07.14 00:35, Emmanuel Lécharny wrote: >> Le 17/07/2014 23:34, Bernd Fondermann a écrit : >>> Hi, >>> >>> just wanted to add my 2 eurocent, don't know if it really makes sense >>> in the discussed context. >>> >>> In Vysper, a state machine is

Re: SSL thoughts

2014-07-19 Thread Emmanuel Lécharny
Some mor ethoughts, after I spent a couple of hours in Rescorla SSL's book... One of the critical point is what to do when we have pending messages to write to a remote peer, which has initiated a (re-)handshake. My initial take was that we should finish to send the current message to teh remote

Re: SSL thoughts

2014-07-19 Thread Jeff MAURY
No, I don't agree with that because the spec says that the new key materials should be set current only when the change cipher spec message is received from the server. So I think we can continue sending messages encrypted with the old key if the handshake messages are after in the queue. The pr

Re: SSL thoughts

2014-07-19 Thread Emmanuel Lécharny
Le 19/07/2014 17:34, Jeff MAURY a écrit : > No, I don't agree with that because the spec says that the new key materials > should be set current only when the change cipher spec message is received > from the server. So I think we can continue sending messages encrypted with > the old key if the

Re: SSL thoughts

2014-07-20 Thread Jeff MAURY
On Sat, Jul 19, 2014 at 6:25 PM, Emmanuel Lécharny wrote: > Le 19/07/2014 17:34, Jeff MAURY a écrit : > > No, I don't agree with that because the spec says that the new key > materials should be set current only when the change cipher spec message is > received from the server. So I think we can

Re: SSL thoughts

2014-07-20 Thread Emmanuel Lécharny
Le 20/07/2014 23:11, Jeff MAURY a écrit : > On Sat, Jul 19, 2014 at 6:25 PM, Emmanuel Lécharny > wrote: > >> Le 19/07/2014 17:34, Jeff MAURY a écrit : >>> No, I don't agree with that because the spec says that the new key >> materials should be set current only when the change cipher spec message

Re: SSL thoughts

2014-07-21 Thread Jeff MAURY
On Mon, Jul 21, 2014 at 5:14 AM, Emmanuel Lécharny wrote: > Le 20/07/2014 23:11, Jeff MAURY a écrit : > > On Sat, Jul 19, 2014 at 6:25 PM, Emmanuel Lécharny > > wrote: > > > >> Le 19/07/2014 17:34, Jeff MAURY a écrit : > >>> No, I don't agree with that because the spec says that the new key > >>

Re: SSL thoughts

2014-07-21 Thread Emmanuel Lécharny
Le 21/07/2014 11:53, Jeff MAURY a écrit : > On Mon, Jul 21, 2014 at 5:14 AM, Emmanuel Lécharny > wrote: > >> Le 20/07/2014 23:11, Jeff MAURY a écrit : >> >>record layer to make the write pending state the write active state. >> The SSL sepc says basically the same thing. >> >> However, that on

Re: SSL thoughts

2014-07-21 Thread Jeff MAURY
On Mon, Jul 21, 2014 at 3:32 PM, Emmanuel Lécharny wrote: > Le 21/07/2014 11:53, Jeff MAURY a écrit : > > On Mon, Jul 21, 2014 at 5:14 AM, Emmanuel Lécharny > > wrote: > > > >> Le 20/07/2014 23:11, Jeff MAURY a écrit : > >> > >>record layer to make the write pending state the write active st

Re: SSL thoughts

2014-07-21 Thread Emmanuel Lécharny
Le 21/07/2014 16:16, Jeff MAURY a écrit : > On Mon, Jul 21, 2014 at 3:32 PM, Emmanuel Lécharny > wrote: > >> Le 21/07/2014 11:53, Jeff MAURY a écrit : >>> On Mon, Jul 21, 2014 at 5:14 AM, Emmanuel Lécharny >>> wrote: >>> Le 20/07/2014 23:11, Jeff MAURY a écrit : record layer to

Re: SSL thoughts

2014-07-23 Thread Jeff MAURY
On Mon, Jul 21, 2014 at 5:25 PM, Emmanuel Lécharny wrote: > Le 21/07/2014 16:16, Jeff MAURY a écrit : > > On Mon, Jul 21, 2014 at 3:32 PM, Emmanuel Lécharny > > wrote: > > > >> Le 21/07/2014 11:53, Jeff MAURY a écrit : > >>> On Mon, Jul 21, 2014 at 5:14 AM, Emmanuel Lécharny < > elecha...@gmail.

Re: SSL thoughts

2014-07-23 Thread Emmanuel Lécharny
Le 23/07/2014 10:56, Jeff MAURY a écrit : > On Mon, Jul 21, 2014 at 5:25 PM, Emmanuel Lécharny > wrote: > >> Le 21/07/2014 16:16, Jeff MAURY a écrit : >>> On Mon, Jul 21, 2014 at 3:32 PM, Emmanuel Lécharny >>> wrote: >>> Le 21/07/2014 11:53, Jeff MAURY a écrit : > On Mon, Jul 21, 2014 at

Re: SSL thoughts

2014-07-30 Thread Jeff MAURY
Hello, after thinking about the messages ordering and rehandshaking, I agree that we should encrypt just before sending. The only problematic case that I can see is if the send queue is empty and the application submit a message when the last client handshake message is received : if both runs co

Re: SSL thoughts

2014-08-01 Thread Emmanuel Lécharny
Le 30/07/2014 23:26, Jeff MAURY a écrit : > Hello, > > after thinking about the messages ordering and rehandshaking, I agree that > we should encrypt just before sending. A > The only problematic case that I can > see is if the send queue is empty and the application submit a message whe

More SSL thoughts

2014-10-07 Thread Jeff MAURY
Hello, as I'm working on the SSL part this time and more specifically on the handshake/rehandshake processing, I have a couple of questions and some infos to share: - I've added 3 more methods in IoHandler to reflect handshake related event: handshakeStarted, handshakeCompleted and secureCl

Re: More SSL thoughts

2014-10-08 Thread Emmanuel Lécharny
Le 07/10/14 23:37, Jeff MAURY a écrit : > Hello, > > as I'm working on the SSL part this time and more specifically on the > handshake/rehandshake processing, I have a couple of questions and some > infos to share: > >- I've added 3 more methods in IoHandler to reflect handshake related >ev

Re: More SSL thoughts

2014-10-08 Thread Jeff MAURY
On Wed, Oct 8, 2014 at 10:33 AM, Emmanuel Lécharny wrote: > Le 07/10/14 23:37, Jeff MAURY a écrit : > > Hello, > > > > as I'm working on the SSL part this time and more specifically on the > > handshake/rehandshake processing, I have a couple of questions and some > > infos to share: > > > >-

Re: More SSL thoughts

2014-10-10 Thread Emmanuel Lécharny
Le 08/10/14 11:45, Jeff MAURY a écrit : > On Wed, Oct 8, 2014 at 10:33 AM, Emmanuel Lécharny > wrote: > >> Le 07/10/14 23:37, Jeff MAURY a écrit : >>> Hello, >>> >>> as I'm working on the SSL part this time and more specifically on the >>> handshake/rehandshake processing, I have a couple of quest

Re: More SSL thoughts

2014-10-10 Thread Jeff MAURY
On Sat, Oct 11, 2014 at 8:24 AM, Emmanuel Lécharny wrote: > Le 08/10/14 11:45, Jeff MAURY a écrit : > > On Wed, Oct 8, 2014 at 10:33 AM, Emmanuel Lécharny > > wrote: > > > >> Le 07/10/14 23:37, Jeff MAURY a écrit : > >>> Hello, > >>> > >>> as I'm working on the SSL part this time and more specif

Re: More SSL thoughts

2014-10-11 Thread Emmanuel Lécharny
Le 11/10/14 08:38, Jeff MAURY a écrit : > On Sat, Oct 11, 2014 at 8:24 AM, Emmanuel Lécharny > wrote: > > > I was mentioning the SSLContext that is the argument of the initSecure > method. Please note that in 3.0, there is no more SSLFilter as SSL >> handling >>> has been moved to core. >>> So my

[MINA3] Re: More SSL thoughts

2014-10-11 Thread Emmanuel Lécharny
Replying again, but this time with MINA 3 in mind (please add a tage in front of teh subject, i order to avoid confusion : I was in MINA 2 mode those last 3 weeks...) Le 07/10/14 23:37, Jeff MAURY a écrit : > Hello, > > as I'm working on the SSL part this time and more specifically on the > hands