1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

82 Commits

Author SHA1 Message Date
jsing
265bd06d02 Remove trailing whitespace. 2014-12-14 15:30:50 +00:00
jsing
744da65f12 ssl3_init_finished_mac() calls BIO_new() which can fail since it in turn
calls malloc(). Instead of silently continuing on failure, check the return
value of BIO_new() and propagate failure back to the caller for appropriate
handling.

ok bcook@
2014-12-10 15:43:31 +00:00
jsing
829c998383 Remove support for GOST R 34.10-94 signature authentication, along with
the two ciphersuites that use it. GOST94 public/private keys have been
long obsoleted and libcrypto does not have support for them anyway.

Discussed with Dmitry Eremin-Solenikov.
2014-12-10 15:36:46 +00:00
jsing
070202f1b2 Remove client handling of RSA in ServerKeyExchange messages, along with
the associated peer_rsa_tmp goop.

This was only needed for export cipher handling and intentional RFC
violations. The export cipher suites have already been removed and
previous cleanup means that we will never send ServerKeyExchange messages
from the server side for RSA.
2014-12-06 14:24:26 +00:00
jsing
55d8b5b6bf Use appropriate internal types for EC curves and formats, rather than
storing and processing in wire encoded form.

Inspired by boringssl.

ok miod@
2014-12-06 13:51:06 +00:00
miod
4bb6f241c5 Update the GOST code in libssl, as contributed by Dmitry Eremin-Solenikov.
This causes a libssl major version bump as this affects the layout of some
internal-but-unfortunately-made-visible structs.
2014-11-18 05:33:43 +00:00
jsing
c5899dbc08 Sort and group includes. 2014-11-16 14:12:47 +00:00
jsing
46f2cc82e9 Clean up more SSLv2 remnants. 2014-11-08 15:21:02 +00:00
jsing
f4d0b69452 Remove remnants from RC2 and SEED - there are no longer any cipher suites
that use these algorithms (and SEED was removed from libcrypto some time
ago).

ok doug@
2014-11-02 10:42:38 +00:00
jsing
95986511df Add support for automatic DH ephemeral keys.
This allows an SSL server to enable DHE ciphers with a single setting,
which results in an DH key being generated based on the server key length.

Partly based on OpenSSL.
2014-10-31 15:25:55 +00:00
jsing
85bda7b83c Remove support for ephemeral/temporary RSA private keys.
The only use for these is via SSL_OP_EPHEMERAL_RSA (which is effectively
a standards violation) and for RSA sign-only, should only be possible if
you are using an export cipher and have an RSA private key that is more
than 512 bits in size (however we no longer support export ciphers).

ok bcook@ miod@
2014-10-31 14:51:01 +00:00
jsing
97025b677e Add support for automatic ephemeral EC keys.
This allows an SSL server to enable ECDHE ciphers with a single setting,
which results in an EC key being generated using the first preference
shared curve.

Based on OpenSSL with inspiration from boringssl.

ok miod@
2014-10-03 13:58:17 +00:00
jsing
be38120641 Clean up EC cipher handling in ssl3_choose_cipher().
The existing code reaches around into various internals of EC, which it
should not know anything about. Replace this with a set of functions that
that can correctly extract the necessary details and handle the
comparisions.

Based on a commit to OpenSSL, with some inspiration from boringssl.

ok miod@
2014-09-30 15:40:09 +00:00
jsing
7789765563 Check that the specified curve is one of the client preferences.
Based on OpenSSL.

ok miod@
2014-09-27 11:01:05 +00:00
jsing
c54199ea7f Remove SSL_kDHr, SSL_kDHd and SSL_aDH. No supported ciphersuites use them,
nor do we plan on supporting them.

ok guenther@
2014-09-07 12:16:23 +00:00
jsing
ef88cf8e57 Replace the remaining uses of ssl3_put_cipher_by_char() with s2n and a
ssl3_cipher_get_value() helper function, which returns the cipher suite
value for the given cipher.

ok miod@
2014-08-24 14:36:45 +00:00
jsing
0b57eba065 Replace the remaining ssl3_get_cipher_by_char() calls with n2s() and
ssl3_get_cipher_by_id().

ok bcook@
2014-08-23 14:52:41 +00:00
jsing
ba83acf62b Provide a ssl3_get_cipher_by_id() function that allows ciphers to be looked
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@
2014-08-11 01:06:22 +00:00
jsing
3e6620b050 Since we no longer need to support SSLv2-style cipher lists, start
unravelling the maze of function pointers and callbacks by directly
calling ssl3_{get,put}_cipher_by_char() and removing the
ssl_{get,put}_cipher_by_char macros.

