Bug 472386 - fips crypto: self-test needed for rfc4309(ccm(aes))
Summary: fips crypto: self-test needed for rfc4309(ccm(aes))
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jarod Wilson
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks: FIPS-140-Tracker
TreeView+ depends on / blocked
 
Reported: 2008-11-20 16:32 UTC by Jarod Wilson
Modified: 2009-09-02 08:50 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 08:50:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1243 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.4 kernel security and bug fix update 2009-09-01 08:53:34 UTC

Description Jarod Wilson 2008-11-20 16:32:52 UTC
Description of problem:
For fips compliance, we need self-tests for all crypto components we're certifying. We're attempting to get the rfc4309 variant off ccm using aes, aka rfc4309(ccm(aes)) certified, but there is currently no self-test for it in tcrypt.

Version-Release number of selected component (if applicable):
kernel-2.6.18-124.el5

How reproducible:
Attempt a crypto operation using rfc4309(ccm(aes)), and observe the notice in dmesg:

alg: No test for rfc4309(ccm(aes)) (rfc4309(ccm_base(ctr(aes-x86_64),aes-x86_64)))


Note: I'm working on obtaining some test vectors with known answers, which we could use to implement this self-test.

Comment 1 Neil Horman 2009-01-19 18:01:29 UTC
FYI, I think we can just use the test vectors from here:
http://csrc.nist.gov/publications/nistpubs/800-38C/SP800-38C.pdf

Comment 2 Neil Horman 2009-01-19 18:31:07 UTC
Note to self.  Looking at the docs above I believe the nist nomenclature to linux crypto lib nomenclature in testmgr is as follows:

NIST        |       linux cryptolib

K           |       key
Klen        |       klen
A           |       assoc
Alen        |       alen
N           |       iv
Nlen        |       N/A (iv is null terminated)
P           |       input
Plen        |       ilen
C           |       result
Clen        |       rlen


I'm a bit concerned about the null termination of iv, as I think its possible for the initial vector to have embedded \00 values in it, which would screw up the computation here, so I'll need to check on that.  Beyond that however, I think we can use any of the examples in the above document using that mapping

Comment 3 RHEL Program Management 2009-02-16 15:40:19 UTC
Updating PM score.

Comment 4 Jarod Wilson 2009-03-13 17:14:57 UTC
(In reply to comment #1)
> FYI, I think we can just use the test vectors from here:
> http://csrc.nist.gov/publications/nistpubs/800-38C/SP800-38C.pdf  

Unfortunately, none of the test vectors there can be used, as we've got a strict implementation limitation of an 11-byte nonce. The examples us 8, 9, 12 and 13. D'oh.

I do have some vectors and known-good answers from the test lab, but it'd certainly be nicer if we could point to an authoritative location where we got test vectors. For the time being, I'll just toss some of those in and focus on the code to exercise them.

Comment 5 Jarod Wilson 2009-04-02 15:50:07 UTC
Ugh. This is turning out to be a bit more difficult than anticipated... The self-tests for rfc4309 currently can't run -- the self-test manages to get itself into a circular dependency lock-up, stalling out in crypto_larval_wait(). Still trying to debug.

Comment 6 Jarod Wilson 2009-04-09 18:47:41 UTC
So the self-tests run correctly on 2.6.30-rc1 + cryptodev-2.6 tree + a one-line fix to the try_then_request_module macro now, and the full self-tests patch has been submitted upstream. Now its on to some git bisection to try to figure out what change it was that got things working so we can back-port that to rhel5.

Comment 7 Jarod Wilson 2009-04-13 21:05:56 UTC
Need to submit an updated patch upstream still, based on some additional testing done locally. Good news is that I've finally actually got this working on a RHEL5 kernel too. Patches coming Real Soon Now(tm).

Comment 9 Jarod Wilson 2009-04-14 13:01:29 UTC
Upstream submission:

http://lkml.org/lkml/2009/4/13/308

Comment 11 Don Zickus 2009-05-06 17:14:54 UTC
in kernel-2.6.18-144.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 17 errata-xmlrpc 2009-09-02 08:50:02 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2009-1243.html


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