Skip to content

examples: Implement the negotiated group output for wolfSSL#2066

Merged
tatsuhiro-t merged 1 commit intomainfrom
examples-wolfssl-negotiated-group
Mar 11, 2026
Merged

examples: Implement the negotiated group output for wolfSSL#2066
tatsuhiro-t merged 1 commit intomainfrom
examples-wolfssl-negotiated-group

Conversation

@tatsuhiro-t
Copy link
Copy Markdown
Member

No description provided.

@tatsuhiro-t tatsuhiro-t added this to the v1.22.0 milestone Mar 11, 2026
@tatsuhiro-t
Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the TLSSessionBase class for wolfSSL by adding functionality to expose the negotiated cryptographic group (e.g., elliptic curve) established during a TLS session. This provides applications with greater visibility into the security parameters of their connections.

Highlights

  • New Feature: Implemented the get_negotiated_group method in TLSSessionBase for wolfSSL, allowing retrieval of the negotiated elliptic curve group name.
  • Code Refinement: Moved the implementation of get_negotiated_group from an inline stub in the header to the source file for better separation of declaration and definition.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • examples/tls_session_base_wolfssl.cc
    • Implemented the get_negotiated_group method to retrieve the negotiated curve name.
    • Used wolfSSL_get_curve_name to fetch the curve name and returned it as a std::string_view.
  • examples/tls_session_base_wolfssl.h
    • Updated the declaration of get_negotiated_group by removing its inline stub implementation.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements the get_negotiated_group function for the wolfSSL TLS session base. The implementation is correct, but can be made more concise. I've added a suggestion to improve readability and reduce verbosity.

Comment on lines +46 to +53
using namespace std::literals;

auto name = wolfSSL_get_curve_name(ssl_);
if (!name) {
return ""sv;
}

return name;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This implementation can be made more concise by using a ternary operator. This also removes the need for using namespace std::literals;.

  auto name = wolfSSL_get_curve_name(ssl_);
  return name ? name : std::string_view{};

@tatsuhiro-t tatsuhiro-t merged commit 4a16c68 into main Mar 11, 2026
73 checks passed
@tatsuhiro-t tatsuhiro-t deleted the examples-wolfssl-negotiated-group branch March 11, 2026 11:37
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements the get_negotiated_group function for the wolfSSL backend. The implementation is functionally correct. I have provided one suggestion to make the code more concise and idiomatic by using modern C++ features.

Comment on lines +45 to +54
std::string_view TLSSessionBase::get_negotiated_group() const {
using namespace std::literals;

auto name = wolfSSL_get_curve_name(ssl_);
if (!name) {
return ""sv;
}

return name;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This function can be made more concise and idiomatic. Using an if statement with an initializer allows you to check the pointer and declare the variable in one step, limiting its scope. This change also removes the need for using namespace std::literals; and uses return {}; to create an empty std::string_view, which is a clean approach.

std::string_view TLSSessionBase::get_negotiated_group() const {
  if (const auto *name = wolfSSL_get_curve_name(ssl_)) {
    return name;
  }
  return {};
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant