Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add openssl support in transport module with some enhancement and bug fix #4

Closed
wants to merge 5 commits into from

Commits on Jul 15, 2024

  1. fix(AutoEvidence): return error too early while creating evidence fro…

    …m dice
    
    Only return Err after attempting all TEEs
    csyJoy committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    ac5f06e View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2024

  1. feat(tls): support openssl in transport module

    feat(tls): add openssl transport module (WIP)
    
    1. apply Builder patten while constructing TLS Client and Server.
    2. implement `send` `shutdown` `receive` interface for TLS Client
    and
    Server.
    3. implement `negotiation` interface for TLS Client and Server
    with
    default openssl verify callback.
    
    TODO:
    1. (maybe) use typestate pattern to staticly protect Client and
    Server
    building procedure.
    2. support openssl error handling.
    3. corner case check before calling bindgen openssl api.
    4. unit test for Client and Server function.
    
    fix(tls-client): use `OPENSSL_EX_DATA_IDX` define in `mod.rs`
    
    fix(tls-init): add custom init function with missing options for
    the `init` function in `openssl-sys`
    
    feat(tls): use a more generic way to handle stream
    
    Add GetFd trait, replace TcpStream with trait object impl GetFd
    
    fix(tls): fix some bugs cause rust borrow checker error and FFI
    call error
    
    feat(tls): replace raw option number with bitflag
    
    feat(tls): support P256
    
    test(tls): add some unit tests
    
    1. openssl init
    2. use private key
    3. use cert
    
    fix(tls-client): fix incorrect SSL function call
    
    feat(tls-init): only init once `ossl_init` by `sync::once`
    
    fix(tls): implement default openssl verify callback correctly
    using rats-rs APIs
    
    use `CertVerifier` to verify cert instead of implementing it
    manually
    
    refactor(tls): code refactor (see full log)
    
    1. expose some functions to pub or pub(crate)
    2. refactor code in a more rust way
    3. remove unused code
    4. implement `with_tcp_steam` as its name implies
    5. merge imports
    
    feat(tls): support mutual client server
    
    test(tls): remove duplicated init
    csyJoy committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    2c14197 View commit details
    Browse the repository at this point in the history
  2. feat(cert): build x509 certificate manually to pass openssl pre-verif…

    …ication
    
    The only difference between the current certificate content and
    the previously generated Root certificate content is the addition
    of Certificate Sign to the KeyUsage Extension.
    csyJoy committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    82bc339 View commit details
    Browse the repository at this point in the history
  3. feat(tls-example): add tls echo server

    TODO:
    1. mutual client and server
    2. more command options
    
    feat(tls-example): add `attest_self` and `verify_peer` in tls example
    csyJoy committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    46afbe5 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2024

  1. fix(misc): Fixed unreasonable parts in the pull request

    1. add comment to `ossl_init` referring to rats-tls repository
    2. inline `init` method of `Client` and `Server` to each
    Builders' method, remove unused Option
    3. remove `Arc<Mutex<Cell<>>` wrapper for openssl CRYPTO index
    since it never change after initialized
    4. move `GetFdDumpImpl` to test module as a stream mock
    csyJoy committed Sep 1, 2024
    Configuration menu
    Copy the full SHA
    f486934 View commit details
    Browse the repository at this point in the history