FS#10530 - checksum verification does not work on BSD

Attached to Project: Pacman
Opened by Xilon (Xilon) - Thursday, 29 May 2008, 09:45 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 16 July 2008, 00:25 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity High
Priority Normal
Reported Version 3.1.3
Due in Version 3.2.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Summary and Info:
makepkg assumes that the various checksum utilities are named "${integ}sum". This is not the case on BSD systems. md5sum and others are part of GNU core utilities, which by default aren't installed on at least FreeBSD. I'm not sure if it can be installed, but it would be overkill to have it as a requirement when similar utilities already exist. BSD systems have md5, sha1, etc. The GNU and BSD utilities have different arguments and, as far as I can tell, different output. I was unable to "port" the command used to verify the checksum to the BSD equivalent.

It actually appears that the BSD utilities are some sort of alias for `openssl dgst -${integ}`, which appears to be the same on Linux. I'll look into using that instead.
This task depends upon

Closed by  Dan McGee (toofishes)
Wednesday, 16 July 2008, 00:25 GMT
Reason for closing:  Implemented
Additional comments about closing:  Changed to openssl for checksum generation/verification in commit b8a66d68593d1f267c3bb8cd8943724711626903
Comment by Xilon (Xilon) - Thursday, 29 May 2008, 10:50 GMT
Using openssl seems to work nicely, but it appears that openssl doesn't support sha256, sha384 or sha512, so only md5 and sha1 could be used.
Comment by Xavier (shining) - Monday, 02 June 2008, 08:50 GMT
Why doesn't openssl support these, and are there any plans for a future support?
Finding answers to these questions would help for making a decision.
Comment by Xilon (Xilon) - Monday, 02 June 2008, 09:31 GMT
It turns out that openssl does support them, they just weren't documented in the man page. They are documented in the output of `openssl dgst --help` and on the openssl web site. See http://archlinux.org/pipermail/pacman-dev/2008-May/011945.html. I have Dan picked up a bug in that last patch which I still have to test, but I was unable to get makepkg to look for files with spaces (it looked for each "word" in the filename instead, ie. 'foo' and 'bar' instead of 'foo bar') in the quick test I tried.