Skip to content

Commit 7e9a612

Browse files
committed
address some review comments
1 parent 28eade4 commit 7e9a612

File tree

3 files changed

+3
-41
lines changed

3 files changed

+3
-41
lines changed

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ readme = "README.md"
1010
[features]
1111
vendored = ["openssl/vendored"]
1212

13-
[dependencies]
14-
lazy_static = "1.0"
15-
rustc-serialize = "0.3"
16-
1713
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
1814
security-framework = "0.3.1"
1915
security-framework-sys = "0.3.1"
16+
lazy_static = "1.0"
2017
libc = "0.2"
2118
tempfile = "3.0"
2219

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//! * TLS/SSL client communication
2828
//! * TLS/SSL server communication
2929
//! * PKCS#12 encoded identities
30-
//! * PKCS#8 encoded identities
30+
//! * X.509/PKCS#8 encoded identities
3131
//! * Secure-by-default for client and server
3232
//! * Includes hostname verification for clients
3333
//! * Supports asynchronous I/O for both the server and the client
@@ -98,12 +98,12 @@
9898
#![warn(missing_docs)]
9999

100100
#[macro_use]
101+
#[cfg(any(target_os = "macos", target_os = "ios"))]
101102
extern crate lazy_static;
102103

103104
#[cfg(test)]
104105
extern crate hex;
105106

106-
extern crate rustc_serialize;
107107
mod pem;
108108

109109
use std::any::Any;

src/pem.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,4 @@
11
#![allow(unused)]
2-
use rustc_serialize::base64::{self, FromBase64, ToBase64};
3-
4-
/// Type of the various `PEM_*` constants supplied to `pem_to_der` / `der_to_pem`.
5-
pub struct PemGuard {
6-
begin: &'static str,
7-
end: &'static str,
8-
}
9-
10-
macro_rules! pem_guard {
11-
($n:expr) => {
12-
&PemGuard {
13-
begin: concat!("-----BEGIN ", $n, "-----"),
14-
end: concat!("-----END ", $n, "-----"),
15-
}
16-
}
17-
}
18-
19-
// Ref. RFC7468, although these are not universally respected.
20-
pub const PEM_CERTIFICATE: &'static PemGuard = pem_guard!("CERTIFICATE");
21-
pub const PEM_CERTIFICATE_REQUEST: &'static PemGuard = pem_guard!("CERTIFICATE REQUEST");
22-
pub const PEM_ENCRYPTED_PRIVATE_KEY: &'static PemGuard = pem_guard!("ENCRYPTED PRIVATE KEY");
23-
pub const PEM_PRIVATE_KEY: &'static PemGuard = pem_guard!("PRIVATE KEY");
24-
pub const PEM_PUBLIC_KEY: &'static PemGuard = pem_guard!("PUBLIC KEY");
25-
pub const PEM_CMS: &'static PemGuard = pem_guard!("CMS");
26-
27-
const BASE64_PEM_WRAP: usize = 64;
28-
29-
lazy_static!{
30-
static ref BASE64_PEM: base64::Config = base64::Config {
31-
char_set: base64::CharacterSet::Standard,
32-
newline: base64::Newline::LF,
33-
pad: true,
34-
line_length: Some(BASE64_PEM_WRAP),
35-
};
36-
}
372

383
/// Split data by PEM guard lines
394
pub struct PemBlock<'a> {

0 commit comments

Comments
 (0)