Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1720723

Summary: Non FIPS140 compliant usage of PRNG
Product: Red Hat Enterprise Linux 8 Reporter: Alexey Tikhonov <atikhono>
Component: sssdAssignee: Alexey Tikhonov <atikhono>
Status: CLOSED ERRATA QA Contact: sssd-qe <sssd-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: cheimes, grajaiya, jhrozek, lslebodn, mniranja, mzidek, pbrezina, sgoveas, spoore, thalman, tscherf
Target Milestone: rcFlags: atikhono: mirror+
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: sssd-2.2.3-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:56:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1760850    
Attachments:
Description Flags
smartcard_fips_sanity_test none

Description Alexey Tikhonov 2019-06-14 16:46:35 UTC
PRNG is used a lot in SSSD sources. Not all cases fall under notion of "security relevant functionality".

But some does.
For example `util/secrets/secrets.c:generate_master_key()`: from my POV, this code may be considered "security relevant", but it uses "/dev/urandom" to generate encryption key, which is not FIPS approved method.

I think it is a good idea to introduce appropriate PRNG wrappers (backed by RAND_bytes() in case of OpenSSL crypto backend) into `util/crypto` and to use those wrappers in every applicable case where "raw" rand(), "/dev/urandom", etc are used now (there are might be some exceptions since it is undesirable to link some components like client libs and resolver with additional libraries).

Comment 1 Alexey Tikhonov 2019-06-14 17:02:17 UTC
Upstream ticket: https://pagure.io/SSSD/sssd/issue/4024

Comment 2 Jakub Hrozek 2019-07-15 12:29:37 UTC
* master:
 * 548ea574645f405307b14bb1113d66f9da1abf2b
 * bfc02ea2cdc111bfb8df044f359655cce3337ccd
 * 93d0aba5a49fdf9df87037eba42986eee02d1d35
 * 9f4b7d9fbec9a7746fc39d9e69054ac469c14d19
 * e839acd1fda573b11170a3d074f60eff9d654008
 * 8be1a0e829ba9eaf6769622adcb3be827575f551

Comment 13 Scott Poore 2020-02-19 19:17:04 UTC
I ran some smart card sssd sanity tests to cover at least some of the sanity verification for this:

Version ::

sssd-2.2.3-15.el8.x86_64

Results ::

Confirm FIPS:

[root@rhel8-2 ~]#  sysctl -n crypto.fips_enabled
1

[root@rhel8-2 ~]# update-crypto-policies --show
FIPS

Setup to be attached

Test with SSH:

[root@rhel8-2 ca]# ssh -I /usr/lib64/opensc-pkcs11.so -l testuser localhost hostname
FIPS mode initialized
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is SHA256:GKon2+AlbuJ5FxfHBeXL9+87snhlFOwJ/ZJEv5cT71k.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
Enter PIN for 'testuser (MyEID)': 
rhel8-2.example.com

Test with SU:

[root@rhel8-2 ~]# su - testuser -c 'su - testuser -c whoami'
PIN for testuser (MyEID): 
testuser

Test GDM service with sssctl:

[root@rhel8-2 ~]# sssctl user-checks -s gdm-smartcard "" -a auth
user: 
action: auth
service: gdm-smartcard

testing pam_authenticate

PIN for testuser (MyEID): 
pam_authenticate for user [testuser]: Success

PAM Environment:
 - PKCS11_LOGIN_TOKEN_NAME=testuser (MyEID)

Comment 14 Scott Poore 2020-02-19 19:17:38 UTC
Created attachment 1664140 [details]
smartcard_fips_sanity_test

Comment 15 Niranjan Mallapadi Raghavender 2020-02-20 10:32:31 UTC
sssd-2.2.3-15.el8.x86_64

Ran fips related sanity tests:
                                                                                                                                                   

test_krb_fips.py::Testkrbfips::test_fips_login PASSED                   
test_krb_fips.py::Testkrbfips::test_fips_as_req PASSED                  
test_krb_fips.py::Testkrbfips::test_fips_as_rep PASSED                  
test_krb_fips.py::Testkrbfips::test_login_fips_weak_crypto PASSED       
test_krb_fips.py::Testkrbfips::test_ldap_gssapi PASSED                  
test_krb_fips.py::Testkrbfips::test_tgs_nonfips PASSED                  
test_ssh_authorizedkeys.py::TestSSHkeys::test_0001_bz1137013 PASSED

Comment 17 errata-xmlrpc 2020-04-28 16:56:02 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.

https://access.redhat.com/errata/RHBA-2020:1863