Prompted by similar changes in boringssl.

ok guenther.
2014-08-10 14:42:55 +00:00
guenther
50b85d1c40 The RSA, DH, and ECDH temporary key callbacks expect the number of keybits
for the key (expressed in RSA key bits, which makes *no sense* for ECDH) as
their second argument, not zero.

(jsing@ notes that the RSA callback is only invoked for 'export' ciphers,
which have been removed from LibreSSL, and for the SSL_OP_EPHEMERAL_RSA
option, which is makes the application non-compliant.  More fuel for the
tedu fire...)

jasper@ noted the breakage and bisected it down to the diff that broke this
ok jsing@ miod@
2014-07-28 04:23:12 +00:00
jsing
daecd61139 The correct name for EDH is DHE, likewise EECDH should be ECDHE.
Based on changes to OpenSSL trunk.

ok beck@ miod@
2014-07-12 22:33:39 +00:00
jsing
f6f8cf51ac Provide ssl_version_string() function, which uses one of those modern C
constructs (a switch statement) and returns the appropriate string defined
by SSL_TXT_* for the given version, including support for DTLSv1 and
DTLSv1-bad. Use this function in SSL_get_version() and SSL_SESSION_print().

ok beck@
2014-07-12 19:45:53 +00:00
jsing
e12ac04744 Remove remnants from PSK, KRB5 and SRP.
ok beck@ miod@
2014-07-12 13:11:53 +00:00
miod
a291cc4741 No need to keep ssl23_foo() flavours mapping to ssl3_foo().
ok tedu@
2014-07-11 08:17:36 +00:00
jsing
17211dc3c1 Remove more compression related code. 2014-07-10 10:09:54 +00:00
tedu
e5b4af747f decompress libssl. ok beck jsing 2014-07-10 08:51:14 +00:00
jsing
9737895d1e tedu the SSL export cipher handling - since we do not have enabled export
ciphers we no longer need the flags or code to support it.

ok beck@ miod@
2014-07-09 11:25:42 +00:00
jsing
0ca99bc128 Remove SSL_FIPS.
ok deraadt@ miod@
2014-07-08 21:50:40 +00:00
jsing
b7aaf58c3e Nuke SSL_NOT_EXP since it does nothing.
ok deraadt@ miod@
2014-07-08 21:31:54 +00:00
jsing
63152afb14 Pull the code that builds a DTLS sequence number out into its own function
to avoid duplication. Also use fewer magic numbers.

ok miod@
2014-06-21 17:02:25 +00:00
jsing
347eea8665 Rename ssl3_record_sequence_update() to ssl3_record_sequence_increment(),
so that it reflects what it is actually doing. Use this function in a
number of places that still have the hand rolled version.

ok beck@ miod@
2014-06-15 15:29:25 +00:00
jsing
12fc33de51 Add ChaCha20-Poly1305 based ciphersuites.
Based on Adam Langley's chromium patches.

Tested by and ok sthen@
2014-06-13 13:28:53 +00:00
jsing
71c54fb9d6 Add an SSL_AEAD_CTX to enable the use of EVP_AEAD with an SSL cipher.
Read and write contexts are also added to the SSL_CTX, along with
supporting code.

Based on Adam Langley's chromium diffs.

Rides the recent SSL library bump.
2014-06-13 10:52:24 +00:00
deraadt
c3d6a26af7 tags as requested by miod and tedu 2014-06-12 15:49:27 +00:00
jsing
f00bd4e3be Add an SSL_CIPHER_ALGORITHM2_AEAD flag that is used to mark a cipher as
using EVP_AEAD. Also provide an EVP_AEAD-only equivalent of
ssl_cipher_get_evp().
2014-06-08 16:24:49 +00:00
deraadt
fae232511e http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=2016265dfbab162ec30718b5e7480add42598158
Don't know the full story, but it looks like a "can't do random
perfectly, so do it god awful" problem was found in 2013, and
replaced with "only do it badly if a flag is set".  New flags
(SSL_MODE_SEND_SERVERHELLO_TIME and SSL_MODE_SEND_SERVERHELLO_TIME)
were added [Ben Laurie?] to support the old scheme of "use time_t
for first 4 bytes of the random buffer".

Nothing uses these flags [ecosystem scan by sthen]

Fully discourage use of these flags in the future by removing
support & definition of them.  The buflen < 4 check is also interesting,
because no entropy would be returned.  No callers passed such small
buffers.
ok miod sthen
2014-06-07 22:23:12 +00:00
jsing
13864de448 ECDH and ECDSA will not work overly well if there is no EC, so unifdef
OPENSSL_NO_EC.

