mirror of https://github.com/ctz/rustls
Upgrade to 2021 edition
This commit is contained in:
parent
dbcf3668bb
commit
6e6baa91e7
|
@ -1,12 +1,11 @@
|
|||
[package]
|
||||
name = "rustls-examples"
|
||||
version = "0.0.1"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
authors = ["Joseph Birr-Pixton <jpixton@gmail.com>"]
|
||||
license = "Apache-2.0/ISC/MIT"
|
||||
description = "Rustls example code and tests."
|
||||
publish = false
|
||||
resolver = "2"
|
||||
|
||||
[features]
|
||||
default = ["logging"]
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
/// observe using `nm` that the binary of this program does not contain any AES code.
|
||||
use std::sync::Arc;
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::io::{stdout, Read, Write};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::io::{stdout, Read, Write};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
/// that is sensible outside of example code.
|
||||
use std::sync::Arc;
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::io::{stdout, Read, Write};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ use std::sync::{Arc, Mutex};
|
|||
use mio::net::TcpStream;
|
||||
|
||||
use std::collections;
|
||||
use std::convert::TryInto;
|
||||
use std::fs;
|
||||
use std::io;
|
||||
use std::io::{BufReader, Read, Write};
|
||||
|
|
|
@ -4,7 +4,7 @@ name = "rustls-fuzz"
|
|||
version = "0.0.1"
|
||||
authors = ["Automatically generated"]
|
||||
publish = false
|
||||
resolver = "2"
|
||||
edition = "2021"
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
|
|
@ -9,7 +9,6 @@ use rustls::{
|
|||
ClientConnection,
|
||||
RootCertStore
|
||||
};
|
||||
use std::convert::TryInto;
|
||||
use std::io;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ extern crate rustls;
|
|||
|
||||
use rustls::internal::msgs::deframer;
|
||||
use rustls::internal::msgs::message::Message;
|
||||
use std::convert::TryFrom;
|
||||
use std::io;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
|
|
|
@ -7,7 +7,6 @@ use rustls::internal::msgs::base::Payload;
|
|||
use rustls::internal::msgs::codec::Reader;
|
||||
use rustls::internal::msgs::fragmenter::MessageFragmenter;
|
||||
use rustls::internal::msgs::message::{Message, OpaqueMessage, PlainMessage};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let mut rdr = Reader::init(data);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#[macro_use] extern crate libfuzzer_sys;
|
||||
extern crate rustls;
|
||||
|
||||
use std::convert::TryFrom;
|
||||
use rustls::internal::msgs::codec::Reader;
|
||||
use rustls::internal::msgs::hsjoiner;
|
||||
use rustls::internal::msgs::message;
|
||||
|
|
|
@ -5,7 +5,6 @@ extern crate rustls;
|
|||
|
||||
use rustls::internal::msgs::codec::Reader;
|
||||
use rustls::internal::msgs::message::{Message, PlainMessage, OpaqueMessage};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let mut rdr = Reader::init(data);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "rustls"
|
||||
version = "0.20.8"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
license = "Apache-2.0/ISC/MIT"
|
||||
readme = "../README.md"
|
||||
|
@ -11,7 +11,6 @@ repository = "https://github.com/rustls/rustls"
|
|||
categories = ["network-programming", "cryptography"]
|
||||
autobenches = false
|
||||
build = "build.rs"
|
||||
resolver = "2"
|
||||
|
||||
[build-dependencies]
|
||||
rustversion = { version = "1.0.6", optional = true }
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// Note: we don't use any of the standard 'cargo bench', 'test::Bencher',
|
||||
// etc. because it's unstable at the time of writing.
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::io::{self, Read, Write};
|
||||
|
|
|
@ -15,7 +15,6 @@ use rustls::server::ClientHello;
|
|||
use rustls::{CipherSuite, ProtocolVersion};
|
||||
use rustls::{ClientConnection, Connection, ServerConnection};
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::io;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
//
|
||||
|
||||
use rustls::{ClientConfig, ClientConnection, Error, OwnedTrustAnchor, RootCertStore};
|
||||
use std::convert::TryInto;
|
||||
use std::env;
|
||||
use std::error::Error as StdError;
|
||||
use std::fs::File;
|
||||
|
|
|
@ -20,7 +20,6 @@ use super::hs;
|
|||
#[cfg(feature = "quic")]
|
||||
use crate::quic;
|
||||
|
||||
use std::convert::TryFrom;
|
||||
use std::error::Error as StdError;
|
||||
use std::marker::PhantomData;
|
||||
use std::net::IpAddr;
|
||||
|
@ -216,7 +215,6 @@ impl ClientConfig {
|
|||
/// so you can do:
|
||||
///
|
||||
/// ```
|
||||
/// # use std::convert::{TryInto, TryFrom};
|
||||
/// # use rustls::ServerName;
|
||||
/// ServerName::try_from("example.com").expect("invalid DNS name");
|
||||
///
|
||||
|
|
|
@ -26,7 +26,6 @@ use crate::vecbuf::ChunkVecBuffer;
|
|||
#[cfg(feature = "quic")]
|
||||
use std::collections::VecDeque;
|
||||
|
||||
use std::convert::TryFrom;
|
||||
use std::fmt::Debug;
|
||||
use std::io;
|
||||
use std::mem;
|
||||
|
|
|
@ -133,7 +133,6 @@
|
|||
//! # use rustls;
|
||||
//! # use webpki;
|
||||
//! # use std::sync::Arc;
|
||||
//! # use std::convert::TryInto;
|
||||
//! # let mut root_store = rustls::RootCertStore::empty();
|
||||
//! # root_store.add_server_trust_anchors(
|
||||
//! # webpki_roots::TLS_SERVER_ROOTS
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use std::convert::TryInto;
|
||||
use std::fmt::Debug;
|
||||
|
||||
/// Wrapper over a slice of bytes that allows reading chunks from
|
||||
|
|
|
@ -126,7 +126,6 @@ mod tests {
|
|||
use super::MessageDeframer;
|
||||
use crate::msgs::message::{Message, OpaqueMessage};
|
||||
use crate::{msgs, Error};
|
||||
use std::convert::TryFrom;
|
||||
use std::io;
|
||||
|
||||
const FIRST_MESSAGE: &[u8] = include_bytes!("../testdata/deframer-test.1.bin");
|
||||
|
|
|
@ -7,8 +7,6 @@ use crate::msgs::codec::{Codec, Reader};
|
|||
use crate::msgs::enums::{AlertDescription, AlertLevel, ContentType, HandshakeType};
|
||||
use crate::msgs::handshake::HandshakeMessagePayload;
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum MessagePayload {
|
||||
Alert(AlertMessagePayload),
|
||||
|
|
|
@ -5,7 +5,6 @@ use super::codec::Reader;
|
|||
use super::enums::{AlertDescription, AlertLevel, HandshakeType};
|
||||
use super::message::{Message, OpaqueMessage, PlainMessage};
|
||||
|
||||
use std::convert::TryFrom;
|
||||
use std::fs;
|
||||
use std::io::Read;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
|
|
@ -30,8 +30,6 @@ mod message_test;
|
|||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::convert::TryFrom;
|
||||
|
||||
#[test]
|
||||
fn smoketest() {
|
||||
use super::codec::Reader;
|
||||
|
|
|
@ -6,8 +6,6 @@ use crate::key::Certificate;
|
|||
use crate::ticketer::TimeBase;
|
||||
use crate::tls13::TLS13_AES_128_GCM_SHA256;
|
||||
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[test]
|
||||
fn clientsessionkey_is_debug() {
|
||||
let name = "hello".try_into().unwrap();
|
||||
|
|
|
@ -7,7 +7,6 @@ use crate::x509::{wrap_in_asn1_len, wrap_in_sequence};
|
|||
use ring::io::der;
|
||||
use ring::signature::{self, EcdsaKeyPair, Ed25519KeyPair, RsaKeyPair};
|
||||
|
||||
use std::convert::TryFrom;
|
||||
use std::error::Error as StdError;
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
|
|
@ -11,7 +11,6 @@ use crate::msgs::handshake::{DigitallySignedStruct, DistinguishedNames};
|
|||
|
||||
use ring::digest::Digest;
|
||||
|
||||
use std::convert::TryFrom;
|
||||
use std::sync::Arc;
|
||||
use std::time::SystemTime;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// Note: we don't use any of the standard 'cargo bench', 'test::Bencher',
|
||||
// etc. because it's unstable at the time of writing.
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::time::{Duration, Instant, SystemTime};
|
||||
|
||||
use crate::key;
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
//! Assorted public API tests.
|
||||
use std::cell::RefCell;
|
||||
use std::convert::TryFrom;
|
||||
#[cfg(feature = "tls12")]
|
||||
use std::convert::TryInto;
|
||||
use std::fmt;
|
||||
use std::io::{self, IoSlice, Read, Write};
|
||||
use std::mem;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
use std::io;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::sync::Arc;
|
||||
|
|
Loading…
Reference in New Issue