Steven Fackler
563754fb08
Add SslContextBuilder::set_tmp_{ec,}dh_callback
2016-11-12 12:43:44 +00:00
Steven Fackler
9b5c62b053
Add PKey::bits
2016-11-12 11:00:15 +00:00
Steven Fackler
7c9afd8c99
Fix function signature
2016-11-12 10:29:31 +00:00
Steven Fackler
26a3358a2b
Add basic X509_STORE access
...
There's more to do here, but this enabled addition of trusted CAs from
X509 objects.
Closes #394
2016-11-12 00:24:12 +00:00
Steven Fackler
6b7279eb52
Consistently support both PEM and DER encodings
...
Closes #500
2016-11-11 20:10:10 +00:00
Steven Fackler
15490a43e3
Add EcKey <-> PKey conversions
...
Closes #499
2016-11-11 19:17:38 +00:00
Steven Fackler
32cbed0782
PKey <-> DH conversions
...
Closes #498
2016-11-11 19:04:54 +00:00
Steven Fackler
609a09ebb9
Add PKey::dsa
...
Closes #501
2016-11-11 18:52:37 +00:00
Steven Fackler
0d2d4865e5
Release v0.9.1
2016-11-11 16:45:22 +00:00
Steven Fackler
203a02c3e6
Actually support AES GCM
...
This is an AEAD cipher, so we need some extra functionality. As another
bonus, we no longer panic if provided an IV with a different length than
the cipher's default.
2016-11-08 20:35:21 +00:00
Steven Fackler
d78acc729b
Add an X509ReqBuilder
2016-11-07 20:42:43 +00:00
Steven Fackler
597d05b8f8
Add stack creation and push
2016-11-06 23:46:42 -08:00
Steven Fackler
5f18ffa4b3
Start of extension support
2016-11-06 21:58:43 -08:00
Steven Fackler
1939e6fd78
Add conf module
2016-11-06 14:49:26 -08:00
Steven Fackler
b83edbad0d
Start on an X509Builder
2016-11-06 14:07:34 -08:00
Steven Fackler
1edb6f682e
Support client CA advertisement
2016-11-06 12:17:14 -08:00
Steven Fackler
a4e0581e4f
Fix build on 1.0.1
2016-11-06 11:57:50 -08:00
Steven Fackler
bcb7b3f5dc
Add accessors for cert and private key
...
Closes #340
2016-11-06 10:46:38 -08:00
Steven Fackler
72ac2a0105
Release v0.9.0
2016-11-05 20:05:50 -07:00
Steven Fackler
62a9f89fce
Avoid lhash weirdness
2016-11-03 20:38:51 -07:00
Steven Fackler
7f308aa5e1
Fix signature
2016-11-02 08:26:18 -07:00
Steven Fackler
aa0040125b
Use built in DH parameters when available
...
Fall back to a hardcoded PEM blob on 1.0.1, but serialized from
DH_get_2048_256.
2016-11-01 22:50:22 -07:00
Steven Fackler
176348630a
Don't clear BigNums in destructor
...
Instead add a clear method.
2016-11-01 21:59:07 -07:00
Steven Fackler
343ce159ec
Fix stack signatures
2016-11-01 19:51:55 -07:00
Steven Fackler
c776534ad4
Clean up stack
2016-11-01 19:25:40 -07:00
Steven Fackler
77b76ed8a8
Merge pull request #506 from simias/stack
...
Implemented a generic Stack API and use it to deal with StackOf(X509) and StackOf(GENERAL_NAME)
2016-11-01 18:59:35 -07:00
Lionel Flandrin
8d0090faec
Implement X509StoreContextRef::get_chain
2016-11-01 21:23:18 +01:00
Lionel Flandrin
3bdefa987a
Implement a generic Stack API to deal with OpenSSL stacks
2016-11-01 21:23:13 +01:00
Lionel Flandrin
9ea27c12b9
Add method to encode a public key as a DER blob
2016-11-01 17:34:21 +01:00
Steven Fackler
dc4098bdd8
Clean up x509 name entries
2016-10-31 22:43:05 -07:00
Steven Fackler
cd7fa9fca2
Update x509
2016-10-31 20:54:34 -07:00
Steven Fackler
16e398e005
Update verify
2016-10-31 20:19:59 -07:00
Steven Fackler
558124b755
Expose SSL_MODEs
2016-10-30 22:02:26 -07:00
Steven Fackler
677718f8da
Configure ECDH parameters in connector
2016-10-30 13:38:09 -07:00
Steven Fackler
8c58ecc2fa
Implement EcKey
...
cc #499
2016-10-30 13:17:20 -07:00
Steven Fackler
781417d50f
Add a macro definition
2016-10-27 19:12:55 -07:00
Steven Fackler
bea53bb39b
Support AES GCM
...
Closes #326
2016-10-25 20:59:33 -07:00
Steven Fackler
39279455c8
Add a shutdown method
2016-10-25 20:40:18 -07:00
Steven Fackler
04fc853ee3
Remove NIDs only defined in 1.0.2+
2016-10-23 09:16:20 -07:00
Steven Fackler
2fd201d9c3
De-enumify Nid
2016-10-22 10:08:32 -07:00
Steven Fackler
5ab037f056
Allow the X509 verify error to be read from an SslRef
2016-10-18 22:21:06 -07:00
Steven Fackler
cfd5192a7d
De-enumify X509ValidationError
...
Also make it an Error.
Closes #352 .
2016-10-18 22:10:37 -07:00
Steven Fackler
c4459c37d9
Callback cleanup
2016-10-18 21:13:13 -07:00
Steven Fackler
6609a81685
Migrate DSA sign/verify to EVP APIs
2016-10-15 15:02:02 -07:00
Steven Fackler
228b8fbc5b
Correctly bind BIO_new_mem_buf
2016-10-15 13:39:47 -07:00
Steven Fackler
bb23b33829
Fix signature of EVP_DigestVerifyFinal on 1.0.1
2016-10-15 12:24:20 -07:00
Steven Fackler
6ae472487f
Support HMAC PKeys and remove hmac module
2016-10-15 11:06:11 -07:00
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
Steven Fackler
f6b612df5f
Release v0.7.13
2016-05-20 15:57:57 -07:00
Steven Fackler
95051b060d
Release v0.7.12
2016-05-16 23:04:03 -07:00
Steven Fackler
dce59a63c5
Merge pull request #389 from cmsd2/master
...
expose rsa from raw private key and rsa sign and verify
2016-05-06 15:12:19 -07:00
Chris Dawes
f82a1c4f75
add rsa signature tests
2016-05-05 23:41:55 +01:00
Steven Fackler
78122a9d68
Release v0.7.11
2016-05-05 13:32:27 -07:00
Steven Fackler
7b73003b67
Add X509StoreContext::error_depth
2016-04-30 09:27:50 -07:00
Steven Fackler
62a7dd10e5
Add Ssl::set_verify
...
It also uses a better, closure based API than the existing callback
methods.
2016-04-30 08:09:12 -07:00
Steven Fackler
a7bade104c
Merge pull request #381 from chaaz/master
...
Add 1DES symm ciphers (des-cbc, des-ecb, des-cfb, des-ofb)
2016-04-29 21:17:17 -07:00
Steven Fackler
32722e1850
Add accessors for x509 subject alt names
2016-04-29 21:15:32 -07:00
Steven Fackler
caf9272c85
Start on GeneralName
2016-04-28 22:16:29 -07:00
Charlie Ozinga
5682c04469
Remove des_cfb and des_ofb, since they appear on limit platforms
2016-04-19 17:28:19 -06:00
Steven Fackler
54fc1df712
Release v0.7.10
2016-04-16 20:57:12 -07:00
Steven Fackler
c2e72f6641
Add SslContext::set_default_verify_paths
2016-04-16 20:47:32 -07:00
Charlie Ozinga
2062d48dd2
Add 1DES symm ciphers (des-cbc, des-ecb, des-cfb, des-ofb)
...
1DES is well and truly dead for actual sensitive information, (its
keysize is too small for modern purposes), but it can still find use in
backwards compatiblity or educational applications.
2016-04-14 03:44:43 -06:00
Steven Fackler
9511a9bc19
Merge pull request #380 from Yoric/master
...
Resolves #378 - Module version with the version information
2016-04-13 14:45:49 -07:00
David Rajchenbach-Teller
0c48f9a0e0
Resolves #378 - Module version with the version information
2016-04-13 23:29:25 +02:00
Rico Huijbers
00282de2a5
Add ability to set session ID context on an SSL context
...
This is necessary to make authentication with client certificates work
without session restarts.
2016-04-13 21:38:23 +02:00
Steven Fackler
d143203f88
Release v0.7.9
2016-04-06 21:34:20 -07:00
Kevin King
4016edd4de
add EVP_PKEY_copy_parameters to FFI
...
copy EVP_PKEY params in PKey::clone
test that PKey::clone creates a copy
2016-04-06 19:39:50 -04:00
Steven Fackler
e0412850ec
Release v0.7.8
2016-03-18 08:54:12 -07:00
Steven Fackler
a569df29f4
Release v0.7.7
2016-03-17 09:04:23 -07:00
Steven Fackler
23fd427900
Merge pull request #353 from bluejekyll/master
...
adding functionality to directly get and set RSA public key material
2016-03-05 13:57:53 -08:00
Erik Johnston
04cbf049c0
Add SSL_get_version
2016-02-29 20:14:48 +00:00
Benjamin Fry
ef95223d26
adding functionality to directly get and set RSA key material
2016-02-17 23:18:42 -08:00
Erik Johnston
1e9667ea89
Add support for SSL_CIPHER
2016-02-17 22:38:32 +00:00
Steven Fackler
3df4c479c9
Release v0.7.6
2016-02-10 09:36:00 -08:00
Steven Fackler
18e7e2455c
Merge pull request #330 from esclear/master
...
Add a interface to RSA structs
2016-01-22 19:07:38 -08:00
Steven Fackler
2ece5b1039
Release v0.7.5
2016-01-22 15:57:21 -08:00
Jimmy Cuadra
d30d1aa277
Remove raw_pointer_derive lint.
2016-01-22 04:45:52 -08:00
Daniel Albert
74db7db560
Merge branch 'master' of https://github.com/sfackler/rust-openssl
2016-01-20 19:59:41 +00:00
Daniel Albert
6ae8298f2c
Make all ffi structs' fields public
2016-01-12 17:46:35 +00:00
Cyberunner23
c0b9a4c8ec
Added tests for private_rsa_key_from_pem() and public_rsa_key_from_pem()
2016-01-09 14:36:01 -05:00
Cyberunner23
be23ff3dce
Added PEM_read_bio_RSAPrivateKey and PEM_read_bio_RSA_PUBKEY
2016-01-05 11:23:14 -05:00
Daniel Albert
5813ca371d
Add RSA structs
2016-01-01 19:33:49 +00:00
Steven Fackler
926c8167be
Release v0.7.4
2015-12-18 22:41:46 -08:00
Steven Fackler
5fa46d428d
Release v0.7.3
2015-12-17 21:25:48 -08:00
Steven Fackler
13f7cfd9d8
Release v0.7.2
2015-12-15 19:41:57 -08:00
Steven Fackler
167008d247
Merge pull request #320 from uasi/add-variations-of-pbkdf2
...
Add PBKDF2-HMAC-SHA256 and -SHA512 functions
2015-12-15 19:30:57 -08:00
Steven Fackler
514c5ec415
Merge pull request #309 from Geal/master
...
Add support for Server Name indication (SNI) on the server's side
2015-12-15 19:22:39 -08:00
Tomoki Aonuma
b6647cc610
Put pbkdf2_hmac_{256,512}() behind feature gate
...
PKCS5_PBKDF2_HMAC is not available with openssl-0.9.8 on os x
2015-12-10 23:00:49 +09:00
Tomoki Aonuma
e9b8627af2
Add PBKDF2-HMAC-SHA256 and -SHA512 functions
2015-12-10 20:29:52 +09:00
Steven Fackler
91f8c542f7
Replace SslStream implementation!
2015-12-09 23:30:29 -08:00
Steven Fackler
9ee6f1c578
IT LIVES
2015-12-09 21:43:02 -08:00
Steven Fackler
4d883d488e
Custom BIO infrastructure
2015-12-08 23:02:38 -08:00
Steven Fackler
f79fd8cea9
Add BIO type definitions
2015-12-07 23:28:28 -08:00
Steven Fackler
fce7cf4d36
Release v0.7.1
2015-11-28 16:14:58 -08:00
Geoffroy Couprie
7835ea1c90
Make shims for SSL_CTX_ctrl and SSL_CTX_callback_ctrl macro wrappers
2015-11-25 08:10:36 +01:00
Geoffroy Couprie
dba3a0ced2
implement get/set ssl context
2015-11-24 17:11:00 +01:00
Geoffroy Couprie
cb4263f91e
test SNI support
2015-11-24 17:11:00 +01:00
Overmind JIANG
3c6c4a7b3d
Fix a leak when using `EVP_PKEY_get1_RSA`.
...
`EVP_PKEY_get1_RSA` returns a RSA structure with its reference count
increased by 1 and therefore we need to call `RSA_free` after finishing
using that value.
2015-11-18 11:36:34 +08:00
Steven Fackler
82547f53d7
Release v0.7.0
2015-11-16 21:10:50 -08:00
Steven Fackler
f36f610d07
Move HMAC_CTX_copy to sys-extras
2015-11-16 20:16:01 -08:00
Steven Fackler
a8a10e64ad
Split stuff requiring a shim out to a separate crate
2015-11-16 20:16:01 -08:00
Thom May
11e3b1b563
Provide public_decrypt, private_encrypt for PKEY
2015-10-28 18:15:55 +00:00
Jamie Turner
c37767df8f
Nonblocking streams support.
2015-10-20 23:14:26 -07:00
Jimmy Cuadra
214c3a60f0
Expose RSA_generate_key_ex.
2015-10-15 08:54:46 -07:00
Steven Fackler
f318a2c84c
Release v0.6.7
2015-10-14 22:25:35 -04:00
Lars Bergstrom
d341a6efeb
Update OpenSSL version checks to 1.0 numbers instead of 0.10 numbers
2015-10-14 19:39:40 -05:00
Steven Fackler
8f5b67fed4
Merge pull request #286 from jedisct1/use_certificate_chain
...
Add set_certificate_chain_file()
2015-10-13 09:26:18 -04:00
Steven Fackler
81bc1edb61
Merge pull request #284 from bheart/cfb-mode
...
AES CFB-mode feature
2015-10-12 21:18:27 -04:00
radare
3ca5ecac74
Add certs.pem in cert probe list
...
It turns out that some distributions use /etc/ssl/certs.pem, which was causing some troubles.
Related issue https://github.com/rust-lang/cargo/issues/1978#issuecomment-147515236
2015-10-12 23:20:33 +02:00
Frank Denis
a28253ee7d
Add set_certificate_chain_file()
...
SSL_CTX_use_certificate_chain_file() is preferred over
SSL_CTX_use_certificate_file().
It allows the use of complete certificate chains instead of loading
only the first certificate in a PEM file.
2015-10-12 20:54:00 +02:00
Will Tange
acbcb49414
AES CFB{1,8,128} mode support
2015-10-11 20:09:36 +02:00
Steven Fackler
60ee731408
Merge pull request #277 from nixpulvis/read_public_pem
...
Add public key PEM read function.
2015-10-10 21:55:37 -04:00
Steven Fackler
677ed6ad1b
Release v0.6.6
2015-10-05 22:34:32 +01:00
Steven Fackler
0ca71a98ff
Clean up init stuff
2015-10-05 22:05:58 +01:00
Manish Goregaokar
6c810e7f9c
Set threadid_func on linux/osx ( fixes #281 )
2015-10-05 21:43:49 +05:30
Nathan Lilienthal
ffa9d330fd
Add public key PEM read function.
2015-10-01 20:33:12 -04:00
Frank Denis
28320a65a7
Add SSL::set_ecdh_auto()
...
This sets automatic curve selection and enables ECDH support.
Requires LibreSSL or OpenSSL >= 1.0.2, so behind a feature gate.
2015-09-25 13:15:37 +02:00
Steven Fackler
b1b76f7913
Merge pull request #266 from jmesmon/alpn
...
ssl/npn+alpn: adjust protocol selection to fail if no protocols match
2015-09-16 11:51:45 -07:00
Frank Denis
6666a1818a
Add DH::from_pem() to load DH parameters from a file
2015-09-13 12:44:50 +02:00
Cody P Schafer
50c5042c70
ssl/npn+alpn: adjust protocol selection to fail if no protocols match
...
The current behavior causes a server written using rust-openssl to (if
it cannot negotiate a protocol) fallback to the first protocol it has
avaliable.
This makes it impossible to detect protocol mismatches.
This updates our selection to be more similar to how openssl's
s_server behaves: non-matching protocols are not supplied with a
fallback.
Note that some setups may actually want a fallback protocol supplied
via ALPN. To support those cases, we should consider adding a generic
callback that allows protocol selection to be entirely controlled by
the programmer.
For the purposes of having a sane default, however, not supplying a
default (and mimicing s_server's behavior) is the best choice.
2015-09-01 17:14:04 -04:00
Steven Fackler
e28b73e1f6
Merge pull request #259 from jedisct1/dh
...
Add support for DHE for forward secrecy
2015-09-01 00:10:03 -04:00
Steven Fackler
7b0b70bd13
Release v0.6.5
2015-08-31 19:10:27 -07:00
Frank Denis
9add4e1001
Add support for set_tmp_dh() and RFC5114 DH parameters for forward secrecy.
...
rust-openssl didn't support forward secrecy at all.
This adds support for DHE, by exposing set_tmp_dh() as well as the RFC5114
parameters, which are conveniently exposed since OpenSSL 1.0.2.
With OpenSSL >= 1.0.2, and the rfc5114 feature gate, enabling DHE is as simple
as (here for 2048-bit MODP group with 256-bit prime order subgroup):
use openssl::dh::DH;
let dh = DH::get_2048_256().unwrap();
ctx.set_tmp_dh(dh).unwrap();
With OpenSSL < 1.0.2, DH::from_params() can be used to manually specify the
DH parameters (here for 2048-bit MODP group with 256-bit prime order subgroup):
use openssl::bn::BigNum;
use openssl::dh::DH;
let p = BigNum::from_hex_str("87A8E61DB4B6663CFFBBD19C651959998CEEF608660DD0F25D2CEED4435E3B00E00DF8F1D61957D4FAF7DF4561B2AA3016C3D91134096FAA3BF4296D830E9A7C209E0C6497517ABD5A8A9D306BCF67ED91F9E6725B4758C022E0B1EF4275BF7B6C5BFC11D45F9088B941F54EB1E59BB8BC39A0BF12307F5C4FDB70C581B23F76B63ACAE1CAA6B7902D52526735488A0EF13C6D9A51BFA4AB3AD8347796524D8EF6A167B5A41825D967E144E5140564251CCACB83E6B486F6B3CA3F7971506026C0B857F689962856DED4010ABD0BE621C3A3960A54E710C375F26375D7014103A4B54330C198AF126116D2276E11715F693877FAD7EF09CADB094AE91E1A1597").unwrap();
let g = BigNum::from_hex_str("3FB32C9B73134D0B2E77506660EDBD484CA7B18F21EF205407F4793A1A0BA12510DBC15077BE463FFF4FED4AAC0BB555BE3A6C1B0C6B47B1BC3773BF7E8C6F62901228F8C28CBB18A55AE31341000A650196F931C77A57F2DDF463E5E9EC144B777DE62AAAB8A8628AC376D282D6ED3864E67982428EBC831D14348F6F2F9193B5045AF2767164E1DFC967C1FB3F2E55A4BD1BFFE83B9C80D052B985D182EA0ADB2A3B7313D3FE14C8484B1E052588B9B7D2BBD2DF016199ECD06E1557CD0915B3353BBB64E0EC377FD028370DF92B52C7891428CDC67EB6184B523D1DB246C32F63078490F00EF8D647D148D47954515E2327CFEF98C582664B4C0F6CC41659").unwrap();
let q = BigNum::from_hex_str("8CF83642A709A097B447997640129DA299B1A47D1EB3750BA308B0FE64F5FBD3").unwrap();
let dh = DH::from_params(p, g, q).unwrap();
ctx.set_tmp_dh(dh).unwrap();
2015-08-31 23:12:57 +02:00
Steven Fackler
dc8cba4822
Merge pull request #251 from ebarnard/evp_bytestokey
...
Expose EVP_BytesToKey
2015-08-23 13:37:55 -04:00
Edward Barnard
8067565707
Expose EVP_BytesToKey
...
This is based on work by pyrho.
Closes #88
2015-08-23 17:08:18 +07:00
Steven Fackler
4cb68efd99
Merge pull request #253 from manuels/master
...
Add get_state_string()
2015-08-19 02:31:15 -04:00
Manuel Schölling
3fe3d57976
Add get_state_string()
2015-08-17 19:01:43 +02:00
Steven Fackler
769b8312d8
Merge pull request #240 from jethrogb/topic/x509_req_extension
...
Implement certificate extensions for certificate requests
2015-08-15 16:04:42 -04:00
Steven Fackler
a10604e15d
Merge pull request #243 from manuels/master
...
Fix probelms with DTLS when no packets are pending.
2015-08-02 22:27:19 -04:00
Steven Fackler
02dc3eda2f
Merge pull request #242 from awelkie/master
...
Added AES CTR-mode under feature flag.
2015-08-02 22:25:09 -04:00
Andrew Dunham
ab7bfad225
Add function to write RSA public key as PEM
2015-07-23 22:30:07 -07:00
Manuel Schölling
a43011d77c
Fix probelms with DTLS when no packets are pending.
...
When using DTLS you might run into the situation where no packets
are pending, so SSL_read returns len=0. On a TLS connection this
means that the connection was closed, but on DTLS it does not
(a DTLS connection cannot be closed in the usual sense).
This commit fixes a bug introduced by c8d23f3 .
Conflicts:
openssl/src/ssl/mod.rs
2015-07-18 13:00:34 +02:00
Allen Welkie
b478c29151
Added AES CTR-mode under feature flag.
2015-07-15 20:45:18 -04:00
Jethro Beekman
90dd54b541
Implement certificate extensions for certificate requests
2015-07-08 13:37:35 -07:00
Steven Fackler
0cb4368ef8
Merge pull request #221 from jethrogb/topic/ssl_options
...
Several SSL option fixes
2015-07-08 10:20:33 -07:00
Steven Fackler
3229296105
Merge pull request #233 from jethrogb/topic/x509_extension
...
Allow setting of arbitrary X509 extensions
2015-07-08 03:10:40 -04:00
Steven Fackler
cc497b4768
Release v0.6.4
2015-07-06 11:09:03 -07:00
Jethro Beekman
aeefa364b7
Decouple C SSL Option bit flags from Rust version
...
The OpenSSL "SSL_OP_*" flags are in constant flux between different OpenSSL
versions. To avoid having to change the Rust definitions, we implement our
own numbering system in Rust, and use an automatically-generated C shim to
convert the bitflags at runtime.
2015-07-01 21:49:11 -07:00
Jethro Beekman
b46574b635
Add arbitrary X509 extensions by OID string
2015-07-01 00:18:45 -07:00
Cody P Schafer
01e01e3747
ssl: support ALPN
...
Heavily based on the existing NPN wrapping code. Naming of public
functions is identical to the NPN ones with `s/npn/alpn/` applied to
prevent devs from needing to remember 2 names (and to let my copy the
npn tests and perform the subistution to generate the apln tests).
It might make sense to (at some point) use macros or a trait to cut down
the duplication.
2015-06-29 10:58:45 -04:00
Steven Fackler
0cff370f1d
Reduce SslStream constructor duplication
2015-06-27 21:40:00 -07:00
Steven Fackler
9d0acfe615
Fix set_hostname
...
It was previously failing to null terminate the hostname string (was
anyone actually using this?). Also move the macro expansion to the C
shim.
2015-06-27 19:37:45 -07:00
Steven Fackler
cb7248d8cb
Import shim'd HMAC stuff with the original name
2015-06-27 15:23:19 -07:00
Steven Fackler
d0b769c93c
Move macro replicas into C shim
2015-06-27 15:11:11 -07:00
Steven Fackler
524c1e63aa
Release v0.6.3
2015-06-25 23:22:04 -07:00
Steven Fackler
c8d23f37a4
Fix EOF handling in retry wrapper
2015-06-25 22:47:53 -07:00
Jethro Beekman
c1232f3035
Implement limited X509_REQ functionality
2015-05-28 00:22:14 -07:00
Steven Fackler
d723481f77
Fix doc root
2015-05-13 16:31:27 -07:00
Steven Fackler
8a9aa0c657
Merge pull request #210 from manuels/pending
...
Add SslStream.pending()
2015-05-05 22:57:14 -04:00
Steven Fackler
fb2822d5c7
Merge pull request #201 from manuels/pkey_cmp
...
Add comparison for PKeys
2015-05-04 10:19:13 -07:00
Manuel Schölling
c8fae312ad
Add SslStream.pending()
2015-04-30 20:00:30 +02:00
Richard Diamond
c55d410829
Fixes for Native Client.
2015-04-18 23:03:11 -05:00
Manuel Schölling
123d400277
Add comparison for PKeys
2015-04-16 17:14:21 +02:00
Manuel Schölling
7db00b97ba
Add X509::public_key()
2015-04-15 22:59:07 +02:00
Manuel Schölling
912cacf4bc
Fix rebase errors
2015-04-06 12:26:10 +02:00
Manuel Schölling
dbef985e32
Move connected_socket to its own crate and fix SSL_CTX_set_read_ahead()
2015-04-06 12:23:11 +02:00
Manuel Schölling
664600eadf
Add DTLSv1 and DTLSv1.2 support
2015-04-06 12:22:50 +02:00
Manuel Schölling
5408b641dd
Add connect() support for UDP sockets
2015-04-06 12:14:36 +02:00
Manuel Schölling
b6c5c113f5
Add SslContext::add_extra_chain_cert()
2015-04-03 14:34:24 +02:00
Manuel Schölling
632d8398cf
Add ability to load private keys from files and use raw keys and certificates for SslContext
2015-04-03 14:34:24 +02:00
Manuel Schölling
b42202b858
Change SslVerifyMode to bitflags and add SSL_VERIFY_FAIL_IF_NO_PEER_CERT
...
SslVerifyMode was changed to bitflags to allow for bitwise operations
like (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT).
2015-04-03 14:34:24 +02:00
Alex Crichton
293f1ce5b1
Fixup for beta
...
Add derive(Clone) and don't negate unsigned numbers
2015-04-02 18:14:51 -07:00
Sean McArthur
24b876521b
rustup: changes to io::Error
2015-04-02 11:12:18 -07:00
Alex Crichton
5a80cc8aae
Update to rust master
2015-03-25 10:51:28 -07:00
Marko Lalic
f09cfdfdd5
openssl-sys: Add TLS extension constants
2015-03-23 08:14:47 +01:00
Marko Lalic
b96bbf6961
openssl-sys: Add NPN functions and constants
2015-03-23 08:14:47 +01:00
Alex Crichton
2560ccb330
Remove usage of unstable features in openssl-sys
2015-03-16 11:05:29 -07:00
Steven Fackler
a65b03c89e
Fix warnings
2015-03-10 19:38:44 -07:00
Steven Fackler
8b8736fb46
Merge pull request #172 from reaperhulk/add-ssl-ctx-set-get-options
...
add support for SSL_CTX_set_options and SSL_CTX_get_options
2015-03-07 08:43:30 -08:00
Alex Crichton
1c9b8a029b
Cut down on unstable features in openssl-sys
...
* Move from `old_path` to `path` (leveraging the `fs` feature as well)
* Move from `StaticMutex` to `Mutex<()>` as they're dynamically initialized
2015-03-04 14:14:05 -08:00
Steven Fackler
1b4a2eef0e
Switch to cargo liblibc
2015-02-24 21:47:30 -08:00
Paul Kehrer
8940bd767b
add support for SSL_CTX_clear_options and use bitflags
2015-02-23 19:39:23 -06:00
Paul Kehrer
06ba41ad47
add support for SSL_CTX_set_options and SSL_CTX_get_options
...
fixes #168
2015-02-22 15:45:00 -06:00
Steven Fackler
6bfc4d986b
Fix warnings
2015-02-19 09:13:22 -08:00
Alex Crichton
bb2fe87d03
Fix debuginfo ICE for now
2015-02-19 07:39:40 -08:00
Steven Fackler
2fa1571e2e
Remove deprecated functions from openssl-sys
2015-02-13 23:31:00 -08:00
Steven Fackler
15ff737b8c
Ask openssl what version it is
2015-02-13 21:39:41 -08:00
Robin Gloster
fabc1da31e
rustup to current master
2015-02-12 18:25:45 +01:00
Steven Fackler
6ef819f971
Fix builds against 0.9.x OpenSSL
...
Namely builds on OSX
2015-02-08 23:31:46 -08:00
Steven Fackler
ec65b0c67b
Move docs to this repo and auto build
2015-02-07 21:30:05 -08:00
Steven Fackler
d06f226b3f
Fix deprecation warnings in openssl-sys
2015-02-05 21:04:18 -08:00
Steven Fackler
361e5f44fa
Move openssl-sys build.rs
2015-02-03 10:04:37 -08:00
Steven Fackler
2864db42af
Merge pull request #153 from mbrubeck/android
...
Don't bail out of openssl-sys build config when targeting Android
2015-02-03 13:03:53 -05:00
Matt Brubeck
96a3ac2644
Don't bail out when targeting Android
2015-02-03 09:23:15 -08:00
Gleb Kozyrev
2bcd67f568
Declare the use of unstable libstd APIs
2015-02-01 14:56:07 +02:00
Gleb Kozyrev
eb7b7bf847
Change Hasher and HMAC APIs closer to std::hash model
...
- Implement Clone and std::io::Writer.
- Reduce the API to write() and finish(). Contrary to std::hash, finish() resets the hasher immediately.
- Add hmac::hmac() convenience fn.
- Replace hash::evpmd() with HashType methods.
- Add assertions as a crude check for failed calls into openssl.
- Add examples and some tests.
[breaking-change]
2015-01-28 21:51:12 +02:00
Steven Fackler
030cf5fe88
Fix for IO changes
2015-01-28 08:47:16 -08:00
Gleb Kozyrev
cb0898df37
Bring ffi definitions closer to the originals
...
Add missing return types and fix imprecise type translations.
Repair the fallout in the openssl crate.
2015-01-21 21:56:56 +02:00
Akos Kiss
c49816055a
Fix ffi: `BN_hex2bn` and `BN_dec2bn` shall take `*const c_char` as parameter
...
`c_char` is not `i8` on all platforms
2015-01-12 20:44:59 +00:00
Alex Crichton
9dfeea6ca9
Update to rust master
2015-01-09 08:12:39 -08:00
Chris Cole
fde7fbd03b
Merge remote-tracking branch 'upstream/master'
2015-01-03 19:31:14 -05:00
Steven Fackler
2f24d8e771
Fix deprecation warnings
2015-01-03 08:31:57 -08:00
Chris Cole
2e2fde4b1a
Added BN_add_word, BN_sub_word, BN_mul_word, BN_div_word.
...
Removed BIGNUM_PTR struct.
2015-01-02 18:47:29 -05:00
Chris Cole
077846fdb1
Merge remote-tracking branch 'upstream/master'
2015-01-02 15:43:02 -05:00
Steven Fackler
ef8b8f7ead
Merge pull request #134 from DiamondLovesYou/master
...
OpenSSL-sys: Cfg off target_os instead off feature.
2015-01-02 11:13:11 -05:00
Valerii Hiora
afffffc730
Array syntax fallout
2015-01-02 13:51:26 +02:00
Richard Diamond
8a7e7b67d8
OpenSSL-sys: Cfg off target_os instead off feature.
...
It seems cargo doesn't provide --cfg entries for dep crates after all.
2015-01-02 03:37:35 -06:00
Samuel Fredrickson
dfdd4c0e4f
Change to use updated Mutex API in latest Rust master.
2014-12-30 16:39:49 -08:00
Chris Cole
fa32bc950b
Added Copy impl.
2014-12-23 15:50:29 -05:00
Chris Cole
156fc65eb0
Merge remote-tracking branch 'upstream/master'
...
Conflicts:
openssl-sys/src/lib.rs
2014-12-23 15:14:27 -05:00
Aaron Weiss
e2fa62e2ae
Replaced now removed NativeMutex with StaticMutex, and fixed Neg
...
implementation for BigNum.
2014-12-21 08:52:12 -05:00
Chris Cole
38682821ad
Added BigNum::{from_dec_str,from_hex_str}, BN_dec2bn, and BN_hex2bn.
2014-12-14 10:02:18 -05:00
Glenn Watson
4d49abd102
Use static linking on android, which simplifies deployment since loading application specific shared libraries on android requires Java code or other hacks.
2014-12-12 08:05:42 +10:00
Steven Fackler
c1e225563d
Clean up Copy impls a bit
2014-12-11 09:04:27 -08:00
Valerii Hiora
c922090075
Update to nightly: explicit Copy trait
2014-12-11 13:44:37 +02:00
Chris Cole
fb1c815274
Merge remote-tracking branch 'upstream/master'
2014-12-10 22:09:20 -05:00
Chris Cole
33f3c966ac
Added mod_word.
2014-12-10 22:08:32 -05:00
Ummon
6d2f8d67f2
Add the openssl function prototype 'HMAC_CTX_cleanup'.
2014-12-10 22:25:32 +01:00
Steven Fackler
6d6ef3e747
Merge pull request #113 from DiamondLovesYou/nacl-crosses
...
Now that pkg-config 0.1.1 has been published, delegate bailout detection to pkg-config.
2014-12-10 00:23:10 -05:00
Richard Diamond
10e8a8f8e3
Now that pkg-config 0.1.1 has been published, delegate to bailout detection to pkg-config.
...
Also bump version minors for publishing. :)
2014-12-09 23:15:04 -06:00
Steven Fackler
43c9a43e2d
Merge pull request #108 from DiamondLovesYou/nacl-crosses
...
Use locally built libreSSL if targeting NaCl instead of the host's versions.
2014-12-09 02:13:09 -05:00
Richard Diamond
0dff5268de
Add a feature to openssl-sys to cause it to build a local copy of libressl for
...
use instead of whatever pkg-config says (which in the case of crosses, is almost
certainly incorrect). This is for PNaCl.
2014-12-09 00:04:06 -06:00
Manish Goregaokar
31d188e313
Directly substitute $OPENSSL_PATH
2014-12-05 06:43:18 -08:00
Manish Goregaokar
82db54c822
Allow passing in Android paths
2014-12-03 12:49:53 -08:00
Steven Fackler
08d1f2e629
Drop execute bit on file
2014-11-28 14:04:33 -08:00
Gleb Kozyrev
5fafe4fc60
Hasher: static contract checking, context reuse
...
- Store EVP_MD_CTX in a separate struct.
- Add with_context() constructor that uses an existing context.
- Switch to EVP_Digest(Init|Final)_ex for efficient context reuse.
- Make update() borrow &mut self.
- Make finalize() consume self. Add finalize_reuse() that also returns the
context which can be passed to from_context() constructor for reuse.
These changes let the type system prevent illegal calls to update() and
finalize().
2014-11-26 21:38:06 +02:00
Andor Uhlár
762331eb2b
Sync is now part of the standard library
2014-11-26 16:04:10 +01:00
Cody P Schafer
c6696eb029
sys: add SSL_get_peer_certificate()
2014-11-24 15:40:48 -05:00
Cody P Schafer
9951cb2bda
sys: add some methods for dealing with x509 certs
2014-11-24 15:38:25 -05:00
Cody P Schafer
381a9b6e51
sys (and bn): make CRYPTO_free() take a *mut c_void insead of a *const c_char
...
CRYPTO_free() ends up being used for a variety of types of data, not just
c_char. And it essentially takes full ownership of the type, making
*mut appropriate.
With this change it also more closely (exactly) matches the C defintion:
void CRYPTO_free(void *ptr);
2014-11-24 15:38:04 -05:00
Valerii Hiora
0cc749d3fc
Runtime fallout
2014-11-21 11:57:48 +02:00
Cody P Schafer
b9e3ed50ad
Baseline server support
...
Allows calling SSL_accept() instead of SSL_connect() when creating an
SslStream.
2014-11-19 15:23:31 -05:00
Steven Fackler
5258ce6ece
Move AES XTS support to a feature
2014-11-16 14:01:24 -08:00
Corey Ford
287d402042
Add XTS-AES mode
2014-11-14 12:22:34 -08:00
Valerii Hiora
b60d140d3d
New build system
2014-11-13 15:17:00 +02:00