Skip to content

Update KeyAgreement classes to support Generic secret generation - #1753

Open
JinhangZhang wants to merge 1 commit into
IBM:java17from
JinhangZhang:openjceplus/backport/java17/genericsecretgeneration
Open

Update KeyAgreement classes to support Generic secret generation#1753
JinhangZhang wants to merge 1 commit into
IBM:java17from
JinhangZhang:openjceplus/backport/java17/genericsecretgeneration

Conversation

@JinhangZhang

Copy link
Copy Markdown
Collaborator

The engineGenerateSecret(String) method in KeyAgreement
classes currently only supports "TlsPremasterSecret",
but the expectation starting in Java 21 is that
"Generic" should be accepted as well. This change
accomplishes that.

Additional test cases to verify said behaviour are
added.

Back-ported from: #573

@jasonkatonica jasonkatonica left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@taoliult taoliult left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -1,5 +1,5 @@
/*
* Copyright IBM Corp. 2023, 2024
* Copyright IBM Corp. 2023, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is 2026 not 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@@ -1,5 +1,5 @@
/*
* Copyright IBM Corp. 2023, 2024
* Copyright IBM Corp. 2023, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

/*
* Copyright IBM Corp. 2023, 2024
* Copyright IBM Corp. 2023, 2025
*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

}
}

public void test_engineGenerateSecret() throws Exception {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this need to be annotated with @Test?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, added

The engineGenerateSecret(String) method in KeyAgreement
classes currently only supports "TlsPremasterSecret",
but the expectation starting in Java 25 is that
"Generic" should be accepted as well. This change
accomplishes that.

Additional test cases to verify said behaviour are
added.

Signed-off-by: Kostas Tsiounis <kostas.tsiounis@ibm.com>
@JinhangZhang
JinhangZhang force-pushed the openjceplus/backport/java17/genericsecretgeneration branch from 8383b7c to 22587e1 Compare September 3, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants