Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tls/src/main/java/org/bouncycastle/jsse/BCSSLEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,10 @@ public interface BCSSLEngine
* if the cipherSuites or protocols properties contain unsupported values
*/
void setParameters(BCSSLParameters parameters);

/**
* Returns the name of the negotiated group for a TLS 1.3 connection. Other TLS versions will always return "UNKNOWN".
* @return the name of the negotiated group
*/
String getNegotiatedGroup();
}
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ public synchronized void setParameters(BCSSLParameters parameters)
SSLParametersUtil.setParameters(this.sslParameters, parameters);
}

@Override
public String getNegotiatedGroup()
{
return protocol.getNegotiatedGroup();
}

// An SSLEngine method from JDK 6
public synchronized void setSSLParameters(SSLParameters sslParameters)
{
Expand Down
10 changes: 10 additions & 0 deletions tls/src/main/java/org/bouncycastle/tls/TlsProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -2283,4 +2283,14 @@ protected static void writeSupplementalData(OutputStream output, Vector suppleme

TlsUtils.writeOpaque24(supp_data, output);
}

/**
* Returns the name of the negotiated group for a TLS 1.3 connection. Other TLS versions will always return "UNKNOWN".
* @return the name of the negotiated group
*/
public String getNegotiatedGroup()
{
final int negotiatedGroup = getContext().getSecurityParameters().getNegotiatedGroup();
return NamedGroup.getName(negotiatedGroup);
}
}