summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/labs.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-10-22Another change that is needed to restore the previous behaviour ofjsing2-10/+6
ASN1_{GENERALIZED,UTC}TIME_set_string(), which allows it to be called with a NULL pointer. ok beck@
2015-10-22Restore previous behaviour and allowjsing2-4/+14
ASN1_{GENERALIZED,UTC,}TIME_set_string() to be called with a NULL pointer. Found the hard way by @kinichiro on github. ok beck@
2015-10-22Extend tests to call ASN1_{GENERALIZED,UTC,}TIME_set_string() with a NULLjsing1-1/+19
pointer - because, you know, you might want to set a string on a NULL object. The previous implementation apparently allowed this as a way of testing if the string was valid... probably because the *_check() functions are only useable after the string has already been set.
2015-10-22Fix case where we wanted to test ASN1_TIME_set_string() but were testingjsing2-6/+6
ASN1_UTCTIME_set_string() twice instead.
2015-10-22Add a regress for libc handling of SIGTHRguenther2-0/+71
2015-10-21Reject too small bits value in BN_generate_prime_ex(), so that it does not riskmiod6-8/+44
becoming negative in probable_prime_dh_safe(). Reported by Franck Denis who noticed `openssl gendh 0' would segfault. Fix adapted from OpenSSL RT#2701. ok beck@ jsing@
2015-10-21In the case where len is not a multiple of sizeof(RC4_CHUNK) the RC4 codejsing2-126/+2
will end up doing a read and write of up to 7 bytes beyond the specified length. This is effectively a non-issue since we read and write back the same data and due to alignment it is within a page boundary. Regardless, avoid this by removing the "special" handling for the remaining length and allow the standard (non-chunk) code to process the remaining bytes, which does not result in overrun. Reported by Pascal Cuoq <cuoq at trust-in-soft.com> - thanks! ok beck@ miod@
2015-10-20Lob a style(9) grenade in here.jsing6-344/+370
2015-10-19free rbio before wbiobeck2-14/+14
ok jsing@
2015-10-19Stop supporing "legcay" time formats that OpenSSL supports. Rewrite thebeck15-1220/+698
utctime and gentime wrappers accordingly. Along with some other cleanup. this also removes the need for timegm. ok bcook@ sthen@ jsing@
2015-10-19Change regress to not believe legacy times are validbeck1-65/+4
2015-10-18Need <string.h> for memset()guenther1-1/+2
2015-10-17Exit if a pledge call fails in non-interactive mode.doug45-89/+179
ok semarie@
2015-10-17add "tty" for several subcommands of opensslsemarie24-48/+48
it is needed in order to let libssl UI_* function plays with echo on/off when asking for password on terminal. passwd subcommand needs additionnal "wpath cpath" in order to let it calls fopen("/dev/tty", "w") (O_WRONLY with O_CREAT | O_TRUNC). problem reported by several with and ok doug@
2015-10-16Remove pointless externs - the structs are declared in the same files ajsing6-16/+6
few lines above.
2015-10-16Expand DECLARE_ASN1_ALLOC_FUNCTIONS and DECLARE_ASN1_FUNCTIONS_constjsing6-22/+68
macros. The only change in the generated assembly is due to line numbering.
2015-10-16Remove pointless uses of DECLARE_ASN1_ENCODE_FUNCTIONS_const.jsing6-16/+10
DECLARE_ASN1_FUNCTIONS_const already includes this macro so using both means we end up with duplicate function prototypes and externs.
2015-10-16Fix use of pointer value after BIO_free, and remove senseless NULL checks.beck2-14/+16
ok bcook@
2015-10-16Put tls_config_verify_client_optional() in the right place.jsing1-6/+6
2015-10-16Fix tpyo.jsing1-3/+3
2015-10-16Implement real "flock" request and add it to userland programs thatmillert1-2/+2
use pledge and file locking. OK deraadt@
2015-10-16actually include the prerequisite dependency for BIO instead of doing nastynessbeck2-10/+4
2015-10-14better fix for overrun reported by Qualys Security.tedu2-8/+2
buf is at all times kept nul terminated, so there is no need to enforce this again upon exit. (no need to move buf around after we exahust space.) ok beck miod
2015-10-14Bail out early if we have no buf_lenbeck2-2/+10
ok miod@
2015-10-14fix a memory leak reported by Qualys Security.tedu2-6/+8
move the bndec variable in tighter since it's not used elsewhere in the loop, then always free it after use. ok bcook miod
2015-10-14Ensure we don't write a 0 byte past end of the buffer in the error case.beck2-6/+6
ok bcook@ deraadt@
2015-10-14tweak previous (two details i apparently missed)schwarze1-4/+6
2015-10-14Add EVP_AEAD_CTX_init(3) manpage to document the new(ish) AEAD API.reyk4-1/+285
The "authenticated encryption with additional data" API is used for ciphers like AES-GCM or ChaCha20-Poly1305. The manpage is a beginning and certainly needs more work, especially improvements in the EXAMPLES section. Based on agl's source code comments. Converted from pod to mandoc by schwarze@ OK schwarze@ jsing@
2015-10-13In rev 1.15 the sizeof argument was fixed in a strlcat() call butmillert1-2/+2
the truncation check immediately following it was not updated to match. Not an issue in practice since the buffers are the same size. OK deraadt@
2015-10-13Put ASN1_dup() under #ifndef LIBRESSL_INTERNAL.jsing2-10/+10
2015-10-13Convert ECParameters_dup() from a macro that uses ASN1_dup_of() into anjsing6-10/+40
actual function. This removes the last ASN1_dup_of usage from the tree. Feedback from doug@ and miod@
2015-10-13Convert a number of the old ASN1_{d2i,i2d}_{bio,fp}_of() macros tojsing2-38/+38
ASN1_item_{d2i,i2d}_{bio,fp}() function calls. ok beck@ doug@
2015-10-13Single byte read/write tests.jsing1-0/+67
2015-10-13Add test coverage for peer certificate info and connection info.jsing2-6/+231
2015-10-13Make regress work again post hackathon tls_handshake/tls_read/tls_writejsing1-7/+42
changes.
2015-10-13Group d2i/i2d function prototypes by type and add missing externs for thejsing2-14/+24
DSAPublicKey, DSAPrivateKey and DSAparams ASN1_ITEMs.
2015-10-12unifdef EVP_CHECK_DES_KEY: Ben Kaduk noticed it has a syntax error; thatguenther4-40/+4
error was present in the original 2004 commit, so it hasn't been used in over 11 years, thus exceeding our deprecation requirements by over a decade. OpenSSL has chosen to *fix it*; we'll gladly watch it burn ok jsing@
2015-10-11Userspace doesn't need to use SUN_LEN(): connect() and bind() must acceptguenther1-8/+3
sizeof(struct sockaddr_un), so do the simple, portable thing ok beck@ deraadt@
2015-10-10Initial support for pledges in openssl(1) commands.doug47-46/+281
openssl(1) has two mechanisms for operating: either a single execution of one command (looking at argv[0] or argv[1]) or as an interactive session than may execute any number of commands. We already have a top level pledge that should cover all commands and that's what interactive mode must continue using. However, we can tighten up the pledges when only executing one command. This is an initial stab at support and may contain regressions. Most commands only need "stdio rpath wpath cpath". The pledges could be further restricted by evaluating the situation after parsing options. deraadt@ and beck@ are roughly fine with this approach.
2015-10-10normalize the ordering of tame requests (particularily, "rpath wpath cpath",deraadt1-2/+2
which i have put in that order). this is not important, but helps look for outliers which might be strange. it hints that "ioctl" should be reassessed in a few places, to see if "tty" is better; that "unix" may be used in some places where "route" could now work.
2015-10-09fix a gotcha in the connect refactoring, that could result in droppingderaadt1-1/+5
through and trying to bind failed v6 connects. ok guenther
2015-10-09Change all tame callers to namechange to pledge(2).deraadt1-3/+3
2015-10-08If getaddrinfo() succeeds, then don't try look ups with other flags, evenguenther1-41/+39
if the connect()s failed. In concert with some resolver fixes in libc, this lets ntpd be tame()ed problem isolated by theo, who had fun untangling the libc and libtls behaviors to place blame for not being able to tame ntpd ok beck@ deraadt@ jsing@
2015-10-08trailing whitespace;jmc1-6/+6
2015-10-08Rip the guts out of another gibbering horror of a time comparison function, andbeck4-74/+48
mark it as #ifndef LIBRESSL_INTERNAL at least we don't use this. ok jsing@
2015-10-08revert previous accidental commitbeck4-46/+72
2015-10-08Spelling in commentbeck6-78/+50
2015-10-07Add tls_peer_cert_notbefore and tls_peer_cert_notafter to expose peer ↵beck6-9/+98
certificate validity times for tls connections. ok jsing@
2015-10-07Allow us to get cipher and version even if there is not a peer certificate.beck2-15/+21
ok doug@
2015-10-07include <sys/time.h> for gettimeofday(2)bcook2-2/+4