# FIPS Compliant Hash for RHEL6 / EL6 RPMs

**URL:** <https://forums.percona.com/t/fips-compliant-hash-for-rhel6-el6-rpms/3284>\
**Category:** Percona Toolkit\
**Created:** [February 18, 2014, 3:41pm UTC](https://forums.percona.com/t/fips-compliant-hash-for-rhel6-el6-rpms/3284 "2014-02-18T15:41:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![crucible](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@crucible](https://forums.percona.com/u/crucible)\
**Post date:** [February 18, 2014, 3:41pm UTC](https://forums.percona.com/t/fips-compliant-hash-for-rhel6-el6-rpms/3284/1 "2014-02-18T15:41:29Z")

</div>

Would someone be able to rebuild your RHEL/EL6 RPMs an algorithm that is supported for systems running in FIPS mode?

This would be changed in your .rpmmacros file:

The following two values need to be set to at least SHA256:

%\_source\_filedigest\_algorithm 8  
%\_binary\_filedigest\_algorithm 8

For reference, the default value for each of those settings is “1”, which is MD5.

This is the default configuration, for reference, along with the other possible variables:

# If not specified or 0, MD5 is used.

# 1 MD5 (default)

# 2 SHA1

# 8 SHA256

# 9 SHA384

# 10 SHA512

# 

#%\_source\_filedigest\_algorithm 1  
#%\_binary\_filedigest\_algorithm 1

Would someone be able rebuild RHEL6 / EL6 rpms with that value changed in the rpmmacros file?

---

<div class="post-metadata">

**Author:** ![crucible](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@crucible](https://forums.percona.com/u/crucible)\
**Post date:** [February 18, 2014, 3:50pm UTC](https://forums.percona.com/t/fips-compliant-hash-for-rhel6-el6-rpms/3284/2 "2014-02-18T15:50:34Z")

</div>

Here is some additional info: When building RPMs for a RHEL 6 environment (that will also be FIPS compliant by default), you must build the RPM with the appropriate digest algorithm and if desired, sign it with a FIPS compliant key. Example:

$ rpmbuild -ba --define “\_source\_filedigest\_algorithm 8” --define “\_binary\_filedigest\_algorithm 8” /home/rpmbuild/rpmbuild/SPECS/package.spec  
$ gpg --gen-key --personal-digest-preference SHA256  
$ gpg --export -a ‘rpmbuild’ \> RPM-GPG-KEY-rpmbuild  
$ sudo rpm --import RPM-GPG-KEY-rpmbuild  
$ rpm --addsign package.el6.x86\_64.rpm

The values associated with the \_source\_filedigest\_algorithm and \_binary\_filedigest\_algorithm options comes from the following list, which by default is set to 1 (MD5):

[I]# If not specified or 0, MD5 is used.

# 1 MD5 (default)

# 2 SHA1

# 8 SHA256

# 9 SHA384

# 10 SHA512

# #%\_source\_filedigest\_algorithm 1

#%\_binary\_filedigest\_algorithm 1 [/I]

If desired, to make the rpmbuild process a bit more seamless, add the following to the user’s /home/rpmbuild/.rpmmacros file:

%\_source\_filedigest\_algorithm 8  
%\_binary\_filedigest\_algorithm 8  
%\_gpg\_name [rpmbuild&#64;example.com](mailto:rpmbuild&#64;example.com)

---

<div class="post-metadata">

**Author:** ![crucible](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@crucible](https://forums.percona.com/u/crucible)\
**Post date:** [March 4, 2014, 12:59pm UTC](https://forums.percona.com/t/fips-compliant-hash-for-rhel6-el6-rpms/3284/3 "2014-03-04T12:59:42Z")

</div>

Anything thoughts on this?

---

<div class="post-metadata">

**Author:** ![xmikew](https://avatars.discourse-cdn.com/v4/letter/x/eb8c5e/32.png) [@xmikew](https://forums.percona.com/u/xmikew)\
**Post date:** [March 4, 2014, 1:19pm UTC](https://forums.percona.com/t/fips-compliant-hash-for-rhel6-el6-rpms/3284/4 "2014-03-04T13:19:29Z")

</div>

Sorry I’m missing the point I think, are you asking someone on percona to update and distribute new rpms with the listed settings changed or are you asking someone to build these rpms on an ad-hoc basis and provide them to you?

---

<div class="post-metadata">

**Author:** ![xmikew](https://avatars.discourse-cdn.com/v4/letter/x/eb8c5e/32.png) [@xmikew](https://forums.percona.com/u/xmikew)\
**Post date:** [March 4, 2014, 1:25pm UTC](https://forums.percona.com/t/fips-compliant-hash-for-rhel6-el6-rpms/3284/5 "2014-03-04T13:25:24Z")

</div>

Ah nevermind, I see what you mean.

---

<div class="post-metadata">

**Author:** ![crucible](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@crucible](https://forums.percona.com/u/crucible)\
**Post date:** [March 5, 2014, 9:33am UTC](https://forums.percona.com/t/fips-compliant-hash-for-rhel6-el6-rpms/3284/6 "2014-03-05T09:33:03Z")

</div>

Yup, asking Percona if they could change how they are building the RPMs. I could rebuild myself but would much rather have them rebuilt by the vendor and provided. Thanks!