ok tedu@
2014-05-31 10:53:39 +00:00
jsing
1faa0e4997 TLS would not be entirely functional without extensions, so unifdef
OPENSSL_NO_TLSEXT.

ok tedu@
2014-05-31 10:49:28 +00:00
jsing
b47e8ef9c3 While working on another diff I ended up looking to see why on earth the
DTLS code had a chunk that checked to see if the SSL version was *not*
DTLS. Turns out that this is inside a big #if 0 block with a comment
explaining why DTLS will never need this code...

The DTLS code was clearly written by wholesale copying the SSLv3 code.
Any code not applicable to DTLS was seemingly #if 0'd or commented out
and left for others to find.

d1_pkt.c is copied from s3_pkt.c and it has a do_dtls1_write() function
that has the same function signature as do_ssl3_write(), except that the
create_empty_fragement (yes, that is the spelling in ssl_locl.h) argument
is unused for DTLS (although there is code that pretends to use it) since
it uses explicit IV (as the comment notes).

Instead of leaving this turd lying around, nuke the #if 0'd code (along
with the check for *not* DTLS) and remove the pointless
create_empty_fragment argument given the only two do_dtls1_write() calls
specify zero.

This kind of thing also makes you wonder how much actual peer review
occurred before the code was initially committed...

ok beck@
2014-05-30 05:27:32 +00:00
tedu
c487df4a3c we no longer care that these aren't used for ssl2 2014-05-29 21:22:54 +00:00
tedu
7fd84db0b7 unidef DH, ECDH, and ECDSA. there's no purpose to a libssl without them.
ok deraadt jsing
2014-05-29 18:11:13 +00:00
jsing
3f6fa97bf9 Make it substantially easier to identify protocol version requirements
by adding an enc_flags field to the ssl3_enc_method, specifying four flags
that are used with this field and providing macros for evaluating these
conditions. Currently the version requirements are identified by
continually checking the version number and other criteria.

This change also adds separate SSL3_ENC_METHOD data for TLS v1.1 and v1.2,
since they have different enc_flags from TLS v1.

Based on changes in OpenSSL head.

No objection from miod@
2014-05-29 16:00:16 +00:00
miod
b7955bf49f Remove unused defines. 2014-05-27 20:22:00 +00:00
tedu
0fe6bc7f91 remove unused shit. from Alexander Schrijver 2014-05-25 17:32:20 +00:00
jsing
4c360d9e27 The ssl_ciper_get_evp() function is currently overloaded to also return the
compression associated with the SSL session. Based on one of Adam Langley's
chromium diffs, factor out the compression handling code into a separate
ssl_cipher_get_comp() function.

Rewrite the compression handling code to avoid pointless duplication and so
that failures are actually returned to and detectable by the caller.

ok miod@
2014-05-25 13:27:38 +00:00
jsing
5f7556c6de DeIMPLEMENT libssl. Expand the IMPLEMENT_* macros since it is far more
readable and one less layer of abstraction. Use C99 initialisers for
clarity, grepability and to protect from future field reordering/removal.

ok miod@ (tedu@ also thought it was a wonderful idea, beck@ also agreed,
but ran away squealing since it reminded him of the VOP layer...)
2014-05-24 12:44:48 +00:00
jsing
68b99d3222 There are two actual uses of e_os2.h in libssl - an OPENSSL_GLOBAL (an
empty define) and an OPENSSL_EXTERN (which is defined as, well... extern).
The use of OPENSSL_EXTERN is already inconsistent since the lines above
and below just use plain old "extern". Expand the two uses of these macros
and stop including e_os2.h in libssl.

ok miod@
2014-05-22 17:43:52 +00:00
jsing
46859c4ae3 Stop pulling pqueue.h into ssl_locl.h since only a small part of libssl
actually needs it. Instead, just include it in the files where it is
actually necessary.

Also remove standard includes from pqueue.h so that they are not available
as a side effect. Just add the two includes that are needed to pqueue.c.

ok miod@
2014-05-22 17:37:06 +00:00
miod
25d62bd432 No longer make pqueue.h a public (and installed) header file. Replace its
inclusion in <ssl/dtls1.h> by the benign
`struct _pqueue; typedef struct _pqueue *pqueue;'.

Note that said dtls1.h should probably be considered a private header as well...

ok beck@
2014-05-15 19:39:46 +00:00
miod
6b61500bd0 Remove orphaned l2n6 and n2l6 macros. 2014-04-27 20:34:33 +00:00