diff options
| author | Alex Crichton <[email protected]> | 2015-04-02 18:14:51 -0700 |
|---|---|---|
| committer | Alex Crichton <[email protected]> | 2015-04-02 18:14:51 -0700 |
| commit | 293f1ce5b19610255f4fe3a69cf8fd159a0d5820 (patch) | |
| tree | 334537900cf3d6d55e3b980e69375a407ff0868c /openssl/src | |
| parent | Remove two features (diff) | |
| download | rust-openssl-293f1ce5b19610255f4fe3a69cf8fd159a0d5820.tar.xz rust-openssl-293f1ce5b19610255f4fe3a69cf8fd159a0d5820.zip | |
Fixup for beta
Add derive(Clone) and don't negate unsigned numbers
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/bn/mod.rs | 6 | ||||
| -rw-r--r-- | openssl/src/crypto/hash.rs | 4 | ||||
| -rw-r--r-- | openssl/src/crypto/hmac.rs | 2 | ||||
| -rw-r--r-- | openssl/src/crypto/pkey.rs | 6 | ||||
| -rw-r--r-- | openssl/src/crypto/symm.rs | 4 | ||||
| -rw-r--r-- | openssl/src/x509/mod.rs | 4 |
6 files changed, 13 insertions, 13 deletions
diff --git a/openssl/src/bn/mod.rs b/openssl/src/bn/mod.rs index 795788fa..ccf28337 100644 --- a/openssl/src/bn/mod.rs +++ b/openssl/src/bn/mod.rs @@ -8,7 +8,7 @@ use ssl::error::SslError; pub struct BigNum(*mut ffi::BIGNUM); -#[derive(Copy)] +#[derive(Copy, Clone)] #[repr(C)] pub enum RNGProperty { MsbMaybeZero = -1, @@ -196,7 +196,7 @@ impl BigNum { pub fn div_word(&mut self, w: c_ulong) -> Result<c_ulong, SslError> { unsafe { let result = ffi::BN_div_word(self.raw(), w); - if result != -1 as c_ulong { + if result != !0 as c_ulong { Ok(result) } else { Err(SslError::get()) @@ -207,7 +207,7 @@ impl BigNum { pub fn mod_word(&self, w: c_ulong) -> Result<c_ulong, SslError> { unsafe { let result = ffi::BN_mod_word(self.raw(), w); - if result != -1 as c_ulong { + if result != !0 as c_ulong { Ok(result) } else { Err(SslError::get()) diff --git a/openssl/src/crypto/hash.rs b/openssl/src/crypto/hash.rs index 29e180e5..801d8ca5 100644 --- a/openssl/src/crypto/hash.rs +++ b/openssl/src/crypto/hash.rs @@ -6,7 +6,7 @@ use std::io; use ffi; /// Message digest (hash) type. -#[derive(Copy)] +#[derive(Copy, Clone)] pub enum Type { MD5, SHA1, @@ -51,7 +51,7 @@ impl Type { } } -#[derive(PartialEq, Copy)] +#[derive(PartialEq, Copy, Clone)] enum State { Reset, Updated, diff --git a/openssl/src/crypto/hmac.rs b/openssl/src/crypto/hmac.rs index dace68aa..a59cb929 100644 --- a/openssl/src/crypto/hmac.rs +++ b/openssl/src/crypto/hmac.rs @@ -22,7 +22,7 @@ use std::io::prelude::*; use crypto::hash::Type; use ffi; -#[derive(PartialEq, Copy)] +#[derive(PartialEq, Copy, Clone)] enum State { Reset, Updated, diff --git a/openssl/src/crypto/pkey.rs b/openssl/src/crypto/pkey.rs index e23171ed..9bcc79b6 100644 --- a/openssl/src/crypto/pkey.rs +++ b/openssl/src/crypto/pkey.rs @@ -9,7 +9,7 @@ use crypto::hash::Type as HashType; use ffi; use ssl::error::{SslError, StreamError}; -#[derive(Copy)] +#[derive(Copy, Clone)] enum Parts { Neither, Public, @@ -17,7 +17,7 @@ enum Parts { } /// Represents a role an asymmetric key might be appropriate for. -#[derive(Copy)] +#[derive(Copy, Clone)] pub enum Role { Encrypt, Decrypt, @@ -26,7 +26,7 @@ pub enum Role { } /// Type of encryption padding to use. -#[derive(Copy)] +#[derive(Copy, Clone)] pub enum EncryptionPadding { OAEP, PKCS1v15 diff --git a/openssl/src/crypto/symm.rs b/openssl/src/crypto/symm.rs index e8bbcf80..62208439 100644 --- a/openssl/src/crypto/symm.rs +++ b/openssl/src/crypto/symm.rs @@ -3,14 +3,14 @@ use libc::{c_int}; use ffi; -#[derive(Copy)] +#[derive(Copy, Clone)] pub enum Mode { Encrypt, Decrypt, } #[allow(non_camel_case_types)] -#[derive(Copy)] +#[derive(Copy, Clone)] pub enum Type { AES_128_ECB, AES_128_CBC, diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index bce9485e..c19f093d 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -20,7 +20,7 @@ use ssl::error::{SslError, StreamError}; #[cfg(test)] mod tests; -#[derive(Copy)] +#[derive(Copy, Clone)] #[repr(i32)] pub enum X509FileType { PEM = ffi::X509_FILETYPE_PEM, @@ -449,7 +449,7 @@ pub struct X509Name<'x> { macro_rules! make_validation_error( ($ok_val:ident, $($name:ident = $val:ident,)+) => ( - #[derive(Copy)] + #[derive(Copy, Clone)] pub enum X509ValidationError { $($name,)+ X509UnknownError(c_int) |