Skip to content

JSSE: implement WolfSSLPrincipal.toString() inside WolfSSLX509#281

Merged
rlm2002 merged 1 commit intowolfSSL:masterfrom
cconlon:WolfSSLPrincipalToString
Jul 17, 2025
Merged

JSSE: implement WolfSSLPrincipal.toString() inside WolfSSLX509#281
rlm2002 merged 1 commit intowolfSSL:masterfrom
cconlon:WolfSSLPrincipalToString

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented Jul 10, 2025

This PR addresses #280, and implements the toString() method inside WolfSSLPrincipal (implements java.security.Principal).

Additional JUnit tests are added here to verify behavior correctness, as well as behavior of default implies() method implementation from java.security.Principal. Since this default behavior works for us, there is no need to re-implement in WolfSSLPrincipal.

This comment was marked as outdated.

@cconlon cconlon force-pushed the WolfSSLPrincipalToString branch from ef6bf9d to d8ed517 Compare July 10, 2025 22:51
@cconlon cconlon requested a review from Copilot July 10, 2025 22:51

This comment was marked as outdated.

…Unit tests for Principal methods including default implies()
@cconlon cconlon force-pushed the WolfSSLPrincipalToString branch from d8ed517 to 3c25229 Compare July 10, 2025 23:00
@cconlon cconlon requested a review from Copilot July 10, 2025 23:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a toString() override for WolfSSLPrincipal to return the same value as getName() and supplements it with JUnit tests verifying toString(), getName(), interface conformance, and the default implies() behavior.

  • Added toString() in WolfSSLX509 principal implementation
  • Introduced common test setup and multiple new JUnit tests in WolfSSLX509Test.java
  • Adjusted test output indentation in existing tests

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/java/com/wolfssl/provider/jsse/WolfSSLX509.java Implemented toString() to delegate to getName()
src/test/com/wolfssl/provider/jsse/test/WolfSSLX509Test.java Added @Before setup and tests for principal methods; tweaked indentation
Comments suppressed due to low confidence (2)

src/test/com/wolfssl/provider/jsse/test/WolfSSLX509Test.java:410

  • [nitpick] The indentation in these error/pass messages now uses three tabs, which differs from other tests—consider standardizing to a single tab for consistency.
                error("\t\t\t... failed");

Comment thread src/test/com/wolfssl/provider/jsse/test/WolfSSLX509Test.java
Comment thread src/test/com/wolfssl/provider/jsse/test/WolfSSLX509Test.java
Comment thread src/test/com/wolfssl/provider/jsse/test/WolfSSLX509Test.java
@rlm2002 rlm2002 merged commit ba7b482 into wolfSSL:master Jul 17, 2025
52 checks passed
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