Bug 1297816 - When using SHA2 as PRF algorithm, the nonce payload is below the RFC required minimum size
When using SHA2 as PRF algorithm, the nonce payload is below the RFC required...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libreswan (Show other bugs)
All Linux
medium Severity high
: rc
: 7.3
Assigned To: Paul Wouters
Jaroslav Aster
Mirek Jahoda
Depends On:
Blocks: 1296594 1313485
  Show dependency treegraph
Reported: 2016-01-12 09:26 EST by Paul Wouters
Modified: 2016-11-03 17:22 EDT (History)
5 users (show)

See Also:
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)
Last Closed: 2016-11-03 17:22:34 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2603 normal SHIPPED_LIVE Moderate: libreswan security and bug fix update 2016-11-03 08:13:02 EDT

  None (edit)
Description Paul Wouters 2016-01-12 09:26:32 EST
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 14:14:31 EDT
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

conn test

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 10:39:55 EDT
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 17:22:34 EDT
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.


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