summaryrefslogtreecommitdiff
path: root/src/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an option that allows the enabled SSL protocols to be explicitlyjsing2014-09-296-9/+51
| | | | | | | | configured. Discussed with several. ok bcook@
* When freeing the config, explicitly call ressl_config_clear_keys() ratherjsing2014-09-291-5/+6
| | | | | | than rerolling our own key clearing code. ok tedu@
* check_cert(): be sure to reset ctx->current_crl to NULL before freeing it.miod2014-09-292-20/+10
| | | | | | | | | X509_STORE_CTX_init(): do not free the X509_STORE_CTX * parameter upon failure, for we did not allocate it and it might not come from the heap, such as in check_crl_path() in this very same file where X509_STORE_CTX_init() gets invoked with a stack address. ok bcook@
* X509_NAME_get_text_by_OBJ(): make sure we do not pass a negative size tomiod2014-09-292-6/+10
| | | | | memcpy(). ok bcook@
* X509_VERIFY_PARAM_set1_name(): if invoked with NULL as the secondmiod2014-09-292-2/+4
| | | | | parameter, correctly set param->name to NULL after having freed it. ok bcook@
* Wrap long lines and add missing argument name.jsing2014-09-281-4/+6
|
* Bump minor after adding SSL_CTX_use_certificate_chain().reyk2014-09-282-2/+2
| | | | ok jsing@ miod@
* Provide a ressl config function that explicitly clears keys.jsing2014-09-282-2/+10
| | | | | | | | | Now that ressl config takes copies of the keys passed to it, the keys need to be explicitly cleared. While this can be done by calling the appropriate functions with a NULL pointer, it is simpler and more obvious to call one function that does this for you. ok tedu@
* Add a new API function SSL_CTX_use_certificate_chain() that allows toreyk2014-09-286-54/+111
| | | | | | | | | | | read the PEM-encoded certificate chain from memory instead of a file. This idea is derived from an older implementation in relayd that was needed to use the function with a privep'ed process in a chroot. Now it is time to get it into LibreSSL to make the API more privsep- friendly and to make it available for other programs and the ressl library. ok jsing@ miod@
* X509v3_add_ext(): do not free stuff we did not allocate in the error path.miod2014-09-282-4/+4
| | | | ok bcook@
* X509_TRUST_add(): check X509_TRUST_get0() return value before dereferencing it,miod2014-09-282-30/+46
| | | | | | for it may be NULL. Do not leak memory upon error. ok bcook@
* Someone (TM) thought it was smart to save memory by using malloc(1) andmiod2014-09-282-10/+8
| | | | | | | | | | | | | manual field fiddling to create an ASN1_INTEGER object, instead of using M_ASN1_INTEGER_new() which will allocate sizeof(long) bytes. That person had probably never looked into malloc(3) and never heard of allocation size rounding. Thus, replace the obfuscated code with M_ASN1_INTEGER_new() followed by ASN1_INTEGER_set(), to achieve a similar result, without the need for /* version == 0 */ comments. ok bcook@
* revamp the config interface to own memory. easier to use correctly withouttedu2014-09-283-49/+99
| | | | | | caller worrying about leaks or lifetimes. after feedback from jsing
* Revert r1.5 and reenable assembler version of ghash now that it has beenmiod2014-09-272-6/+6
| | | | fixed.
* Doh, rev 1.4 had left out one routine with both 32-bit and 64-bit code, wheremiod2014-09-272-0/+4
| | | | the 64-bit code has to be disabled under OpenBSD/hppa.
* Disable assembler code for ghash on hppa, causes wrong computations in somemiod2014-09-274-8/+8
| | | | | cases and breaks TLS 1.2; crank libcrypto.so minor version out of safety and to be able to tell broken versions apart easily.
* There is not much point checking ecdhp is not NULL... twice.jsing2014-09-274-28/+10
| | | | ok miod@
* Check that the specified curve is one of the client preferences.jsing2014-09-2710-16/+140
| | | | | | Based on OpenSSL. ok miod@
* X509_STORE_new(): do not leak memory upon error.miod2014-09-262-28/+34
| | | | | | | X509_STORE_get1_certs(), X509_STORE_get1_crls(): check the result of allocations. ok tedu@
* X509_issuer_and_serial_hash(): do not leak memory if an error occurs duringmiod2014-09-262-2/+6
| | | | | | the first EVP block. ok tedu@
* X509at_add1_attr(): do not free stuff we did not allocate in the error path.miod2014-09-262-6/+6
| | | | ok tedu@
* Now that we have a static version of the default EC formats, also use itjsing2014-09-262-94/+88
| | | | | | | | for the server hello. From OpenSSL. ok miod@
* Fix regression introduced in revision 1.15 by using strndup() instead ofmiod2014-09-232-12/+12
| | | | | | strdup() to allocated directory list components. ok jsing@
* Refactor and simplify the ECC extension handling. The existing codejsing2014-09-224-244/+196
| | | | | | | | | effectively built two "static" data structures - instead of doing this, just use static data structures to start with. From OpenSSL (part of a larger commit). ok miod@
* Also check the result from final_finish_mac() against finish_mac_length injsing2014-09-222-38/+34
| | | | | | ssl3_send_finished(). While this previously checked against a zero return value (which could occur on failure), we may as well test against the expected length, since we already know what that is.
* It is possible (although unlikely in practice) for peer_finish_md_len tojsing2014-09-222-26/+22
| | | | | | | | | | | | | | end up with a value of zero, primarily since ssl3_take_mac() fails to check the return value from the final_finish_mac() call. This would then mean that an SSL finished message with a zero-byte payload would successfully match against the calculated finish MAC. Avoid this by checking the length of peer_finish_md_len and the SSL finished message payload, against the known length already stored in the SSL3_ENC_METHOD finish_mac_length field (making use of a previously unused field). ok miod@ (a little while back)
* Document SSL_OP_TLSEXT_PADDING.jsing2014-09-211-0/+6
| | | | From OpenSSL.
* Move the TLS padding extension under an SSL_OP_TLSEXT_PADDING option, whichjsing2014-09-214-20/+36
| | | | | | | | | | | | | | | is off by default (instead of being enabled unconditionally). The TLS padding extension was added as a workaround for a bug in F5 SSL terminators, however appears to trigger bugs in IronPort SMTP appliances. Now the SSL client gets to choose which of these devices it wants to trigger bugs in... Ported from OpenSSL. Discussed with many. ok miod@
* a_enum.c used to be a copy of a_int.c with s/INTEGER/ENUMERATED/g , butmiod2014-09-212-8/+18
| | | | | | | | some changes an a_int.c did not get applied to a_enum.c; despite style changes, make sure BN_to_ASN1_ENUMERATED() correctly handles a zero value the same way BN_to_ASN1_INTEGER() does. ok bcook@ beck@ jsing@
* Fix a memory leak in the error path in ASN1_mbstring_ncopy().miod2014-09-212-38/+58
| | | | | | | Replace an if() posse with a switch() statement in traverse_string(). Remove unnecessary casts in cpy_*(), with tweaks from guenther@; ok bcook@ jsing@ guenther@
* Add CHACHA20 as a cipher symmetric encryption alias.jsing2014-09-192-2/+10
| | | | From Ming <gzchenym at 126.com>
* remove obfuscating parens. man operator is your friend.tedu2014-09-194-30/+30
|
* A few more MLINKs.miod2014-09-161-1/+7
|
* When fopen()ing internal to libc (the API doesn't support the useguenther2014-09-155-14/+14
| | | | | | | of the resulting FILE *), then pass fopen() the 'e' mode letter to mark it close-on-exec. ok miod@
* Do not claim that empty numbers set EINVAL, our implementation doesn't.schwarze2014-09-142-37/+61
| | | | | | | Mention that invalid bases do set EINVAL (as required by POSIX); this part of the change uses part of an earlier patch by millert@. Minor mdoc(7) cleanup and sync between the two pages while here. Feedback and ok jmc@ and millert@.
* Make sure that the following functions return 0 and EINVAL asschwarze2014-09-136-20/+60
| | | | | | | | | | required by the C standard when called with an invalid base: strtoll(), strtoimax(), strtoul(), strtoull(), and strtoumax(). Same behaviour for strtoq() and strtouq() even though not standardized. No functional change in strtol(), it was the only one already correct. While here, simplify the conditional expression for checking the base and sync whitespace and comments among the six files. ok millert@
* obvious cases of missing .An;schwarze2014-09-081-3/+3
| | | | | found with the new mandoc(1) MANDOCERR_AN_MISSING warning; no text changes
* Remove SSL_kDHr, SSL_kDHd and SSL_aDH. No supported ciphersuites use them,jsing2014-09-0716-182/+54
| | | | | | nor do we plan on supporting them. ok guenther@
* POSIX specifies arpa/inet.h as the include file for these.millert2014-09-041-3/+3
| | | | OK aja@ mikeb@
* Make the in6addr constant declarations and definitions consistentbluhm2014-08-311-3/+3
| | | | | in kernel and user land. OK florian@ mpi@
* Add sockatmark()guenther2014-08-313-5/+170
| | | | ok millert@ manpage feedback jmc@
* preserve errno value on success.bcook2014-08-282-8/+12
| | | | | If getrandom returns a temporary failure, make sure errno is not polluted when it succeeds. Thanks to deraadt@ for pointing it out.
* Add the API function ressl_config_set_ecdhcurve(config, name) to set areyk2014-08-274-9/+29
| | | | | | non-standard ECDH curve by name or to disable it by passing NULL. OK jsing@
* Move openssl(1) from /usr/sbin/openssl to /usr/bin/openssl, since it is notjsing2014-08-2655-33619/+0
| | | | | | | | 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@
* constify strerror return valuebcook2014-08-242-4/+4
| | | | | | | | | 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@
* Include <sys/time.h> to get struct timevalbcook2014-08-242-2/+4
| | | | | | | | | 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@
* Include <sys/select.h> to get selectbcook2014-08-244-4/+9
| | | | | | | | | These files currently depends on the wrapper <stdlib.h> file indirectly including a header that provides select(). from Jonas 'Sortie' Termansen ok deraadt@ tedu@
* Let SSL_CIPHER_description() allocate the buffer for the description,jsing2014-08-241-4/+6
| | | | | | | | | | | | | | | | 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.
* Replace the remaining uses of ssl3_put_cipher_by_char() with s2n and ajsing2014-08-2410-58/+38
| | | | | | | ssl3_cipher_get_value() helper function, which returns the cipher suite value for the given cipher. ok miod@
* Remove non-standard GOST cipher suites (which are not compiled injsing2014-08-232-136/+2
| | | | | | currently). From Dmitry Eremin-Solenikov.