Steven Fackler
bc4e47a321
Fix lookup errors with SNI callback.
...
The job of an SNI callback is typically to swap out the context
associated with an SSL depending on the domain the client is trying to
talk to. Typically, only the callbacks associated with the current
context are used, but this is not the case for the SNI callback.
If SNI is run for a second time on a connection (i.e. in a
renegotiation) and the context was replaced with one that didn't itself
register an SNI callback, the old callback would run but wouldn't be
able to find its state in the context's ex data. To work around this, we
pass the pointer to the callback data directly to the callback to make
sure it's always available. It still lives in ex data to handle the
lifetime management.
Closes #979
2018-08-31 20:23:55 -07:00
Steven Fackler
2df87cfd59
Fix doc reference
2018-08-19 20:19:10 -07:00
Steven Fackler
ef7721092d
SRTP cleanup
2018-08-19 18:50:11 -07:00
Aron Wieck
59c578cf04
Add methods for DTLS/SRTP key handshake
2018-08-14 16:04:33 +02:00
Steven Fackler
1396143c66
Add get_shutdown and set_shutdown
2018-08-08 13:19:55 -07:00
Steven Fackler
ee5215bd31
SslSessionRef methods return static strings
...
Closes #961
2018-07-19 20:22:57 -07:00
Steven Fackler
6440ee04ef
Merge pull request #943 from lolzballs/master
...
Add wrapper for SSL_CTX_set_psk_server_callback
2018-06-17 15:47:00 -07:00
Steven Fackler
115cb730b0
Switch to accessors in libressl where possible
...
Some accessors are mysteriously still macros so we can't make everything
opaque yet, unfortunately.
cc #909
2018-06-09 21:49:36 -07:00
Steven Fackler
cdc90c7e9d
Add SslRef::set_alpn_protos
2018-06-04 20:19:27 -07:00
Steven Fackler
0745d66927
Update to 1.1.1-pre7
...
The initial session ticket is now sent as part of SSL_accept, so some
tests need to write a single byte through the stream to make sure that
both ends have fully completed to avoid test flakes.
TLSv1.3 cipher suite control has been extracted from the normal cipher
list into a separate method: SslContextBuilder::set_ciphersuites.
2018-06-02 13:58:56 -07:00
Benjamin Cheng
5d8a44612d
add test for psk; deprecated set_psk_callback
2018-06-02 13:47:52 -04:00
Benjamin Cheng
b1eb1224f5
Merge remote-tracking branch 'origin/master'
2018-06-02 10:56:31 -04:00
Steven Fackler
3456add537
Add SslRef::verified_chain
2018-05-29 21:53:22 -07:00
Steven Fackler
3cd33cdd8b
Don't panic on bogus servernames
...
Also add a second version of the method to avoid filtering out non-utf8
names.
Closes #930
2018-05-24 20:22:15 -07:00
Steven Fackler
c0876cc8c6
Add bindings to SSL_get_finished and SSL_get_peer_finished
...
These are used for the tls-unique SCRAM channel binding mode.
2018-05-24 20:00:28 -07:00
Steven Fackler
c7db3d18ad
Merge pull request #920 from Ralith/max-early-data-accessors
...
TLS1.3 early data support
2018-05-22 20:42:46 -07:00
Benjamin Saunders
2e478fdcf4
Expose early I/O
2018-05-22 20:25:28 -07:00
Steven Fackler
7a7f98a32c
Revert "Move proto version accessors to SslContextRef"
2018-05-20 20:55:20 -07:00
Steven Fackler
b976b5fd52
Move proto version accessors to SslContextRef
...
Add a Derf impl for SslContextBuilder so existing use still works.
2018-05-20 20:47:00 -07:00
Steven Fackler
4c1fdf1d81
Support ALPN on libressl
...
Closes #690
2018-05-20 12:52:49 -07:00
Steven Fackler
a6fcef01c0
Overhaul openssl cfgs
...
Also expose hostname verification on libressl
2018-05-20 12:33:02 -07:00
Steven Fackler
d991566f2b
Support min/max version in LibreSSL
...
Their implementations of the accessors don't behave expected with no
bounds, so we ignore those bits of the tests.
2018-05-19 19:57:12 -07:00
Benjamin Saunders
69c75a178b
Expose early keying material export
2018-05-17 13:16:41 -07:00
Benjamin Saunders
d5d414b16f
Expose max TLS1.3 early data accessors
2018-05-17 12:02:32 -07:00
Benjamin Cheng
47a68e2929
Add wrapper for SSL_CTX_set_psk_server_callback
2018-05-16 17:49:36 -04:00
Steven Fackler
ff2c7ffefd
Merge Ssl impl blocks
2018-05-12 16:50:50 +01:00
Steven Fackler
c25b6f3e26
Clean up SSL callbacks
...
Also add an Arc to avoid a weird use after free edge case if a callback
changes a callback.
2018-05-12 15:02:53 +01:00
Steven Fackler
5cfbe7ac6a
Disable tests that talk to Google on LibreSSL 2.5.0
...
They're flickering, and I'm assuming it's just because that version is
so old.
2018-05-12 13:59:22 +01:00
Steven Fackler
e5d65306e7
Change SslContext callback handling
...
Use the existing infrastructure!
2018-05-12 13:19:01 +01:00
Steven Fackler
7a1b59d605
Fix base version for min/max proto accessors
...
Closes #911
2018-05-09 20:04:43 +01:00
Benjamin Saunders
47431f66bb
Expose SslSession <-> DER conversion
2018-04-29 01:54:16 -07:00
Steven Fackler
e423da2d12
Merge pull request #858 from Ralith/stateless-api
...
Introduce SslStreamBuilder
2018-03-31 11:28:03 -07:00
Steven Fackler
1bbe1b6a8f
Clean up a couple of holdovers from old features
2018-03-29 10:20:18 +02:00
Benjamin Saunders
99fdb2bd0b
Introduce SslStreamBuilder
2018-03-28 18:14:48 -07:00
Benjamin Saunders
bbb1cb61f6
Update to OpenSSL 1.1.1-pre3
2018-03-28 18:14:44 -07:00
Steven Fackler
7c33346960
Remove version-specific features
...
Closes #852
2018-03-19 00:41:33 -07:00
Benjamin Saunders
09b1fe9a0d
Expose additional cipher and digest accessors
2018-03-16 20:33:23 -07:00
Steven Fackler
9f5ef88880
Add a Sync + Send bound to the custom ext type
...
It's stored inside of the Ssl, so this is probably tecnically
necessarly?
2018-03-11 15:36:47 -07:00
Steven Fackler
d0329473bd
Merge branch 'master' into custom-extensions
2018-03-11 15:27:28 -07:00
Benjamin Saunders
e02dbde2f7
Generic custom extension add fn return type
2018-03-10 22:30:54 -08:00
Steven Fackler
562fe79f4c
Add one more set of impls
2018-03-10 08:53:46 -08:00
Benjamin Saunders
b0bc1c770e
High-level API for OpenSSL 1.1.1 custom extension support
2018-03-09 20:33:49 -08:00
Benjamin Saunders
f92de22b8d
Add SslOptions::ENABLE_MIDDLEBOX_COMPAT
2018-03-03 14:57:38 -08:00
Steven Fackler
b7ba577339
Add min/max protocol version support
2018-02-25 23:20:10 -08:00
Benjamin Saunders
e04dbfa3ee
Expose cookie generate/verify callback setters
2018-02-25 20:05:15 -08:00
Steven Fackler
f72f35e9bd
Add RFC 5705 support
2018-02-23 22:04:57 -08:00
Steven Fackler
7e0591a377
Actually add version stuff
2018-02-21 23:25:28 -08:00
Steven Fackler
2daaf3fdea
Add some debugging-related bindings
2018-02-17 17:49:49 -08:00
Steven Fackler
90d5f85511
Add SSL_version binding
2018-02-17 13:44:21 -08:00
Steven Fackler
3f5e3f095e
Fix session cloning
2018-02-17 10:12:47 -08:00
Steven Fackler
e5123d266b
Bind remove and get session callbacks
2018-02-16 22:24:34 -08:00
Steven Fackler
4dffa0c33f
SSL session callbacks have always been around
2018-02-16 21:31:09 -08:00
Steven Fackler
af4832e145
Doc tweak
2018-02-15 21:33:39 -08:00
Steven Fackler
a9d8bea33c
Add more session cache support
2018-02-15 21:30:20 -08:00
Steven Fackler
f4ddd66b03
Tweak features
...
We should keep the version features totally separate for now.
2018-02-14 22:11:24 -08:00
Steven Fackler
2765775535
OpenSSL 1.1.1 support
2018-02-13 22:31:37 -08:00
Steven Fackler
af7aa52364
Adjust the SNI callback
...
Brings it more in line with how the raw callback is structured.
2018-01-06 22:20:20 -08:00
Steven Fackler
f50dd20cb6
Fix docs
2018-01-06 21:42:37 -08:00
Steven Fackler
1553447385
Misc cleanup
2018-01-01 12:23:41 -08:00
Steven Fackler
9043cf9aa7
Move X509Filetype to SslFiletype
...
These constants have the same values, but X509_FILETYPE_DEFAULT doesn't
work in the Ssl methods and using the SSL_* names is a bit less
confusing.
2018-01-01 11:50:07 -08:00
Steven Fackler
d207897458
Parameterize keys over what they contain
...
Closes #790
2017-12-30 21:53:39 -08:00
Steven Fackler
1085e79447
Remove `SslRef::compression`
...
TLS compression is extremely deprecated, so no-one should be messing
with this in the first place.
2017-12-28 20:22:05 -08:00
Steven Fackler
23bab6336e
Add a parameter to servername
2017-12-28 10:18:23 -08:00
Steven Fackler
7fbda61609
Overhaul ALPN
...
There was previously a lot of behind the scenes magic. We now bind much
more directly to the relevant functions.
Also remove APN support. That protocol is supersceded by ALPN - let's
see if anyone actually needs to use it.
2017-12-27 16:24:01 -07:00
Steven Fackler
52a06adc08
Overhaul ssl error
2017-12-26 21:03:49 -07:00
Steven Fackler
129b6b9d84
Overhaul verify error type
...
Also set the error in the hostname verification callback for 1.0.1
2017-12-26 14:43:10 -07:00
Steven Fackler
19dc6ce1eb
Adjust SslConnector and SslAcceptor construction
2017-12-26 10:39:21 -07:00
Steven Fackler
ce0641f093
Drop Any bounds
2017-12-26 08:55:12 -07:00
Steven Fackler
3744e31e16
Fix a bunch of FIXMEs
2017-12-25 21:44:41 -07:00
Steven Fackler
7d0c6c9442
Fix tests
2017-12-25 20:32:06 -07:00
Steven Fackler
77448362ce
Rename X509FileType to X509Filetype
2017-12-25 19:57:02 -07:00
Steven Fackler
3eab162dc2
Move to associated consts
2017-12-25 19:56:27 -07:00
Steven Fackler
bbae793eb3
Upgrade bitflags to 1.0
...
Closes #756
2017-12-25 19:38:11 -07:00
Steven Fackler
4b732dad19
Fix link
2017-12-09 15:50:23 -08:00
Steven Fackler
3207e57a09
Finish documentation for the ssl module
...
Closes #727
2017-12-04 22:15:56 -08:00
Steven Fackler
bf70d3dd71
Docs for the ssl module.
...
cc #727
2017-12-03 23:10:56 -08:00
Steven Fackler
e9ad9f1afd
Upgrade foreign-types
...
foreign-types 0.3 and 0.2 now share the same types and traits, so this
is backwards compatible.
2017-11-26 17:07:24 -07:00
Steven Fackler
de987f20c8
Revert "Update foreign-types to 0.3"
2017-11-21 08:51:37 -08:00
Anthony Ramine
93be1c4f2f
Update foreign-types to 0.3
2017-11-21 09:17:39 +01:00
Steven Fackler
55bf390dbe
Adjust libressl version detection
...
The 2.5.3+ and 2.6.3+ series are ABI-stable, so we don't need to
whitelist individual releases in those ranges.
2017-11-13 21:51:55 -08:00
phoebe jenkins
6257835757
Add support for LibreSSL 2.6.3
2017-11-13 09:51:17 -05:00
Steven Fackler
8830bd5daf
Add a couple of FIXMEs
2017-11-05 10:47:05 -08:00
Steven Fackler
a1a3219483
Handle local retries
...
OpenSSL can return SSL_ERROR_WANT_READ even on blocking sockets after
renegotiation or heartbeats. Heartbeats ignore the flag that normally
makes these things handled internally anyway on 1.0.2. To handle this
more properly, we now have a special error type we use to signal this
event. The `Read` and `Write` implementation automatically retry in this
situation since that's what you normally want. People can use `ssl_read`
and `ssl_write` if they want the lower level control.
Closes #760
2017-11-04 13:32:18 -07:00
Brian Vincent
d5299a8d2b
Fixed a typo in an error message, WANT_WRITE -> WANT_READ
2017-10-17 20:06:35 -05:00
Steven Fackler
ff8f54812c
Merge pull request #752 from chrisvittal/libressl262
...
Add support for LibreSSL 2.6.2
2017-10-03 22:11:29 -07:00
Christopher Vittal
1308cb2b52
Fix cfgs for libressl262
2017-10-04 00:53:09 -04:00
johnthagen
b5bb8de4f2
Convert try! usage to ?
2017-10-03 17:44:02 -04:00
Marc-Antoine Perennou
5091830379
openssl: libressl 2.6.1 dropped suuport for npn
...
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-09-17 19:46:05 +02:00
Steven Fackler
c2164a4864
Add peer_cert_chain
2017-07-29 10:34:10 -07:00
Steven Fackler
374ad206d5
Use foreign-type's Opaque
2017-07-15 21:53:49 -07:00
Steven Fackler
bcd0dcafcb
Rustfmt
2017-07-15 21:46:11 -07:00
Steven Fackler
5c2410c38a
Init before creating ex indexes
2017-07-15 18:58:24 -07:00
Steven Fackler
fd52bbe85c
Add an API to install extra data
2017-07-15 16:50:36 -07:00
Steven Fackler
e3c7a2785c
Move callbacks to a submodule
2017-07-15 16:50:36 -07:00
Steven Fackler
279bffccf5
Merge pull request #641 from luser/psk
...
Expose PSK via a SslContextBuilder::set_psk_callback method
2017-07-04 18:19:17 -10:00
Steven Fackler
240eb9731f
Properly reexport ConnectConfiguration
2017-06-14 19:54:09 -07:00
Ted Mielczarek
4de58596d9
Make some changes for review comments
2017-06-02 08:20:03 -04:00
Steven Fackler
3028958bf6
Little docs fix
2017-05-29 21:11:49 -07:00
Steven Fackler
c89af1d5f8
Add a fixme
2017-05-29 18:04:32 -07:00
Ted Mielczarek
16183f41f6
Expose PSK via a SslContextBuilder::set_psk_callback method
2017-05-26 14:51:04 -04:00