summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2014-08-31Don't .Xr uuidgen(1) yet.Miod Vallat
2014-08-31Sync with FreeBSD. No functional change but more readable code.Miod Vallat
2014-08-31Fix incorrect behaviour by syncing with FreeBSD; reported by Jonas 'Sortie'Miod Vallat
Termansen, thanks!
2014-08-31Make the in6addr constant declarations and definitions consistentAlexander Bluhm
in kernel and user land. OK florian@ mpi@
2014-08-31Add uuid support routines to libc. From FreeBSD via NetBSD via Bitrig viaMiod Vallat
Markus Mueller.
2014-08-31tweaks;Jason McIntyre
2014-08-31provide section numbers for xrs;Jason McIntyre
2014-08-31They're thread IDs, not PIDs. The wording is a bit clunky, but closerPhilip Guenther
to the truth
2014-08-31Declare and document getthrid()Philip Guenther
indirectly prodded by krw@
2014-08-31Add sockatmark()Philip Guenther
ok millert@ manpage feedback jmc@
2014-08-31Add additional userland interfaces for setting close-on-exec on fdsPhilip Guenther
when creating them: mkostemp(), mkostemps(), the 'e' mode letter for fopen(), freopen(), fdopen(), and popen(). The close-on-exec flag will be cleared by the action created by posix_spawn_file_actions_adddup2(). Also, add support for the C11 'x' mode letter for fopen() and freopen(), setting O_EXCL when possibly creating files. Note: this requires kernel support for pipe2() and dup3()! ok millert@
2014-08-31Add additional kernel interfaces for setting close-on-exec on fdsPhilip Guenther
when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC, SOCK_CLOEXEC. Includes SOCK_NONBLOCK support. ok matthew@
2014-08-30Xr __tfork instead of forkPhilip Guenther
2014-08-28preserve errno value on success.Brent Cook
If getrandom returns a temporary failure, make sure errno is not polluted when it succeeds. Thanks to deraadt@ for pointing it out.
2014-08-27Nuke net.inet6.icmp6.rediraccept and allow redirects on interfacesFlorian Obser
with autoconf enabled. If one is doing SLAAC one does already trust link local icmp6 so the policy for icmp6 redirects should be the same. pointed out by & OK bluhm@; OK henning@
2014-08-27Add the API function ressl_config_set_ecdhcurve(config, name) to set aReyk Floeter
non-standard ECDH curve by name or to disable it by passing NULL. OK jsing@
2014-08-26Move openssl(1) from /usr/sbin/openssl to /usr/bin/openssl, since it is notJoel Sing
a system/superuser binary. At the same time, move the source code from its current lib/libssl/src/apps location to a more appropriate home under usr.bin/openssl. ok deraadt@ miod@
2014-08-25Delete secret or secret-derived data with explicit_bzero.Doug Hogan
concept ok deraadt@ diff looks ok tedu@
2014-08-24constify strerror return valueBrent Cook
There is no intention to modify the string returned by strerror and doing so is forbidden by the standard. from Jonas 'Sortie' Termansen ok tedu@ deraadt@
2014-08-24Include <sys/time.h> to get struct timevalBrent Cook
The crypto/bio/bss_dgram.c file assumes that another file indirectly includes <stdlib.h> that includes <sys/time.h>. from Jonas 'Sortie' Termansen ok deraadt@ tedu@
2014-08-24Include <sys/select.h> to get selectBrent Cook
These files currently depends on the wrapper <stdlib.h> file indirectly including a header that provides select(). from Jonas 'Sortie' Termansen ok deraadt@ tedu@
2014-08-24Let SSL_CIPHER_description() allocate the buffer for the description,Joel Sing
rather than passing in a fixed size buffer. This is yet another example of a horribly designed API - if the given buffer is NULL then SSL_CIPHER_description() allocates one for us (great!), which we then need to free (no problem). However, if this allocation fails it returns a pointer to a static string "OPENSSL_malloc Error" - obviously bad things happen if we call free() with this pointer. Unfortunately, there is no way of knowing that the function failed, other than comparing the returned string against the string literal - so do that before calling free()... Joint work with beck@ during g2k14.
2014-08-24Replace the remaining uses of ssl3_put_cipher_by_char() with s2n and aJoel Sing
ssl3_cipher_get_value() helper function, which returns the cipher suite value for the given cipher. ok miod@
2014-08-23Remove non-standard GOST cipher suites (which are not compiled inJoel Sing
currently). From Dmitry Eremin-Solenikov.
2014-08-23Replace the remaining ssl3_get_cipher_by_char() calls with n2s() andJoel Sing
ssl3_get_cipher_by_id(). ok bcook@
2014-08-23unbind;Jason McIntyre
2014-08-22POSIX/FreeBSD/NetBSD/Linux/etc agree -- blk[size|cnt]_t is the bomb.Kenneth R Westerback
So add the types blksize_t (a.k.a. int32_t) and blkcnt_t (a.k.a. int64_t). Use blkcnt_t in stat.h since the base type (int64_t) does not change. blksize_t in stat.h will follow after the tree is audited for signed issues, since the base type will change from u_int32_t to a POSIX compliant int32_t. Guidance and feedback from guenther@ ok millert@
2014-08-20Remove userland bits related to the crypto(4) interface; ok deraadtMike Belopuhov
2014-08-19Three independent typos for `independent' or `independently'.Miod Vallat
2014-08-18replace more ROTATE macros with plain-old C code.bcook
Let the compiler optimize these. Even older versions of gcc generate equal or better quality code than the inline asm. ok miod@
2014-08-18remove return value from HOST_c2l/l2c macrosbcook
These macros and asm inlines simulate a function returning a value, but nothing ever uses this return value. Remove the pseudo-returns and (void) casts discarding the unused values. This, maybe unsurprisingly, speeds things up a bit. It also removes the GCC 4.9 warnings about unused values. ok miod@ deraadt@
2014-08-18a small tweak to improve malloc in multithreaded programs. we don't needTed Unangst
to hold the malloc lock across mmap syscalls in all cases. dropping it allows another thread to access the existing chunk cache if necessary. could be improved to be a bit more aggressive, but i've been testing this simple diff for some time now with good results.
2014-08-18Add mention of execvpe() setting errno on failure.Philip Guenther
from Justus Baumgartner (meddev50 (at) gmail.com)
2014-08-16Cover execvpe() in the description of what the envp arg means.Philip Guenther
from Justus Baumgartner (meddev50 (at) gmail.com) ok jmc@
2014-08-16only build the getrandom path if SYS_getrandom is defined.bcook
like the sysctl path
2014-08-16Fixed typo in "distinct".Tobias Stoeckmann
ok jmc@
2014-08-16getrandom(2) support for getentropy_linuxbcook
This enables support for the new getrandom(2) syscall in Linux 3.17. If the call exists and fails, return a failure in getentropy(2) emulation as well. This adds a EINTR check in case the urandom pool is not initialized. Tested on Fedora Rawhide with 3.17rc0 and Ubuntu 14.04 ok deraadt@
2014-08-15use void * instead of char *. ok jsingTed Unangst
2014-08-15XPG requires insque() and remque() to work with linear lists and not justPhilip Guenther
circular lists. Amazingly, they managed to extend the requirements to no longer match the behavior of the VAX instructions they were modeled after, so the trivial VAX ASM versions have to go. Nice job breaking it, X/Open! Based on a diff from enh (at) google.com ok miod@
2014-08-15Use O_CLOEXEC wherever we open a file and then call fcntl(F_SETFD, FD_CLOEXEC)Philip Guenther
on it, simplifying error checking, reducing system calls, and improving thread-safety for libraries. ok miod@
2014-08-14fixed overrid(d)en typoTobias Stoeckmann
millert@ and jmc@ agree that "overriden" is wrong
2014-08-13munmap correct object in (extremely unlikely, and effectively terminal)Theo de Raadt
case of failing to map the 2nd object. found by Paul Maurers
2014-08-12Merge a patch that i successfully pushed to OpenSSL,Ingo Schwarze
original OpenSSL commit message follows: Fixed as shown; to be released post-1.0.2 commit bebbb11d132cc149f7713d6693703f8bfae10072 Author: Ingo Schwarze <schwarze@usta.de> Date: Sat Jan 18 11:46:25 2014 +0100 RT3239: Extra comma in NAME lines of two manpages In two OpenSSL manual pages, in the NAME section, the last word of the name list is followed by a stray trailing comma. While this may seem minor, it is worth fixing because it may confuse some makewhatis(8) implementations. While here, also add the missing word "size" to the one line description in SSL_CTX_set_max_cert_list(3). Reviewed by: Dr Stephen Henson <shenson@drh-consultancy.co.uk>
2014-08-12Replace intrinsic ROTATE macros with an inline.bcook
Without the cast/mask, the compiler is allowed to optimize this directly to the correct CPU intrinsic for rotate.
2014-08-11Guard RSA / RC4-5 ASM when NO_ASM is not definedbcook
Most assembly blocks remain inactive if OPENSSL_NO_ASM is not defined, only enabling inline assembly, but the RSA / RC4-5 blocks (used only in amd64 systems) turn on implicitly. Guard these two as well. This simplifies enabling just inline ASM in portable, no effective change in OpenBSD.
2014-08-11Check the return value of sk_SSL_CIPHER_new_null(), since it allocatesJoel Sing
memory and can return NULL. ok miod@
2014-08-11Unchecked memory allocation and potential leak upon error inMiod Vallat
ssl3_get_cert_verify(). ok guenther@ jsing@
2014-08-11Remove now-unused SSL2_STATE as well as ssl2-specific state machine values.Miod Vallat
ok guenther@ jsing@
2014-08-11Currently, ssl3_put_char_by_bytes(NULL, NULL) is just a long handed wayJoel Sing
of writing "2". Add a define for the SSL3_CIPHER_VALUE_SIZE (rather than using a less-readable hardcoded constant everywhere) and replace the ssl3_put_char_by_bytes(NULL, NULL) calls with it. ok bcook@ miod@
2014-08-11Provide a ssl3_get_cipher_by_id() function that allows ciphers to be lookedJoel Sing
up by their ID. For one, this avoids an ugly mess in ssl_sess.c, where the cipher value is manually written into a buffer, just so the cipher can be located using ssl3_get_cipher_by_char(). ok bcook@ miod@