Skip to content

Conversation

@franferrax
Copy link

@franferrax franferrax commented May 9, 2022

Search this PR in Red Hat Jira

RH2023467: Enable the export of keys in plain from the NSS Software Token while in FIPS mode [rhel-8, openjdk-17]

Description

In the context of RH1991003, we implemented an enhancement to import plain secret and private keys (i.e.: obtained from a file-based keystore) into the NSS Software token in FIPS mode. The goal now is to enable the reverse operation: export keys in plain from the NSS Software Token while in FIPS mode.

The scope was initially constrained to keys of CKO_SECRET_KEY class, as this is what we required for TLS 1.3 key-derivation in FIPS mode (see RH2020290). As a dependency for PKCS#12 keystores in FIPS mode (see RH2048582), we extended the exporter functionality to support keys of CKO_PRIVATE_KEY class, in colaboration with @martinuy, @akashche and myself (@franferrax).

In the same way that for the importer functionality, the exporter can be disabled by means of the com.redhat.fips.plainKeySupport system property: -Dcom.redhat.fips.plainKeySupport=false. Default behavior is enabled.

As part of this work, we aim to implement several code, debugging and reliability improvements to the FIPS Key Importer.

@gnu-andrew
Copy link

@franferrax can you run a workflow on this branch from https://github.com/franferrax/jdk/actions/workflows/submit.yml ? I've enabled actions on this repository now, so hopefully it will be automatic in future.

@franferrax
Copy link
Author

@franferrax can you run a workflow on this branch from https://github.com/franferrax/jdk/actions/workflows/submit.yml ? I've enabled actions on this repository now, so hopefully it will be automatic in future.

Sure, running: https://github.com/franferrax/jdk/actions/runs/2309360075

Just in case, I've left the Platform(s) to execute on as default, we might want to limit this to Linux in the future (or introduce our own platforms if possible).

@gnu-andrew
Copy link

@franferrax can you run a workflow on this branch from https://github.com/franferrax/jdk/actions/workflows/submit.yml ? I've enabled actions on this repository now, so hopefully it will be automatic in future.

Sure, running: https://github.com/franferrax/jdk/actions/runs/2309360075

Just in case, I've left the Platform(s) to execute on as default, we might want to limit this to Linux in the future (or introduce our own platforms if possible).

That's fine. Yeah, I will do some local changes to the config tomorrow. We may as well leave Windows on in case we ever want to include the patches there, but I'll turn off Mac. Going on my experiences enabling this with my IcedTea fork, the config probably needs to be altered anyway to run at the appropriate point, in the absence of SKARA.

As to this patch, it looks fine & the Linux build was ok, so I'll integrate this. The Mac & Windows failures are curious; I'll see if they replicate without this patch as well.

@gnu-andrew gnu-andrew self-assigned this May 12, 2022
Copy link

@gnu-andrew gnu-andrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed failures seen with this patch are already present in the baseline fips-17u branch: https://github.com/rh-openjdk/jdk/runs/6398670091?check_suite_focus=true

@gnu-andrew gnu-andrew merged commit bd324bd into rh-openjdk:fips-17u May 12, 2022
@franferrax franferrax deleted the fips-17u branch May 12, 2022 17:20
@franferrax
Copy link
Author

franferrax commented May 18, 2022

Pre-submit tests workflow Linux x86/x64 tier1 failures preliminary analysis

NOTE: as already said, these failures are present at least since 6e74f28, before this pull request


EDIT: this is caused by the same issue fixed for the jdk.crypto.cryptoki module in bfd7c5d, but occurring for the jdk.crypto.ec module. For the record, this was discussed and analyzed in an internal mailing list (search by Message-ID).

gnu-andrew pushed a commit that referenced this pull request Jun 24, 2022
RH2023467: Enable FIPS keys export

Co-Authored-By: Martin Balao <mbalao@redhat.com>
Co-Authored-By: Alex Kashchenko <akashche@redhat.com>
gnu-andrew pushed a commit that referenced this pull request Aug 28, 2022
RH2023467: Enable FIPS keys export

Co-Authored-By: Martin Balao <mbalao@redhat.com>
Co-Authored-By: Alex Kashchenko <akashche@redhat.com>
franferrax added a commit to franferrax/fips-whitebox that referenced this pull request Oct 25, 2022
This attribute isn't queried but used as input, as required in rh-openjdk/jdk@62ffef3 code. However, after rh-openjdk/jdk@f3d97d5, this is no longer needed, since that information is queried by the exporter itself. Referenced commits are part of rh-openjdk/jdk#1.
gnu-andrew pushed a commit that referenced this pull request Apr 3, 2023
RH2023467: Enable FIPS keys export

Co-Authored-By: Martin Balao <mbalao@redhat.com>
Co-Authored-By: Alex Kashchenko <akashche@redhat.com>
gnu-andrew pushed a commit that referenced this pull request Aug 22, 2023
RH2023467: Enable FIPS keys export

Co-Authored-By: Martin Balao <mbalao@redhat.com>
Co-Authored-By: Alex Kashchenko <akashche@redhat.com>
gnu-andrew pushed a commit that referenced this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants