Red Hat Bugzilla – Bug 1155340
Provide sym key derive mechansm as result of encryption of message
Last modified: 2015-03-05 03:28:53 EST
+++ 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 , ¶m , 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:
Created attachment 953836 [details] Test case for issue
Created attachment 953838 [details] makefile for test case
Created attachment 953839 [details] Fix
Elio: Great! I will give this a spin in the next day or so.
(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?
> 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
ok, thanks, I'll try to update it later
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