1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
//! TODO: Write intro: <https://github.com/tlspuffin/tlspuffin/issues/94>
//!
//! ### Used protocol and cryptographic libraries
//!
//! In order to easily implement concrete functions, we use several libraries which provide us with
//! predefined encoders for TLS packets, cryptographic primitives, as well as higher level
//! cryptographic operations specific for TLS.
//!
//! We forked the [rustls](https://github.com/ctz/rustls) library for cryptographic operations like deriving secrets. We also use it to encode and decode TLS messages.
//!
//! The cryptographic library [ring](https://github.com/briansmith/ring) allows us to use the derived secrets to encrypt and decrypt TLS messages.
//! # Example
//!
//! ```rust
//! use puffin::agent::TLSVersion::*;
//! use puffin::agent::{AgentDescriptor, AgentName};
//! use puffin::algebra::signature::Signature;
//! use puffin::algebra::Term;
//! use puffin::input_action;
//! use puffin::trace::{
//! Action, InputAction, OutputAction, Query, Source, Step, Trace, TraceContext,
//! };
//! use tlspuffin::protocol::TLSProtocolTypes;
//! use tlspuffin::query::TlsQueryMatcher;
//! use tlspuffin::tls::fn_impl::fn_client_hello;
//! use tlspuffin::tls::rustls::msgs::enums::{
//! CipherSuite, Compression, HandshakeType, ProtocolVersion,
//! };
//! use tlspuffin::tls::rustls::msgs::handshake::{ClientExtension, Random, SessionID};
//!
//! let client: AgentName = AgentName::first();
//! let server: AgentName = client.next();
//!
//! let trace = Trace::<TLSProtocolTypes> {
//! prior_traces: vec![],
//! descriptors: vec![
//! AgentDescriptor::new_client(client, V1_3),
//! AgentDescriptor::new_server(server, V1_3),
//! ],
//! steps: vec![
//! OutputAction::new_step(client),
//! // Client: Hello Client -> Server
//! Step {
//! agent: server,
//! action: Action::Input(input_action! {
//! Term::Application(
//! Signature::new_function(&fn_client_hello),
//! vec![
//! Term::Variable(Signature::new_var_with_type::<ProtocolVersion, _>(
//! Some(Source::Agent(client)),
//! Some(TlsQueryMatcher::Handshake(Some(HandshakeType::ClientHello))),
//! 0,
//! )),
//! Term::Variable(Signature::new_var_with_type::<Random, _>(
//! Some(Source::Agent(client)),
//! Some(TlsQueryMatcher::Handshake(Some(HandshakeType::ClientHello))),
//! 0,
//! )),
//! Term::Variable(Signature::new_var_with_type::<SessionID, _>(
//! Some(Source::Agent(client)),
//! Some(TlsQueryMatcher::Handshake(Some(HandshakeType::ClientHello))),
//! 0,
//! )),
//! Term::Variable(Signature::new_var_with_type::<Vec<CipherSuite>, _>(
//! Some(Source::Agent(client)),
//! Some(TlsQueryMatcher::Handshake(Some(HandshakeType::ClientHello))),
//! 0,
//! )),
//! Term::Variable(Signature::new_var_with_type::<Vec<Compression>, _>(
//! Some(Source::Agent(client)),
//! Some(TlsQueryMatcher::Handshake(Some(HandshakeType::ClientHello))),
//! 0,
//! )),
//! Term::Variable(
//! Signature::new_var_with_type::<Vec<ClientExtension>, _>(
//! Some(Source::Agent(client)),
//! Some(TlsQueryMatcher::Handshake(Some(
//! HandshakeType::ClientHello,
//! ))),
//! 0,
//! ),
//! ),
//! ],
//! )
//! }),
//! },
//! // further steps here
//! ],
//! };
//! ```
//!
//! # Example with `term!` macro
//!
//! ```rust
//! use puffin::agent::AgentName;
//! use puffin::algebra::Term;
//! use puffin::term;
//! use puffin::trace::Source;
//! use tlspuffin::protocol::TLSProtocolTypes;
//! use tlspuffin::query::TlsQueryMatcher;
//! use tlspuffin::tls::fn_impl::fn_client_hello;
//! use tlspuffin::tls::rustls::msgs::enums::{
//! CipherSuite, Compression, HandshakeType, ProtocolVersion,
//! };
//! use tlspuffin::tls::rustls::msgs::handshake::{ClientExtension, Random, SessionID};
//!
//! let client = AgentName::first();
//! let term: Term<TLSProtocolTypes> = term! {
//! fn_client_hello(
//! ((client, 0)/ProtocolVersion),
//! ((client, 0)/Random),
//! ((client, 0)/SessionID),
//! ((client, 0)/Vec<CipherSuite>),
//! ((client, 0)/Vec<Compression>),
//! ((client, 0)/Vec<ClientExtension>)
//! )
//! };
//! ```
#[cfg(feature = "boringssl-binding")]
pub mod boringssl;
#[cfg(feature = "libressl-binding")]
pub mod libressl;
#[cfg(feature = "openssl-binding")]
pub mod openssl;
#[cfg(feature = "wolfssl-binding")]
pub mod wolfssl;
#[cfg(feature = "rust-put")]
pub mod rand;
pub mod claims;
pub mod debug;
pub mod protocol;
pub mod put;
pub mod put_registry;
pub mod query;
pub mod static_certs;
pub mod tcp;
pub mod tls;
#[cfg(feature = "test-utils")]
pub mod test_utils;