#include <wvsslstream.h>
Inheritance diagram for WvSSLStream:
Public Methods | |
WvSSLStream (WvStream *_slave, WvX509Mgr *x509=NULL, bool _verify=false, bool _is_server=false) | |
virtual | ~WvSSLStream () |
virtual bool | pre_select (SelectInfo &si) |
virtual bool | post_select (SelectInfo &si) |
virtual void | close () |
WvSSLStream (WvStream *_slave, WvX509Mgr *x509=NULL, bool _verify=false, bool _is_server=false) | |
virtual | ~WvSSLStream () |
virtual bool | pre_select (SelectInfo &si) |
virtual bool | post_select (SelectInfo &si) |
virtual void | close () |
Protected Methods | |
virtual size_t | uwrite (const void *buf, size_t len) |
virtual size_t | uread (void *buf, size_t len) |
virtual size_t | uwrite (const void *buf, size_t len) |
virtual size_t | uread (void *buf, size_t len) |
Protected Attributes | |
WvStream * | slave |
SSL_CTX * | ctx |
SSL * | ssl |
SSL_METHOD * | meth |
WvStream * | slave |
SSL_CTX * | ctx |
SSL * | ssl |
SSL_METHOD * | meth |
Private Attributes | |
volatile bool | sslconnected |
bool | is_server |
bool | verify |
bool | read_again |
WvLog | debug |
char | bouncebuffer [1400] |
size_t | writeonly |
Definition at line 26 of file crypto/wvsslstream.h.
|
Start an SSL Connection on the stream _slave - if the x509 structure is passed to the wvsslstream, then the stream will assume it is a server. This is a temporary hack, since a client can also have a certificate(for client side validation - SSLv3, TLS). Eventually, this constructor will have a third parameter, bool _is_server, which will be used to decide between server and client mode. Definition at line 6 of file wvsslstream.cc. References WvX509Mgr::cert, ctx, debug, WvStream::force_select(), is_server, WvX509Mgr::keypair, meth, read_again, WvRSAKey::rsa, WvStream::seterr(), slave, ssl, sslconnected, verify, and writeonly. |
|
Cleans up everything (calls close + frees up the SSL Objects used) Definition at line 88 of file wvsslstream.cc. |
|
Start an SSL Connection on the stream _slave - if the x509 structure is passed to the wvsslstream, then the stream will assume it is a server. This is a temporary hack, since a client can also have a certificate(for client side validation - SSLv3, TLS). Eventually, this constructor will have a third parameter, bool _is_server, which will be used to decide between server and client mode. |
|
Cleans up everything (calls close + frees up the SSL Objects used) |
|
Close down the SSL Connection Reimplemented from WvStreamClone. |
|
Close down the SSL Connection Reimplemented from WvStreamClone. Definition at line 178 of file wvsslstream.cc. References WvStreamClone::close(), ctx, and ssl. Referenced by uread(), uwrite(), and ~WvSSLStream(). |
|
post_select() is called after select(), and returns true if this object is now ready. Usually this is done by checking for this object in the read, write, and except lists in the SelectInfo structure. If you want to do it in some other way, you should usually do it in pre_select() instead. (post_select() _only_ gets called if select() returned true for _some_ stream or another.) You may also want to do extra maintenance functions here; for example, the standard WvStream::post_select tries to flush outbuf if it's nonempty. WvTCPConn might retry connect() if it's waiting for a connection to be established. Reimplemented from WvStreamClone. |
|
post_select() is called after select(), and returns true if this object is now ready. Usually this is done by checking for this object in the read, write, and except lists in the SelectInfo structure. If you want to do it in some other way, you should usually do it in pre_select() instead. (post_select() _only_ gets called if select() returned true for _some_ stream or another.) You may also want to do extra maintenance functions here; for example, the standard WvStream::post_select tries to flush outbuf if it's nonempty. WvTCPConn might retry connect() if it's waiting for a connection to be established. Reimplemented from WvStreamClone. Definition at line 212 of file wvsslstream.cc. References debug, WvX509Mgr::err, WvX509Mgr::errstr, WvStreamClone::getrfd(), WvStreamClone::getwfd(), WvStream::isok(), WvStreamClone::post_select(), WvStream::seterr(), slave, ssl, sslconnected, WvStream::undo_force_select(), and WvX509Mgr::validate(). |
|
pre_select() sets up for eventually calling select(). It adds the right fds to the read, write, and except lists in the SelectInfo struct. Returns true if we already know this stream is ready, and there's no need to actually do a real select(). Some streams, such as timers, can be implemented by _only_ either returning true or false here after doing a calculation, and never actually adding anything to the SelectInfo. You can add your stream to any of the lists even if readable, writable, or isexception isn't set. This is what force_select() does. You can also choose not to add yourself to the list if you know it would be useless right now. pre_select() is only called if isok() is true. pre_select() is allowed to reduce msec_timeout (or change it if it's -1). However, it's not allowed to _increase_ msec_timeout. Reimplemented from WvStreamClone. |
|
pre_select() sets up for eventually calling select(). It adds the right fds to the read, write, and except lists in the SelectInfo struct. Returns true if we already know this stream is ready, and there's no need to actually do a real select(). Some streams, such as timers, can be implemented by _only_ either returning true or false here after doing a calculation, and never actually adding anything to the SelectInfo. You can add your stream to any of the lists even if readable, writable, or isexception isn't set. This is what force_select() does. You can also choose not to add yourself to the list if you know it would be useless right now. pre_select() is only called if isok() is true. pre_select() is allowed to reduce msec_timeout (or change it if it's -1). However, it's not allowed to _increase_ msec_timeout. Reimplemented from WvStreamClone. Definition at line 197 of file wvsslstream.cc. References debug, WvStreamClone::pre_select(), and read_again. |
|
Overrides for the standard read function, so that SSL_read() will get called... Reimplemented from WvStreamClone. |
|
Overrides for the standard read function, so that SSL_read() will get called... Reimplemented from WvStreamClone. Definition at line 98 of file wvsslstream.cc. References close(), debug, read_again, WvStream::seterr(), ssl, and sslconnected. |
|
Overrides the standard write function, and use SSL_write() instead... Reimplemented from WvStreamClone. |
|
Overrides the standard write function, and use SSL_write() instead... Reimplemented from WvStreamClone. Definition at line 128 of file wvsslstream.cc. References bouncebuffer, close(), debug, WvStream::seterr(), ssl, sslconnected, and writeonly. |
|
Buffer to handle SSL_write() stupidity... if you're really curious, read the SSL_write() man page, and you'll know why. Definition at line 121 of file include/wvsslstream.h. Referenced by uwrite(). |
|
SSL Context - used to create SSL Object Definition at line 62 of file include/wvsslstream.h. |
|
SSL Context - used to create SSL Object Definition at line 62 of file crypto/wvsslstream.h. Referenced by close(), and WvSSLStream(). |
|
Internal Log Object Definition at line 115 of file include/wvsslstream.h. Referenced by post_select(), pre_select(), uread(), uwrite(), WvSSLStream(), and ~WvSSLStream(). |
|
Keep track of whether we are a client or a server Definition at line 98 of file include/wvsslstream.h. Referenced by WvSSLStream(). |
|
Again, used to setup the SSL Object - The Method is set so that this client can Connect to, and understand SSLv2, SSLv3, and TLS servers Definition at line 74 of file include/wvsslstream.h. |
|
Again, used to setup the SSL Object - The Method is set so that this client can Connect to, and understand SSLv2, SSLv3, and TLS servers Definition at line 74 of file crypto/wvsslstream.h. Referenced by WvSSLStream(). |
|
SSL may keep its own internal read buffers, so we need to avoid doing a real select() until these are definitely empty (SSL_read returns EAGAIN). Definition at line 110 of file include/wvsslstream.h. Referenced by pre_select(), uread(), and WvSSLStream(). |
|
Connection to be "cloned" Definition at line 57 of file include/wvsslstream.h. |
|
Connection to be "cloned" Definition at line 57 of file crypto/wvsslstream.h. Referenced by post_select(), WvSSLStream(), and ~WvSSLStream(). |
|
Main SSL Object - after SSL_set_fd() we make all calls through the connection through here Definition at line 68 of file include/wvsslstream.h. |
|
Main SSL Object - after SSL_set_fd() we make all calls through the connection through here Definition at line 68 of file crypto/wvsslstream.h. Referenced by close(), post_select(), uread(), uwrite(), and WvSSLStream(). |
|
Connection Status Flag, since SSL takes a few seconds to initialize itself. Definition at line 93 of file include/wvsslstream.h. Referenced by post_select(), uread(), uwrite(), and WvSSLStream(). |
|
Keep track of whether we want to check the peer who connects to us Definition at line 103 of file include/wvsslstream.h. Referenced by WvSSLStream(). |
|
Definition at line 122 of file include/wvsslstream.h. Referenced by uwrite(), and WvSSLStream(). |