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

Use correct multihash algorithm code for WebRTC addresses #1036

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions light-base/src/platform/address_parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn multiaddr_to_address(multiaddr: &Multiaddr) -> Result<AddressOrMultiStrea
) => {
// TODO: unwrapping is hacky because Multiaddr is supposed to guarantee that this is a valid multihash but doesn't due to typing issues
let multihash = multihash::MultihashRef::from_bytes(&hash).unwrap();
if multihash.hash_algorithm_code() != 12 {
if multihash.hash_algorithm_code() != 0x12 {
return Err(Error::NonSha256Certhash);
}
let Ok(&remote_certificate_sha256) = <&[u8; 32]>::try_from(multihash.data())
Expand All @@ -129,7 +129,7 @@ pub fn multiaddr_to_address(multiaddr: &Multiaddr) -> Result<AddressOrMultiStrea
) => {
// TODO: unwrapping is hacky because Multiaddr is supposed to guarantee that this is a valid multihash but doesn't due to typing issues
let multihash = multihash::MultihashRef::from_bytes(&hash).unwrap();
if multihash.hash_algorithm_code() != 12 {
if multihash.hash_algorithm_code() != 0x12 {
return Err(Error::NonSha256Certhash);
}
let Ok(&remote_certificate_sha256) = <&[u8; 32]>::try_from(multihash.data())
Expand Down
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- It is now possible for parachain chain specifications to include just a `genesis.stateRootHash` field (and no `genesis.raw` field). A warning in the logs is now printed for all chain specifications that include a `genesis.raw` field. ([#1034](https://github.com/smol-dot/smoldot/pull/1034))

### Fixed

- Fix WebRTC addresses failing to be be parsed. ([#1036](https://github.com/smol-dot/smoldot/pull/1036))

## 1.0.16 - 2023-08-14

### Changed
Expand Down
Loading