Bug 1882178

Summary: crypto-policies: invalid DH key size of 1023 bits for LEGACY
Product: Red Hat Enterprise Linux 8 Reporter: zzambers
Component: crypto-policiesAssignee: Alexander Sosedkin <asosedki>
Status: CLOSED NEXTRELEASE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: ahughes
Target Milestone: rcKeywords: Triaged
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-15 13:57:20 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: 1882168, 1882185, 1883312    

Description zzambers 2020-09-24 01:26:47 UTC
LEGACY crypto policy sets jdk.tls.ephemeralDHKeySize to 1023, which is invalid and would throw exception if it was actually used [1].

Also DH keySize < 1023 in jdk.tls.disabledAlgorithms property seems weird, if key size of 1023 does not make sense. (Is there reason for that?). Btw. RHEL-8 page about crypto says < 1024 are disabled [2].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1882168#c1
[2] https://access.redhat.com/articles/3642912

Comment 1 zzambers 2020-09-24 01:36:12 UTC
Also value of jdk.tls.ephemeralDHKeySize=0 in "EMPTY" would be invalid.

Comment 2 Tomas Mraz 2020-09-24 06:18:12 UTC
The 1023 value was used because there were historically some servers on the public web that actually had 1023 bit DH parameters. Other crypto libraries supported by crypto-policies accept this value. I believe we can change it now to 1024.

The EMPTY policy is not that interesting, it is there just for internal testing purposes of the crypto-policies config generators, but we can also adjust the generator to not emit anything if the value is 0.

As for the issue of the value not being applied, ideally someone who has knowledge of the java configuration should submit a PR to the upstream crypto-policies repository on gitlab fixing those issues.

Comment 3 zzambers 2020-09-24 12:10:47 UTC
(In reply to Tomas Mraz from comment #2)
> The 1023 value was used because there were historically some servers on the
> public web that actually had 1023 bit DH parameters. Other crypto libraries
> supported by crypto-policies accept this value. I believe we can change it
> now to 1024.
> 
> The EMPTY policy is not that interesting, it is there just for internal
> testing purposes of the crypto-policies config generators, but we can also
> adjust the generator to not emit anything if the value is 0.
> 

thank you for explanation

> As for the issue of the value not being applied, ideally someone who has
> knowledge of the java configuration should submit a PR to the upstream
> crypto-policies repository on gitlab fixing those issues.

I think this is something, that can only be fixed in openjdk package. [1]
From what I know properties from crypto policy file end-up in security
properties but this one should end up in System properties instead.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1702356

Comment 5 Andrew John Hughes 2020-09-28 18:15:20 UTC
(In reply to Tomas Mraz from comment #2)
> The 1023 value was used because there were historically some servers on the
> public web that actually had 1023 bit DH parameters. Other crypto libraries
> supported by crypto-policies accept this value. I believe we can change it
> now to 1024.
> 
> The EMPTY policy is not that interesting, it is there just for internal
> testing purposes of the crypto-policies config generators, but we can also
> adjust the generator to not emit anything if the value is 0.
> 
> As for the issue of the value not being applied, ideally someone who has
> knowledge of the java configuration should submit a PR to the upstream
> crypto-policies repository on gitlab fixing those issues.

We can add support for handling system properties, but we first need these to be separated in the crypto-policies package. See bug 1883312.

Comment 9 Alexander Sosedkin 2022-03-15 13:57:20 UTC
Unless it explodes on someone, I'd prefer to keep it this way in RHEL-8.

RHEL-9 doesn't have it (and implements option separation), so we're covered there.