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

[wasm][crypto] RandomNumberGenerator mapped to Web Crypto getRandomValues #42728

Merged
merged 19 commits into from
Oct 1, 2020
Merged

[wasm][crypto] RandomNumberGenerator mapped to Web Crypto getRandomValues #42728

merged 19 commits into from
Oct 1, 2020

Commits on Sep 25, 2020

  1. [wasm][crypto] RandomNumberGenerator mapped to Web Crypto getRandomVa…

    …lues
    
    - Uses Web Crypto API [`getRandomValues`](https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues) if available.
    - Falls back to `/dev/urandom` as default if the crypto library is missing.
    kjpou1 committed Sep 25, 2020
    Configuration menu
    Copy the full SHA
    f0a662c View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2020

  1. Configuration menu
    Copy the full SHA
    eb46e2f View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' of https://github.com/dotnet/runtime into wasm-…

    …crypto-getRandomValues
    kjpou1 committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    ce149c9 View commit details
    Browse the repository at this point in the history
  3. remove extraneous code comment

    kjpou1 committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    878cfcf View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    289efef View commit details
    Browse the repository at this point in the history
  5. Address review comment

    kjpou1 committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    b5d372b View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2020

  1. Merge branch 'master' of https://github.com/dotnet/runtime into wasm-…

    …crypto-getRandomValues
    kjpou1 committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    f657f4f View commit details
    Browse the repository at this point in the history
  2. Add javascript bridge implementation library to Native source tree.

    - Javascript checks for crypto interface and uses `crypto.getRandomValues`
    - Add api bridge call when building for emscripten browser.
    - separate out into browser subdirectory
    - If we couldn't find a proper implementation, as Math.random() is not suitable we will abort.
    
    ```
    
    ABORT: no cryptographic support found getRandomValues. Consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };
    
    ```
    kjpou1 committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    cf74a12 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    88fa846 View commit details
    Browse the repository at this point in the history
  4. Remove old test code

    kjpou1 committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    2b8987d View commit details
    Browse the repository at this point in the history
  5. Remove testing code

    kjpou1 committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    61f1c19 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ce13ad1 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2020

  1. Merge branch 'master' of https://github.com/dotnet/runtime into wasm-…

    …crypto-getRandomValues
    kjpou1 committed Sep 30, 2020
    Configuration menu
    Copy the full SHA
    4eb6639 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5e593bb View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2020

  1. Update src/mono/wasm/runtime-test.js

    Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
    kjpou1 and CoffeeFlux authored Oct 1, 2020
    Configuration menu
    Copy the full SHA
    76de399 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' of https://github.com/dotnet/runtime into wasm-…

    …crypto-getRandomValues
    kjpou1 committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    75a81ce View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8077f7c View commit details
    Browse the repository at this point in the history
  4. Formatting

    kjpou1 committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    ec16f1a View commit details
    Browse the repository at this point in the history
  5. Return -1 if crypto does not exist instead of aborting from js. This …

    …allows the managed code exception flow to continue as normal.
    kjpou1 committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    7b7e9d2 View commit details
    Browse the repository at this point in the history