Checksum verification: how does it work?

54 views
Skip to first unread message

Mauro Molinari

unread,
Apr 30, 2014, 9:47:00 AM4/30/14
to krusade...@googlegroups.com
Hello,
I'm a new Krusader user. I have a question about checksum verification. I downloaded a file (Debian 7.5.0 CD ISO) and I wanted to check its correctness. So I downloaded the coresponding MD5SUMS from the Debian website and put it beside the ISO file. Then, I invoked the checksum verification tool from Krusader, after selecting the ISO file, and in the dialog that opened I selected the MD5SUMS file. However, Krusader said it couldn't find any suitable tool to perform the verification task, and to check my settings. However, Krusader settings are correct: the md5sum tool is correctly configured as /usb/bin/md5sum and I do have md5sum installed in my system. In fact, I can manually use it to successfully verify my ISO file against the MD5SUMS file.

Question is: must the MD5SUMS file have a .md5 extension in order to make Krusader understand that it must use the md5sum tool to check it? Or does it work in a different way?

Thanks in advance.

1235

unread,
Apr 30, 2014, 10:54:38 AM4/30/14
to krusade...@googlegroups.com
On Wed, 30 Apr 2014 06:47:00 -0700 (PDT)
Mauro Molinari <maur...@tiscali.it> wrote:


> Question is: must the MD5SUMS file have a .md5 extension in order to
> make Krusader understand that it must use the md5sum tool to check
> it? Or does it work in a different way?

Yes, it determines which tools to use according to the file extension
of the checksum file.

Here is the code that determines with which tool to verify (line 432 of
"Dialogs/checksumdlg.cpp"):

// do we have a tool for that extension?
int i;
CS_Tool *mytool = 0;
for (i = 0; i < tools.count(); ++i)
if (cs_typeToText[tools.at(i)->type] == extension.toLower()) {
mytool = tools.at(i);
break;
}
if (!mytool) {
KMessageBox::error(0, i18n("<qt>Krusader cannot find a checksum
tool that handles %1 on your system. Please check the
<b>Dependencies</b> page in Krusader's settings.</qt>",
extension)); return; }


Valid extensions are (line 198 of "Dialogs/checksumdlg.cpp"):

cs_typeToText[CS_Tool::MD5] = "md5";
cs_typeToText[CS_Tool::SHA1] = "sha1";
cs_typeToText[CS_Tool::SHA256] = "sha256";
cs_typeToText[CS_Tool::SHA224] = "sha224";
cs_typeToText[CS_Tool::SHA384] = "sha384";
cs_typeToText[CS_Tool::SHA512] = "sha512";
cs_typeToText[CS_Tool::TIGER] = "tiger";
cs_typeToText[CS_Tool::WHIRLPOOL] = "whirlpool";
cs_typeToText[CS_Tool::SFV] = "sfv";
cs_typeToText[CS_Tool::CRC] = "crc";

Mauro Molinari

unread,
Jul 24, 2014, 6:02:24 PM7/24/14
to krusade...@googlegroups.com
Thanks for your reply (I'm a bit late, I know... :-P)
However I really think Krusader should be smarter on handling this...
maybe checking the inclusion of the algorithm name in the whole file
name, instead of just the extension, would be an acceptable solution.
Or, even better, trying a detection on a best effort basis and then
showing a dialog to the user when he/she can choose to override the
guess made by the program, before starting the actual checksum
verification.
If fact, right now I cannot verify the standard Debian/Ubuntu checksum
files without prior renaming... I wouldn't say they are not "standard"
enough to expect Krusader to support them out-of-the-box... what do you
think? :-)

Cheers.
Mauro
Reply all
Reply to author
Forward
0 new messages