My first stumbles with OpenSSL [was: SSL overhead]

2008-04-17 Thread Tomas Neme
All who have answered: Thanks a lot. Yes, I understood that the poll() should read to a buffer last night, in the shower. You know how that works ;). But I also understood that I had misunderstood the way the "poll" and "read" methods were being used, and "read" will be called no matter what "poll

Re: SSL overhead

2008-04-17 Thread Dr. Stephen Henson
On Wed, Apr 16, 2008, Tomas Neme wrote: > does one of the flags in the BIO object say anything about the > blocking nature of the BIO? For example, does SSL_connect return > automatically or not depending on the BIO flags, or on the BIO_write > and read return values? > If a BIO is blocking it s

Re: SSL overhead

2008-04-17 Thread Steffen DETTMER
* Tomas Neme wrote on Wed, Apr 16, 2008 at 17:44 -0300: > The problem is that SSL_pending might return 0 if there's > stuff on the socket, but isn't enough to decode a full record. If you want SSL to be transparent, why are you interested in intermediate protocol-specific data which would not be

RE: SSL overhead

2008-04-17 Thread Keller, Michael
supported/documented. Cheers, Michael. > -Original Message- > From: Tomas Neme [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 15, 2008 4:24 PM > To: openssl-users@openssl.org > Subject: Re: SSL overhead > > OK, I think I'll implement my own BIO. My C is good, althou

RE: SSL overhead

2008-04-16 Thread David Schwartz
> One more question: I'm working on an ansynchronous framework, and > there's a "poll" method that gets called in each iteration. In our > sockets, this method's supposed to do whatever needs doing, and return > how many bytes are waiting to be read from the socket, so the return > value should be

Re: SSL overhead

2008-04-16 Thread Tomas Neme
does one of the flags in the BIO object say anything about the blocking nature of the BIO? For example, does SSL_connect return automatically or not depending on the BIO flags, or on the BIO_write and read return values? T -- |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy and paste b

Re: SSL overhead

2008-04-16 Thread Tomas Neme
One more question: I'm working on an ansynchronous framework, and there's a "poll" method that gets called in each iteration. In our sockets, this method's supposed to do whatever needs doing, and return how many bytes are waiting to be read from the socket, so the return value should be the value

Re: SSL overhead

2008-04-15 Thread Tomas Neme
> It would seem that the socket BIO handles the socket abstraction, but > it does not handle calls to BIO_S_CONNECT. Actually, a grep for > BIO_S_CONNECT returns only bss_conn.. why is this? shouldn't sockets > have a call to connect too? sorry, I forgot that you create the BIO_socket with the

Re: SSL overhead

2008-04-15 Thread Victor Duchovni
On Tue, Apr 15, 2008 at 04:22:03PM -0300, Tomas Neme wrote: > Stephen: > > > > Most of them you don't need to worry about. I'd suggest looking at the > > > fd BIO > > > and copy some of the functionality from that. > > I also need to know which of the BIO_CTRL_* params do I have to > impleme

Re: SSL overhead

2008-04-15 Thread Tomas Neme
Stephen: > > Most of them you don't need to worry about. I'd suggest looking at the fd > > BIO > > and copy some of the functionality from that. I also need to know which of the BIO_CTRL_* params do I have to implement in my _ctrl function. Is there a reason why you said to look at the fd BIO

Re: SSL overhead

2008-04-15 Thread Tomas Neme
> Most of them you don't need to worry about. I'd suggest looking at the fd BIO > and copy some of the functionality from that. OK, I will. I just wondered because mem_new (the new method of BIO_s_mem) sets shutdown = 1 ; init = 1; num = -1 and rtcp does init = 1 ; num = 0 ; flags = 0 ; so I'd l

Re: SSL overhead

2008-04-15 Thread Dr. Stephen Henson
On Tue, Apr 15, 2008, Tomas Neme wrote: > Is there any reference of what do the different members of the BIO > objects mean? method, ptr, next_bio and prev_bio are pretty obvious, > but the rest, I don't know, and I haven't been able to find any > details out there.. I'll keep googling, but if any

Re: SSL overhead

2008-04-15 Thread Tomas Neme
Is there any reference of what do the different members of the BIO objects mean? method, ptr, next_bio and prev_bio are pretty obvious, but the rest, I don't know, and I haven't been able to find any details out there.. I'll keep googling, but if anyone knows of a good detail out there, please poin

Re: SSL overhead

2008-04-15 Thread Tomas Neme
OK, I think I'll implement my own BIO. My C is good, although not brilliant, but I can do it. What stopped me from trying that approach in the first place was that the BIO* functions are so many and that I don't know which ones do I actually *need* to reimplement (that is, which ones is the eng

RE: SSL overhead

2008-04-14 Thread David Schwartz
> The documentation's poor at best, and I don't completely get the > general concepts. From reading examples I figure that only the > BIO_f_ssl does encryption-decryption when written into? so what should > I do if I want to provide an api that has functions b_encrypt and > encrypt_flush? I think

Re: SSL overhead

2008-04-14 Thread Goetz Babin-Ebell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tomas Neme wrote: | The documentation's poor at best, and I don't completely get the | general concepts. From reading examples I figure that only the | BIO_f_ssl does encryption-decryption when written into? so what should | I do if I want to provide

Re: SSL overhead

2008-04-14 Thread Tomas Neme
> general concepts. From reading examples I figure that only the > BIO_f_ssl does encryption-decryption when written into? so what should Or doing SSL_write into a SSL object with a BIO_s_mem object as the write-bio will write the encrypted data into it? T -- |_|0|_| |_|_|0| |0|0|0| (\__/) (

Re: SSL overhead

2008-04-14 Thread Tomas Neme
I'm getting started with ssl, and there's a lot of things I don't get about the library, small, and quite a lot of them Isn't there an IRC channel, or some kind of faster communication way than this? The documentation's poor at best, and I don't completely get the general concepts. From reading e

SSL overhead

2008-04-14 Thread Tomas Neme
We have our own TCP implementation, and we're thinking of using a BIO_s_mem to add an SSL layer to it. The plan is: read the socket, put the encrypted data into the ssl object's BIO, and then do a read from it. Likewise, produce the data, feed it into OpenSSL, and then take the data from the BIO an