aboutsummaryrefslogtreecommitdiff
path: root/ssl/bio_ssl.c
AgeCommit message (Collapse)AuthorFilesLines
2017-12-18Add comments to NULL func ptrs in bio_method_stDaniel Bevenius1-3/+3
This commit adds comments to bio_method_st definitions where the function pointers are defined as NULL. Most of the structs have comments but some where missing and not all consitent. CLA: trivial Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4881)
2017-12-15Fix invalid function type casts.Bernd Edlinger1-18/+4
Rename bio_info_cb to BIO_info_cb. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4493)
2017-12-09Make BIO_METHOD struct definitions consistentDaniel Bevenius1-1/+2
I noticed that some of the BIO_METHOD structs are placing the name on the same line as the type and some don't. This commit places the name on a separate line for consistency (which looks like what the majority do) CLA: trivial Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4878)
2017-10-18Remove parentheses of return.KaoruToda1-17/+17
Since return is inconsistent, I removed unnecessary parentheses and unified them. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4541)
2017-10-09Since return is inconsistent, I removed unnecessary parentheses andKaoruToda1-1/+1
unified them. - return (0); -> return 0; - return (1); -> return 1; - return (-1); -> return -1; Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4500)
2017-03-07Get pointer type right in BIO_ssl_shutdown()Rich Salz1-8/+9
Also, restore 1.0.2 behavior of looping over all BIO's in the chain. Thanks to Joseph Bester for finding this and suggesting a fix to the crash. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2651)
2017-02-28Remove some #if 0 code in ssl, crypto/bioTodd Short1-9/+1
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2781)
2017-02-23Implement SSL_read_ex() and SSL_write_ex() as documented.Kurt Roeckx1-2/+2
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #1964
2016-11-04Test the size_t constant time functionsMatt Caswell1-4/+0
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-11-04Remove a stray TODO that has already been fixedMatt Caswell1-6/+1
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-11-04Convert SSL BIO to use SSL_write_ex().Matt Caswell1-13/+5
We also modify the SSL_get_error() function to handle the fact that with SSL_write_ex() the error return is 0 not -1, and fix some bugs in the SSL BIO reading. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-10-28Tweaks based on review feedback of BIO size_t workMatt Caswell1-14/+14
Rename some parameters. Also change handling of buffer sizes >INT_MAX in length. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-10-28Fix a shadowed variable declaration warningMatt Caswell1-3/+3
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-10-28Create BIO_write_ex() which handles size_t argumentsMatt Caswell1-12/+16
Also extend BIO_METHOD to be able to supply an implementation for the new BIO_write_ex function. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-10-28Create BIO_read_ex() which handles size_t argumentsMatt Caswell1-3/+13
Also extend BIO_METHOD to be able to supply an implementation for the new BIO_read function. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-29Fix BIO_pop for SSL BIOsMatt Caswell1-10/+2
The BIO_pop implementation assumes that the rbio still equals the next BIO in the chain. While this would normally be the case, it is possible that it could have been changed directly by the application. It also does not properly cater for the scenario where the buffering BIO is still in place for the write BIO. Most of the existing BIO_pop code for SSL BIOs can be replaced by a single call to SSL_set_bio(). This is equivalent to the existing code but additionally handles the scenario where the rbio has been changed or the buffering BIO is still in place. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-29Fix BIO_push ref counting for SSL BIOMatt Caswell1-1/+5
When pushing a BIO onto an SSL BIO we set the rbio and wbio for the SSL object to be the BIO that has been pushed. Therefore we need to up the ref count for that BIO. The existing code was uping the ref count on the wrong BIO. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-17Copyright consolidation 01/10Rich Salz1-54/+6
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-04-27Fix BIO_CTRL_DUP for an SSL BIOMatt Caswell1-4/+5
The variables in the BIO weren't being duplicated properly. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-29Make BIO opaqueMatt Caswell1-58/+62
Move the the BIO_METHOD and BIO structures into internal header files, provide appropriate accessor methods and update all internal code to use the new accessors where appropriate. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-21RT4660: BIO_METHODs should be const.David Benjamin1-2/+2
BIO_new, etc., don't need a non-const BIO_METHOD. This allows all the built-in method tables to live in .rodata. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-08Convert CRYPTO_LOCK_BIO to new multi-threading APIAlessandro Ghedini1-3/+3
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz1-1/+0
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-09-20Handle SSL_ERROR_WANT_X509_LOOKUPDr. Stephen Henson1-0/+4
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-02Add and use OPENSSL_zallocRich Salz1-2/+1
There are many places (nearly 50) where we malloc and then memset. Add an OPENSSL_zalloc routine to encapsulate that. (Missed one conversion; thanks Richard) Also fixes GH328 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-05memset, memcpy, sizeof consistency fixesRich Salz1-1/+1
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-04Use safer sizeof variant in mallocRich Salz1-2/+1
For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-01free null cleanup finaleRich Salz1-2/+1
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-28remove malloc castsRich Salz1-1/+1
Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-16Code style: space after 'if'Viktor Dukhovni1-2/+2
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-11free NULL cleanup 10Rich Salz1-3/+2
Avoid checking for NULL before calling free functions. This gets ssl.*free: ssl_sess_cert_free ssl_free ssl_excert_free ssl_cert_free SSL_free SSL_SRP_CTX_free SSL_SESSION_free SSL_CTX_free SSL_CTX_SRP_CTX_free SSL_CONF_CTX_free Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-03-25Resolve swallowed returns codesMatt Caswell1-1/+2
The recent updates to libssl to enforce stricter return code checking, left a small number of instances behind where return codes were being swallowed (typically because the function they were being called from was declared as void). This commit fixes those instances to handle the return codes more appropriately. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25free NULL cleanupRich Salz1-6/+3
This commit handles BIO_ACCEPT_free BIO_CB_FREE BIO_CONNECT_free BIO_free BIO_free_all BIO_vfree Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-23Fix missing return value checksMatt Caswell1-1/+4
Ensure that all functions have their return values checked where appropriate. This covers all functions defined and called from within libssl. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-02-06dead code cleanup: #if 0 in sslRich Salz1-12/+0
I left many "#if 0" lines, usually because I thought we would probably want to revisit them later, or because they provided some useful internal documentation tips. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-01-31Make libssl opaque. Move all structures that were previously protected byMatt Caswell1-1/+1
OPENSSL_NO_SSL_INTERN into internal header files. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell1-500/+482
Reviewed-by: Tim Hudson <tjh@openssl.org>
2012-04-16OPENSSL_NO_SOCK fixes.Andy Polyakov1-0/+2
PR: 2791 Submitted by: Ben Noordhuis
2011-05-25PR: 2529Dr. Stephen Henson1-0/+4
Submitted by: Marcus Meissner <meissner@suse.de> Reviewed by: steve Call ssl_new() to reallocate SSL BIO internals if we want to replace the existing internal SSL structure.
2009-06-25Update from 1.0.0-stableDr. Stephen Henson1-9/+11
2006-03-15fix problems found by coverity: remove useless codeNils Larsch1-1/+0
2005-04-26Fix various incorrect error function codes.Bodo Möller1-1/+1
("perl util/ck_errf.pl */*.c */*/*.c" still reports many more.)
2005-04-20Make kerberos ciphersuite code compile again.Dr. Stephen Henson1-2/+2
Avoid more shadow warnings.
2005-03-31Give everything prototypes (well, everything that's actually used).Ben Laurie1-2/+2
2003-02-14Make it possible to disable OCSP, the speed application, and the use of sockets.Richard Levitte1-0/+2
PR: 358
2003-01-30A few small bugs with BIO popping.Richard Levitte1-0/+4
PR: 364
2002-01-12Prototype info function.Ben Laurie1-1/+3
2000-10-12Make non blocking I/O work for accept BIOs.Dr. Stephen Henson1-0/+4
2000-06-21Fixes for Win32 build.Dr. Stephen Henson1-2/+2
This is mostly a work around for the old VC++ problem that it treats func() as func(void). Various prototypes had been added to 'compare' function pointers that triggered this. This could be fixed by removing the prototype, adding function pointer casts to every call or changing the passed function to use the expected arguments. I mostly did the latter. The mkdef.pl script was modified to remove the typesafe functions which no longer exist. Oh and some functions called OPENSSL_freeLibrary() were changed back to FreeLibrary(), wonder how that happened :-)
2000-06-01There have been a number of complaints from a number of sources that namesRichard Levitte1-2/+2
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.