Bug 786191

Summary: selinux-policy update shows error parsing file obj_perm_sets.spt in FIPS mode
Product: Red Hat Enterprise Linux 6 Reporter: Miroslav Vadkerti <mvadkert>
Component: policycoreutilsAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: high Docs Contact:
Priority: high    
Version: 6.2CC: dwalsh, eparis, jpallich, ksrot, mmalik, msvoboda, sdsmall
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: policycoreutils-2.0.83-19.24.el6 Doc Type: Bug Fix
Doc Text:
When installing packages on the system in (Federal Information Processing Standard (FIPS) mode, parsing errors could occur and installation failed. This was caused by the "/usr/lib64/python2.7/site-packages/sepolgen/yacc.py" parser, which used MD5 checksums that are not supported in FIPS mode. This update modifies the parser to use SHA-256 checksums and installation process is now successful.
Story Points: ---
Clone Of:
: 953862 (view as bug list) Environment:
Last Closed: 2012-06-20 15:10:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 787605, 953862    

Description Miroslav Vadkerti 2012-01-31 17:09:54 UTC
Description of problem:
When updating EL6.2 GA selinux policy to selinux-policy-3.7.19-126.el6_2.4
in FIPS mode I see this error

1:selinux-policy         ########################################### [  9%]
error parsing headers
error parsing file /usr/share/selinux/devel/include/support/obj_perm_sets.spt: error:060800A0:digital envelope routines:EVP_DigestInit_ex:unknown cipher

Version-Release number of selected component (if applicable):
selinux-policy-3.7.19-126.el6_2.4

How reproducible:
Should be 100% in our test scenario (see additional info)

Steps to Reproduce:
1. Install RHEL6.2 GA and switch to FIPS mode
2. Update 
3.
  
Actual results:
Error when updating

Expected results:
No error

Additional info:
Please note this bug was spotted during installation with custom kickstart we use for Common Criteria testing. The installation is in FIPS mode.

Comment 3 Daniel Walsh 2012-01-31 19:27:11 UTC
Steven? Eric? Any ideas?

Comment 4 Stephen Smalley 2012-01-31 20:53:37 UTC
Error is from sepolgen-ifgen.
Digging a bit further, appears to trace back to sepolgen/yacc.py, which uses hashlib.md5().  fips mode kills md5?
Bug 689387 looks similar but for a different program that uses md5.

Comment 5 Daniel Walsh 2012-01-31 22:11:25 UTC
So if we change this code to hashlib.sha256() it might work...

It seems to work on Rawhide.

Miroslav Vadkerti

Can you change the code and try it again.

# sed -i 's/md5/sha256/g' /usr/lib64/python2.7/site-packages/sepolgen/yacc.py
# yum reinstall selinux-policy-targeted

Comment 6 Miroslav Vadkerti 2012-02-01 09:05:32 UTC
I confirm that the change fixes the issue:

# sed -i 's/md5/sha256/g' /usr/lib64/python2.6/site-packages/sepolgen/yacc.py
# yum reinstall selinux-policy-*
...
Running Transaction
  Installing : selinux-policy-3.7.19-126.el6_2.4.noarch                                                                                                                                                   1/3 
  Installing : selinux-policy-targeted-3.7.19-126.el6_2.4.noarch                                                                                                                                          2/3 
  Installing : selinux-policy-mls-3.7.19-126.el6_2.4.noarch                                                                                                                                               3/3 

Installed:
  selinux-policy.noarch 0:3.7.19-126.el6_2.4                      selinux-policy-mls.noarch 0:3.7.19-126.el6_2.4                      selinux-policy-targeted.noarch 0:3.7.19-126.el6_2.4                     

Complete!

Comment 7 Daniel Walsh 2012-02-01 19:16:46 UTC
Fixed in policycoreutils-2.0.83-19.20.el6_2

Comment 10 Miroslav Svoboda 2012-02-14 17:51:28 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When installing packages on the system in (Federal Information Processing Standard (FIPS) mode, parsing errors could occur and installation failed. This was caused by the "/usr/lib64/python2.7/site-packages/sepolgen/yacc.py" parser, which used MD5 checksums that are not supported in FIPS mode. This update modifies the parser to use SHA-256 checksums and installation process is now successful.

Comment 16 Miroslav Grepl 2012-04-18 07:59:54 UTC
Fixed in policycoreutils-2.0.83-19.24.el6

Comment 19 errata-xmlrpc 2012-06-20 15:10:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0969.html