cargo fix --edition --all-features

This commit is contained in:
Joseph Birr-Pixton 2019-01-20 17:24:27 +00:00
parent bfc8ae3f76
commit 46ba147d2b
45 changed files with 297 additions and 297 deletions

View File

@ -25,7 +25,7 @@ extern crate ct_logs;
extern crate vecio;
mod util;
use util::WriteVAdapter;
use crate::util::WriteVAdapter;
use rustls::Session;

View File

@ -25,7 +25,7 @@ use rustls::{RootCertStore, Session, NoClientAuth, AllowAnyAuthenticatedClient,
AllowAnyAnonymousOrAuthenticatedClient};
mod util;
use util::WriteVAdapter;
use crate::util::WriteVAdapter;
// Token for our listening socket.
const LISTENER: mio::Token = mio::Token(0);

View File

@ -1,10 +1,10 @@
use webpki;
use untrusted;
pub use msgs::handshake::{DistinguishedName, DistinguishedNames};
use pemfile;
use x509;
use key;
pub use crate::msgs::handshake::{DistinguishedName, DistinguishedNames};
use crate::pemfile;
use crate::x509;
use crate::key;
use std::io;
/// This is like a `webpki::TrustAnchor`, except it owns

View File

@ -1,14 +1,14 @@
use ring;
use std::io::Write;
use msgs::codec;
use msgs::codec::Codec;
use msgs::enums::{ContentType, ProtocolVersion};
use msgs::message::{BorrowMessage, Message, MessagePayload};
use msgs::fragmenter::MAX_FRAGMENT_LEN;
use error::TLSError;
use session::SessionSecrets;
use suites::{SupportedCipherSuite, BulkAlgorithm};
use key_schedule::{derive_traffic_key, derive_traffic_iv};
use crate::msgs::codec;
use crate::msgs::codec::Codec;
use crate::msgs::enums::{ContentType, ProtocolVersion};
use crate::msgs::message::{BorrowMessage, Message, MessagePayload};
use crate::msgs::fragmenter::MAX_FRAGMENT_LEN;
use crate::error::TLSError;
use crate::session::SessionSecrets;
use crate::suites::{SupportedCipherSuite, BulkAlgorithm};
use crate::key_schedule::{derive_traffic_key, derive_traffic_iv};
// accum[i] ^= offset[i] for all i in 0..len(accum)
fn xor(accum: &mut [u8], offset: &[u8]) {

View File

@ -1,15 +1,15 @@
use msgs::handshake::CertificatePayload;
use msgs::handshake::DigitallySignedStruct;
use msgs::handshake::SessionID;
use msgs::handshake::SCTList;
use msgs::handshake::ServerExtension;
use msgs::handshake::ClientExtension;
use msgs::persist;
use msgs::enums::ExtensionType;
use msgs::enums::NamedGroup;
use session::SessionRandoms;
use sign;
use suites;
use crate::msgs::handshake::CertificatePayload;
use crate::msgs::handshake::DigitallySignedStruct;
use crate::msgs::handshake::SessionID;
use crate::msgs::handshake::SCTList;
use crate::msgs::handshake::ServerExtension;
use crate::msgs::handshake::ClientExtension;
use crate::msgs::persist;
use crate::msgs::enums::ExtensionType;
use crate::msgs::enums::NamedGroup;
use crate::session::SessionRandoms;
use crate::sign;
use crate::suites;
use webpki;
use std::mem;

View File

@ -1,7 +1,7 @@
use msgs::enums::SignatureScheme;
use sign;
use key;
use client;
use crate::msgs::enums::SignatureScheme;
use crate::sign;
use crate::key;
use crate::client;
use std::collections;
use std::sync::{Arc, Mutex};
@ -105,7 +105,7 @@ impl client::ResolvesClientCert for AlwaysResolvesClientCert {
#[cfg(test)]
mod test {
use super::*;
use StoresClientSessions;
use crate::StoresClientSessions;
#[test]
fn test_noclientsessionstorage_drops_put() {

View File

@ -1,44 +1,44 @@
use msgs::enums::{ContentType, HandshakeType, ExtensionType, SignatureScheme};
use msgs::enums::{Compression, ProtocolVersion, AlertDescription, NamedGroup};
use msgs::message::{Message, MessagePayload};
use msgs::base::{Payload, PayloadU8};
use msgs::handshake::{HandshakePayload, HandshakeMessagePayload, ClientHelloPayload};
use msgs::handshake::{SessionID, Random, ServerHelloPayload};
use msgs::handshake::{ClientExtension, HasServerExtensions};
use msgs::handshake::{SupportedSignatureSchemes, SupportedMandatedSignatureSchemes};
use msgs::handshake::DecomposedSignatureScheme;
use msgs::handshake::{NamedGroups, SupportedGroups, KeyShareEntry, EncryptedExtensions};
use msgs::handshake::{ECPointFormatList, SupportedPointFormats};
use msgs::handshake::{ProtocolNameList, ConvertProtocolNameList};
use msgs::handshake::{CertificatePayloadTLS13, CertificateEntry};
use msgs::handshake::ServerKeyExchangePayload;
use msgs::handshake::DigitallySignedStruct;
use msgs::handshake::{PresharedKeyIdentity, PresharedKeyOffer, HelloRetryRequest};
use msgs::handshake::{CertificateStatusRequest, SCTList};
use msgs::enums::{ClientCertificateType, PSKKeyExchangeMode, ECPointFormat};
use msgs::codec::{Codec, Reader};
use msgs::persist;
use msgs::ccs::ChangeCipherSpecPayload;
use client::ClientSessionImpl;
use session::SessionSecrets;
use key_schedule::{KeySchedule, SecretKind};
use cipher;
use suites;
use hash_hs;
use verify;
use rand;
use ticketer;
use error::TLSError;
use handshake::{check_message, check_handshake_message};
use crate::msgs::enums::{ContentType, HandshakeType, ExtensionType, SignatureScheme};
use crate::msgs::enums::{Compression, ProtocolVersion, AlertDescription, NamedGroup};
use crate::msgs::message::{Message, MessagePayload};
use crate::msgs::base::{Payload, PayloadU8};
use crate::msgs::handshake::{HandshakePayload, HandshakeMessagePayload, ClientHelloPayload};
use crate::msgs::handshake::{SessionID, Random, ServerHelloPayload};
use crate::msgs::handshake::{ClientExtension, HasServerExtensions};
use crate::msgs::handshake::{SupportedSignatureSchemes, SupportedMandatedSignatureSchemes};
use crate::msgs::handshake::DecomposedSignatureScheme;
use crate::msgs::handshake::{NamedGroups, SupportedGroups, KeyShareEntry, EncryptedExtensions};
use crate::msgs::handshake::{ECPointFormatList, SupportedPointFormats};
use crate::msgs::handshake::{ProtocolNameList, ConvertProtocolNameList};
use crate::msgs::handshake::{CertificatePayloadTLS13, CertificateEntry};
use crate::msgs::handshake::ServerKeyExchangePayload;
use crate::msgs::handshake::DigitallySignedStruct;
use crate::msgs::handshake::{PresharedKeyIdentity, PresharedKeyOffer, HelloRetryRequest};
use crate::msgs::handshake::{CertificateStatusRequest, SCTList};
use crate::msgs::enums::{ClientCertificateType, PSKKeyExchangeMode, ECPointFormat};
use crate::msgs::codec::{Codec, Reader};
use crate::msgs::persist;
use crate::msgs::ccs::ChangeCipherSpecPayload;
use crate::client::ClientSessionImpl;
use crate::session::SessionSecrets;
use crate::key_schedule::{KeySchedule, SecretKind};
use crate::cipher;
use crate::suites;
use crate::hash_hs;
use crate::verify;
use crate::rand;
use crate::ticketer;
use crate::error::TLSError;
use crate::handshake::{check_message, check_handshake_message};
#[cfg(feature = "quic")]
use {
use crate::{
quic,
msgs::base::PayloadU16,
session::Protocol
};
use client::common::{ServerCertDetails, ServerKXDetails, HandshakeDetails};
use client::common::{ClientHelloDetails, ReceivedTicketDetails, ClientAuthDetails};
use crate::client::common::{ServerCertDetails, ServerKXDetails, HandshakeDetails};
use crate::client::common::{ClientHelloDetails, ReceivedTicketDetails, ClientAuthDetails};
use std::mem;
use ring::constant_time;
@ -683,7 +683,7 @@ impl State for ExpectServerHello {
let server_hello = extract_handshake!(m, HandshakePayload::ServerHello).unwrap();
trace!("We got ServerHello {:#?}", server_hello);
use ProtocolVersion::{TLSv1_2, TLSv1_3};
use crate::ProtocolVersion::{TLSv1_2, TLSv1_3};
let tls13_supported = sess.config.supports_version(TLSv1_3);
let server_version = if server_hello.legacy_version == TLSv1_2 {

View File

@ -1,19 +1,19 @@
use msgs::enums::CipherSuite;
use msgs::enums::{AlertDescription, HandshakeType};
use session::{Session, SessionCommon};
use keylog::{KeyLog, NoKeyLog};
use suites::{SupportedCipherSuite, ALL_CIPHERSUITES};
use msgs::handshake::CertificatePayload;
use msgs::enums::SignatureScheme;
use msgs::enums::{ContentType, ProtocolVersion};
use msgs::handshake::ClientExtension;
use msgs::message::Message;
use verify;
use anchors;
use sign;
use error::TLSError;
use key;
use vecbuf::WriteV;
use crate::msgs::enums::CipherSuite;
use crate::msgs::enums::{AlertDescription, HandshakeType};
use crate::session::{Session, SessionCommon};
use crate::keylog::{KeyLog, NoKeyLog};
use crate::suites::{SupportedCipherSuite, ALL_CIPHERSUITES};
use crate::msgs::handshake::CertificatePayload;
use crate::msgs::enums::SignatureScheme;
use crate::msgs::enums::{ContentType, ProtocolVersion};
use crate::msgs::handshake::ClientExtension;
use crate::msgs::message::Message;
use crate::verify;
use crate::anchors;
use crate::sign;
use crate::error::TLSError;
use crate::key;
use crate::vecbuf::WriteV;
use std::sync::Arc;
use std::io;
@ -193,7 +193,7 @@ impl ClientConfig {
// Externally the MTU is the whole packet size. The difference
// is PACKET_OVERHEAD.
if let Some(x) = *mtu {
use msgs::fragmenter;
use crate::msgs::fragmenter;
debug_assert!(x > fragmenter::PACKET_OVERHEAD);
self.mtu = Some(x - fragmenter::PACKET_OVERHEAD);
} else {

View File

@ -1,6 +1,6 @@
use std::fmt;
use std::error::Error;
use msgs::enums::{ContentType, HandshakeType, AlertDescription};
use crate::msgs::enums::{ContentType, HandshakeType, AlertDescription};
use webpki;
use sct;
@ -147,7 +147,7 @@ mod tests {
fn smoke() {
use super::TLSError;
use std::error::Error;
use msgs::enums::{ContentType, HandshakeType, AlertDescription};
use crate::msgs::enums::{ContentType, HandshakeType, AlertDescription};
use webpki;
use sct;

View File

@ -1,6 +1,6 @@
use msgs::enums::{ContentType, HandshakeType};
use msgs::message::{Message, MessagePayload};
use error::TLSError;
use crate::msgs::enums::{ContentType, HandshakeType};
use crate::msgs::message::{Message, MessagePayload};
use crate::error::TLSError;
pub fn check_handshake_message(m: &Message,
handshake_types: &[HandshakeType]) -> Result<(), TLSError> {

View File

@ -1,8 +1,8 @@
use ring::digest;
use std::mem;
use msgs::codec::Codec;
use msgs::message::{Message, MessagePayload};
use msgs::handshake::HandshakeMessagePayload;
use crate::msgs::codec::Codec;
use crate::msgs::message::{Message, MessagePayload};
use crate::msgs::handshake::HandshakeMessagePayload;
/// This deals with keeping a running hash of the handshake
/// payloads. This is computed by buffering initially. Once

View File

@ -1,8 +1,8 @@
/// Key schedule maintenance for TLS1.3
use ring::{hmac, digest, hkdf};
use msgs::codec::Codec;
use error::TLSError;
use crate::msgs::codec::Codec;
use crate::error::TLSError;
/// The kinds of secret we can extract from `KeySchedule`.
#[derive(Debug, Clone, Copy, PartialEq)]

View File

@ -266,40 +266,40 @@ mod keylog;
pub mod internal {
/// Functions for parsing PEM files containing certificates/keys.
pub mod pemfile {
pub use pemfile::{certs, rsa_private_keys, pkcs8_private_keys};
pub use crate::pemfile::{certs, rsa_private_keys, pkcs8_private_keys};
}
/// Low-level TLS message parsing and encoding functions.
pub mod msgs {
pub use msgs::*;
pub use crate::msgs::*;
}
}
// The public interface is:
pub use msgs::enums::ProtocolVersion;
pub use msgs::enums::SignatureScheme;
pub use msgs::enums::CipherSuite;
pub use error::TLSError;
pub use session::Session;
pub use stream::{Stream, StreamOwned};
pub use anchors::{DistinguishedNames, RootCertStore};
pub use client::StoresClientSessions;
pub use client::handy::{NoClientSessionStorage, ClientSessionMemoryCache};
pub use client::{ClientConfig, ClientSession, WriteEarlyData};
pub use client::ResolvesClientCert;
pub use server::StoresServerSessions;
pub use server::handy::{NoServerSessionStorage, ServerSessionMemoryCache};
pub use server::{ServerConfig, ServerSession};
pub use server::handy::ResolvesServerCertUsingSNI;
pub use server::ResolvesServerCert;
pub use server::ProducesTickets;
pub use ticketer::Ticketer;
pub use verify::{NoClientAuth, AllowAnyAuthenticatedClient,
pub use crate::msgs::enums::ProtocolVersion;
pub use crate::msgs::enums::SignatureScheme;
pub use crate::msgs::enums::CipherSuite;
pub use crate::error::TLSError;
pub use crate::session::Session;
pub use crate::stream::{Stream, StreamOwned};
pub use crate::anchors::{DistinguishedNames, RootCertStore};
pub use crate::client::StoresClientSessions;
pub use crate::client::handy::{NoClientSessionStorage, ClientSessionMemoryCache};
pub use crate::client::{ClientConfig, ClientSession, WriteEarlyData};
pub use crate::client::ResolvesClientCert;
pub use crate::server::StoresServerSessions;
pub use crate::server::handy::{NoServerSessionStorage, ServerSessionMemoryCache};
pub use crate::server::{ServerConfig, ServerSession};
pub use crate::server::handy::ResolvesServerCertUsingSNI;
pub use crate::server::ResolvesServerCert;
pub use crate::server::ProducesTickets;
pub use crate::ticketer::Ticketer;
pub use crate::verify::{NoClientAuth, AllowAnyAuthenticatedClient,
AllowAnyAnonymousOrAuthenticatedClient};
pub use suites::{ALL_CIPHERSUITES, BulkAlgorithm, SupportedCipherSuite};
pub use key::{Certificate, PrivateKey};
pub use keylog::{KeyLog, NoKeyLog, KeyLogFile};
pub use vecbuf::WriteV;
pub use crate::suites::{ALL_CIPHERSUITES, BulkAlgorithm, SupportedCipherSuite};
pub use crate::key::{Certificate, PrivateKey};
pub use crate::keylog::{KeyLog, NoKeyLog, KeyLogFile};
pub use crate::vecbuf::WriteV;
/// Message signing interfaces and implementations.
pub mod sign;
@ -318,8 +318,8 @@ mod quic {
}
#[cfg(feature = "dangerous_configuration")]
pub use verify::{ServerCertVerifier, ServerCertVerified,
pub use crate::verify::{ServerCertVerifier, ServerCertVerified,
ClientCertVerifier, ClientCertVerified};
#[cfg(feature = "dangerous_configuration")]
pub use client::danger::DangerousClientConfig;
pub use crate::client::danger::DangerousClientConfig;

View File

@ -1,5 +1,5 @@
use msgs::enums::{AlertLevel, AlertDescription};
use msgs::codec::{Codec, Reader};
use crate::msgs::enums::{AlertLevel, AlertDescription};
use crate::msgs::codec::{Codec, Reader};
#[derive(Debug)]
pub struct AlertMessagePayload {

View File

@ -1,6 +1,6 @@
use msgs::codec;
use msgs::codec::{Codec, Reader};
use key;
use crate::msgs::codec;
use crate::msgs::codec::{Codec, Reader};
use crate::key;
/// An externally length'd payload
#[derive(Debug, Clone, PartialEq)]
pub struct Payload(pub Vec<u8>);

View File

@ -1,4 +1,4 @@
use msgs::codec::{Codec, Reader};
use crate::msgs::codec::{Codec, Reader};
#[derive(Debug)]
pub struct ChangeCipherSpecPayload;

View File

@ -54,7 +54,7 @@ pub trait Codec: Debug + Sized {
/// Decode yourself by fiddling with the `Reader`.
/// Return Some if it worked, None if not.
fn read(&mut Reader) -> Option<Self>;
fn read(_: &mut Reader) -> Option<Self>;
/// Convenience function to get the results of `encode()`.
fn get_encoding(&self) -> Vec<u8> {

View File

@ -2,9 +2,9 @@
use std::collections::VecDeque;
use std::io;
use msgs::codec;
use msgs::codec::Codec;
use msgs::message::Message;
use crate::msgs::codec;
use crate::msgs::codec::Codec;
use crate::msgs::message::Message;
const HEADER_SIZE: usize = 1 + 2 + 2;
@ -126,7 +126,7 @@ impl MessageDeframer {
mod tests {
use super::MessageDeframer;
use std::io;
use msgs;
use crate::msgs;
const FIRST_MESSAGE: &'static [u8] = include_bytes!("../testdata/deframer-test.1.bin");
const SECOND_MESSAGE: &'static [u8] = include_bytes!("../testdata/deframer-test.2.bin");

View File

@ -1,6 +1,6 @@
/// This file is autogenerated. See https://github.com/ctz/tls-hacking/
use msgs::codec::{Reader, Codec};
use crate::msgs::codec::{Reader, Codec};
/// The `ProtocolVersion` TLS protocol enum. Values in this enum are taken
/// from the various RFCs covering TLS, and are listed by IANA.

View File

@ -1,7 +1,7 @@
use std::collections::VecDeque;
use msgs::message::{BorrowMessage, Message, MessagePayload};
use msgs::enums::{ContentType, ProtocolVersion};
use crate::msgs::message::{BorrowMessage, Message, MessagePayload};
use crate::msgs::enums::{ContentType, ProtocolVersion};
pub const MAX_FRAGMENT_LEN: usize = 16384;
pub const PACKET_OVERHEAD: usize = 1 + 2 + 2;
@ -66,9 +66,9 @@ impl MessageFragmenter {
#[cfg(test)]
mod tests {
use super::{MessageFragmenter, PACKET_OVERHEAD};
use msgs::message::{MessagePayload, Message};
use msgs::enums::{ContentType, ProtocolVersion};
use msgs::codec::Codec;
use crate::msgs::message::{MessagePayload, Message};
use crate::msgs::enums::{ContentType, ProtocolVersion};
use crate::msgs::codec::Codec;
use std::collections::VecDeque;
fn msg_eq(mm: Option<Message>,

View File

@ -1,18 +1,18 @@
use msgs::enums::{ProtocolVersion, HandshakeType};
use msgs::enums::{CipherSuite, Compression, ExtensionType, ECPointFormat};
use msgs::enums::{HashAlgorithm, SignatureAlgorithm, ServerNameType};
use msgs::enums::{SignatureScheme, KeyUpdateRequest, NamedGroup};
use msgs::enums::{ClientCertificateType, CertificateStatusType};
use msgs::enums::ECCurveType;
use msgs::enums::PSKKeyExchangeMode;
use msgs::base::{Payload, PayloadU8, PayloadU16, PayloadU24};
use msgs::codec;
use msgs::codec::{Codec, Reader};
use crate::msgs::enums::{ProtocolVersion, HandshakeType};
use crate::msgs::enums::{CipherSuite, Compression, ExtensionType, ECPointFormat};
use crate::msgs::enums::{HashAlgorithm, SignatureAlgorithm, ServerNameType};
use crate::msgs::enums::{SignatureScheme, KeyUpdateRequest, NamedGroup};
use crate::msgs::enums::{ClientCertificateType, CertificateStatusType};
use crate::msgs::enums::ECCurveType;
use crate::msgs::enums::PSKKeyExchangeMode;
use crate::msgs::base::{Payload, PayloadU8, PayloadU16, PayloadU24};
use crate::msgs::codec;
use crate::msgs::codec::{Codec, Reader};
use std::fmt;
use std::io::Write;
use std::collections;
use std::mem;
use key;
use crate::key;
use untrusted;
use webpki;
@ -241,8 +241,8 @@ impl DecomposedSignatureScheme for SignatureScheme {
}
fn make(alg: SignatureAlgorithm, hash: HashAlgorithm) -> SignatureScheme {
use msgs::enums::SignatureAlgorithm::{RSA, ECDSA};
use msgs::enums::HashAlgorithm::{SHA1, SHA256, SHA384, SHA512};
use crate::msgs::enums::SignatureAlgorithm::{RSA, ECDSA};
use crate::msgs::enums::HashAlgorithm::{SHA1, SHA256, SHA384, SHA512};
match (alg, hash) {
(RSA, SHA1) => SignatureScheme::RSA_PKCS1_SHA1,

View File

@ -3,7 +3,7 @@ use super::enums::*;
use super::base::{Payload, PayloadU8, PayloadU16, PayloadU24};
use super::codec::{Reader, Codec};
use webpki::DNSNameRef;
use key::Certificate;
use crate::key::Certificate;
use std::mem;

View File

@ -1,10 +1,10 @@
use std::collections::VecDeque;
use msgs::codec;
use msgs::message::{Message, MessagePayload};
use msgs::enums::{ContentType, ProtocolVersion};
use msgs::handshake::HandshakeMessagePayload;
use crate::msgs::codec;
use crate::msgs::message::{Message, MessagePayload};
use crate::msgs::enums::{ContentType, ProtocolVersion};
use crate::msgs::handshake::HandshakeMessagePayload;
const HEADER_SIZE: usize = 1 + 3;
@ -103,10 +103,10 @@ impl HandshakeJoiner {
#[cfg(test)]
mod tests {
use super::HandshakeJoiner;
use msgs::enums::{ProtocolVersion, ContentType, HandshakeType};
use msgs::handshake::{HandshakeMessagePayload, HandshakePayload};
use msgs::message::{Message, MessagePayload};
use msgs::base::Payload;
use crate::msgs::enums::{ProtocolVersion, ContentType, HandshakeType};
use crate::msgs::handshake::{HandshakeMessagePayload, HandshakePayload};
use crate::msgs::message::{Message, MessagePayload};
use crate::msgs::base::Payload;
#[test]
fn want() {

View File

@ -1,12 +1,12 @@
use msgs::codec::{Codec, Reader};
use msgs::base::Payload;
use msgs::alert::AlertMessagePayload;
use msgs::ccs::ChangeCipherSpecPayload;
use msgs::handshake::HandshakeMessagePayload;
use msgs::enums::{ContentType, ProtocolVersion};
use msgs::enums::{AlertLevel, AlertDescription};
use msgs::enums::HandshakeType;
use crate::msgs::codec::{Codec, Reader};
use crate::msgs::base::Payload;
use crate::msgs::alert::AlertMessagePayload;
use crate::msgs::ccs::ChangeCipherSpecPayload;
use crate::msgs::handshake::HandshakeMessagePayload;
use crate::msgs::enums::{ContentType, ProtocolVersion};
use crate::msgs::enums::{AlertLevel, AlertDescription};
use crate::msgs::enums::HandshakeType;
use std::mem;

View File

@ -1,8 +1,8 @@
use msgs::handshake::SessionID;
use msgs::enums::{CipherSuite, ProtocolVersion};
use msgs::codec::{Reader, Codec};
use msgs::handshake::CertificatePayload;
use msgs::base::{PayloadU8, PayloadU16};
use crate::msgs::handshake::SessionID;
use crate::msgs::enums::{CipherSuite, ProtocolVersion};
use crate::msgs::codec::{Reader, Codec};
use crate::msgs::handshake::CertificatePayload;
use crate::msgs::base::{PayloadU8, PayloadU16};
use webpki;
use untrusted;

View File

@ -1,6 +1,6 @@
use std::io;
use base64;
use key;
use crate::key;
/// Extract and decode all PEM sections from `rd`, which begin with `start_mark`
/// and end with `end_mark`. Apply the functor `f` to each decoded buffer,

View File

@ -1,12 +1,12 @@
/// This module contains optional APIs for implementing QUIC TLS.
use client::{ClientConfig, ClientSession, ClientSessionImpl};
use msgs::enums::{ContentType, ProtocolVersion, AlertDescription};
use msgs::handshake::{ClientExtension, ServerExtension};
use msgs::message::{Message, MessagePayload};
use server::{ServerConfig, ServerSession, ServerSessionImpl};
use error::TLSError;
use key_schedule::{KeySchedule, SecretKind};
use session::{SessionCommon, Protocol};
use crate::client::{ClientConfig, ClientSession, ClientSessionImpl};
use crate::msgs::enums::{ContentType, ProtocolVersion, AlertDescription};
use crate::msgs::handshake::{ClientExtension, ServerExtension};
use crate::msgs::message::{Message, MessagePayload};
use crate::server::{ServerConfig, ServerSession, ServerSessionImpl};
use crate::error::TLSError;
use crate::key_schedule::{KeySchedule, SecretKind};
use crate::session::{SessionCommon, Protocol};
use std::sync::Arc;
use webpki;

View File

@ -4,7 +4,7 @@
/// they panic on error.
use ring::rand::{SystemRandom, SecureRandom};
use msgs::codec;
use crate::msgs::codec;
/// Fill the whole slice with random material.
pub fn fill_random(bytes: &mut [u8]) {

View File

@ -1,7 +1,7 @@
use session::SessionRandoms;
use msgs::handshake::{ServerExtension, SessionID};
use suites;
use key;
use crate::session::SessionRandoms;
use crate::msgs::handshake::{ServerExtension, SessionID};
use crate::suites;
use crate::key;
use std::mem;

View File

@ -1,9 +1,9 @@
use msgs::enums::SignatureScheme;
use sign;
use key;
use crate::msgs::enums::SignatureScheme;
use crate::sign;
use crate::key;
use webpki;
use server;
use error::TLSError;
use crate::server;
use crate::error::TLSError;
use std::collections;
use std::sync::{Arc, Mutex};
@ -189,7 +189,7 @@ impl server::ResolvesServerCert for ResolvesServerCertUsingSNI {
#[cfg(test)]
mod test {
use super::*;
use StoresServerSessions;
use crate::StoresServerSessions;
#[test]
fn test_noserversessionstorage_drops_put() {

View File

@ -1,46 +1,46 @@
use msgs::enums::{ContentType, HandshakeType, ProtocolVersion};
use msgs::enums::{Compression, NamedGroup, ECPointFormat, CipherSuite};
use msgs::enums::{ExtensionType, AlertDescription};
use msgs::enums::{ClientCertificateType, SignatureScheme, PSKKeyExchangeMode};
use msgs::message::{Message, MessagePayload};
use msgs::base::{Payload, PayloadU8};
use msgs::handshake::{HandshakePayload, SupportedSignatureSchemes};
use msgs::handshake::{HandshakeMessagePayload, ServerHelloPayload, Random};
use msgs::handshake::{ClientHelloPayload, ServerExtension, SessionID};
use msgs::handshake::{ConvertProtocolNameList, ConvertServerNameList};
use msgs::handshake::{NamedGroups, SupportedGroups, ClientExtension};
use msgs::handshake::{ECPointFormatList, SupportedPointFormats};
use msgs::handshake::{ServerECDHParams, DigitallySignedStruct};
use msgs::handshake::{ServerKeyExchangePayload, ECDHEServerKeyExchange};
use msgs::handshake::{CertificateRequestPayload, NewSessionTicketPayload};
use msgs::handshake::{CertificateRequestPayloadTLS13, NewSessionTicketPayloadTLS13};
use msgs::handshake::{HelloRetryRequest, HelloRetryExtension, KeyShareEntry};
use msgs::handshake::{CertificatePayloadTLS13, CertificateEntry};
use msgs::handshake::{CertificateStatus, CertificateExtension};
use msgs::handshake::{CertReqExtension, SupportedMandatedSignatureSchemes};
use msgs::ccs::ChangeCipherSpecPayload;
use msgs::codec::Codec;
use msgs::persist;
use session::SessionSecrets;
use cipher;
use server::ServerSessionImpl;
use key_schedule::{KeySchedule, SecretKind};
use suites;
use verify;
use util;
use rand;
use sign;
use error::TLSError;
use handshake::{check_handshake_message, check_message};
use crate::msgs::enums::{ContentType, HandshakeType, ProtocolVersion};
use crate::msgs::enums::{Compression, NamedGroup, ECPointFormat, CipherSuite};
use crate::msgs::enums::{ExtensionType, AlertDescription};
use crate::msgs::enums::{ClientCertificateType, SignatureScheme, PSKKeyExchangeMode};
use crate::msgs::message::{Message, MessagePayload};
use crate::msgs::base::{Payload, PayloadU8};
use crate::msgs::handshake::{HandshakePayload, SupportedSignatureSchemes};
use crate::msgs::handshake::{HandshakeMessagePayload, ServerHelloPayload, Random};
use crate::msgs::handshake::{ClientHelloPayload, ServerExtension, SessionID};
use crate::msgs::handshake::{ConvertProtocolNameList, ConvertServerNameList};
use crate::msgs::handshake::{NamedGroups, SupportedGroups, ClientExtension};
use crate::msgs::handshake::{ECPointFormatList, SupportedPointFormats};
use crate::msgs::handshake::{ServerECDHParams, DigitallySignedStruct};
use crate::msgs::handshake::{ServerKeyExchangePayload, ECDHEServerKeyExchange};
use crate::msgs::handshake::{CertificateRequestPayload, NewSessionTicketPayload};
use crate::msgs::handshake::{CertificateRequestPayloadTLS13, NewSessionTicketPayloadTLS13};
use crate::msgs::handshake::{HelloRetryRequest, HelloRetryExtension, KeyShareEntry};
use crate::msgs::handshake::{CertificatePayloadTLS13, CertificateEntry};
use crate::msgs::handshake::{CertificateStatus, CertificateExtension};
use crate::msgs::handshake::{CertReqExtension, SupportedMandatedSignatureSchemes};
use crate::msgs::ccs::ChangeCipherSpecPayload;
use crate::msgs::codec::Codec;
use crate::msgs::persist;
use crate::session::SessionSecrets;
use crate::cipher;
use crate::server::ServerSessionImpl;
use crate::key_schedule::{KeySchedule, SecretKind};
use crate::suites;
use crate::verify;
use crate::util;
use crate::rand;
use crate::sign;
use crate::error::TLSError;
use crate::handshake::{check_handshake_message, check_message};
use webpki;
#[cfg(feature = "quic")]
use {
use crate::{
quic,
msgs::handshake::NewSessionTicketExtension,
session::Protocol
};
use server::common::{HandshakeDetails, ServerKXDetails, ClientCertDetails};
use crate::server::common::{HandshakeDetails, ServerKXDetails, ClientCertDetails};
use ring::constant_time;

View File

@ -1,15 +1,15 @@
use session::{Session, SessionCommon};
use keylog::{KeyLog, NoKeyLog};
use suites::{SupportedCipherSuite, ALL_CIPHERSUITES};
use msgs::enums::{ContentType, SignatureScheme};
use msgs::enums::{AlertDescription, HandshakeType, ProtocolVersion};
use msgs::handshake::ServerExtension;
use msgs::message::Message;
use error::TLSError;
use sign;
use verify;
use key;
use vecbuf::WriteV;
use crate::session::{Session, SessionCommon};
use crate::keylog::{KeyLog, NoKeyLog};
use crate::suites::{SupportedCipherSuite, ALL_CIPHERSUITES};
use crate::msgs::enums::{ContentType, SignatureScheme};
use crate::msgs::enums::{AlertDescription, HandshakeType, ProtocolVersion};
use crate::msgs::handshake::ServerExtension;
use crate::msgs::message::Message;
use crate::error::TLSError;
use crate::sign;
use crate::verify;
use crate::key;
use crate::vecbuf::WriteV;
use webpki;

View File

@ -1,23 +1,23 @@
use ring;
use std::io::{Read, Write};
use msgs::message::{BorrowMessage, Message, MessagePayload};
use msgs::deframer::MessageDeframer;
use msgs::fragmenter::{MessageFragmenter, MAX_FRAGMENT_LEN};
use msgs::hsjoiner::HandshakeJoiner;
use msgs::base::Payload;
use msgs::codec::Codec;
use msgs::enums::{ContentType, ProtocolVersion, AlertDescription, AlertLevel};
use msgs::enums::KeyUpdateRequest;
use error::TLSError;
use suites::SupportedCipherSuite;
use cipher::{MessageDecrypter, MessageEncrypter, self};
use vecbuf::{ChunkVecBuffer, WriteV};
use key;
use key_schedule::{SecretKind, KeySchedule};
use prf;
use rand;
use quic;
use hash_hs;
use crate::msgs::message::{BorrowMessage, Message, MessagePayload};
use crate::msgs::deframer::MessageDeframer;
use crate::msgs::fragmenter::{MessageFragmenter, MAX_FRAGMENT_LEN};
use crate::msgs::hsjoiner::HandshakeJoiner;
use crate::msgs::base::Payload;
use crate::msgs::codec::Codec;
use crate::msgs::enums::{ContentType, ProtocolVersion, AlertDescription, AlertLevel};
use crate::msgs::enums::KeyUpdateRequest;
use crate::error::TLSError;
use crate::suites::SupportedCipherSuite;
use crate::cipher::{MessageDecrypter, MessageEncrypter, self};
use crate::vecbuf::{ChunkVecBuffer, WriteV};
use crate::key;
use crate::key_schedule::{SecretKind, KeySchedule};
use crate::prf;
use crate::rand;
use crate::quic;
use crate::hash_hs;
use std::io;
use std::collections::VecDeque;

View File

@ -1,7 +1,7 @@
use msgs::enums::{SignatureAlgorithm, SignatureScheme};
use util;
use key;
use error::TLSError;
use crate::msgs::enums::{SignatureAlgorithm, SignatureScheme};
use crate::util;
use crate::key;
use crate::error::TLSError;
use untrusted;
@ -275,7 +275,7 @@ impl SigningKey for SingleSchemeSigningKey {
}
fn algorithm(&self) -> SignatureAlgorithm {
use msgs::handshake::DecomposedSignatureScheme;
use crate::msgs::handshake::DecomposedSignatureScheme;
self.scheme.sign()
}
}

View File

@ -1,5 +1,5 @@
use std::io::{Read, Write, Result};
use session::Session;
use crate::session::Session;
/// This type implements `io::Read` and `io::Write`, encapsulating
/// a Session `S` and an underlying transport `T`, such as a socket.
@ -128,9 +128,9 @@ impl<S, T> Write for StreamOwned<S, T> where S: Session, T: Read + Write {
#[cfg(test)]
mod tests {
use super::{Stream, StreamOwned};
use session::Session;
use client::ClientSession;
use server::ServerSession;
use crate::session::Session;
use crate::client::ClientSession;
use crate::server::ServerSession;
use std::net::TcpStream;
#[test]

View File

@ -1,9 +1,9 @@
use msgs::enums::{CipherSuite, HashAlgorithm, SignatureAlgorithm, SignatureScheme};
use msgs::enums::{NamedGroup, ProtocolVersion};
use msgs::handshake::KeyExchangeAlgorithm;
use msgs::handshake::DecomposedSignatureScheme;
use msgs::handshake::{ClientECDHParams, ServerECDHParams};
use msgs::codec::{Reader, Codec};
use crate::msgs::enums::{CipherSuite, HashAlgorithm, SignatureAlgorithm, SignatureScheme};
use crate::msgs::enums::{NamedGroup, ProtocolVersion};
use crate::msgs::handshake::KeyExchangeAlgorithm;
use crate::msgs::handshake::DecomposedSignatureScheme;
use crate::msgs::handshake::{ClientECDHParams, ServerECDHParams};
use crate::msgs::codec::{Reader, Codec};
use ring;
use untrusted;
@ -422,7 +422,7 @@ pub fn reduce_given_version(all: &[&'static SupportedCipherSuite],
#[cfg(test)]
mod test {
use msgs::enums::CipherSuite;
use crate::msgs::enums::CipherSuite;
#[test]
fn test_client_pref() {

View File

@ -1,6 +1,6 @@
use server::ProducesTickets;
use rand;
use crate::server::ProducesTickets;
use crate::rand;
use std::mem;
use std::sync::{Mutex, Arc};

View File

@ -4,12 +4,12 @@ use sct;
use std;
use std::sync::Arc;
use key::Certificate;
use msgs::handshake::DigitallySignedStruct;
use msgs::handshake::SCTList;
use msgs::enums::SignatureScheme;
use error::TLSError;
use anchors::{DistinguishedNames, RootCertStore};
use crate::key::Certificate;
use crate::msgs::handshake::DigitallySignedStruct;
use crate::msgs::handshake::SCTList;
use crate::msgs::enums::SignatureScheme;
use crate::error::TLSError;
use crate::anchors::{DistinguishedNames, RootCertStore};
type SignatureAlgorithms = &'static [&'static webpki::SignatureAlgorithm];
@ -321,7 +321,7 @@ pub fn verify_signed_struct(message: &[u8],
fn convert_alg_tls13(scheme: SignatureScheme)
-> Result<&'static webpki::SignatureAlgorithm, TLSError> {
use msgs::enums::SignatureScheme::*;
use crate::msgs::enums::SignatureScheme::*;
match scheme {
ECDSA_NISTP256_SHA256 => Ok(&webpki::ECDSA_P256_SHA256),

View File

@ -6,11 +6,11 @@
use std::time::{Duration, Instant};
use anchors;
use error::TLSError;
use verify;
use verify::ServerCertVerifier;
use key;
use crate::anchors;
use crate::error::TLSError;
use crate::verify;
use crate::verify::ServerCertVerifier;
use crate::key;
use webpki;
extern crate webpki_roots;

View File

@ -1,6 +1,6 @@
#[allow(dead_code)]
mod common;
use common::OpenSSLServer;
use crate::common::OpenSSLServer;
// Test where the server gives certificates A -> B where the
// validation path is A -> B -> C where C is a trust root

View File

@ -3,7 +3,7 @@
#[allow(dead_code)]
mod common;
use common::OpenSSLServer;
use crate::common::OpenSSLServer;
#[test]
fn ecdhe_rsa_aes_128_gcm_sha256() {

View File

@ -2,7 +2,7 @@
#[allow(dead_code)]
mod common;
use common::OpenSSLServer;
use crate::common::OpenSSLServer;
#[test]
fn curve_nistp256() {

View File

@ -2,7 +2,7 @@
#[allow(dead_code)]
mod common;
use common::OpenSSLServer;
use crate::common::OpenSSLServer;
#[test]
fn no_ecdhe() {

View File

@ -1,7 +1,7 @@
#[allow(dead_code)]
mod common;
use common::OpenSSLServer;
use common::TlsServer;
use crate::common::OpenSSLServer;
use crate::common::TlsServer;
use std::fs;

View File

@ -3,7 +3,7 @@
#[allow(dead_code)]
mod common;
use common::TlsServer;
use crate::common::TlsServer;
#[test]
fn ecdhe_rsa_aes_128_gcm_sha256() {