summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
AgeCommit message (Collapse)Author
2001-10-24Fix SSL handshake functions and SSL_clear() such that SSL_clear()Bodo Möller
never resets s->method to s->ctx->method when called from within one of the SSL handshake functions.
2001-10-20New functions SSL[_CTX]_set_msg_callback().Bodo Möller
New macros SSL[_CTX]_set_msg_callback_arg(). Message callback imlementation for SSL 3.0/TLS 1.0 (no SSL 2.0 yet). New '-msg' option for 'openssl s_client' and 'openssl s_server' that enable a message callback that displays all protocol messages. In ssl3_get_client_hello (ssl/s3_srvr.c), generate a fatal alert if client_version is smaller than the protocol version in use. Also change ssl23_get_client_hello (ssl/s23_srvr.c) to select TLS 1.0 if the client demanded SSL 3.0 but only TLS 1.0 is enabled; then the client will at least see that alert. Fix SSL[_CTX]_ctrl prototype (void * instead of char * for generic pointer). Add/update some OpenSSL copyright notices.
2001-10-17gcc complained about "write" being shadowed even though the "write"Bodo Möller
variable name occured just in a function *prototype* -- so rename it
2001-10-16Add per-SSL 'msg_callback' with 'msg_callback_arg'.Bodo Möller
Both have per-SSL_CTX defaults. These new values can be set by calling SSL[_CTX]_[callback_]ctrl with codes SSL_CTRL_SET_MSG_CALLBACK and SSL_CTRL_SET_MSG_CALLBACK_ARG. So far, the callback is never actually called. Also rearrange some SSL_CTX struct members (some exist just in SSL_CTXs, others are defaults for SSLs and are either copied during SSL_new, or used if the value in the SSL is not set; these three classes of members were not in a logical order), and add some missing assignments to SSL_dup.
2001-09-20New function SSL_renegotiate_pending().Bodo Möller
New option SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION.
2001-09-11Make maximum certifcate chain size accepted from the peer applicationLutz Jänicke
settable (proposed by "Douglas E. Engert" <deengert@anl.gov>).
2001-09-01Make the necessary changes to work with the recent "ex_data" overhaul.Geoff Thorpe
See the commit log message for that for more information. NB: X509_STORE_CTX's use of "ex_data" support was actually misimplemented (initialisation by "memset" won't/can't/doesn't work). This fixes that but requires that X509_STORE_CTX_init() be able to handle errors - so its prototype has been changed to return 'int' rather than 'void'. All uses of that function throughout the source code have been tracked down and adjusted.
2001-08-12The indexes returned by ***_get_ex_new_index() functions are used whenGeoff Thorpe
setting stack (actually, array) values in ex_data. So only increment the global counters if the underlying CRYPTO_get_ex_new_index() call succeeds. This change doesn't make "ex_data" right (see the comment at the head of ex_data.c to know why), but at least makes the source code marginally less frustrating.
2001-07-30Fix inconsistent behaviour with respect to verify_callback handling.Lutz Jänicke
2001-07-16SSL_get_rfc were documented but not implemented.Richard Levitte
2001-07-15SSL_get_[rw]fd were documented but not implemented.Richard Levitte
2001-07-11Include kssl_lcl.h where needed.Richard Levitte
2001-07-11Changes to the Kerberos SSL code by Jeffrey Altman <jaltman@columbia.edu>Richard Levitte
His comments are: . adds use of replay cache to protect against replay attacks . adds functions kssl_tgt_is_available() and kssl_keytab_is_available() which are used within s3_lib.c and ssl_lib.c to determine at runtime whether or not KRB5 ciphers can be supported during the current session.
2001-05-10Purpose and trust setting functions for X509_STORE.Dr. Stephen Henson
Tidy existing code.
2001-04-08Avoid assert() in the library.Bodo Möller
2001-03-09Consistently use 'void *' for SSL read, peek and write functions.Bodo Möller
2001-03-08add ssl23_peekBodo Möller
2001-03-07Fix ERR_R_... problems.Bodo Möller
2001-02-23Fix an oversight - when checking a potential session ID for conflicts withGeoff Thorpe
an SSL_CTX's session cache, it is necessary to compare the ssl_version at the same time (a conflict is defined, courtesy of SSL_SESSION_cmp(), as a matching id/id_length pair and a matching ssl_version). However, the SSL_SESSION that will result from the current negotiation does not necessarily have the same ssl version as the "SSL_METHOD" in use by the SSL_CTX - part of the work in a handshake is to agree on an ssl version! This is fixed by having the check function accept an SSL pointer rather than the SSL_CTX it belongs to. [Thanks to Lutz for illuminating the full extent of my stupidity]
2001-02-21If a callback is generating a new session ID for SSLv2, then upon exiting,Geoff Thorpe
the ID will be padded out to 16 bytes if the callback attempted to generate a shorter one. The problem is that the uniqueness checking function used in callbacks may mistakenly think a 9-byte ID is unique when in fact its padded 16-byte version is not. This makes the checking function detect SSLv2 cases, and ensures the padded form is checked rather than the shorter one passed by the callback.
2001-02-21This change allows a callback to be used to override the generation ofGeoff Thorpe
SSL/TLS session IDs in a server. According to RFC2246, the session ID is an arbitrary value chosen by the server. It can be useful to have some control over this "arbitrary value" so as to choose it in ways that can aid in things like external session caching and balancing (eg. clustering). The default session ID generation is to fill the ID with random data. The callback used by default is built in to ssl_sess.c, but registering a callback in an SSL_CTX or in a particular SSL overrides this. BTW: SSL callbacks will override SSL_CTX callbacks, and a new SSL structure inherits any callback set in its 'parent' SSL_CTX. The header comments describe how this mechanism ticks, and source code comments describe (hopefully) why it ticks the way it does. Man pages are on the way ... [NB: Lutz was also hacking away and helping me to figure out how best to do this.]
2001-02-20Use new-style system-id macros everywhere possible. I hope I haven'tRichard Levitte
missed any. This compiles and runs on Linux, and external applications have no problems with it. The definite test will be to build this on VMS.
2000-12-12SSL_new() may potentially add a certfificate. Therefore, wenRichard Levitte
duplicating the certificate that is in the original SSL, remove the one that SSL_new() provided, if any. Spotted by: Mike Zeoli <zeoli@roguewave.com>
2000-12-08Next step in tidying up the LHASH code.Geoff Thorpe
DECLARE/IMPLEMENT macros now exist to create type (and prototype) safe wrapper functions that avoid the use of function pointer casting yet retain type-safety for type-specific callbacks. However, most of the usage within OpenSSL itself doesn't really require the extra function because the hash and compare callbacks are internal functions declared only for use by the hash table. So this change catches all those cases and reimplements the functions using the base-level LHASH prototypes and does per-variable casting inside those functions to convert to the appropriate item type. The exception so far is in ssl_lib.c where the hash and compare callbacks are not static - they're exposed in ssl.h so their prototypes should not be changed. In this last case, the IMPLEMENT_LHASH_*** macros have been left intact.
2000-12-04Make the remaining LHASH macro changes. This should leave no remainingGeoff Thorpe
cases of function pointer casting in lh_new() calls - and leave only the lh_doall and lh_doall_arg cases to be finished.
2000-12-02remove unused static functionUlf Möller
2000-12-01First step in tidying up the LHASH code. The callback prototypes (andGeoff Thorpe
casts) used in the lhash code are about as horrible and evil as they can be. For starters, the callback prototypes contain empty parameter lists. Yuck. This first change defines clearer prototypes - including "typedef"'d function pointer types to use as "hash" and "compare" callbacks, as well as the callbacks passed to the lh_doall and lh_doall_arg iteration functions. Now at least more explicit (and clear) casting is required in all of the dependant code - and that should be included in this commit. The next step will be to hunt down and obliterate some of the function pointer casting being used when it's not necessary - a particularly evil variant exists in the implementation of lh_doall.
2000-11-30First tentative impementation of Kerberos 5 cryptos and keys for SSL/TLS. ↵Richard Levitte
Implemented by Vern Staats <staatsvr@asc.hpc.mil>, further hacked and distributed by Jeffrey Altman <jaltnab@columbia.edu>
2000-11-30comp_methods in a SSL_CTX points at an internal database. Do *not*Richard Levitte
free that, since it's shared by all SSL_CTX's, present and future.
2000-11-28Comments on SSL_peek deficienciesBodo Möller
2000-10-12Make non blocking I/O work for accept BIOs.Dr. Stephen Henson
2000-09-26Set s->read_ahead in SSL_new because SSL_clear no longer modifies it.Bodo Möller
2000-09-26Don't modify s->read_ahead in SSL_clear, which is called fromBodo Möller
accept/connect functions; those should not change the read_ahead setting of the SSL structure.
2000-09-17Use sk_*_new_null() instead of sk_*_new(NULL), since that takes careRichard Levitte
of complaints from the compiler about data pointers and function pointers not being compatible with each other.
2000-09-05Keep a not of original encoding in certificate requests.Dr. Stephen Henson
Add new option to PKCS7_sign to exclude S/MIME capabilities.
2000-09-04Avoid abort() throughout the library, except when preprocessorBodo Möller
symbols for debugging are defined.
2000-06-01There have been a number of complaints from a number of sources that namesRichard Levitte
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
2000-06-01The previous commit to crypto/stack/*.[ch] pulled the type-safety stringsGeoff Thorpe
yet tighter, and also put some heat on the rest of the library by insisting (correctly) that compare callbacks used in stacks are prototyped with "const" parameters. This has led to a depth-first explosion of compiler warnings in the code where 1 constification has led to 3 or 4 more. Fortunately these have all been resolved to completion and the code seems cleaner as a result - in particular many of the _cmp() functions should have been prototyped with "const"s, and now are. There was one little problem however; X509_cmp() should by rights compare "const X509 *" pointers, and it is now declared as such. However, it's internal workings can involve recalculating hash values and extensions if they have not already been setup. Someone with a more intricate understanding of the flow control of X509 might be able to tighten this up, but for now - this seemed the obvious place to stop the "depth-first" constification of the code by using an evil cast (they have migrated all the way here from safestack.h). Fortunately, this is the only place in the code where this was required to complete these type-safety changes, and it's reasonably clear and commented, and seemed the least unacceptable of the options. Trying to take the constification further ends up exploding out considerably, and indeed leads directly into generalised ASN functions which are not likely to cooperate well with this.
2000-03-27Comments for SSL_get_peer_cert_chain inconsistency.Bodo Möller
2000-02-25Some time in history, SSL_CTX_sessions() disappeared. It is nowRichard Levitte
restored, but not as a macro this time...
2000-02-24Remove structures that are no longer used.Richard Levitte
2000-02-24nicer manpagesUlf Möller
2000-02-24Fix NO_RSA (misplaced #endif).Ulf Möller
2000-02-23Allow ADH to be used but not present in the default cipherDr. Stephen Henson
list. Allow CERTIFICATE to be used in PEM headers for PKCS#7 structures: some CAs do this.
2000-02-21Fix some bugs and document othersBodo Möller
2000-02-20Move the registration of callback functions to special functionsRichard Levitte
designed for that. This removes the potential error to mix data and function pointers. Please note that I'm a little unsure how incorrect calls to the old ctrl functions should be handled, in som cases. I currently return 0 and that's it, but it may be more correct to generate a genuine error in those cases.
2000-01-30Seek out and destroy another evil cast.Ulf Möller
2000-01-30Source code cleanups: Use void * rather than char * in lhash,Ulf Möller
eliminate some of the -Wcast-qual warnings (debug-ben-strict target)
2000-01-23Tidy up CRYPTO_EX_DATA structures.Dr. Stephen Henson
2000-01-22Apply Lutz Behnke's 56 bit cipher patch with a fewDr. Stephen Henson
minor changes. Docs haven't been added at this stage. They are probably best included in the 'ciphers' program docs.