Git Product home page Git Product logo

openssl-tests's Introduction

openssl-tests

An experiment for running BoringSSL tests against OpenSSL

Notes

This is not an official Google product.

This is an experimental patch. Several tests fail for the wrong reasons, for example, because the BoringSSL test harness is tuned to specific BoringSSL errors, or because a BoringSSL feature is not available in OpenSSL.

OpenSSL and BoringSSL are provided as git submodules. This means that, by default, they're checked out to a specific git commit at which the patch and build are known to work.

Please check the openssl INSTALL file for build pre-requisites. You will also need "go" installed.

Build instructions

  1. Initialize the OpenSSL and BoringSSL submodules:

    $ git submodule init
    $ git submodule update
    
  2. Configure OpenSSL

    $ cd openssl
    $ ./config enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers
    $ cd ..
    
  3. Patch BoringSSL

    $ cd boringssl && git am ../ossl-shim.patch && cd ..
    
  4. Build and run tests

    $ make test
    

Other instructions

  • To test against a newer version of OpenSSL locally, cd into the submodule directory and use git as usual, e.g., to pull the latest master:

    $ git checkout master
    $ git pull
    
  • To revert all local changes and bring the submodules back to the original state, do:

    $ git submodule update
    
  • To run a single test:

    $ cd boringssl/ssl/test/runner
    $ go test -shim-path ../../../../ossl_shim -pipe -test TestName
    

openssl-tests's People

Contributors

ekasper avatar mattcaswell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

openssl-tests's Issues

Enable DTLS retransmit tests

There are a bunch of DTLS retransmit tests that currently don't work. They depend on SSL_CTX_set_current_time_cb which is a BoringSSL-only API to mock out the clock used in retransmit.

Might be worth getting those working since 1.1.0 rewrote a lot of stuff around the handshake, to make sure that's all still working as expected.

https://commondatastorage.googleapis.com/chromium-boringssl-docs/ssl.h.html#SSL_CTX_set_current_time_cb
https://boringssl.googlesource.com/boringssl/+/master/ssl/test/runner/runner.go#4765

Figure out how to make updating less painful

Right now we have a large diff on bssl_shim and a small diff on runner.go. It'd be nice to avoid rebasing being a hassle. Filing this so we have a place to figure out ideas.

I think ideally we'd get rid of the runner.go diff. For the shim, I think we want to move to this repo containing a fork of bssl_shim rather than patches. It seems the diff is large enough that patches aren't quite reasonable? However, the churn might make that unrealistic. Not sure. There are probably changes to be made to cut down on churn in the shim.

Some ideas:

  • Move all the CheckHandshakeProperties logic out of the shim. The shim perhaps has an extra channel to the runner and spits out some kind of (key, value) list. Then the Go code can assert on all that.
  • Better story for unimplemented stuff. Test suppressions in config files? The command-line parser has a dedicated exit code for unknown flags that the runner interprets as a skip?
  • Figure out what to do about all the expectedError checks. We could either have a config file mapping to OpenSSL strings or perhaps we add the right expectedLocalError (runner-side) and explore what value expectedError (shim-side) gives us that expectedLocalError can't.
  • A few flags control "API" behavior that, in theory, should be invisible, like -async and -implicit-handshake. Different implementations may have different API modes they'd like to test. Perhaps those shouldn't be controlled by the test case and instead runner should just take a set of "configurations" and do the cross product?
    • Some tests might be sensitive to this for weird reasons. Would need to sort that out, or config should say "skip X test for Y config".
    • This would make tests take even longer to run, but maybe that's fine?
    • Another nuisance is some "modes" are probably specific to certain tests, like OpenSSL/BoringSSL have multiple client auth configuration APIs. Perhaps we should specify that some modes only apply to some tests?
  • There's flags that control the shim's read/write pattern like -write-different-record-sizes, -shim-writes-first, -shim-shuts-down. Those have always bugged me a little. It would be good if ossl_shim needn't update every time we need a new read/write pattern. Maybe there should be some "control" channel to the shim so we can just tell the shim "please read 5 bytes now and tell me what you think you got", "please write this data now", "please shutdown now", etc. That could be the same channel as the (key, value) results list, perhaps.

@ekasper @mattcaswell, what are your thoughts? Most of this would involve changes in BoringSSL, but I'm open to changing the BoringSSL copy where helpful. (Assuming, of course, they don't get in the way of satisfying our own testing needs. But most of these changes seem like general cleanliness improvements anyway. Test suppressions and stuff aren't as useful for us, but shouldn't be too burdensome.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.