Skip to content

Commit

Permalink
Check for correct version of RBX format
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdalpino committed Feb 27, 2023
1 parent faf2b1b commit 2768760
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Serializers/RBX.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ public function deserialize(Encoding $encoding) : Persistable
throw new RuntimeException('Invalid message format.');
}

if ($version != self::VERSION) {
throw new RuntimeException("Incompatible with RBX version $version.");
}

[$type, $hash] = array_pad(explode(':', $checksum, 2), 2, null);

if ($hash !== hash($type, $header)) {
Expand Down

0 comments on commit 2768760

Please sign in to comment.