Commit Graph

150 Commits

Author SHA1 Message Date
Gleb Kozyrev ce427edb08 Chase std API stability changes 2015-02-03 18:22:40 +02:00
Gleb Kozyrev 4546f6d7d3 Derive Debug instead of deprecated Show 2015-02-01 14:40:00 +02:00
Steven Fackler 89c3eaf483 Fix for stability changes 2015-01-29 09:05:19 -08:00
Gleb Kozyrev 4bd7ed8a39 Avoid duplicate calls to *_Final when dropping Hasher and HMAC
An assertion triggered in finalize() would lead to drop() erroneously redoing the finalization. Set the state to Finalized unconditionally to prevent this.
2015-01-29 17:50:10 +02:00
Gleb Kozyrev 71f8420205 Rename crypto:#️⃣:HashType -> Type
s/HashType/Type/ to follow the current Rust style. Import Type as HashType in modules where the name might be ambiguous.
[breaking change]
2015-01-28 21:51:12 +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
Steven Fackler 0a258a0a21 Fix for upstream changes 2015-01-23 10:21:08 -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
Steven Fackler 65c1079a54 Drop execute bits on source files 2015-01-16 22:25:01 -08:00
Steven Fackler 2f5d1e579b Add Show impls 2015-01-09 20:18:32 -08:00
Steven Fackler 5a153e9ead Fix doctest 2015-01-09 10:10:03 -08:00
Alex Crichton 9dfeea6ca9 Update to rust master 2015-01-09 08:12:39 -08:00
Valerii Hiora 2a646916d7 Handle recent breaking changes
- macro reform
- split of Show and String in formatter
- CString reform
- feature changes
2015-01-07 15:32:51 +02:00
Peter Atashian 3b19802680 Update rust
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-01-06 05:02:34 -05:00
Chris Cole 63fda80bf7 Merge remote-tracking branch 'upstream/master' 2015-01-05 23:53:23 -05:00
Steven Fackler 8d67a34d29 Fix for upstream changes 2015-01-04 08:03:51 -08:00
Chris Cole b2929a662a Added use of ToCStr trait. 2015-01-03 20:05:38 -05: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
Valerii Hiora cf028e971a Updated to master:
- library stab issues
- deriving -> derive
- {mod} -> {self}
2015-01-03 16:42:58 +02: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
Valerii Hiora afffffc730 Array syntax fallout 2015-01-02 13:51:26 +02:00
Cody P Schafer 066c54a34c ssl: use std::ptr::Unique to fix for opt-in Sync
Modifies Ssl & SslContext.

This removes the errors like:

	src/ssl/tests.rs:202:14: 202:27 error: the trait `core::kinds::Send` is not implemented for the type `*mut libc::types::common::c95::c_void`
	src/ssl/tests.rs:202     let _t = Thread::spawn(move || {
                                          ^~~~~~~~~~~~~
	src/ssl/tests.rs:202:14: 202:27 note: the type `*mut libc::types::common::c95::c_void` must implement `core::kinds::Send` because it appears within the type `ssl::Ssl`

We may want some locking around calls that do multiple operations on
the underlying Ssl and SslContext objects, but this lets us preserve
functionality for now.
2014-12-29 16:41:11 -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
Alex Crichton 7774e672a2 Update to rust master 2014-12-23 08:14:42 -08:00
Aaron Weiss e2fa62e2ae Replaced now removed NativeMutex with StaticMutex, and fixed Neg
implementation for BigNum.
2014-12-21 08:52:12 -05:00
Steven Fackler 217dad59df Print unexpected error codes
This is breaking occaisionally but I can't repro it locally :(
2014-12-19 19:56:31 -08:00
Aaron Weiss a637f2b0bf Updated for language changes to macros. 2014-12-19 10:45:19 -05:00
Alex Crichton 01a5d7cc56 Update to rust master 2014-12-16 08:14:50 -08:00
Valerii Hiora 6119d916cb Track master: proc removal, tuple indexing 2014-12-15 14:01:17 +02: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
Steven Fackler c1e225563d Clean up Copy impls a bit 2014-12-11 09:04:27 -08:00
Chris Cole 7a4fbc1567 Added BigNum::one(). 2014-12-11 11:04:29 -05:00
Valerii Hiora c922090075 Update to nightly: explicit Copy trait 2014-12-11 13:44:37 +02:00
Chris Cole f0de773888 Use "ffi" namespace. 2014-12-10 22:11:29 -05: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 6cdd2cf577 Speed up SslStream initialization a bit 2014-12-06 11:17:46 -08:00
Steven Fackler 2901c279ab Fix doc test and stop doc upload 2014-12-03 09:18:53 -08:00
Chris Cole 5f76f1cb62 Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/bn/mod.rs
2014-11-29 19:47:09 -05:00
Chris Cole ff04805497 Added mod_mul. 2014-11-29 19:40:48 -05:00
Steven Fackler c3603b0db0 Make SslStream Cloneable
Closes #6
2014-11-29 11:06:16 -08:00
Steven Fackler 72ca8433f5 Add MaybeSslStream 2014-11-28 15:43:58 -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
Steven Fackler a7a9ef7eaa Allow access to the underlying stream
The use case here is to allow methods like `set_read_timeout` to be
called.
2014-11-25 16:44:42 -08:00
Steven Fackler f71555e820 Fix deprecation warning 2014-11-24 13:09:16 -08:00