Bug 205598

Summary: [patch] sbin/md5.c param -c, convert to lowercase so E975548260B65C79AF... matches calculated e975548260b65c79af...
Product: Base System Reporter: Olli Hauer <ohauer>
Component: binAssignee: Eitan Adler <eadler>
Status: Closed FIXED    
Severity: Affects Some People Keywords: patch
Priority: --- Flags: ohauer: mfc-stable10?
ohauer: mfc-stable9?
Version: 10.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
sbin/md5.c patch none

Description Olli Hauer freebsd_committer freebsd_triage 2015-12-25 13:42:58 UTC
Created attachment 164621 [details]
sbin/md5.c patch

This week I was running into a stupid compare issue 

Transferring a bigger image from a vendor who publish also the check sums but stupidly in UPPERCASE (seems to be a default on some sites)

After feeding the checksum to 'sha256 -c E975548260B65C79AF... $download_file' and getting a failed back I wiped the file from disk and noticed <arrg> checksum was correct but in UPPERCASE ...

The attached patch will convert an UPPERCASE checksum before comparing into lowercase (will help every FreeBSD user downloading files from HP)
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-05-23 11:45:54 UTC
A commit references this bug:

Author: eadler
Date: Wed May 23 11:45:47 UTC 2018
New revision: 334091
URL: https://svnweb.freebsd.org/changeset/base/334091

Log:
  md5: perform compare case-insenstive

  md5 generates a md5 hash lowercase, but it might be provided in
  uppercase. Allow this.

  PR:		205598
  Reported by:	ohauer
  MFC After:	2 weeks

Changes:
  head/sbin/md5/md5.c
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-23 11:46:04 UTC
Thanks! Fixed.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-06-09 03:02:42 UTC
A commit references this bug:

Author: eadler
Date: Sat Jun  9 03:01:39 UTC 2018
New revision: 334870
URL: https://svnweb.freebsd.org/changeset/base/334870

Log:
  MFC r334091:

  md5: perform compare case-insenstive

  md5 generates a md5 hash lowercase, but it might be provided in
  uppercase. Allow this.

  PR:           205598
  Reported by:  ohauer
  MFC After:    2 weeks

Changes:
_U  stable/11/
  stable/11/sbin/md5/md5.c