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

1762 Commits

Author SHA1 Message Date
jsing
0d55d5127d Provide functions for starting, finishing and writing SSL handshake
messages. This will allow for removal of repeated/duplicated code.

Additionally, DTLS was written by wholesale copying of the SSL/TLS code,
with some DTLS specifics being added to the duplicated code. Since these
SSL handshake message functions know how to handle both SSL/TLS and DTLS,
upon conversion the duplicate versions will become identical (or close to),
at which point the DTLS versions can be removed and the SSL/TLS versions
used for both protocols.

Partially based on similar changes in OpenSSL.

ok miod@
2014-12-14 16:07:26 +00:00
jsing
265bd06d02 Remove trailing whitespace. 2014-12-14 15:30:50 +00:00
jsing
40eee476bc unifdef OPENSSL_NO_NEXTPROTONEG, which is one of the last standing #ifndef
mazes in libssl. NPN is being replaced by ALPN, however it is still going
to be around for a while yet.

ok miod@
2014-12-14 14:34:43 +00:00
jsing
7002c20863 unifdef NETSCAPE_HANG_BUG from the DTLS code. The code is not currently
enabled and I would hope that no one is using client certificates with DTLS
and Netscape, assuming it even supported it...

ok bcook@ miod@
2014-12-14 13:45:47 +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
deee009d2f libssl major++ 2014-12-10 14:59:32 +00:00
jsing
d436807c3f Add support for ALPN.
Based on OpenSSL and BoringSSL.

ok bcook@
2014-12-10 14:58:56 +00:00
bcook
c2e63fbdd2 add stdint.h to ssl.h.
ok jsing@
2014-12-10 14:51:00 +00:00
bcook
b0fce74efc Use platform-defined method of printing a pointer.
Casting a pointer to an unsigned long discards bits on an LLP64 system.

ok deraadt@
2014-12-08 03:54:19 +00:00
jsing
53369472f2 Make GOST compile with a strict C compiler - in this case incrementing a
void pointer is undefined and initialising an array with {} is a syntax
error.

Based on a diff from kinichiro inoguchi.
2014-12-07 16:33:51 +00:00
miod
b8a5a303e4 Correctly output the result in STREEBOG512_Final() when running on a big-endian
system. *blush*
2014-12-07 16:07:56 +00:00
miod
5743845849 Make sure to load absolute symbol address with dla' instead of la' when
generating code for 64-bit mips userland.
2014-12-07 15:55:58 +00:00
miod
ac46eb462c Remove OPENSSL_FIPSCANISTER mentions. 2014-12-07 15:37:27 +00:00
jsing
51e2328e8c Remove get_optional_pkey_id() - it is a hack that existed due to GOST
only sometimes being available... and when it was available it was via
the crypto engine. GOST is now part of libcrypto proper.

Instead of trying to do EVP PKEY lookups via string literals and the
ASN1 interfaces, lookup the methods directly using the appropriate NID.

ok bcook@
2014-12-07 12:13:06 +00:00
schwarze
9f49da3217 fix manual names that clash with other manuals 2014-12-06 23:39:35 +00:00
doug
d47fdd6e01 Avoid modifying input on failure in X509_(TRUST|PURPOSE)_add.
If X509_TRUST_add() or X509_PURPOSE_add() fail, they will leave the
object in an inconsistent state since the name is already freed.
This commit avoids changing the original name unless the *_add() call
will succeed.

Based on BoringSSL's commit: ab2815eaff6219ef57aedca2f7b1b72333c27fd0

ok miod@
2014-12-06 19:26:37 +00:00
jsing
aca8722f4a Remove now bogus comment that got missed in the GOST commit. 2014-12-06 15:27:45 +00:00
jsing
6e4df77cd4 Fix some horrible style(9) violations... 2014-12-06 15:25:40 +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
jsing
86c91ae86b Ensure that the client specified EC curve list length is a multiple of two.
The EC curve handling code assumes this to be the case and will read one
byte off the end of the curve list during processing, in the case where it
is not.

ok miod@
2014-12-06 13:28:56 +00:00
jsing
5b56a6f60b Fix two cases where it is possible to read one or two bytes past the end of
the buffer. The later size check would catch this, however reading first
and checking later is less than ideal.

ok miod@
2014-12-06 13:21:14 +00:00
schwarze
33f4dfa7b5 add missing .Fn macros in the SYNOPSIS; found with mandoc.db(5) 2014-12-04 18:27:10 +00:00
bcook
f1b4d7a81e Move Windows OS-specific functions to make porting easier.
Several functions that need to be redefined for a Windows port are right
in the middle of other code that is relatively portable. This patch
isolates the functions that need Windows-specific implementations so
they can be built conditionally in the portable tree.

