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 1155340 - Provide sym key derive mechansm as result of encryption of message
Summary: Provide sym key derive mechansm as result of encryption of message
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nss-softokn
Version: 7.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Bob Relyea
QA Contact: Hubert Kario
URL:
Whiteboard:
Depends On: 1155306
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-21 23:19 UTC by Jack Magne
Modified: 2015-03-05 08:28 UTC (History)
9 users (show)

Fixed In Version: nss-softokn-3.16.2-12.el7
Doc Type: Enhancement
Doc Text:
Feature: Add a symmetric key derive mechanism as result of encryption of message. Reason: The Certificate System Development team that is trying to implement a later secure channel protocol and needs to be able to derive a symmetric key based in the encryption of some data with the original symmetric key. In order to maintain FIPS compliance this operation can't be made in the clear and needs to be done by NSS in the given token. Result: The Certificate System development needs have been met.
Clone Of: 1155306
: 1167975 (view as bug list)
Environment:
Last Closed: 2015-03-05 08:28:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test case for issue (5.39 KB, text/x-csrc)
2014-11-04 21:15 UTC, Bob Relyea
no flags Details
makefile for test case (277 bytes, patch)
2014-11-04 21:17 UTC, Bob Relyea
no flags Details | Diff
Fix (9.70 KB, patch)
2014-11-04 21:18 UTC, Bob Relyea
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0364 0 normal SHIPPED_LIVE nss, nss-softokn, nss-util, and nspr bug fix and enhancement update 2015-03-05 12:51:43 UTC

Description Jack Magne 2014-10-21 23:19:13 UTC
+++ This bug was initially created as a clone of Bug #1155306 +++

Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Jack Magne on 2014-10-21 17:23:30 EDT ---

Sorry, premature enter.

Description of problem:

In Certificate Development we are trying to implement a later secure channel protocol. One of the things we need to do , is to be able to derive a symmetric key based in the encryption of some data with the original symmetric key.


In order to maintain FIPS compliance we want to not have to do this operation in the clear and have it done by NSS in the given token. Here is an example of what we want to do:

PK11_Derive( master , CKM_DES_ECB_ENCRYPT_DATA , &param , CKM_CONCATENATE_BASE_AND_KEY  , CKA_DERIVE, 0);

Ideally we need to be able to do some sort of CBC encrytion on this message data. If there is a mechanism that gives us that as well, that would be great to have also.



Version-Release number of selected component (if applicable):

Latest Fedora, 21,20 if possible.


How reproducible:

Always.


Steps to Reproduce:
1. Try to use the given mechanism in code with NSS.


Actual results:

An error will be returned saying something about mechanism not supported.


Expected results:

The mechanism should ideally work in the soft token.


Additional info:

Comment 4 Bob Relyea 2014-11-04 21:15:38 UTC
Created attachment 953836 [details]
Test case for issue

Comment 5 Bob Relyea 2014-11-04 21:17:18 UTC
Created attachment 953838 [details]
makefile for test case

Comment 6 Bob Relyea 2014-11-04 21:18:07 UTC
Created attachment 953839 [details]
Fix

Comment 10 Jack Magne 2014-11-06 17:38:58 UTC
Elio:

Great! I will give this a spin in the next day or so.

Comment 13 Hubert Kario 2015-01-27 17:20:33 UTC
(In reply to Bob Relyea from comment #4)
> Created attachment 953836 [details]
> Test case for issue

could you extend it to support also FIPS mode? or how do I detect FIPS mode in NSS?

Comment 14 Bob Relyea 2015-01-27 17:52:56 UTC
>	rv = PK11_ExtractKeyValue(newKey);

Will fail in FIPS mode. (PORT_GetError() == SEC_ERROR_IO).

The test case would have to be rewritten as a known answer test. :

PK11_PBEKeyGen() /*use a known fixed password */
PK11_Dervive()
PK11_Encrypt() /* with derived key (not basekey), use a known buffer, and IV */
PORT_Memcmp()  /* with answer you calculated earlier using the same password, known buffer, and IV */

I presume you are running on RHEL-7 with the system in system FIPS mode.

You call PK11_IsFIPS() to tell if NSS is in FIPS mode.

bob

Comment 15 Hubert Kario 2015-01-28 12:01:29 UTC
ok, thanks, I'll try to update it later

Comment 17 errata-xmlrpc 2015-03-05 08:28:53 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://rhn.redhat.com/errata/RHBA-2015-0364.html


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