summaryrefslogtreecommitdiff
path: root/src/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch if_nameindex(3) to use the new NET_RT_IFNAMES sysctl to get theclaudio2015-10-233-88/+73
| | | | | | | | list of interface names. At the same time switch if_nametoindex(3) and if_indextoname(3) to use if_nameindex(3) instead of getifaddrs(3). if_nameindex(3) exposes much less then getifaddrs(3) and is allowed by pledge(2). With and OK deraadt@
* Use waitpid() instead of wait() to avoid returning early from another childguenther2015-10-231-2/+3
| | | | | | exiting, and loop the waitpid() on EINTR ok deraadt@ millert@
* Loop the waitpid() on EINTR, and save and restore the disposition ofguenther2015-10-231-9/+12
| | | | | | | SIGINT and SIGQUIT with sigaction() instead of signal() so that all bits are preserved. ok deraadt@ millert@
* Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadguenther2015-10-232-9/+9
| | | | | | | | | into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need. ok deraadt@ millert@
* Cast ctype function arguments to unsigned char.mmcc2015-10-221-2/+2
| | | | ok guenther@
* Another change that is needed to restore the previous behaviour ofjsing2015-10-222-10/+6
| | | | | | | ASN1_{GENERALIZED,UTC}TIME_set_string(), which allows it to be called with a NULL pointer. ok beck@
* Restore previous behaviour and allowjsing2015-10-222-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@
* Reject too small bits value in BN_generate_prime_ex(), so that it does not riskmiod2015-10-216-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@
* In the case where len is not a multiple of sizeof(RC4_CHUNK) the RC4 codejsing2015-10-212-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@
* Lob a style(9) grenade in here.jsing2015-10-206-344/+370
|
* free rbio before wbiobeck2015-10-192-14/+14
| | | | ok jsing@
* Stop supporing "legcay" time formats that OpenSSL supports. Rewrite thebeck2015-10-1915-1220/+698
| | | | | | utctime and gentime wrappers accordingly. Along with some other cleanup. this also removes the need for timegm. ok bcook@ sthen@ jsing@
* Remove pointless externs - the structs are declared in the same files ajsing2015-10-166-16/+6
| | | | few lines above.
* Expand DECLARE_ASN1_ALLOC_FUNCTIONS and DECLARE_ASN1_FUNCTIONS_constjsing2015-10-166-22/+68
| | | | macros. The only change in the generated assembly is due to line numbering.
* Remove pointless uses of DECLARE_ASN1_ENCODE_FUNCTIONS_const.jsing2015-10-166-16/+10
| | | | | DECLARE_ASN1_FUNCTIONS_const already includes this macro so using both means we end up with duplicate function prototypes and externs.
* Fix use of pointer value after BIO_free, and remove senseless NULL checks.beck2015-10-162-14/+16
| | | | ok bcook@
* Put tls_config_verify_client_optional() in the right place.jsing2015-10-161-6/+6
|
* Fix tpyo.jsing2015-10-161-3/+3
|
* actually include the prerequisite dependency for BIO instead of doing nastynessbeck2015-10-162-10/+4
|
* better fix for overrun reported by Qualys Security.tedu2015-10-142-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
* Bail out early if we have no buf_lenbeck2015-10-142-2/+10
| | | | ok miod@
* fix a memory leak reported by Qualys Security.tedu2015-10-142-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
* Ensure we don't write a 0 byte past end of the buffer in the error case.beck2015-10-142-6/+6
| | | | ok bcook@ deraadt@
* tweak previous (two details i apparently missed)schwarze2015-10-141-4/+6
|
* Add EVP_AEAD_CTX_init(3) manpage to document the new(ish) AEAD API.reyk2015-10-144-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@
* In rev 1.15 the sizeof argument was fixed in a strlcat() call butmillert2015-10-131-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@
* Put ASN1_dup() under #ifndef LIBRESSL_INTERNAL.jsing2015-10-132-10/+10
|
* Convert ECParameters_dup() from a macro that uses ASN1_dup_of() into anjsing2015-10-136-10/+40
| | | | | | actual function. This removes the last ASN1_dup_of usage from the tree. Feedback from doug@ and miod@
* Convert a number of the old ASN1_{d2i,i2d}_{bio,fp}_of() macros tojsing2015-10-132-38/+38
| | | | | | ASN1_item_{d2i,i2d}_{bio,fp}() function calls. ok beck@ doug@
* Group d2i/i2d function prototypes by type and add missing externs for thejsing2015-10-132-14/+24
| | | | DSAPublicKey, DSAPrivateKey and DSAparams ASN1_ITEMs.
* unifdef EVP_CHECK_DES_KEY: Ben Kaduk noticed it has a syntax error; thatguenther2015-10-124-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@
* fix a gotcha in the connect refactoring, that could result in droppingderaadt2015-10-091-1/+5
| | | | | through and trying to bind failed v6 connects. ok guenther
* If getaddrinfo() succeeds, then don't try look ups with other flags, evenguenther2015-10-081-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@
* trailing whitespace;jmc2015-10-081-6/+6
|
* Rip the guts out of another gibbering horror of a time comparison function, andbeck2015-10-084-74/+48
| | | | | mark it as #ifndef LIBRESSL_INTERNAL at least we don't use this. ok jsing@
* revert previous accidental commitbeck2015-10-084-46/+72
|
* Spelling in commentbeck2015-10-086-78/+50
|
* Add tls_peer_cert_notbefore and tls_peer_cert_notafter to expose peer ↵beck2015-10-076-9/+98
| | | | | | | certificate validity times for tls connections. ok jsing@
* Allow us to get cipher and version even if there is not a peer certificate.beck2015-10-072-15/+21
| | | | ok doug@
* include <sys/time.h> for gettimeofday(2)bcook2015-10-072-2/+4
|
* prefer limits.h over sys/limits.hbcook2015-10-062-6/+6
| | | | ok deraadt@
* Make sure dot is not set after tz - fixes incorrect handling, which allowsjsing2015-10-052-4/+4
| | | | | | 20151005171301+1.09Z to be treated as a valid time. ok beck@
* Wrap <resolv.h> so that internal calls go directguenther2015-10-053-5/+11
| | | | ok millert@
* Apply some style(9), tweak a few things for readability and add somejsing2015-10-042-72/+80
| | | | | | additional bounds checks. ok beck@
* wrap __ivaliduser_sa() so the internal call is direct (at least until weguenther2015-10-041-0/+2
| | | | stop exporting it)
* recv() and send() aren't overriden by libpthread (vs recvfrom() and sendto()!)guenther2015-10-042-2/+4
| | | | so wrap them to make internal calls go direct
* SSL_new(): fix ref counting and memory leak in error path.doug2015-10-032-16/+6
| | | | | | | | | | Rather than a half-hearted attempt to free up resources and fix ref counting at the SSL_CTX level, let SSL_free() do its job. This diff got lost in the shuffle somewhere. It's from last year. Ref counting error reported by Parakleta in github ticket #51. Thanks! ok jsing@, beck@
* Flense the greasy black guts of unreadble string parsing code out of three areasbeck2015-10-0215-543/+666
| | | | | | | | | in asn1 and x509 code, all dealing with an ASN1_TIME. This brings the parsing together in one function that converts into a struct tm. While we are at it this also brings us into conformance with RFC 5280 for times allowed in an X509 cert, as OpenSSL is very liberal with what it allows. input and fixes from deraadt@ jsing@ guethther@ and others. ok krw@, guenther@, jsing@
* s/ssl3_client_kex/ssl3_send_client_kex/ for consistency with the caller.jsing2015-10-022-18/+22
|
* include <sys/types.h> for ssize_tbcook2015-10-011-1/+3
| | | | ok jsing@, deraadt@