summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2014-10-23Save space in man page: err() -> errc() and combine vars.Doug Hogan
Suggested by millert@ and schwarze@. OK schwarze@, millert@
2014-10-22We prefer to use call reallocarray() with nmemb first and size second.Todd C. Miller
Requested by guenther@
2014-10-22In PKCS12_setup_mac(), do not assign p12->mac->salt->length until the allocationMiod Vallat
of p12->mac->salt->data has actually succeeded. In one of my trees for a long time already...
2014-10-22Use reallocarray() instead of calloc() (originally was realloc).Todd C. Miller
OK deraadt@
2014-10-22Avoid a NULL pointer dereference that can be triggered byJoel Sing
SSL3_RT_HANDSHAKE replays. Reported by Markus Stenberg <markus.stenberg at iki.fi> - thanks! ok deraadt@
2014-10-22Place most of the RAND_* functions under #ifndef LIBRESSL_INTERNAL (someJoel Sing
are still needed for the engine). Our code should use arc4random instead.
2014-10-22Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().Joel Sing
arc4random_buf() is guaranteed to always succeed - it is worth noting that a number of the replaced function calls were already missing return value checks. ok deraadt@
2014-10-22Avoid writing in second person in malloc.3Doug Hogan
ok deraadt@
2014-10-22Don't leak the old data if _kvm_reallocarray() failsPhilip Guenther
ok millert@ doug@
2014-10-20List extensions in the STANDARDS section, replacing some text below CAVEATS.Ingo Schwarze
Remove excessive technicalities on zero-sized objects as suggested by deraadt@. contributions and ok deraadt@, ok jmc@ on an earlier version
2014-10-20digests: *_LONG_LOG2 is not used, stop talking about it.Brent Cook
Modified patch from Dmitry Eremin-Solenikov leave the sole public define in ripemd.h ok deraadt@ miod@
2014-10-20SSL: Fix memory leak in d2i_SSL_SESSION.Brent Cook
Modified version of patch from Dmitry Eremin-Solenikov. ==28360== 98 bytes in 2 blocks are definitely lost in loss record 7 of 7 ==28360== at 0x402AC54: realloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==28360== by 0x40E2D2C: ASN1_STRING_set (asn1_lib.c:393) ==28360== by 0x40EC22C: asn1_ex_c2i (tasn_dec.c:959) ==28360== by 0x40EC632: asn1_d2i_ex_primitive (tasn_dec.c:824) ==28360== by 0x40ED2E6: ASN1_item_ex_d2i (tasn_dec.c:230) ==28360== by 0x40ED421: ASN1_item_d2i (tasn_dec.c:133) ==28360== by 0x40F0335: d2i_ASN1_OCTET_STRING (tasn_typ.c:75) ==28360== by 0x405FD6D: d2i_SSL_SESSION (ssl_asn1.c:367) ==28360== by 0x405DD6E: ssl3_send_newsession_ticket (s3_srvr.c:2743) ==28360== by 0x405EA48: ssl3_accept (s3_srvr.c:665) ==28360== by 0x4067C34: SSL_accept (ssl_lib.c:922) ==28360== by 0x404E97B: ssl23_get_client_hello (s23_srvr.c:573) ok miod@ beck@
2014-10-19make RETURN VALUES more conciseIngo Schwarze
and fix two instances of "new sentence, new line" while here feedback and ok jmc@, ok doug@
2014-10-19Revamp malloc.3 by reordering the sections and rewriting parts.Doug Hogan
The old man page had a lot of useful information, but it was all mixed together which made it difficult to reference. The main theme in this commit is that the sections are more focused: * DESCRIPTION describes the overall behavior * RETURN VALUES describes what it may return (including implementation defined values) * EXAMPLES shows why we recently started an audit on malloc and realloc usage in the tree. * Added CAVEATS which describes what is implementation defined, gotchas and security implications of misusing these functions * Added IDIOMS which describes how these functions should or should not be used The MALLOC_OPTIONS section was left unchanged. Function names were added to DIAGNOSTICS and STANDARDS. The MALLOC_OPTIONS and DIAGNOSTICS sections were pushed down in the page so more pertinent information is higher up. This has gone through several revisions thanks to input from deraadt@ and schwarze@. Ingo also helped with some of the mandoc formatting. OK schwarze@ (as far as it is a good starting point and the code snippets look ok)
2014-10-19Revert last commit due to changed semantics found by make release.Doug Hogan
2014-10-18Remove some #ifdef from libevent.Alexander Bluhm
OK nicm@
2014-10-18Better POSIX compliance in realpath(3).Doug Hogan
millert@ made changes to realpath.c based on FreeBSD's version. I merged Todd's changes into dl_realpath.c. ok millert@, guenther@
2014-10-18None of these need to include <openssl/rand.h>Joel Sing
2014-10-18Sort/group includes.Joel Sing
2014-10-18Remove the remaining #ifdef HAVE_ and the #define _GNU_SOURCE.Alexander Bluhm
OK nicm@
2014-10-18Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().Joel Sing
arc4random provides high quality pseudo-random numbers, hence there is no need to differentiate between "strong" and "pseudo". Furthermore, the arc4random_buf() function is guaranteed to succeed, which avoids the need to check for and handle failure, simplifying the code. It is worth noting that a number of the replaced RAND_bytes() and RAND_pseudo_bytes() calls were missing return value checks and these functions can fail for a number of reasons (at least in OpenSSL - thankfully they were converted to wrappers around arc4random_buf() some time ago in LibreSSL). ok beck@ deraadt@ miod@
2014-10-18reallocarray() -- a little tricky to reviewTheo de Raadt
ok doug millert
2014-10-18Typical malloc() with size multiplication to reallocarray().Doug Hogan
ok deraadt@
2014-10-17Remove #ifdef HAVE_backend and remove references to unimplementedAlexander Bluhm
backends. OK nicm@
2014-10-17trivial sync of the first sentence of the DESCRIPTIONIngo Schwarze
with btree(3) and recno(3); from jean-philippe at ouellet dot biz
2014-10-17Remove some #ifdef HAVE_syscall.Alexander Bluhm
OK nicm@
2014-10-17Remove #ifdef HAVE_.*_H, just include the header files.Alexander Bluhm
Do not include sys/param.h. OK nicm@
2014-10-17Remove non-exposed malloc/realloc/free wrappers, and then substituteTheo de Raadt
reallocarray() where it helps. ok doug
2014-10-16use reallocarray(); ok lteoTheo de Raadt
2014-10-16Fix bounds check for newlen without relying on unspecified behavior.Todd C. Miller
OK deraadt@
2014-10-16Remove references to unimplemented CLOCK_VIRTUAL. It is non-standardTodd C. Miller
and existing implementations vary as to whether it returns time for the calling thread or the entire process. OK kettenis@
2014-10-16we stopped building librt a while back. delete stubs.Ted Unangst
2014-10-16use .fn here too. from Jean-Philippe OuelletTed Unangst
2014-10-16Remove #ifdef HAVE_CONFIG_H, there is no config.h file.Alexander Bluhm
OK nicm@
2014-10-16Get rid of the last remaining BUF_strdup and BUF_strlcpy and friends, useBob Beck
intrinsic functions everywhere, and wrap these functions in an #ifndef LIBRESSL_INTERNAL to make sure we don't bring their use back.
2014-10-15Remove #ifndef HAVE_TAILQFOREACH containing a private tailqAlexander Bluhm
implementation. OK nicm@
2014-10-15Fuck it. No SSLv3; not now, not ever. The API of the future will onlyTed Unangst
support the protocols of the future. (Perhaps a bit late in burning this bridge entirely, but there's no time like the present, esp. with other players now leaning against back compat.)
2014-10-15basic formatting fixes;Jason McIntyre
2014-10-15Disable SSLv3 by default.Joel Sing
SSLv3 has been long known to have weaknesses and the POODLE attack has once again shown that it is effectively broken/insecure. As such, it is time to stop enabling a protocol was deprecated almost 15 years ago. If an application really wants to provide backwards compatibility, at the cost of security, for now SSL_CTX_clear_option(ctx, SSL_OP_NO_SSLv3) can be used to re-enable it on a per-application basis. General agreement from many. ok miod@
2014-10-15Clear protocol options before optionally setting them.Joel Sing
2014-10-15Set SSL_OP_SINGLE_ECDH_USE before calling SSL_CTX_set_tmp_ecdh() - thisJoel Sing
avoids generating an EC key pair that will never be used.
2014-10-15Only require an EC public key in tls1_set_ec_id(), if we need to provideJoel Sing
a compression identifier. In the case of a server using ephemeral EC keys, the supplied key is unlikely to have a public key where SSL_CTX_set_tmp_ecdh() is called after SSL_OP_SINGLE_ECDH_USE has been set. This makes ECDHE ciphers work again for this use case.
2014-10-15Add cipher aliases for DHE (the correct name for EDH) and ECDHE (theJoel Sing
correct name for EECDH). The EDH and EECDH aliases remain for backwards compatibility.
2014-10-15use reallocarray()Theo de Raadt
2014-10-15Apply reallocarray() idiom.Theo de Raadt
ok guenther
2014-10-14seems like a good time to make the ressl default TLSv1 only.Ted Unangst
ok guenther
2014-10-14Bump libressl version string to 2.1.Brent Cook
This makes 'openssl version' print a string that matches the -portable release number. Thanks to @blakkeim for pointing it out. The version integer is left alone, with the idea of discouraging software from relying on magic numbers for detecting features. Software configuration should do explicit feature tests instead. ok beck@, deraadt@
2014-10-14fairly obvious reallocarray() conversionTheo de Raadt
2014-10-13remove unused variableCharles Longeau
ok tedu@
2014-10-13The return value on success of fcntl(F_SETFL) is not actually specified,Brent Cook
only that it returns -1 on failure. pointed out by guenther@