ok jsing@ deraadt@
2014-12-03 22:14:38 +00:00
bcook
be0a55f1ad We're not supporting 16-bit Windows, remove cast.
ok jsing@ deraadt@
2014-12-03 21:55:51 +00:00
deraadt
e9c78e4fdd handle the (impossible) situation of a size_t - 1 buffer from
EC_POINT_point2oct so that later allocation does not overflow
with miod
2014-12-03 19:53:20 +00:00
deraadt
144e7222ee Spotted another opportunity to use reallocarray().
ok miod
2014-12-03 19:45:16 +00:00
miod
34efa9794f Add brainpool curves to eccurves_default[], accidentally missing from 1.32;
from OpenSSL HEAD via Thomas Jakobi.
2014-12-02 20:46:19 +00:00
jmc
97f31fe225 add some openbsd tags, and a first pass at cleanup; 2014-12-02 14:11:01 +00:00
schwarze
4101111aca Remove non-portable use of .Pf that doesn't work with groff;
found because the groff_mdoc(7) macros warn about it.
2014-11-30 01:51:47 +00:00
jsing
f363eaee11 Ensure that sess_cert is not NULL at the start of
ssl3_send_client_key_exchange(), rather than checking it in the key
exchange algorithm specific code.

ok beck@ miod@
2014-11-27 16:13:36 +00:00
jsing
75fd032185 Avoid a double-free in an error path.
Reported by Felix Groebert of the Google Security Team.

ok beck@ miod@
2014-11-27 16:07:33 +00:00
jsing
1d1d8690bd Avoid a NULL dereference in the DTLS client that can be triggered by a
crafted server response used in conjunction with an anonymous DH or
anonymous ECDH ciphersuite.

Fixes CVE-2014-3510, which is effectively a repeat of CVE-2014-3470 in
copied code.

Reported by Felix Groebert of the Google Security Team.

ok beck@ miod@
2014-11-27 16:03:03 +00:00
bcook
0f5f5d2d75 remove superflous gettimeofday wrapper.
ok beck@ tedu@ miod@ guenther@ doug@ deraadt@
2014-11-26 05:41:44 +00:00
bcook
3d7ceb2083 memset like a normal human.
ok beck@ tedu@ miod@
2014-11-26 05:39:06 +00:00
bcook
c0f961d474 normalize set/getsockopt usage.
Remove the remaining random casts on optval. Fixups for this can be handled by
the portability layer all in once place.

Remove remaining fake socklen_t unions, though beck@ points out that this also
removes support for socklen_t changing its length at runtime. RIP.

ok tedu@ beck@ miod@ deraadt@
2014-11-26 05:37:26 +00:00
bcook
2bfe11d6d4 Linux has had IP_MTU since 2005, don't force it.
ok beck@ miod@ tedu@ deraadt@
2014-11-26 05:01:47 +00:00
bentley
d674f2a4f9 Fix incorrect escape. 2014-11-22 06:46:08 +00:00
deraadt
f02102f598 MPE support, begone. ok tedu 2014-11-21 18:15:40 +00:00
krw
036c7a3474 Nuke yet more obvious #include duplications.
ok deraadt@
2014-11-19 13:35:36 +00:00
bcook
a7f4b1cbf4 include camellia.h using the public include path 2014-11-19 11:37:52 +00:00
doug
3d3c5e2af6 Fix a memory leak with pkey in client key exchange
Based on boringssl commit: 1df112448b41c3568477f3fcd3b8fc820ce80066

ok miod@ jsing@
2014-11-19 05:51:25 +00:00
miod
d183439ab0 Argh, another bug introduced in r1.3; Dmitry Eremin-Solenikov 2014-11-18 21:18:56 +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
miod
382147b327 Enable the build of GOST routines in libcrypto. Riding upon the Cammelia
libcrypto minor bump.
2014-11-18 05:31:47 +00:00
miod
2f8395562b More missing error checks I forgot to commit last week, part of the large
cleanup diff.
2014-11-18 05:30:07 +00:00
miod
ababa8c8e2 Return success in param_copy_gost01() if there is no private key to copy;
broken in r1.3.
Spotted by Dmitry Eremin-Solenikov
2014-11-18 05:27:05 +00:00
tedu
aa9af0f61f further BUF_strdup conversion: these places should be safe to rely on
the function argument not being NULL
2014-11-18 03:28:05 +00:00
miod
21c207d43b Add the Cammelia cipher to libcrypto.
There used to be a strong reluctance to provide this cipher in LibreSSL in the
past, because the licence terms under which Cammelia was released by NTT were
free-but-not-in-the-corners, by restricting the right to modify the source
code, as well retaining the right to enforce their patents against anyone
in the future.

However, as stated in http://www.ntt.co.jp/news/news06e/0604/060413a.html ,
NTT changed its mind and made this code truly free. We only wish there had
been more visibility of this, for we could have had enabled Cammelia
earlier (-:

Licence change noticed by deraadt@. General agreement from the usual LibreSSL
suspects.

Crank libcrypto.so minor version due to the added symbols.
2014-11-17 20:31:20 +00:00