aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bn/mod.rs1
-rw-r--r--src/crypto/hash.rs1
-rw-r--r--src/crypto/pkey.rs4
-rw-r--r--src/crypto/symm.rs2
-rw-r--r--src/ssl/mod.rs2
-rw-r--r--src/x509/mod.rs7
6 files changed, 14 insertions, 3 deletions
diff --git a/src/bn/mod.rs b/src/bn/mod.rs
index 2536f8a5..069c6b22 100644
--- a/src/bn/mod.rs
+++ b/src/bn/mod.rs
@@ -7,6 +7,7 @@ use ssl::error::SslError;
pub struct BigNum(*mut ffi::BIGNUM);
+#[deriving(Copy)]
#[repr(C)]
pub enum RNGProperty {
MsbMaybeZero = -1,
diff --git a/src/crypto/hash.rs b/src/crypto/hash.rs
index b5d0eab5..37573368 100644
--- a/src/crypto/hash.rs
+++ b/src/crypto/hash.rs
@@ -4,6 +4,7 @@ use std::io;
use ffi;
+#[deriving(Copy)]
pub enum HashType {
MD5,
SHA1,
diff --git a/src/crypto/pkey.rs b/src/crypto/pkey.rs
index 146d2aa3..bab7addc 100644
--- a/src/crypto/pkey.rs
+++ b/src/crypto/pkey.rs
@@ -6,7 +6,7 @@ use crypto::hash::HashType;
use ffi;
use ssl::error::{SslError, StreamError};
-
+#[deriving(Copy)]
enum Parts {
Neither,
Public,
@@ -14,6 +14,7 @@ enum Parts {
}
/// Represents a role an asymmetric key might be appropriate for.
+#[deriving(Copy)]
pub enum Role {
Encrypt,
Decrypt,
@@ -22,6 +23,7 @@ pub enum Role {
}
/// Type of encryption padding to use.
+#[deriving(Copy)]
pub enum EncryptionPadding {
OAEP,
PKCS1v15
diff --git a/src/crypto/symm.rs b/src/crypto/symm.rs
index 998d351c..61365f2e 100644
--- a/src/crypto/symm.rs
+++ b/src/crypto/symm.rs
@@ -2,12 +2,14 @@ use libc::{c_int};
use ffi;
+#[deriving(Copy)]
pub enum Mode {
Encrypt,
Decrypt,
}
#[allow(non_camel_case_types)]
+#[deriving(Copy)]
pub enum Type {
AES_128_ECB,
AES_128_CBC,
diff --git a/src/ssl/mod.rs b/src/ssl/mod.rs
index 6112bc8d..5aa60666 100644
--- a/src/ssl/mod.rs
+++ b/src/ssl/mod.rs
@@ -33,6 +33,7 @@ fn init() {
/// Determines the SSL method supported
#[deriving(Show, Hash, PartialEq, Eq)]
#[allow(non_camel_case_types)]
+#[deriving(Copy)]
pub enum SslMethod {
#[cfg(feature = "sslv2")]
/// Only support the SSLv2 protocol, requires `feature="sslv2"`
@@ -68,6 +69,7 @@ impl SslMethod {
}
/// Determines the type of certificate verification used
+#[deriving(Copy)]
#[repr(i32)]
pub enum SslVerifyMode {
/// Verify that the server's certificate is trusted
diff --git a/src/x509/mod.rs b/src/x509/mod.rs
index a06fe4e1..47294c3d 100644
--- a/src/x509/mod.rs
+++ b/src/x509/mod.rs
@@ -15,6 +15,7 @@ use ssl::error::{SslError, StreamError};
#[cfg(test)]
mod tests;
+#[deriving(Copy)]
#[repr(i32)]
pub enum X509FileType {
PEM = ffi::X509_FILETYPE_PEM,
@@ -22,6 +23,7 @@ pub enum X509FileType {
Default = ffi::X509_FILETYPE_DEFAULT
}
+#[allow(missing_copy_implementations)]
pub struct X509StoreContext {
ctx: *mut ffi::X509_STORE_CTX
}
@@ -54,7 +56,7 @@ trait AsStr<'a> {
fn as_str(&self) -> &'a str;
}
-#[deriving(Clone)]
+#[deriving(Clone, Copy)]
pub enum KeyUsage {
DigitalSignature,
NonRepudiation,
@@ -84,7 +86,7 @@ impl AsStr<'static> for KeyUsage {
}
-#[deriving(Clone)]
+#[deriving(Clone, Copy)]
pub enum ExtKeyUsage {
ServerAuth,
ClientAuth,
@@ -430,6 +432,7 @@ pub struct X509Name<'x> {
macro_rules! make_validation_error(
($ok_val:ident, $($name:ident = $val:ident,)+) => (
+ #[deriving(Copy)]
pub enum X509ValidationError {
$($name,)+
X509UnknownError(c_int)