Skip to content

Commit

Permalink
Fix channel binding test
Browse files Browse the repository at this point in the history
This doesn't feel quite right, but it does work.

Signed-off-by: Paul Arthur <[email protected]>
  • Loading branch information
flowerysong committed Jul 31, 2024
1 parent ca0166c commit 1ba9678
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,9 @@ int sasl_client_start(sasl_conn_t *conn,

myflags = conn->props.security_flags;

/* not a real security flag */
myflags &= ~SASL_SEC_NONSTD_CBIND;

/* if there's an external layer with a better SSF then this is no
* longer considered a plaintext mechanism
*/
Expand Down
3 changes: 3 additions & 0 deletions lib/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,9 @@ static int mech_permitted(sasl_conn_t *conn,
/* special case plaintext */
myflags = conn->props.security_flags;

/* not a real security flag */
myflags &= ~SASL_SEC_NONSTD_CBIND;

/* if there's an external layer this is no longer plaintext */
if ((conn->props.min_ssf <= conn->external.ssf) &&
(conn->external.ssf > 1)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def gssapi_tests(testdir):
print(' ', end='')
err += gssapi_channel_binding_test(kenv)

print('GSSAPI CHANNEL BINDING MISMTACH:')
print('GSSAPI CHANNEL BINDING MISMATCH:')
print(' ', end='')
err += gssapi_channel_binding_mismatch_test(kenv)

Expand Down
3 changes: 3 additions & 0 deletions tests/t_gssapi_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ int main(int argc, char *argv[])

if (cb.name) {
sasl_setprop(conn, SASL_CHANNEL_BINDING, &cb);
sasl_security_properties_t secprops = { 0 };
secprops.security_flags = SASL_SEC_NONSTD_CBIND;
sasl_setprop(conn, SASL_SEC_PROPS, &secprops);
}

if (spnego) {
Expand Down
3 changes: 3 additions & 0 deletions tests/t_gssapi_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ int main(int argc, char *argv[])

if (cb.name) {
sasl_setprop(conn, SASL_CHANNEL_BINDING, &cb);
sasl_security_properties_t secprops = { 0 };
secprops.security_flags = SASL_SEC_NONSTD_CBIND;
sasl_setprop(conn, SASL_SEC_PROPS, &secprops);
}

if (plain) {
Expand Down

0 comments on commit 1ba9678

Please sign in to comment.