Commit Graph

227 Commits

Author SHA1 Message Date
Steven Fackler b564cb5db7 Add digest signature methods 2016-10-15 09:48:34 -07:00
Steven Fackler 64b8e5e553 Merge pull request #471 from sfackler/no-comp
Handle OPENSSL_NO_COMP
2016-10-14 23:09:11 -07:00
Steven Fackler 7ac0599638 Fix test_alpn_server_select_none
In OpenSSL 1.1, a failure to negotiate a protocol is a fatal error, so
fork that test. This also popped up an issue where we assumed all errors
had library, function, and reason strings which is not necessarily the
case.

While we're in here, adjust the Display impl to match what OpenSSL
prints out.

Closes #465
2016-10-14 22:01:21 -07:00
Steven Fackler f520aa2860 Handle OPENSSL_NO_COMP
Closes #459
2016-10-14 20:50:45 -07:00
Steven Fackler d7a433bdef Respect osslconf in systest
Also cfg off SSLv3_method, since it's disabled in the OpenSSL that ships
with Arch Linux. More such flags can be added on demand - it doesn't
seem worth auditing everything for them.
2016-10-14 19:16:08 -07:00
Steven Fackler d976b8f595 Enable hostname verification on 1.0.2 2016-10-14 18:56:15 -07:00
Steven Fackler af51b263b1 Support hostname verification
Closes #206
2016-10-14 17:39:31 -07:00
Steven Fackler ae282a78e2 Remove link_name usage 2016-10-14 16:15:50 -07:00
Steven Fackler b610e01793 Flag off dtls and mask ssl_ops
Also un-feature gate npn as it ships with 1.0.1
2016-10-13 19:06:53 -07:00
Steven Fackler af3e06d3e8 Add remaining SSL_OP constants 2016-10-12 22:50:08 -07:00
Alex Crichton 43c951f743 Add support for OpenSSL 1.1.0
This commit is relatively major refactoring of the `openssl-sys` crate as well
as the `openssl` crate itself. The end goal here was to support OpenSSL 1.1.0,
and lots of other various tweaks happened along the way. The major new features
are:

* OpenSSL 1.1.0 is supported
* OpenSSL 0.9.8 is no longer supported (aka all OSX users by default)
* All FFI bindings are verified with the `ctest` crate (same way as the `libc`
  crate)
* CI matrixes are vastly expanded to include 32/64 of all platforms, more
  OpenSSL version coverage, as well as ARM coverage on Linux
* The `c_helpers` module is completely removed along with the `gcc` dependency.
* The `openssl-sys` build script was completely rewritten
  * Now uses `OPENSSL_DIR` to find the installation, not include/lib env vars.
  * Better error messages for mismatched versions.
  * Better error messages for failing to find OpenSSL on a platform (more can be
    done here)
  * Probing of OpenSSL build-time configuration to inform the API of the `*-sys`
    crate.
* Many Cargo features have been removed as they're now enabled by default.

As this is a breaking change to both the `openssl` and `openssl-sys` crates this
will necessitate a major version bump of both. There's still a few more API
questions remaining but let's hash that out on a PR!

Closes #452
2016-10-12 22:49:55 -07:00
manuels 44ed665f02 Add RAND_status()
RAND_status() returns 1 if the PRNG has been seeded with enough data, 0 otherwise.
2016-10-01 13:42:13 +02:00
manuels 4cc55b65e0 Add RSA_*_PADDING constants 2016-10-01 13:39:33 +02:00
Steven Fackler 4718a88e04 Release openssl-sys v0.7.17, openssl v0.8.2 2016-08-18 12:59:22 -07:00
Steven Fackler cd69343d67 Fix SslContext::add_extra_chain_cert
SSL_CTX_add_extra_chain_cert assumes ownership of the certificate, so
the method really needs to take an X509 by value. Work around this by
manually cloning the cert.

This method has been around for over a year but I'm guessing nobody
actually used it since it produces a nice double free into segfault!
2016-08-17 19:30:57 -07:00
David Weinstein 96b1ef829c Add `"x509_expiry"` feature flag
- fix return of `ASN1_TIME_print`
- assert on null `date`
2016-08-17 01:23:54 -04:00
David Weinstein f9cd4bff1f Progress on asn1 expiry
- Use MemBio and implement `Display` for Asn1Time

