Skip to content

Commit 25d2b52

Browse files
committed
8328046: Need to keep leading zeros in TlsPremasterSecret of TLS1.3 DHKeyAgreement
Reviewed-by: hchao
1 parent d6ebcf8 commit 25d2b52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/java.base/share/classes/sun/security/ssl/KAKeyDerivation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -214,13 +214,13 @@ private SecretKey t13DeriveKey(String type)
214214
var decapsulator = kem.newDecapsulator(localPrivateKey);
215215
sharedSecret = decapsulator.decapsulate(
216216
keyshare, 0, decapsulator.secretSize(),
217-
"TlsPremasterSecret");
217+
"Generic");
218218
} else {
219219
// Using traditional DH-style Key Agreement
220220
KeyAgreement ka = KeyAgreement.getInstance(algorithmName);
221221
ka.init(localPrivateKey);
222222
ka.doPhase(peerPublicKey, true);
223-
sharedSecret = ka.generateSecret("TlsPremasterSecret");
223+
sharedSecret = ka.generateSecret("Generic");
224224
}
225225

226226
return deriveHandshakeSecret(type, sharedSecret);

0 commit comments

Comments
 (0)