locka99 / opcua

A client and server implementation of the OPC UA specification written in Rust
Mozilla Public License 2.0
480 stars 129 forks source link

Fix: constant time hash verification #149

Closed milgner closed 2 years ago

milgner commented 2 years ago

All credit goes to @phlay for pointing this out.

Using regular comparison on the byte slice will abort as soon as the first byte doesn't match. This could open up the system to timing attacks on the verification. Using openssl::memcmp::eq, the comparison runs in constant-time.