Skip to content

Latest commit

 

History

History
 
 

chromium

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

This directory contains instructions and corresponding patches to build the Chromium web browser using the OQS-BoringSSL fork, thereby enabling Chromium to use quantum-safe key exchange algorithms. Note that these instructions have only been tested on an Ubuntu 19.10 x86_64 machine and apply at present only to a subset of quantum-safe key-exchanges as documented here.

Further be aware that both cloning the source code as well as building Chromium can take several hours if you do not have excellent network connectivity and serious multicore CPUs at your disposal: The download has a size of over 40GB and even a size-and-performance optimized build (see note below) takes 1143 CPU user minutes on a 2.6GHz i7 CPU, i.e. something like 300 minutes or 5 hours on a quad-core system.

  1. Ensure the system requirements listed here are met.

  2. To obtain the source code, follow the instructions in the "Install depot_tools" and "Get the code" sections here. Note: Do not set --no-history to save time as you need git history in the next step.

  3. Navigate to the root directory of the source code, which we will refer to hereafter as <CHROMIMUM_ROOT>, and run git checkout 85.0.4161.2, which is the latest tag for which we have verified the build instructions. Then, to ensure that all of chromium's third party dependencies are compatible with this tag, run gclient sync.

  4. Navigate to <CHROMIUM_ROOT>/third_party/boringssl/src, and switch the BoringSSL source code to the OQS-BoringSSL fork by running the following commands:

  • git remote add oqs-bssl https://github.com/open-quantum-safe/boringssl
  • git fetch oqs-bssl
  • git checkout -b oqs-bssl-master oqs-bssl/master
  1. In a directory of your choosing, clone and build liboqs as follows:
  • git clone --branch master https://github.com/open-quantum-safe/liboqs.git
  • cd liboqs && mkdir build && cd build
  • cmake .. -G"Ninja" -DCMAKE_INSTALL_PREFIX=<CHROMIUM_ROOT>/third_party/boringssl/src/oqs -DOQS_USE_OPENSSL=OFF
  • ninja && ninja install

Note: You might have to install ninja if not already done, e.g., by running sudo apt-get install ninja. You also might want to run SKIP_TESTS=doxygen,style ninja run_tests to validate liboqs operating OK on your machine. For this you need to install pytest if not already present on your machine, e.g., by running sudo apt-get install python3-pytest python3-pytest-xdist first.

  1. After successfully installing liboqs as per the above, navigate to <CHROMIUM_ROOT> and apply the oqs-mods.patch file provided here by running git apply <PATH_TO_PATCH_FILE>. Then, navigate to third_party/boringssl, and run python src/util/generate_build_files.py gn.

Note: For this to succeed, you might have to install go if not already present on your machine, e.g., by running sudo apt install golang-go. If any error occurs in this step, Chromium will build fine, just without support for quantum-safe crypto, i.e., only the final testing steps below will fail.

  1. Finally, navigate back to <CHROMIUM_ROOT> and follow the instructions here from the "Install additional build dependencies" section onwards to build Chromium.

Note: It is strongly advisable to set certain build options to obtain a size-and-performance optimized chromium variant, also saving on build time. Do this by executing gn args out/Default and adding the following variables to the configuration file opened in your editor:

# Set build arguments here. See `gn help buildargs`.
is_debug = false
symbol_level = 0
enable_nacl = false
blink_symbol_level=0

To verify that Chromium can perform a TLS 1.3 handshake using a post-quantum key exchange:

  1. Navigate to <CHROMIUM_ROOT>, and start Chromium by executing ./out/Default/chrome
  2. Navigate again to the <CHROMIUM_ROOT>/third_party/boringssl/src folder, and build OQS-BoringSSL as a standalone project by running mkdir build && cd build && cmake -GNinja ...
  3. Then, in the build directory, run ./tool/bssl server -accept 4433 -www -loop -curves <KEX>, where <KEX> can be any key-exchange algorithm named here that is supported by default by Chromium. The kDefaultGroups array lists all such algorithms*.
  4. Load https://localhost:4433 in Chromium.

An alternative test consists of using the newly built Chromium to access the OQS test server at https://test.openquantumsafe.org and clicking on any of the algorithm combinations supported by Chromium, e.g., p256_kyber512 (running at port 6071 ).

Note: In order to avoid certificate warnings, you need to download the test site certificate using the newly-built chromium. Then click the "..." Control extensions button in the top-right window corner of your newly built Chromium browser, select "Settings", click on "Privacy and Security" in the newly opened window on the left, click on "Security" in the window pane on the right, scroll down and click on "Manage certificates", click on the "Certificates" tab in the newly opened screen, click on "Import" near the top of the newly opened pane and click on the "Downloads" folder on the file selector window that opens. Then double-click on "CA.crt" and check the box next to "Trust this certificate for identifying websites" and finally click "OK".

* For an explanation of why Chromium supports only a subset of key-exchange algorithms by default, consult OQS-BoringSSL's Implementation Notes wiki page.