Commit Graph

810 Commits

Author SHA1 Message Date
Philipp Keck 1767cd5464 Pointer from PKey docs to sign module.
Could even add a link, but I don't know how.

Someone who wants to use OpenSSL to compute an HMAC won't find a "hmac" module and won't find HMACs in the "hash" module. Unless the person knows that HMACs are used to "sign" messages (the usual term in this context would be "authenticate"), they will probably use the search function and look for "hmac", then they'll find this method. So it's helpful to include a pointer to the right API to use. Without such a pointer, the API user is left with a seemingly useless Pkey instance.

Similar pointers could be helpful from the other creator methods in this file. And/or from the top-level documentation or the hash documentation towards the sign module. Another idea would be a trivial `hmac` module with a few helper functions that internally just use Pkey. If many users who just want a simple HMAC value can use that API, there are fewer dependencies on `Pkey` and `sign`, which is probably a good thing.
2017-01-03 14:48:46 +01:00
Steven Fackler cfb2539ed4 Typo 2017-01-02 09:37:31 -08:00
Steven Fackler 0483ea767c Little cleanup 2017-01-01 11:05:54 -08:00
Steven Fackler 0e0bee50a5 Clean up bio 2017-01-01 10:18:43 -08:00
Steven Fackler 7e75c76bb4 Stick tag description on the right function 2017-01-01 10:13:34 -08:00
Steven Fackler cdabc1b3e3 Fix docs 2017-01-01 10:07:32 -08:00
Steven Fackler 85a6e8acca Fix doc reference 2017-01-01 09:53:08 -08:00
Benjamin Fry 444c00955a add EcKey creation from EcPoint, public_key 2016-12-31 10:40:56 -08:00
Steven Fackler 5c49b58a88 Indicate that memcmp::eq should be used for HMACs 2016-12-31 09:44:57 -08:00
Steven Fackler 762510a5fa Release v0.9.4 2016-12-23 13:38:52 -05:00
Steven Fackler 7e035a7fd1 Merge pull request #538 from semarie/libressl
Add LibreSSL support
2016-12-22 11:59:19 -05:00
Sébastien Marie a70e27ae64 Add Travis build against LibreSSL 2016-12-21 09:27:21 +01:00
Sébastien Marie b3526cbd2b Add LibreSSL 2.5.0 support 2016-12-21 09:27:12 +01:00
Alex Crichton 8e01f8d250 Handle zero-length reads/writes
This commit adds some short-circuits for zero-length reads/writes to
`SslStream`. Because OpenSSL returns 0 on error, then we could mistakenly
confuse a 0-length success as an actual error, so we avoid writing or reading 0
bytes by returning quickly with a success.
2016-12-20 15:52:18 -08:00
Steven Fackler 791f2c8f4d Release v0.9.3 2016-12-09 21:54:06 -08:00
Steven Fackler 26cefe7d97 Switch to docs.rs for docs 2016-12-09 21:52:43 -08:00
Steven Fackler 152d788998 Fix ErrorStack display 2016-12-09 21:32:41 -08:00
0xa 5340895249 Add Blowfish tests 2016-12-09 21:31:26 +00:00
0xa 0850f605b1 Use EVP_bf_cfb64 instead of EVP_bf_cfb 2016-12-09 18:42:10 +00:00
0xa 0081665339 Add Blowfish support 2016-12-09 17:06:15 +00:00
Steven Fackler 0602712bf4 Release v0.9.2 2016-11-27 22:23:32 -08:00
Steven Fackler 146512099b Implement Clone for SslConnector and SslAcceptor 2016-11-27 21:35:35 -08:00
Steven Fackler 234f126d7d Cleanup 2016-11-27 21:00:59 -08:00
Steven Fackler 8b60d4a3c2 Return Option from group 2016-11-16 15:45:15 -08:00
Steven Fackler e58dda8990 Remove EcGroup constructors
You also need a generator and possibly other stuff. Let's hold off on
construction until someone has a concrete requirement for them.
2016-11-16 13:53:03 +01:00
Steven Fackler 7515510125 Test elliptic curve signatures 2016-11-15 22:06:20 +01:00
Steven Fackler ec0fa36714 Add a test for mul_generator 2016-11-15 21:24:34 +01:00
Steven Fackler b914f779e8 Turns out yet another variant of EC_POINT_mul is allowed! 2016-11-15 21:20:06 +01:00
Steven Fackler 6794a45d60 Rename ec_key to ec 2016-11-14 22:37:01 +01:00
Steven Fackler 90acfaea51 Split EcKey::mul 2016-11-14 22:08:04 +01:00
Steven Fackler e929e09216 Add EcPoint::invert 2016-11-14 22:02:47 +01:00
Steven Fackler 4c60aa005d Fix non-static EcGroup method locations 2016-11-14 19:20:08 +01:00
Steven Fackler 82eb3c4f51 Add EcKey::check_key 2016-11-13 22:10:52 +00:00
Steven Fackler 35f11d555e More functionality 2016-11-13 22:06:18 +00:00
Steven Fackler 1a52649516 More functionality 2016-11-13 20:46:01 +00:00
Steven Fackler 3d31539ba9 Public keys are not always present 2016-11-13 20:31:44 +00:00
Steven Fackler 0d0b5080e2 Rename new_by_curve_name to from_curve_name 2016-11-13 20:21:44 +00:00
Steven Fackler b2de36049a Add Some more elliptic curve functionality 2016-11-13 20:19:38 +00:00
Steven Fackler 7dbef567e6 Remove some stray manual impls 2016-11-13 18:00:42 +00:00
Steven Fackler ccef9e339d Macroise from_pem 2016-11-13 17:56:48 +00:00
Steven Fackler df9666c334 Macroise to_pem 2016-11-13 17:42:45 +00:00
Steven Fackler 48c0009418 Macroise from_der 2016-11-13 17:06:50 +00:00
Steven Fackler b0415f466c Macroise to_der 2016-11-13 16:52:19 +00:00
Steven Fackler ed9f600e28 Make password callback return a Result 2016-11-13 16:18:52 +00:00
Steven Fackler 387e78257b Support serialization of encrypted private keys
Switch to PEM_write_bio_PKCS8PrivateKey since the other function outputs
nonstandard PEM when encrypting.
2016-11-13 16:09:52 +00:00
Steven Fackler 7d411c7975 Add private_key_from_pem_passphrase 2016-11-13 15:27:39 +00:00
Steven Fackler 2a8923c050 Macro-implement private_key_to_pem 2016-11-13 15:12:50 +00:00
Steven Fackler 08e0c4ca90 Some serialization support for EcKey 2016-11-13 15:02:38 +00:00
Steven Fackler 85c1474ce6 No need to use a raw string anymore 2016-11-13 12:19:31 +00:00
Steven Fackler 64e9932ac9 Use ffdhe2048 in mozilla_intermediate 2016-11-12 17:52:58 +00:00
Steven Fackler 2f8301fc63 Be a bit more emphatic about the danger 2016-11-12 16:51:26 +00:00
Steven Fackler 6b3599d319 Add a connect method that does not perform hostname verification
The method name is intentionally painful to type to discourage its use
2016-11-12 16:45:18 +00:00
Steven Fackler 7cdb58bc47 Simplify test logic a bit 2016-11-12 14:42:48 +00:00
Steven Fackler 157034d995 Add a missing init 2016-11-12 14:30:53 +00:00
Steven Fackler 796d7b4deb Add constructors for various standard primes 2016-11-12 14:20:43 +00:00
Steven Fackler 96d24c8957 Add SslRef::set_{tmp_dh,tmp_ecdh,ecdh_auto} 2016-11-12 13:45:54 +00:00
Steven Fackler 2a1d7b2bcb Pick different cipher lists on 1.0.1 and 1.0.2 2016-11-12 13:36:03 +00:00
Steven Fackler 93253ba599 Adjust cipher lists to work on older versions 2016-11-12 13:09:12 +00:00
Steven Fackler 780c46e0e7 Add SslRef::set_tmp_{ec,}dh_calback 2016-11-12 12:56:58 +00:00
Steven Fackler 563754fb08 Add SslContextBuilder::set_tmp_{ec,}dh_callback 2016-11-12 12:43:44 +00:00
Steven Fackler b14d68f715 Drop bits to u32 2016-11-12 11:14:05 +00:00
Steven Fackler 9b5c62b053 Add PKey::bits 2016-11-12 11:00:15 +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 898e7f02df Fix EOF detection
See https://github.com/openssl/openssl/issues/1903 for details
2016-11-11 15:10:30 +00:00
Steven Fackler a42c6e8713 Drop rustc-serialize dependency 2016-11-09 20:35:23 +00:00
Steven Fackler 7c8ae5f664 Better docs for AEAD tag 2016-11-09 18:54:29 +00:00
Steven Fackler aa7c27536a Make sure to override SslContext verify callback always
The 1.0.1 code has to override this to setup hostname validation, and
don't want behavior to silently change depending on the OpenSSL version
you're building against.
2016-11-08 22:38:48 +00:00
Steven Fackler 913723997b Add convenience functions for AEAD encryption/decryption 2016-11-08 22:35:16 +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 b3b7194e82 Docs 2016-11-08 19:10:56 +00:00
Steven Fackler 97872500a3 Deprecate X509Generator 2016-11-07 21:48:40 +00:00
Steven Fackler c0e02e7e51 Use X509Builder in X509Generator 2016-11-07 21:15:36 +00:00
Steven Fackler 18c5d1f771 Add init calls to new constructors 2016-11-07 20:50:57 +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 8f7df7b205 Add SubjectAlternativeName 2016-11-06 23:19:58 -08:00
Steven Fackler d17c3355ab More extension progress 2016-11-06 22:52:53 -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 79e2004eef Fixes 2016-11-05 19:28:17 -07:00
Steven Fackler 8ad1e5565b Remove set_rsa
PKey is reference counted so allowing mutation is unsound
2016-11-05 18:49:09 -07:00
Steven Fackler 96a5ccfc6b Implement Pkcs12 via type_! 2016-11-05 18:46:34 -07:00
Steven Fackler 4e2ffe5b9b Re-adjust BigNum API 2016-11-05 17:35:31 -07:00
Steven Fackler 8037258913 Return a Stack in Pkcs12 2016-11-05 13:57:05 -07:00
Steven Fackler ed69d6b037 Add Stack::pop 2016-11-05 13:40:53 -07:00
Steven Fackler 52feaae59f More cleanup 2016-11-05 13:15:14 -07:00
Steven Fackler ac36d542fd Simplify destructor a bit 2016-11-05 13:10:50 -07:00
Steven Fackler 398ab2fbc4 Add a consuming iterator for Stacks 2016-11-05 13:01:54 -07:00
Steven Fackler f15c817c2d Rustfmt 2016-11-05 10:54:17 -07:00
Steven Fackler 71a114707f Remove unused dependency 2016-11-05 10:38:12 -07:00