Skip to content

Commit 177d3e8

Browse files
committed
address some review comments
1 parent 28eade4 commit 177d3e8

File tree

3 files changed

+1
-41
lines changed

3 files changed

+1
-41
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ vendored = ["openssl/vendored"]
1212

1313
[dependencies]
1414
lazy_static = "1.0"
15-
rustc-serialize = "0.3"
1615

1716
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
1817
security-framework = "0.3.1"

src/lib.rs

Lines changed: 1 addition & 5 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
@@ -97,13 +97,9 @@
9797
#![doc(html_root_url = "https://docs.rs/native-tls/0.2")]
9898
#![warn(missing_docs)]
9999

100-
#[macro_use]
101-
extern crate lazy_static;
102-
103100
#[cfg(test)]
104101
extern crate hex;
105102

106-
extern crate rustc_serialize;
107103
mod pem;
108104

109105
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)