Skip to content

Commit

Permalink
fix: Fix wasm32-unknown-unknown
Browse files Browse the repository at this point in the history
current c2pa-rs main branch:
x509-certificate v0.21.0 -> ring 0.16.20
This version of ring does not support WASI.

x509-certificate v0.22.0 -> ring 0.17.5
This version of ring supports WASI and wasm32-unknown-unknown, but this
version of x509-certificate added the use of ring::rand::SystemRandom
to signing.rs. This works with WASI, but not wasm32-unknown-unknown.

The solution was to add ring directly as a dependency with the feature
wasm32_unknown_unknown_js.
  • Loading branch information
cdmurph32 committed Jan 29, 2025
1 parent 09abb30 commit 571e601
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ web-sys = { version = "0.3.58", features = [
[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies]
getrandom = { version = "0.2.7", features = ["js"] }
js-sys = "0.3.58"
ring = { version = "0.17", features = ["wasm32_unknown_unknown_js"]}

[dev-dependencies]
const-oid = "0.9.6"
Expand Down

0 comments on commit 571e601

Please sign in to comment.