You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.
Expected behavior
Return Invalid length error without crashing.
Backtrace
thread 'jsonrpc-eventloop-1' panicked at 'assertion failed: `(left == right)`
left: `65`, a [
right: `32`: destination and source slices have different lengths', libcore/slice/mod.rs:1785:9
note:ERun with `RUST_BACKTRACE=1` for a backtrace.
The text was updated successfully, but these errors were encountered:
Describe the bug
The KM node panics if it receives a signature with valid hex bad bad length.
The error is at this line: https://github.com/enigmampc/enigma-core/blob/c18f65c11ff86d297776ca13b4a6cbe7507bd7ee/enigma-principal/app/src/boot_network/keys_provider_http.rs#L71
We pass the signature to
copy_from_slice
without checking length first which then asserts their length.The solution is to implement something like this: https://github.com/enigmampc/enigma-core/blob/develop/enigma-types/src/hash.rs#L15
To Reproduce
Send this request to the KM node:
Expected behavior
Return Invalid length error without crashing.
Backtrace
The text was updated successfully, but these errors were encountered: