Bug 586841 - filehash probe computes incorrect sha1sum
Summary: filehash probe computes incorrect sha1sum
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: openscap
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Kopeček
QA Contact: Ondrej Moriš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-28 13:02 UTC by Ondrej Moriš
Modified: 2010-04-28 13:45 UTC (History)
2 users (show)

Fixed In Version: commit baf2e0539d3dbced90a9234931fc861548252383
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-28 13:45:46 UTC
Type: ---
Embargoed:


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

Description Ondrej Moriš 2010-04-28 13:02:29 UTC
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 13:05:17 UTC
Created attachment 409819 [details]
Testing result.

Comment 3 Ondrej Moriš 2010-04-28 13:40:03 UTC
Thanks Dan, it works now :-).


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