- Tweak doc for asn1 `not_before`, `not_after`
2016-08-17 01:23:54 -04:00
Steven Fackler 629f638f08 Release openssl-sys v0.7.16, openssl v0.8.1 2016-08-15 18:44:57 -07:00
Steven Fackler 912f7499cd Initialize algorithms in init
Required to deserialize PKCS12 on 0.9.8, looks like
2016-08-14 12:51:33 -07:00
Steven Fackler e5299fd7c9 Fix memory leak in general name stack 2016-08-14 11:16:53 -07:00
Steven Fackler 6b12a0cdde PKCS #12 support 2016-08-14 11:11:26 -07:00
Steven Fackler 773a6f0735 Start on PKCS #12 support 2016-08-14 10:11:38 -07:00
Steven Fackler 2e8f19ca2f Release openssl-sys v0.7.15, openssl v0.8.0 2016-08-11 21:00:43 -07:00
Steven Fackler 207d8e6b30 Undelete bogus extern declaration
Old rust-openssl versions rely on it being there
2016-08-10 22:16:58 -07:00
Steven Fackler 35c79d1768 Fix build 2016-08-09 23:13:56 -07:00
Steven Fackler 67b5b4d814 Make hmac support optional and remove openssl-sys-extras
rust-openssl no longer requires headers for the default feature set.
2016-08-09 22:52:12 -07:00
Steven Fackler a8224d199b symm reform 2016-08-08 23:10:03 -07:00
Steven Fackler 522447378e Copy over getter macros 2016-08-08 20:37:48 -07:00
Steven Fackler bf07dd9a4e Remove symm_internal 2016-08-08 20:26:04 -07:00
Steven Fackler 6b1016c86e Add PKey::from_rsa 2016-08-07 22:56:44 -07:00
Steven Fackler 2a3e9a2856 Add RSA::generate 2016-08-07 22:35:37 -07:00
Steven Fackler 7855f428aa PKey reform
This deletes the vast majority of PKey's API, since it was weirdly tied
to RSA and super broken.
2016-08-07 20:38:46 -07:00
Steven Fackler 7ca5ccf064 Hash reform
Closes #430
2016-08-07 16:29:36 -07:00
Steven Fackler c47be8b14b Move SSL_CTX_set_ecdh_auto to -sys 2016-08-04 22:52:40 -07:00
Steven Fackler ee67ea8ea0 Mvoe SSL_CTX_add_extra_chain_cert to -sys 2016-08-04 22:46:47 -07:00
Steven Fackler 378b86326c Move SSL_CTX_set_tmp_dh to -sys 2016-08-04 22:43:24 -07:00
Steven Fackler 7fb7f4671d Move SSL_CTX_set_read_ahead to -sys 2016-08-04 22:40:01 -07:00
Steven Fackler 77dbab2cad Move SSL_CTX_set_tlsext_servername_callback to -sys 2016-08-04 22:37:39 -07:00
Steven Fackler c2a7c5b7f0 Move SSL_set_tlsext_host_name to -sys 2016-08-04 22:28:33 -07:00
Steven Fackler b29ea62491 Move BIO macros into -sys 2016-08-04 22:22:55 -07:00
Steven Fackler 17474520bc Support basic SSL options without C shims 2016-08-04 22:14:18 -07:00
Steven Fackler abacc8bb18 Define SSL_CTX_set_mode in openssl-sys 2016-08-02 22:14:44 -07:00
Steven Fackler 08e27f31ed Restructure PEM input/output methods
Dealing with byte buffers directly avoids error handling weirdness and
we were loading it all into memory before anyway.
2016-08-02 20:49:28 -07:00
Alex Crichton 3539be3366 Add MidHandshakeSslStream
Allows recognizing when a stream is still in handshake mode and can gracefully
transition when ready. The blocking usage of the API should still be the same,
just helps nonblocking implementations!
2016-07-31 16:01:06 -07:00
Steven Fackler df30e9e700 Merge pull request #402 from bbatha/feat/dsa-ffi
DSA bindings
2016-07-29 22:35:50 -07:00
Ben Batha a3a602be51 add low level dsa primitives 2016-07-29 19:04:37 -04:00
Onur Aslan 5ed77df197 Implement save_der for X509 and X509Req 2016-07-29 12:14:49 +03:00
Shaun Taheri 722a2bd673 Set SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag 2016-07-24 20:55:15 +02:00
Steven Fackler 5135fca87f Release v0.7.14 2016-07-01 18:43:39 -04:00
Steven Fackler 121169c1f5 Set auto retry
SSL_read returns a WANT_READ after a renegotiation by default which ends
up bubbling up as a weird BUG error. Tell OpenSSL to just do the read
again.
2016-07-01 18:31:47 -04:00