Re: [openssl-users] SSL_read, SSL_write error handling

2016-09-15 Thread Viktor Dukhovni
On Thu, Sep 15, 2016 at 07:18:52AM +0200, Alex Hultman wrote: > io_callback(events) { > if (messages_to_send && (events & OS_WRITABLE)) { > SSL_write(.); > if (error) { > if (error_is_want_read) { > system_poll &= OS_READA

Re: [openssl-users] SSL_read, SSL_write error handling

2016-09-14 Thread Alex Hultman
I did find a very good explanation here: https://mta.openssl.org/pipermail/openssl-users/2015-March/000709.html The idea of "what SSL wants" and "what the app wants" is a very good explanation. This is the pseudocode I'm working with currently: io_callback(events) { if (messages_to_se

Re: [openssl-users] SSL_read, SSL_write error handling

2016-09-14 Thread Viktor Dukhovni
On Thu, Sep 15, 2016 at 05:07:22AM +0200, Alex Hultman wrote: > If SSL_write returns the error SSL_ERROR_WANT_READ, am I then allowed to > call SSL_read before I have called SSL_write? WANT_READ means that OpenSSL *internally* needs to read some (often ciphertext) bytes from the peer, and that si

[openssl-users] SSL_read, SSL_write error handling

2016-09-14 Thread Alex Hultman
write - despite the fact that the error was thrown by the opposite SSL_* function call? Does an SSL_ERROR_WANT_READ have to be handled by the SSL_* function that caused the error, or will any of the two (SSL_read, SSL_write) functions handle this desire? -- openssl-users mailing list To unsubs

[openssl-users] Non-blocking SSL_read/SSL_write: difference between renegociation and data famine

2016-09-12 Thread Nicolas Brunie
Hi, I am trying to implement bufferization of data on a SSL connection at the application layer. To do so I implemented a wrapper to SSL_write, which fills a buffer rather than sending data directly to SSL_write. When the buffer is full the data is flushed in a call to SSL_write, but when t

Re: Parameter requirements of SSL_read / SSL_write after an associated SSL_ERROR_WANT_READ / SSL_ERROR_WANT_WRITE ...

2014-12-02 Thread John Lane Schultz
. Cheers! - John Lane Schultz Spread Concepts LLC Cell: 443 838 2200 On Dec 3, 2014, at 2:03 AM, John Lane Schultz wrote: I’ve read that when SSL_read / SSL_write returns a SSL_ERROR_WANT_READ / SSL_ERROR_WANT_WRITE that when the required readable / writeable condition has been met tha

Parameter requirements of SSL_read / SSL_write after an associated SSL_ERROR_WANT_READ / SSL_ERROR_WANT_WRITE ...

2014-12-02 Thread John Lane Schultz
I’ve read that when SSL_read / SSL_write returns a SSL_ERROR_WANT_READ / SSL_ERROR_WANT_WRITE that when the required readable / writeable condition has been met that the call to SSL_read / SSL_write must be made with EXACTLY the same parameters as the previous call that returned the error. Can

RE: SSL_read, SSL_write confusion

2012-07-02 Thread Dave Thompson
>From: owner-openssl-us...@openssl.org On Behalf Of Dogan Kurt >Sent: Friday, 29 June, 2012 15:14 >Hi, i am developing a client app with openssl. I use SSL_read >and SSL_write in blocking mode, i just cant figure out something >about them, if server sends me 10 kb and i call SSL_read just >once

SSL_read, SSL_write confusion

2012-07-01 Thread Doğan Kurt
Hi, i am developing a client app with openssl. I use SSL_read and SSL_write in blocking mode, i just cant figure out something about them, if server sends me 10 kb and i call SSL_read just once, can i assume that i will receive all the data at once. I use simple recv call with that classic approac

RE: data size issue with SSL_read( ) / SSL_write

2011-03-22 Thread Ryan Pfeifle
> From: owner-openssl-us...@openssl.org > [mailto:owner-openssl-us...@openssl.org] On Behalf Of ikuzar > Sent: Friday, March 18, 2011 5:41 AM > To: openssl-users@openssl.org > Subject: Re: data size issue with SSL_read( ) / SSL_write > > Ryan, what is the suitable cipher

Re: data size issue with SSL_read( ) / SSL_write

2011-03-18 Thread ikuzar
Any >> review, retransmission, dissemination or other use of, or taking of any >> action in reliance upon, this information by persons or entities other than >> the intended recipient is prohibited. If you received this in error, please >> contact the sender and delete this mate

Re: data size issue with SSL_read( ) / SSL_write

2011-03-18 Thread ikuzar
> the intended recipient is prohibited. If you received this in error, please > contact the sender and delete this material from any computer. > > > *From:* owner-openssl-us...@openssl.org [mailto: > owner-openssl-us...@openssl.org] *On Behalf Of *ikuzar > *Sent:* Thursday, Mar

Re: data size issue with SSL_read( ) / SSL_write

2011-03-17 Thread David Schwartz
On 3/17/2011 7:43 AM, ikuzar wrote: I am confused. When I used a simple c++ program which uses SSL functions for the first time, I need not implement a protocol. when I tell SSL_write( ) to send 5 bytes and tell SSL_read( ) to read 10 bytes, the last reads 5 bytes ! ( doesn't it ? am I wrong ?

Re: data size issue with SSL_read( ) / SSL_write

2011-03-17 Thread ikuzar
I am confused. When I used a simple c++ program which uses SSL functions for the first time, I need not implement a protocol. when I tell SSL_write( ) to send 5 bytes and tell SSL_read( ) to read 10 bytes, the last reads 5 bytes ! ( doesn't it ? am I wrong ? I assume SSL reads expect \0 then it st

Re: data size issue with SSL_read( ) / SSL_write

2011-03-17 Thread David Schwartz
On 3/17/2011 6:40 AM, ikuzar wrote: Why do we expect \r\n ? why not \0 ? That's why you need to implement a protocol. DS __ OpenSSL Project http://www.openssl.org User Support Mailing List

Re: data size issue with SSL_read( ) / SSL_write

2011-03-17 Thread ikuzar
Why do we expect \r\n ? why not \0 ? 2011/3/17 > Hi > > does your server send \r\n with hello? > > i read byte by byte until i found an \r\n > > Regards > Luiz > > > Hello, > > > > In my programm, client send "HELLO" message to server. > > > > 1) > > > ---

Re: data size issue with SSL_read( ) / SSL_write

2011-03-17 Thread luiz
Hi does your server send \r\n with hello? i read byte by byte until i found an \r\n Regards Luiz > Hello, > > In my programm, client send "HELLO" message to server. > > 1) > --- > SSL_write is encapsulated in MY_sen

Re: data size issue with SSL_read( ) / SSL_write

2011-03-17 Thread David Schwartz
On 3/17/2011 5:00 AM, ikuzar wrote: The problem : when I print data, I have got : HELLO��y0�y 0�y��y i`�0�y ������L���L��-M etc... instead of HELLO. in MYrecv, when I make L = 5, it works what should I do to read just the right size so that when I print I get HELLO, GOODBYE, etc .

data size issue with SSL_read( ) / SSL_write

2011-03-17 Thread ikuzar
Hello, In my programm, client send "HELLO" message to server. 1) --- SSL_write is encapsulated in MY_send( ) function like this : MY_send(MY_cn sd, const char* data, size_t len) { ret = SSL_write(socki->ssl, d

Re: Does OpenSSL have any plans of supporting SSL_read / SSL_write on the same SSL_S from multiple threads?

2010-09-27 Thread David Schwartz
r there are any plans, but I doubt it. The reason not to is that the library is not the right place to implement that kind of logic. (b) As far as I understand, the main problem with the parallel SSL_read / SSL_write is renegotiation, i.e. a call to SSL_read can lead to a send call and vice-versa,

Does OpenSSL have any plans of supporting SSL_read / SSL_write on the same SSL_S from multiple threads?

2010-09-25 Thread Jayaraghavendran k
, but couldn't find anything), If no, why not? (b) As far as I understand, the main problem with the parallel SSL_read / SSL_write is renegotiation, i.e. a call to SSL_read can lead to a send call and vice-versa, so, if I ensure I don't do renegotiation at all (both sides use my application

Re: Understanding SSL_read()/SSL_write()

2009-12-13 Thread Patrick Patterson
ations, credential passing, session setup and teardown... which are, by far, the most likely reason to get SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE... the SSL layer needs another pass through select() / poll() with the appropriate call being made to completely something happening in *its* protocol la

RE: Understanding SSL_read()/SSL_write()

2009-12-12 Thread David Schwartz
Sebastian Treu: > > If you set ALLOW_MOVING_WRITE_BUFFER, the restriction is relaxed. The > > only > > restriction that remains is that you must present a consistent data > > stream. > > For example, if you try to SSL_write "foo" and two bytes are sent, > > your next > > SSL_write *must* start wit

Re: Understanding SSL_read()/SSL_write()

2009-12-12 Thread Sebastián Treu
On Sat, Dec 12, 2009 at 4:12 PM, David Schwartz wrote: > Sebastian Treu wrote: > >> Well, maybe I miss the point of what man pages wanted to say with: >> >> "[...] >> WARNING >>        When an SSL_write() operation has to be repeated because of >>        SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE

RE: Understanding SSL_read()/SSL_write()

2009-12-12 Thread David Schwartz
Sebastian Treu wrote: > Well, maybe I miss the point of what man pages wanted to say with: > > "[...] > WARNING >When an SSL_write() operation has to be repeated because of >SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE, it must be repeated > with >the same arguments. > [...

Re: Understanding SSL_read()/SSL_write()

2009-12-12 Thread Sebastián Treu
On Sat, Dec 12, 2009 at 7:19 AM, Sebastián Treu wrote: > differents arguments. I also noted that SSL_write() is "clever" enough > to send _any_ length, so segmented writes will be overriding that > warning (if I undestood what man wanted to say). When I say clever > enough, I meant that in what I

Re: Understanding SSL_read()/SSL_write()

2009-12-12 Thread Sebastián Treu
Hi David, >> Others things are to instantaneously put that client in a wait list >> when SSL_write() could not succed, continue with the others, and try >> with that client again later. But, sometimes we can get a WANT_WRITE >> or WANT_READ when renegotiating so this does not appears a solution.

RE: Understanding SSL_read()/SSL_write()

2009-12-11 Thread David Schwartz
Sebastian Treu: > As David said in an older thread, I can think of the API as a state > machine and then, regarding how much progress we get, do something. > Considering this, I have some doubts about a communication between > server and clients. Let's say we write a client that in his nature, >

Re: Understanding SSL_read()/SSL_write()

2009-12-11 Thread Sebastián Treu
Hi, I didn't want to start another thread about this two I/O functions. For starters (like me) on this two I/O calls, things get a bit confusing at the beggining. I used to read man pages and doc before asking something that I don't know and gather information about it to try to resolve the proble

Re: Understanding SSL_read()/SSL_write()

2009-10-14 Thread aerowolf
On Wed, Oct 14, 2009 at 9:55 AM, Rij wrote: Hello everyone, I need a deeper understanding of SSL_read()/SSL_write() and was wondering if someone could please provide some insight. As far as I understand, OpenSSL has is a record-oriented protocol. Lets say the record size is 16K. Let's

RE: Understanding SSL_read()/SSL_write()

2009-10-14 Thread David Schwartz
> Hello everyone, > > I need a deeper understanding of SSL_read()/SSL_write() and was > wondering if someone could please provide some insight. > > As far as I understand, OpenSSL has is a record-oriented protocol. > Lets say the record size is 16K. Let's say a clie

Understanding SSL_read()/SSL_write()

2009-10-14 Thread Rij
Hello everyone, I need a deeper understanding of SSL_read()/SSL_write() and was wondering if someone could please provide some insight. As far as I understand, OpenSSL has is a record-oriented protocol. Lets say the record size is 16K. Let's say a client requests data of size 40K and then

RE: SSL_read/SSL_write and select

2009-08-03 Thread David Schwartz
Luiz Rafael Culik Guimaraes wrote: > How to use properly SSL_read/SSL_write with select? Make sure to set the socket/BIO non-blocking. Call SSL_read or SSL_write when you want to read or write plaintext to/from the SSL connection. *Only* call 'select' on the underlying sock

SSL_read/SSL_write and select

2009-08-03 Thread Luiz Rafael Culik Guimaraes
Dear Friends How to use properly SSL_read/SSL_write with select? my default code with use standart api, make an call to select before call to recv/send api my code to read is like this to Read i use do { if( iPos == iAllocated - 1 ) { iAllocated += iBufferSize

RE: SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-17 Thread David Schwartz
> > Because that's what HTTP version 1.0 says to do, and you asked > > for HTTP 1.0 > > behavior. If it didn't, how would the client know when it got the entire > > request? > (You mean the entire response, and in particular response body > aka entity.) Right. > Content-length is allowed in 1.0

RE: SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-17 Thread Dave Thompson
> From: owner-openssl-users On Behalf Of David Schwartz > Sent: Monday, 14 January, 2008 16:48 > > In fact, I'm not sure why apache closes connection even if I > set KeepAlive > > to On in httpd.conf. > > Because that's what HTTP version 1.0 says to do, and you asked > for HTTP 1.0 > behavior.

RE: SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-14 Thread David Schwartz
> Hi > Thanks for reply. > > In fact, I'm not sure why apache closes connection even if I set KeepAlive > to On in httpd.conf. Because that's what HTTP version 1.0 says to do, and you asked for HTTP 1.0 behavior. If it didn't, how would the client know when it got the entire request? > If I send

RE: SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-14 Thread Dima Rusyy
_ > OpenSSL Project http://www.openssl.org > User Support Mailing Listopenssl-users@openssl.org > Automated List Manager [EMAIL PROTECTED] > > -- View this message in context: ht

RE: SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-14 Thread Dima Rusyy
_ > OpenSSL Project http://www.openssl.org > User Support Mailing Listopenssl-users@openssl.org > Automated List Manager [EMAIL PROTECTED] > > -- View this message in context: ht

RE: SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-14 Thread David Schwartz
> Hello! > > I use openssl to work with apache server via https. > But I see a strange situation when the second and the third calls > to send() > in my test-case read 0 bytes from socket. > Can you provide here any help? Why is that surprising? That's exactly what I would expect to happen. When

Re: SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-14 Thread Dima Rusyy
openssl-users@openssl.org > Automated List Manager [EMAIL PROTECTED] > > -- View this message in context: http://www.nabble.com/SSL_read-reads-0-bytes-after-SSL_write-SSL_read-SSL_write-tp14737783p14797266.html Sent from the OpenSSL - User mailing list arch

SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-14 Thread Dima Rusyy
BIO_new_socket(sock, BIO_NOCLOSE); SSL_set_bio(ssl, sbio, sbio); err = SSL_connect(ssl); send(); send(); send(); BIO_free_all(sbio); ERR_print_errors_fp(stderr); return 0; } -- View this message in context: http://www.nabble.com/SSL_read-reads-0-bytes-after-SSL_write-SSL_read-SSL_writ

Re: SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-10 Thread Marek . Marcola
Hello, > I use openssl to work with apache server via https. > But I see a strange situation when second and third calls to send() in my test-case read > 0 bytes from socket. > Can you provide here any help? You should not use names like "send" in your program. send() is already defined system cal

SSL_read reads 0 bytes after SSL_write/SSL_read/SSL_write

2008-01-10 Thread Dima Rusyy
Hello! I use openssl to work with apache server via https. But I see a strange situation when second and third calls to send() in my test-case read 0 bytes from socket. Can you provide here any help? I use 'Fedora Core 7 x86' and openssl-0.9.8e. Thanks! -Dima #include #include #include #inclu

RE: Regarding epollET with SSL_read/ SSL_write

2007-07-10 Thread David Schwartz
> But as per the behavior of the Edge triggered epoll, > the epoll_wait will raise event only if it receives a data > after putting this in the read event of epoll every time. > Does this affect the behavior of SSL_read / SSL_write. If any > one implements the server using epoll ET

Regarding epollET with SSL_read/ SSL_write

2007-07-10 Thread Kingston Smiler
triggered epoll, the epoll_wait will raise event only if it receives a data after putting this in the read event of epoll every time. Does this affect the behavior of SSL_read / SSL_write. If any one implements the server using epoll ET can you please let me know that there is any special case that

SSL_read SSL_write async mode error

2006-10-18 Thread Leandro Gustavo Biss Becker
Hi   I'm using BIO in async mode. When writing or reading data with SSL_write or SSL_read, in some parts of the code, after receive some data I use EVPs functions. In some cases, due key problems, my EVP_DecryptFinalEx fails and call EVPerr(EVP_F_EVP_DECRYPTFINAL_EX,EVP_R_BAD_DECRYPT); Th

RE: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-24 Thread David Schwartz
> David > > can't understand > ""Incorrect. The 'SSL_write' function is the function to send > unencrypted data over the SSL link. It has nothing to do with the > encrypted data the SSL engine wants to write to the socket."" > When we do SSL_write the i/p is unencrypted data and this gets send >

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-24 Thread Krishna M Singh
David can't understand ""Incorrect. The 'SSL_write' function is the function to send unencrypted data over the SSL link. It has nothing to do with the encrypted data the SSL engine wants to write to the socket."" When we do SSL_write the i/p is unencrypted data and this gets send over the SSL l

RE: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-23 Thread David Schwartz
> > If you get a 'select' hit, whether for readability or > > writability, you > >should retry *all* operations, whether reads or writes. > > (Obviously, don't > >call SSL_write unless you have some data to write!) > > Again, I also recommend trying an SSL_read on any hit, > > whether for

RE: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread urjit_gokhale
Original message >Date: Tue, 22 Aug 2006 12:22:37 -0700 >From: "David Schwartz" <[EMAIL PROTECTED]> >Subject: RE: Wrapping SSL_read/SSL_write so they behave like read/write.] >To: > You should 'select' for writability if and only if

RE: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread David Schwartz
> To answer my own question: No. Here is an amended version. While I believe your code is okay, it can be improved in a few ways. It contains some assumptions that are not always true, and it will work better without those assumptions. > > for(cp = connobjs; cp; cp = cp->next) > >

Re: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread Marek Marcola
Hello, > >You may use select() but with some care. > >Simplest way is to: > > 1) wait on select() > > 2) read hit from SSL descriptor occur > > 3) read incrementally with SSL_read() from that descriptor until > >WANT_READ > > (or in other words - get all data from SSL read buffer) > > 4) go to se

Re: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread urjit_gokhale
Original message >Date: Tue, 22 Aug 2006 15:00:46 +0200 >From: Marek Marcola <[EMAIL PROTECTED]> >Subject: Re: Wrapping SSL_read/SSL_write so they behave like read/write.] >To: openssl-users@openssl.org >You may use select() but with some care. >Simplest

Re: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread Steven Young
On Tue, Aug 22, 2006 at 12:06:29PM -0400, Steven Young wrote: > On Tue, Aug 22, 2006 at 03:00:46PM +0200, Marek Marcola wrote: > > You may use select() but with some care. > > Simplest way is to: > > 1) wait on select() > > 2) read hit from SSL descriptor occur > > 3) read incrementally with SSL

Re: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread Steven Young
On Tue, Aug 22, 2006 at 03:00:46PM +0200, Marek Marcola wrote: > You may use select() but with some care. > Simplest way is to: > 1) wait on select() > 2) read hit from SSL descriptor occur > 3) read incrementally with SSL_read() from that descriptor until > WANT_READ >(or in other words - g

Re: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread Joe Flowers
Do something like this for a SSL_read() and something very similar for SSL_write() and SSL_shutdown(), etc. (I'm assuming non-blocking sockets): - totalbytesread=0; stop='n'; unsigned

Re: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread Marek Marcola
Hello, > Pardon me, I think I'm a little thick today. I get what you're > all saying but I'm still not 100% sure of how this should be applied. > Here's the program flow, without SSL: > > while(!quit) { > for(i in all file descriptors) { > if(we have something buffered up to say to the s

Re: Wrapping SSL_read/SSL_write so they behave like read/write.]

2006-08-22 Thread Steven Young
Apologies if this is a duplicate; I was messing around with my e-mail yesterday and it was broken for a while. I didn't see this go through. On Sun, Aug 20, 2006 at 06:54:36PM -0400, Joe Flowers wrote: > It means call exactly the same SSL function you just did with the exact > same paramete

RE: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-20 Thread David Schwartz
> If you get SSL_ERROR_WANT_WRITE, even if you have no application data > to send, the protocol itself requires data to be written Correct. > -- so you > need to call SSL_write(). Incorrect. The 'SSL_write' function is the function to send unencrypted data over the SSL link. I

RE: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-20 Thread David Schwartz
> Encapsulated SSL data comes in records/packets. When you select() > some descriptor for read, and select() gives you such hit you start > reading data from SSL buffers. And now we may have some problems. > If you will retry SSL_read() until you will get WANT_READ then > you will get all data fro

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-20 Thread Joe Flowers
Joe Flowers wrote: It means the exactly same SSL function you just did with the exact same parameters as you ust did that produced this SSL_ERROR_WANT_WRITE return. Again, it's clearly explained in the docs. Joe Good grief. Pardon my grammar. The sentence should have read: It means call exa

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-20 Thread Joe Flowers
I wouldn't advise that. Read the docs: "When calling |SSL_write()| with num=0 bytes to be sent the behaviour is undefined." I still stand by me first reply on this thread, as I believe it follows directly from the docs. Read the docs on SSL_read() and SSL_write(). SSL_ERROR_WANT_WRITE does n

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-20 Thread Kyle Hamilton
If you get SSL_ERROR_WANT_WRITE, even if you have no application data to send, the protocol itself requires data to be written -- so you need to call SSL_write(). If you get SSL_ERROR_WANT_READ, even if you're writing application data, that means that the protocol itself is requiring data to be r

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-20 Thread Marek Marcola
Hello, > On Sun, Aug 20, 2006 at 07:46:26PM +0200, Marek Marcola wrote: > > I've forget to pay your attention on other problem that may appear > > with code like: > > > > do { > > ret = SSL_read(sslobject, buf, bufsz); > > err = SSL_get_error(sslobject, ret); > > } while (ret <= 0 && (

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-20 Thread Steven Young
On Sun, Aug 20, 2006 at 07:46:26PM +0200, Marek Marcola wrote: > I've forget to pay your attention on other problem that may appear > with code like: > > do { > ret = SSL_read(sslobject, buf, bufsz); > err = SSL_get_error(sslobject, ret); > } while (ret <= 0 && (err == SSL_ERROR_WANT_R

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-20 Thread Marek Marcola
Hello > On Sat, Aug 19, 2006 at 11:58:27PM +0200, Marek Marcola wrote: > > In this situation calling SSL_read() next time is enough > > (SSL layer will continue to write its own data and after this > > read real data) but this SSL_read() should be performed > > when socket descriptor is ready fo

RE: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-19 Thread David Schwartz
> I'm a little unclear on how this should be implemented.. so if I call > SSL_read, get -1 back, and err = SSL_ERROR_WANT_READ, do I just call > SSL_read again? No. That error is telling you that you need to wait until the socket is (again) readable. > Because that's what I've been doing

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-19 Thread Steven Young
On Sat, Aug 19, 2006 at 11:58:27PM +0200, Marek Marcola wrote: > In this situation calling SSL_read() next time is enough > (SSL layer will continue to write its own data and after this > read real data) but this SSL_read() should be performed > when socket descriptor is ready for write now.

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-19 Thread Marek Marcola
Hello, > > You should change loop ending condition - this loop should end > > when SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE occur because > > this errors may be returned on non-blocking sockets on SSL_read() > > and on SSL_write(). On normal use this will happen mostly where > > re-handshake is

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-19 Thread Steven Young
On Sat, Aug 19, 2006 at 05:44:35PM -0400, Steven Young wrote: > You're right; I don't want blocking behaviour. The non-SSL part > of the code solves this by select()ing on the readable file descriptors > and only calling read() when there is something to be read. To give you an idea of what's

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-19 Thread Steven Young
On Sat, Aug 19, 2006 at 10:27:52PM +0200, Marek Marcola wrote: > I'm not sure if this is good solution because this will give > you semi-blocking behaviour (we are only in non-blocking wrapper > and checking for read/write is done by select() in "upper" layer). You're right; I don't want blockin

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-19 Thread Marek Marcola
Hello, > You need to put select(ready to read or write) inside each (BOTH > SSL_read() and SSL_write()) of your while loops at the beginning, and > then cycle on WANT_READ or WANT_WRITE for BOTH SSL_read() and > SSL_write() loops. > > You're getting high utilization because you are not putting

Re: Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-19 Thread Joe Flowers
Steve, You need to put select(ready to read or write) inside each (BOTH SSL_read() and SSL_write()) of your while loops at the beginning, and then cycle on WANT_READ or WANT_WRITE for BOTH SSL_read() and SSL_write() loops. You're getting high utilization because you are not putting select i

Wrapping SSL_read/SSL_write so they behave like read/write.

2006-08-19 Thread Steven Young
Hello, I'm writing a program which can be compiled either with SSL support or without. In order to limit the amount of #ifdef'ing I have to put throughout the rest of my program, I'm trying to wrap SSL_read and SSL_write so they can be treated like read/write on a regular socket. This is

RE: SSL_read/SSL_write from kernel

2006-06-28 Thread Gayathri Sundar
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Marek Marcola Sent: Wednesday, June 28, 2006 8:06 PM To: openssl-users@openssl.org Subject: RE: SSL_read/SSL_write from kernel Hello, > Thanks, but let me rephrase my question. > > There seems to be a requirement for us to pr

RE: SSL_read/SSL_write from kernel

2006-06-28 Thread Marek Marcola
ck ciphers, > we need > to ensure the data segment within the sk_buff is a multiple of the > block cipher > length, otherwise, we need to do a buffer copy and maintain the > remaining data > in some kernel memory, prequeue it and append it to the next sk_buff.. > > If openss

RE: SSL_read/SSL_write from kernel

2006-06-28 Thread Gayathri Sundar
need to ensure the data segment within the sk_buff is a multiple of the block cipher length, otherwise, we need to do a buffer copy and maintain the remaining data in some kernel memory, prequeue it and append it to the next sk_buff..   If openssl does support SSL_read/SSL_write from kernel

RE: SSL_read/SSL_write from kernel

2006-06-28 Thread Vishnubhatla, Vijaya Bhaskar
ECTED] On Behalf Of Gayathri SundarSent: Wednesday, June 28, 2006 1:06 PMTo: openssl-users@openssl.orgSubject: SSL_read/SSL_write from kernel Hi.,   Does openssl as such provide support for packet processing from kernel..i.e what do I have to do to invoke SSL_read/write from kernel..has a

SSL_read/SSL_write from kernel

2006-06-28 Thread Gayathri Sundar
Title: intoto Stationery Hi.,   Does openssl as such provide support for packet processing from kernel..i.e what do I have to do to invoke SSL_read/write from kernel..has anyone attempted this before.   Thanks --Gayathri    

SSL_read/SSL_write from kernel

2006-06-28 Thread Gayathri Sundar
Hi., Does openssl as such provide support for packet processing from kernel..i.e what do I have to do to invoke SSL_read/write from kernel..has anyone attempted this before. Thanks --Gayathri __ OpenSSL Project

SSL_read & SSL_write and retry

2005-02-03 Thread Edward Chan
Title: SSL_read & SSL_write and retry Hi there, I've been trying to figure out the correct way to use SSL_read and SSL_write with retry and auto retry mode, etc.  I'm a little confused.  I've got a program that uses blocking sockets, and select (I only use select to check

RE: Socket hangs on SSL_read/SSL_write

2001-08-16 Thread Miles Sabin
Eric Rescorla wrote, > The man page says: ^^^ Huh? Which platform? I'd be more impressed by POSIX chapter and verse, but even that's irrelevant because all it might or might not tell us is that many platforms aren't fully POSIX compliant. > select() examines the I/O descriptor sets whose a

RE: Socket hangs on SSL_read/SSL_write

2001-08-15 Thread Bill @ Rebey.com
c Rescorla Sent: Wednesday, August 15, 2001 11:36 AM To: [EMAIL PROTECTED] Subject:Re: Socket hangs on SSL_read/SSL_write "Bill @ Rebey.com" <[EMAIL PROTECTED]> writes: > I have a pair of programs that work fine (they can communicate with one > another) in "clear&

Re: Socket hangs on SSL_read/SSL_write

2001-08-15 Thread Eric Rescorla
"Bill @ Rebey.com" <[EMAIL PROTECTED]> writes: > I have a pair of programs that work fine (they can communicate with one > another) in "clear" (non-SSL mode), but when I switch them to use SSL, the > SSL_write hangs, as does the SSL_read on the other end. ( "select"ing for > Read on the reader's

Socket hangs on SSL_read/SSL_write

2001-08-15 Thread Bill @ Rebey.com
I have a pair of programs that work fine (they can communicate with one another) in "clear" (non-SSL mode), but when I switch them to use SSL, the SSL_write hangs, as does the SSL_read on the other end. ( "select"ing for Read on the reader's handle doesn't even work - the "select" never trips).

Re: SSL_read, SSL_write

2000-05-23 Thread Steven M. Cherry
> Can anyone look at them and tell me what's wrong > with them? My SSL connections are working, but the reading is never able to > detect when a peer has closed the other end of the connection. > > > int sslsocket::getch(char& ch) > { > if(m_init) > init(); > > int ret = SSL_read(m_ssl,