Bug 586841 - filehash probe computes incorrect sha1sum
filehash probe computes incorrect sha1sum
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: openscap (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Kopeček
Ondrej Moriš
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-28 09:02 EDT by Ondrej Moriš
Modified: 2010-04-28 09:45 EDT (History)
2 users (show)

See Also:
Fixed In Version: commit baf2e0539d3dbced90a9234931fc861548252383
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-04-28 09:45:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Testing content. (2.85 KB, text/xml)
2010-04-28 09:02 EDT, Ondrej Moriš
no flags Details
Testing result. (5.80 KB, text/xml)
2010-04-28 09:05 EDT, Ondrej Moriš
no flags Details

  None (edit)
Description Ondrej Moriš 2010-04-28 09:02:29 EDT
Created attachment 409814 [details]
Testing content.

Description of problem:

Probe filehash computes incorrect sha1sum (md5 sum is fine). See attached content and the corresponding result. There are strange zeros and ones in computed hash. According to documentation SHA1 is 160-bit checksum, hence it should contain 40 hexadecimals (i.e. sha1 string should contain 40 characters).

Version-Release number of selected component (if applicable):

commit 1d6b556e23cec6ba5e057a7b6b84aaa840419ce1

How reproducible:

always

Steps to Reproduce:

1. use tests/OVAL/probes/test_probes.c to evaluate attached content
  
Actual results:

<system_data>
  <filehash_item xmlns="..." id="1" status="exists">
   <path>/dev</path>
   <filename>null</filename>
   <md5>d41d8cd98f00b204e9800998ecf8427e</md5>
   <sha1>da39a3ee5e6b4b0d3255bfef95601890afd80709010000000100000000000000</sha1>
  </filehash_item>
</system_data>

Expected results:

<system_data>
  <filehash_item xmlns="..." id="1" status="exists">
   <path>/dev</path>
   <filename>null</filename>
   <md5>d41d8cd98f00b204e9800998ecf8427e</md5>
   <sha1>da39a3ee5e6b4b0d3255bfef95601890afd80709</sha1>
  </filehash_item>
</system_data>

Additional info:
Comment 1 Ondrej Moriš 2010-04-28 09:05:17 EDT
Created attachment 409819 [details]
Testing result.
Comment 3 Ondrej Moriš 2010-04-28 09:40:03 EDT
Thanks Dan, it works now :-).

Note You need to log in before you can comment on or make changes to this bug.