summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Jettison DTLS over SCTP.jsing2015-02-0914-818/+14
| | | | | | | | OpenBSD does not have SCTP support and it sees little use in the wild. OPENSSL_NO_SCTP is already specified via opensslfeatures.h, hence this is a code removal only and symbols should remain unchanged. ok beck@ miod@ tedu@
* When parsing the host in tls_connect(), first check if it is a numericreyk2015-02-091-29/+49
| | | | | | | | | IPv4 or IPv6 address before trying to resolve the address with the AI_ADDRCONFIG flag set. This makes sure that attempts to connect to numeric IPs or loopback addresses are always possible and not prevented by AI_ADDRCONFIG. OK jsing@ tedu@
* Return NULL when there are no shared ciphers.doug2015-02-092-8/+12
| | | | | | | | | | | | | | | | | OpenSSL added this change to avoid an out-of-bounds write since they're accessing p[-1]. We initialize buf and use strrchr() so we aren't subject to the same OOB write. However, we should return NULL rather than an empty string when there are no shared ciphers. Also, KNF a particularly bad section above here that miod noticed. Based on OpenSSL commits: 4ee356686f72ff849f6f3d58562224ace732b1a6 308505b838e4e3ce8485bb30f5b26e2766dc7f8b ok miod@
* Remember to zero the ciphers configuration.jsing2015-02-091-2/+4
|
* This is neither code not proper documentation.miod2015-02-0914-314/+0
|
* Rewrite the openssl(1) ciphers command.jsing2015-02-091-158/+128
| | | | | | | | | This has the same functionality as the previous version, however uses the new option handling code, uses SSL_CIPHER_get_value() since we no longer care about SSlv2 cipher suites and uses standard I/O functions instead of BIO functions. ok beck@ doug@
* Remove unused GOST test that prevents clang from building libcrypto.doug2015-02-092-110/+2
| | | | | | | | | | clang warns that it is unused and we have -Werror enabled. This test isn't hooked up to anything yet. We can add it back with a future GOST update. clang 3.5 can now build libssl and libcrypto as long as you use CFLAGS=-Wno-pointer-sign. "seems reasonable" bcook@, miod@
* Use `> 0' instead of `!= 0' as a successful condition formiod2015-02-0820-88/+88
| | | | | | EC_POINT_is_at_infinity() and EC_POINT_is_on_curve(), for they may return -1 should an error arise. ok doug@ jsing@
* Move a few typedef up in this file in order to be able to use them in env_md_stmiod2015-02-082-28/+20
| | | | | and get rid of a silly FIXME comment. ok doug@ jsing@
* Check memory allocation results in EVP_PBE_alg_add_type().miod2015-02-082-6/+20
| | | | ok doug@ jsing@
* Check memory allocation results, as well as stack pushes.miod2015-02-082-18/+68
| | | | | | Also fix a memory leak in one of the error paths of SMIME_read_ASN1(), spotted by doug@ tweaks&ok doug@ jsing@
* Rely upon enc_flags rather than the tls version, to upgrade SHA1+MD5 tomiod2015-02-082-8/+8
| | | | | SHA256 in ssl_get_algorithm2(). From OpenSSL HEAD; ok jsing@
* Lob a KNF grenade into the ecdsa code.jsing2015-02-0816-624/+576
|
* Delete commented out code from openssl(1) apps.doug2015-02-088-95/+11
| | | | | | | | | | From OpenSSL commits: 6f91b017bbb7140f816721141ac156d1b828a6b3 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 a2b18e657ea1a932d125154f4e13ab2258796d90 ok miod@, jsing@
* Use the AI_ADDRCONFIG flag in tls_connect(). This tells the resolverreyk2015-02-081-1/+2
| | | | | | | to ignore unsupported address families - eg. don't resolv IPv6 on IPv4-only hosts. OK jsing@
* Added tls_load_file()reyk2015-02-071-1/+2
|
* Add manpage bits for tls_load_file() and tls_accept_socket().reyk2015-02-072-2/+28
| | | | | | | | The tls_accept_socket() has been previously removed because the API is not fixed yet; but it is also already used by httpd(8) and spamd(8) so it is time to add it again and eventually change it later. OK tedu@
* Add tls_load_file() as a helper to load certificates or encrypted keysreyk2015-02-072-2/+92
| | | | | | | | | into memory. This can be used for tls_config_set_ca_mem(), tls_config_set_cert_mem() or tls_config_set_key_mem(). With input from jsing@, tedu@ and henning@ OK tedu@
* Don't leak addresses in error messages.miod2015-02-072-4/+4
|
* Remove useless variables and use the values directly.doug2015-02-072-10/+6
| | | | | | From OpenSSL commit 3d47c1d331fdc7574d2275cda1a630ccdb624b08. ok miod@, jsing@
* Don't support very old versions of Netscape (is there any other kind?).doug2015-02-072-12/+10
| | | | | | | | | | | | | | Apparently "very old" Netscape versions illegally included empty content and a detached signature. OpenSSL removed the #if 0 that protected these users and added a new button OPENSSL_DONT_SUPPORT_OLD_NETSCAPE. It appears to be off by default to keep the hopes and dreams of very old Netscape users alive. We decided to be rebels and disable support. If you installed your browser from floppy disks, it's time to upgrade! Based on OpenSSL commit: 02a938c953b3e1ced71d9a832de1618f907eb96d ok tedu@, miod@, jsing@
* Delete a lot of #if 0 code in libressl.doug2015-02-0790-1346/+110
| | | | | | | | | | | | | | | | | | | | | | | | | There are a few instances where #if 1 is removed but the code remains. Based on the following OpenSSL commits. Some of the commits weren't strictly deletions so they are going to be split up into separate commits. 6f91b017bbb7140f816721141ac156d1b828a6b3 3d47c1d331fdc7574d2275cda1a630ccdb624b08 dfb56425b68314b2b57e17c82c1df42e7a015132 c8fa2356a00cbaada8963f739e5570298311a060 f16a64d11f55c01f56baa62ebf1dec7f8fe718cb 9ccc00ef6ea65567622e40c49aca43f2c6d79cdb 02a938c953b3e1ced71d9a832de1618f907eb96d 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 d6fbb194095312f4722c81c9362dbd0de66cb656 6f1a93ad111c7dfe36a09a976c4c009079b19ea1 1a5adcfb5edfe23908b350f8757df405b0f5f71f 8de24b792743d11e1d5a0dcd336a49368750c577 a2b18e657ea1a932d125154f4e13ab2258796d90 8e964419603d2478dfb391c66e7ccb2dcc9776b4 32dfde107636ac9bc62a5b3233fe2a54dbc27008 input + ok jsing@, miod@, tedu@
* Convert tls_connect_fds() and tls_accept_socket() to the new OpenSSL errorjsing2015-02-074-26/+16
| | | | | | | dance handling code. This means that we get slightly useful messages when a TLS connection or accept fails. Requested by reyk@
* Convert several of the server side handshake functions to the new handshakejsing2015-02-074-238/+108
| | | | | | message handling routines. ok miod@
* Crank major for libcrypto since symbols have been removed.jsing2015-02-072-4/+4
| | | | Requested by deraadt@
* Add tls_config_set_dheparams() to allow specification of the parameters tojsing2015-02-077-22/+53
| | | | | | | | | use for DHE. This enables the use of DHE cipher suites. Rename tls_config_set_ecdhcurve() to tls_config_set_ecdhecurve() since it is only used to specify the curve for ephemeral ECDH. Discussed with reyk@
* Don't allow tag number 31 in CBB_add_asn1().doug2015-02-074-24/+54
| | | | | | | | | Tag 31 is invalid for a short form identifier octet (single byte). KNF a little more. Based on BoringSSL commit 5ba305643f55d37a3e45e8388a36d50c1b2d4ff5 ok miod@
* Crank libssl major due to the recent changes and removals.jsing2015-02-072-4/+4
| | | | ok beck@ deraadt@ miod@
* Clean up the {get,put}_cipher_by_char() implementations. Also usejsing2015-02-076-60/+28
| | | | | | | ssl3_get_cipher_by_value() in other parts of the code where it simplifies things. ok doug@
* Only call free in CBB_init().doug2015-02-072-6/+12
| | | | | | | | | | | CBB_init_fixed() should not call free because it can lead to use after free or double free bugs. The caller should be responsible for creating and destroying the buffer. From BoringSSL commit a84f06fc1eee6ea25ce040675fbad72c532afece miod agrees with the reasoning ok jsing@, beck@
* Attempt to implement the OpenSSL error dance so that TLS read/writejsing2015-02-071-29/+61
| | | | | | failures return something that is actually useful to the caller. ok reyk@
* Add regress tests for SSL_CIPHER_get_by_value() and SSL_CIPHER_get_by_id().jsing2015-02-071-1/+61
|
* Provide a SSL_CIPHER_get_by_value() function that allows a cipher to bejsing2015-02-078-8/+66
| | | | | | | | | | | | | | retrieved via its cipher suite value. A corresponding SSL_CIPHER_by_value() function returns the cipher suite value for a given SSL_CIPHER. These functions should mean that software does not need to resort to put_cipher_by_char()/get_cipher_by_char() in order to locate a cipher. Begrudgingly also provide a SSL_CIPHER_get_by_id() function that locates a cipher via the internal cipher identifier. Unfortunately these have already been leaked outside the library via SSL_CIPHER_by_id() and the various SSL3_CK_* and TLS1_CK_* defines in the ssl3.h/tls1.h headers. ok beck@ miod@
* Modify BSIZE to BUFLEN to avoid redefinition on HP-UX.bcook2015-02-072-15/+15
| | | | | | | | | | HP-UX defines BSIZE in its <sys/param.h>, and there is a route where its getting included as a side-effect. I tracked back to at least from HP-UX 9.0 ca. 1993, up to the latest, so the user namespace is polluted. from kinichiro <kinichiro.inoguchi@gmail.com> ok miod@, jsing@
* Stop defining TERMIOS, ANSI_SOURCE and OPENSSL_NO_RC5 for libssl builds.jsing2015-02-071-3/+1
| | | | | | | The first two are unused in libssl/libcrypto and OPENSSL_NO_RC5 is already defined via openssl/opensslfeatures.h. ok beck@ doug@ miod@
* Combine c_allc.c and c_alld.c into c_all.c - there is not much point havingjsing2015-02-077-724/+462
| | | | | | | this split across files, especially when two of them have less code than license text. ok bcook@ beck@ doug@ miod@
* Fix typo and ASN.1 tag number range comment in bytestring.h.doug2015-02-072-8/+8
| | | | | | | | | | CBS_get_asn1() and CBS_get_any_asn1_element() only support the single byte ASN.1 identifier octets (aka short form tags). Tag number 31 is the start of the multi-byte long form per X.690 section 8.1.2.4. From BoringSSL commit 2683af70e73f116e14db2bca6290fa4a010a2ee4 ok miod@
* SIZE_MAX is standard, we should be using it in preference to themillert2015-02-061-5/+3
| | | | obsolete SIZE_T_MAX. OK miod@ beck@
* KNF bytestring files.doug2015-02-069-2398/+2788
| | | | | | | | I checked that this doesn't change anything. Compiled with clang using -Wno-pointer-sign -g0 to reduce the differences. Only difference in the asm is due to assert(0) line number changes in bs_cbs.c and bs_cbb.c. miod is ok with the general process.
* Remove accidental, commented out code.doug2015-02-062-22/+2
| | | | This was to test a patch for upstream.
* Unifdef NETSCAPE_HANG_BUG.jsing2015-02-062-44/+2
| | | | | | | If you're still using a buggy version of Netscape from 2000, for HTTPS with client certificates, it is probably a good time to find a new browser. "kill it softly... with napalm and kisses" miod@
* Add additional checks to ssl3_send_client_key_exchange() that ensuresjsing2015-02-062-36/+50
| | | | | | | | ephemeral keys exist for SSL_kDHE and SSL_kECDHE. This would have prevented CVE-2014-3572. ok doug@
* Import BoringSSL's crypto bytestring and crypto bytebuilder APIs.doug2015-02-0612-2/+3359
| | | | | | | | | | | | | | This is imported with as few changes as possible for the initial commit. I removed OPENSSL_EXPORT, replaced OPENSSL_malloc() etc with malloc() and changed a few header includes. BoringSSL has this as part of their public API. We're leaving it internal to libssl for now. Based on BoringSSL's CBB/CBS API as of commit c5cc15b4f5b1d6e9b9112cb8d30205a638aa2c54. input + ok jsing@, miod@
* Add libssl ciphers regress, which currently only coversjsing2015-02-063-1/+130
| | | | get_cipher_by_char/put_cipher_by_char.
* Bring back the horrible API that is get_cipher_by_char/put_cipher_by_char.jsing2015-02-0628-30/+176
| | | | | | | | This API was intended to be an internal only, however like many things in OpenSSL, it is exposed externally and parts of the software ecosystem are now using it since there is no real alternative within the public API. ok doug@, tedu@ and reluctantly miod@
* Rename SSL_CTX_use_certificate_chain() to SSL_CTX_use_certificate_chain_mem().reyk2015-02-068-21/+22
| | | | | As discussed with beck@ jsing@ and others OK beck@
* Declare the x509_(mem|file|dir)_lookup symbols as static because theyreyk2015-02-056-12/+12
| | | | | | | | shouldn't be used directly. They aren't part of the API; each module (file, dir, mem) provides an actual function to export the now-static object. OK miod@
* Make the TLS connect and accept error messages consistent.bluhm2015-01-302-5/+4
| | | | OK jsing@
* Use .Rv where appropriate, and move it to RETURN VALUES;schwarze2015-01-293-27/+13
| | | | | remove .Tn, and a few minor macro adjustments. Patch from Kaspars at Bankovskis dot net.
* dial the time back to about 0.1s, closer to the original targets andtedu2015-01-281-4/+4
| | | | friendlier for users. requested by deraadt