authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-06 02:09:37 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-06 02:09:37 -07:00
log790d3b997c342e1827b041b330f8f3d41613ead6
tree2c8e3bda705a6c89a0e8a633a4d8607f3bd05ff6
parent51e232718355b5f0d3be9732c7e545c4335adc07

util: verify_hash now only checks substring


1 files changed, 1 insertions(+), 1 deletions(-)

src/util/funcs.zig+1-1
...@@ -270,7 +270,7 @@ pub fn validate_hash(input: []const u8, file_path: []const u8) !bool {...@@ -270,7 +270,7 @@ pub fn validate_hash(input: []const u8, file_path: []const u8) !bool {
270 .sha256 => try do_hash(std.crypto.hash.sha2.Sha256, data),270 .sha256 => try do_hash(std.crypto.hash.sha2.Sha256, data),
271 .sha512 => try do_hash(std.crypto.hash.sha2.Sha512, data),271 .sha512 => try do_hash(std.crypto.hash.sha2.Sha512, data),
272 };272 };
273 const result = std.mem.eql(u8, expected, actual);273 const result = std.mem.startsWith(u8, actual, expected);
274 if (!result) {274 if (!result) {
275 std.log.info("expected: {s}, actual: {s}", .{ expected, actual });275 std.log.info("expected: {s}, actual: {s}", .{ expected, actual });
276 }276 }