Bug 1297816

Summary: When using SHA2 as PRF algorithm, the nonce payload is below the RFC required minimum size
Product: Red Hat Enterprise Linux 7 Reporter: Paul Wouters <pwouters>
Component: libreswanAssignee: Paul Wouters <pwouters>
Status: CLOSED ERRATA QA Contact: Jaroslav Aster <jaster>
Severity: high Docs Contact: Mirek Jahoda <mjahoda>
Priority: medium    
Version: 7.2CC: jaster, omoris, pvrabec, pwouters, tmraz
Target Milestone: rc   
Target Release: 7.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Nonce size had not been updated in years Consequence: the nonce size was too small when using SHA2-384 and SHA2-512. This reduced security below FIPS requirements. Fix: Increased default nonce size Result: FIPs requirement no longer violated
Story Points: ---
Clone Of:
: 1335209 (view as bug list) Environment:
Last Closed: 2016-11-03 21:22:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1296594, 1313485    

Description Paul Wouters 2016-01-12 14:26:32 UTC
Description of problem:

IKEv2 requires a nonce size of at least half the size of the key length of the PRF key size used. libreswan always used 128 bit, which is enough for all but two sha2 variants (sha2_384 and sha2_512)


Merge in upstream https://github.com/libreswan/libreswan/commit/d935515aeef12225a54ba34478d394ac1f3c0750

Comment 2 Jaroslav Aster 2016-05-04 18:14:31 UTC
Hi Paul,

could you give me some reproducer for that? I think, I understand the issue, but I do not know what I have to looking for in the log file. For test I used this configuration file:

config setup
    protostack=netkey
    plutodebug=all
    plutostderrlog=${PLUTO_LOG}

conn test
    left=${syncCLIENT}
    right=${syncSERVER}
    authby=secret
    auto=add
    ikev2=insist
    ike=aes_gcm-sha2_512


One more question. I read your patch and it seems to me, there are two, non-related, parts - dcookie and nonce. Am I right or these parts are related?

Comment 3 Paul Wouters 2016-05-05 14:39:55 UTC
when running with plutodebug=all, look for something like:

May  5 10:21:25: | ***parse ISAKMP Nonce Payload:
May  5 10:21:25: |    next payload type: ISAKMP_NEXT_KE (0x4)
May  5 10:21:25: |    length: 24 (0x18)

You should see the different sizes on length.

the dcookie part of that commit is unrelated to the nonce size.


This fix will come in via a rebase

Comment 7 errata-xmlrpc 2016-11-03 21:22:34 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/RHSA-2016-2603.html