Skip to content

Conversation

@JinhangZhang
Copy link
Collaborator

@JinhangZhang JinhangZhang commented Jan 5, 2026

The ECPrivateKey sequence defines two optional fields: parameters and publicKey. When parsing an ECPrivateKey, the code must allow cases where only one of these fields is present, or where both are absent or where both are presented.

In addition, it seems that Java does not automatically concatenate the cause’s message with the outer exception’s message, the detailed message associated with the cause is not merged into the current exception’s detail message. Therefore, getMessage() is explicitly included when throwing the exception in order to preserve and expose the underlying error details.

@JinhangZhang JinhangZhang force-pushed the bugs/eckeyfactory branch 2 times, most recently from 0d06ba4 to 5580080 Compare January 5, 2026 23:41
@JinhangZhang JinhangZhang changed the title Tolerate the optional parameters in the ECPrivateKey sequence Tolerate the optional fields in the ECPrivateKey sequence Jan 5, 2026
@JinhangZhang JinhangZhang force-pushed the bugs/eckeyfactory branch 2 times, most recently from 694bc14 to 345b25f Compare January 5, 2026 23:49
@JinhangZhang JinhangZhang force-pushed the bugs/eckeyfactory branch 2 times, most recently from b69779e to 784905d Compare January 7, 2026 22:51
The ECPrivateKey sequence defines two optional fields:
parameters and publicKey. When parsing an ECPrivateKey,
the code must allow cases where only one of these fields
is present, or where both are absent or where both are
presented.

In addition, it seems that java does not automatically
concatenate the cause’s message with the outer exception’s
message, the detailed message associated with the cause
is not merged into the current exception’s detail message.
Therefore, getMessage() is explicitly included when throwing
the exception in order to preserve and expose the underlying
error details.

Signed-off-by: JinhangZhang <[email protected]>
@jasonkatonica jasonkatonica self-requested a review January 9, 2026 15:25
Copy link
Member

@jasonkatonica jasonkatonica left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@KostasTsiounis KostasTsiounis left a comment

Choose a reason for hiding this comment

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

LGTM

@jasonkatonica jasonkatonica merged commit 81215ad into IBM:main Jan 12, 2026
3 checks passed
johnpeck-us-ibm pushed a commit to johnpeck-us-ibm/OpenJCEPlus that referenced this pull request Jan 16, 2026
The ECPrivateKey sequence defines two optional fields:
parameters and publicKey. When parsing an ECPrivateKey,
the code must allow cases where only one of these fields
is present, or where both are absent or where both are
presented.

In addition, it seems that java does not automatically
concatenate the cause’s message with the outer exception’s
message, the detailed message associated with the cause
is not merged into the current exception’s detail message.
Therefore, getMessage() is explicitly included when throwing
the exception in order to preserve and expose the underlying
error details.

Signed-off-by: JinhangZhang <[email protected]>
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.

4 participants