aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2013-12-28 18:39:07 -0700
committerSteven Fackler <[email protected]>2013-12-28 18:39:07 -0700
commit9b3746260cb88e36df9be16b72c1c5f39204e78e (patch)
treeaadd76325a0505e0f6bfbea87444170501703e50
parentMerge remote-tracking branches 'rustcrypto/master' and 'rust-ssl/master' (diff)
downloadrust-openssl-9b3746260cb88e36df9be16b72c1c5f39204e78e.tar.xz
rust-openssl-9b3746260cb88e36df9be16b72c1c5f39204e78e.zip
Integrate everything
-rw-r--r--.gitignore2
-rw-r--r--LICENSE15
-rw-r--r--Makefile6
-rw-r--r--crypto/hash.rs4
-rw-r--r--crypto/hmac.rs2
-rw-r--r--crypto/mod.rs (renamed from crypto/lib.rs)2
-rw-r--r--crypto/pkey.rs4
-rw-r--r--crypto/symm.rs4
-rw-r--r--lib.rs6
-rw-r--r--ssl/mod.rs (renamed from ssl/lib.rs)9
-rw-r--r--ssl/tests.rs (renamed from ssl/test.rs)6
-rw-r--r--test/cert.pem (renamed from ssl/test/cert.pem)0
-rw-r--r--test/key.pem (renamed from ssl/test/key.pem)0
13 files changed, 37 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index 9aef65b4..27a84a97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
/.rust/
/doc/
+/rust-openssl
+/rust-openssl.dSYM/
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..665f599e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,15 @@
+Copyright 2011 Google Inc.
+ 2013 Jack Lloyd
+ 2013 Steven Fackler
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/Makefile b/Makefile
index 51070f9d..789ece8a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,11 @@ RUSTC ?= rustc
RUST_FLAGS ?= -Z debug-info -O
all:
- $(RUSTPKG) $(RUST_FLAGS) install crypto
+ $(RUSTPKG) $(RUST_FLAGS) install
test:
- $(RUSTC) $(RUST_FLAGS) --test src/crypto/lib.rs
- ./src/crypto/crypto
+ $(RUSTC) $(RUST_FLAGS) --test lib.rs
+ ./rust-openssl
clean:
rm -rf bin/ lib/ build/ src/crypto/lib
diff --git a/crypto/hash.rs b/crypto/hash.rs
index bb75d0ef..9967ee1f 100644
--- a/crypto/hash.rs
+++ b/crypto/hash.rs
@@ -105,8 +105,8 @@ pub fn hash(t: HashType, data: &[u8]) -> ~[u8] {
#[cfg(test)]
mod tests {
- use hex::FromHex;
- use hex::ToHex;
+ use crypto::hex::FromHex;
+ use crypto::hex::ToHex;
struct HashTest {
input: ~[u8],
diff --git a/crypto/hmac.rs b/crypto/hmac.rs
index 5cac7f50..d7a76e08 100644
--- a/crypto/hmac.rs
+++ b/crypto/hmac.rs
@@ -17,7 +17,7 @@
use std::libc::{c_uchar, c_int, c_uint};
use std::ptr;
use std::vec;
-use hash;
+use crypto::hash;
#[allow(non_camel_case_types)]
pub struct HMAC_CTX {
diff --git a/crypto/lib.rs b/crypto/mod.rs
index f1038450..30fb08b0 100644
--- a/crypto/lib.rs
+++ b/crypto/mod.rs
@@ -15,8 +15,6 @@
* limitations under the License.
*/
-#[crate_id = "crypto#0.3"];
-
pub mod hash;
pub mod hex;
pub mod hmac;
diff --git a/crypto/pkey.rs b/crypto/pkey.rs
index b8206d4e..8a2b06c1 100644
--- a/crypto/pkey.rs
+++ b/crypto/pkey.rs
@@ -3,7 +3,7 @@ use std::libc::{c_char, c_int, c_uint};
use std::libc;
use std::ptr;
use std::vec;
-use hash::{HashType, MD5, SHA1, SHA224, SHA256, SHA384, SHA512};
+use crypto::hash::{HashType, MD5, SHA1, SHA224, SHA256, SHA384, SHA512};
#[allow(non_camel_case_types)]
pub type EVP_PKEY = *libc::c_void;
@@ -336,7 +336,7 @@ impl Drop for PKey {
#[cfg(test)]
mod tests {
- use hash::{MD5, SHA1};
+ use crypto::hash::{MD5, SHA1};
#[test]
fn test_gen_pub() {
diff --git a/crypto/symm.rs b/crypto/symm.rs
index d3c54d27..365a716a 100644
--- a/crypto/symm.rs
+++ b/crypto/symm.rs
@@ -194,7 +194,7 @@ pub fn decrypt(t: Type, key: &[u8], iv: ~[u8], data: &[u8]) -> ~[u8] {
#[cfg(test)]
mod tests {
- use hex::FromHex;
+ use crypto::hex::FromHex;
// Test vectors from FIPS-197:
// http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
@@ -223,7 +223,7 @@ mod tests {
}
fn cipher_test(ciphertype: super::Type, pt: ~str, ct: ~str, key: ~str, iv: ~str) {
- use hex::ToHex;
+ use crypto::hex::ToHex;
let cipher = super::Crypter::new(ciphertype);
cipher.init(super::Encrypt, key.from_hex(), iv.from_hex());
diff --git a/lib.rs b/lib.rs
new file mode 100644
index 00000000..79c12407
--- /dev/null
+++ b/lib.rs
@@ -0,0 +1,6 @@
+#[feature(struct_variant, macro_rules)];
+#[crate_id="github.com/sfackler/rust-openssl"];
+#[doc(html_root_url="http://sfackler.github.io/rust-openssl/doc")];
+
+pub mod ssl;
+pub mod crypto;
diff --git a/ssl/lib.rs b/ssl/mod.rs
index 8725080c..777e5dae 100644
--- a/ssl/lib.rs
+++ b/ssl/mod.rs
@@ -1,7 +1,3 @@
-#[feature(struct_variant, macro_rules)];
-#[crate_id="github.com/sfackler/rust-ssl"];
-#[doc(html_root_url="http://sfackler.github.io/rust-ssl/doc/")];
-
use std::cast;
use std::libc::{c_int, c_void, c_char};
use std::ptr;
@@ -12,11 +8,12 @@ use std::unstable::mutex::Mutex;
use std::io::{Stream, Reader, Writer, Decorator};
use std::vec;
-use self::error::{SslError, SslSessionClosed, StreamEof};
+use ssl::error::{SslError, SslSessionClosed, StreamEof};
pub mod error;
-
mod ffi;
+#[cfg(test)]
+mod tests;
static mut STARTED_INIT: AtomicBool = INIT_ATOMIC_BOOL;
static mut FINISHED_INIT: AtomicBool = INIT_ATOMIC_BOOL;
diff --git a/ssl/test.rs b/ssl/tests.rs
index 2655fa98..266acc4c 100644
--- a/ssl/test.rs
+++ b/ssl/tests.rs
@@ -1,12 +1,8 @@
-#[feature(struct_variant, macro_rules)];
-
use std::io::Writer;
use std::io::net::tcp::TcpStream;
use std::str;
-use lib::{Sslv23, SslContext, SslStream, SslVerifyPeer, X509StoreContext};
-
-mod lib;
+use ssl::{Sslv23, SslContext, SslStream, SslVerifyPeer, X509StoreContext};
#[test]
fn test_new_ctx() {
diff --git a/ssl/test/cert.pem b/test/cert.pem
index a520dd24..a520dd24 100644
--- a/ssl/test/cert.pem
+++ b/test/cert.pem
diff --git a/ssl/test/key.pem b/test/key.pem
index a3f80dd9..a3f80dd9 100644
--- a/ssl/test/key.pem
+++ b/test/key.pem