Skip to content
Snippets Groups Projects
Commit ab9acd86 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

Fix the hash computer

* Output the correct length of hash
* Don't omit zeroes
parent 04171679
No related branches found
No related tags found
No related merge requests found
......@@ -48,11 +48,11 @@ for my $plugin (@plugins) {
my $sha = Digest::SHA->new(256);
$sha->addfile($library);
my @digest = parse $sha->hexdigest;
for my $i (0..@passwd) {
for my $i (0..@passwd - 1) {
$passwd[$i] ^= $digest[$i];
}
rmtree 'usr';
}
my $result = join '', map sprintf("%X", $_), @passwd;
my $result = join '', map sprintf("%02X", $_), @passwd;
say "UPDATE clients SET builtin_passwd = '$result' WHERE tag = '$tag';";
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment