Skip to content

Commit

Permalink
Include channel binding type in GSSAPI duplicate
Browse files Browse the repository at this point in the history
Fixed an issue in which a non-default channel binding type was not
preserved when duplicating a GSSAPI bind request.  Also, added a
method to retrieve the channel binding type in use for a GSSAPI bind
request.
  • Loading branch information
dirmgr committed May 25, 2023
1 parent 1c5e7aa commit c282150
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 7 deletions.
21 changes: 14 additions & 7 deletions docs/release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ <h3>Version 6.0.9</h3>
<br><br>
</li>

<li>
Added a ResultCode.getStandardName method that can be used to retrieve the name
assigned to the associated result code in the relevant specification. This may
not be available for result codes that are not defined in known specifications.
<br><br>
</li>

<li>
Added a new HTTPProxySocketFactory class that can be used to allow establishing
LDAP and LDAPS connections through an HTTP proxy server, and added a new
Expand All @@ -64,6 +57,20 @@ <h3>Version 6.0.9</h3>
<br><br>
</li>

<li>
Fixed an issue in which a non-default channel binding type was not preserved when
duplicating a GSSAPI bind request. Also, added a method to retrieve the channel
binding type in use for a GSSAPI bind request.
<br><br>
</li>

<li>
Added a ResultCode.getStandardName method that can be used to retrieve the name
assigned to the associated result code in the relevant specification. This may
not be available for result codes that are not defined in known specifications.
<br><br>
</li>

<li>
Updated support for passphrase-encrypted input and output streams to provide a
mechanism for caching the derived secret keys so that it's not necessary to
Expand Down
17 changes: 17 additions & 0 deletions src/com/unboundid/ldap/sdk/GSSAPIBindRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,22 @@ public Set<String> getSuppressedSystemProperties()



/**
* Retrieves the type of channel binding that should be used for this GSSAPI
* bind request.
*
* @return The type of channel binding that should be used for this GSSAPI
* bind request, or {@link GSSAPIChannelBindingType#NONE} if no
* channel binding should be used.
*/
@NotNull()
public GSSAPIChannelBindingType getChannelBindingType()
{
return channelBindingType;
}



/**
* Indicates whether JVM-level debugging should be enabled for GSSAPI bind
* processing.
Expand Down Expand Up @@ -1762,6 +1778,7 @@ public GSSAPIBindRequest duplicate(@Nullable final Control[] controls)
gssapiProperties.setIsInitiator(isInitiator);
gssapiProperties.setSuppressedSystemProperties(
suppressedSystemProperties);
gssapiProperties.setChannelBindingType(channelBindingType);

final GSSAPIBindRequest bindRequest =
new GSSAPIBindRequest(gssapiProperties, controls);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ public void testConstructor1()
assertNotNull(r.getSuppressedSystemProperties());
assertTrue(r.getSuppressedSystemProperties().isEmpty());

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.NONE);

assertFalse(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down Expand Up @@ -245,6 +249,10 @@ public void testConstructor2()
assertNotNull(r.getSuppressedSystemProperties());
assertTrue(r.getSuppressedSystemProperties().isEmpty());

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.NONE);

assertFalse(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down Expand Up @@ -340,6 +348,10 @@ public void testConstructor3()
assertNotNull(r.getSuppressedSystemProperties());
assertTrue(r.getSuppressedSystemProperties().isEmpty());

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.NONE);

assertFalse(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down Expand Up @@ -431,6 +443,10 @@ public void testConstructor4()
assertNotNull(r.getSuppressedSystemProperties());
assertTrue(r.getSuppressedSystemProperties().isEmpty());

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.NONE);

assertFalse(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down Expand Up @@ -522,6 +538,10 @@ public void testConstructor5()
assertNotNull(r.getSuppressedSystemProperties());
assertTrue(r.getSuppressedSystemProperties().isEmpty());

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.NONE);

assertFalse(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down Expand Up @@ -619,6 +639,10 @@ public void testConstructor6()
assertNotNull(r.getSuppressedSystemProperties());
assertTrue(r.getSuppressedSystemProperties().isEmpty());

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.NONE);

assertFalse(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down Expand Up @@ -721,6 +745,10 @@ public void testConstructor7()
assertNotNull(r.getSuppressedSystemProperties());
assertTrue(r.getSuppressedSystemProperties().isEmpty());

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.NONE);

assertFalse(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down Expand Up @@ -818,6 +846,10 @@ public void testConstructor8()
assertNotNull(r.getSuppressedSystemProperties());
assertTrue(r.getSuppressedSystemProperties().isEmpty());

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.NONE);

assertFalse(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down Expand Up @@ -879,6 +911,8 @@ public void testPropertiesConstructor()
"java.security.krb5.kdc",
"javax.security.auth.useSubjectCredsOnly"));
gssapiProperties.setEnableGSSAPIDebugging(true);
gssapiProperties.setChannelBindingType(
GSSAPIChannelBindingType.TLS_SERVER_END_POINT);

GSSAPIBindRequest r = new GSSAPIBindRequest(gssapiProperties, controls);
r = r.duplicate();
Expand Down Expand Up @@ -940,6 +974,10 @@ public void testPropertiesConstructor()
"java.security.krb5.kdc",
"javax.security.auth.useSubjectCredsOnly"));

assertNotNull(r.getChannelBindingType());
assertEquals(r.getChannelBindingType(),
GSSAPIChannelBindingType.TLS_SERVER_END_POINT);

assertTrue(r.enableGSSAPIDebugging());

assertNotNull(r.getRebindRequest("127.0.0.1", 389));
Expand Down

0 comments on commit c282150

Please sign in to comment.