Skip to content

Commit 55af4f3

Browse files
committed
Ensure that delegated_creds is non-null when set
Previously, in the high-level API, we would unconditionally set wrap the return value of delegated_creds, which could result in delegated_creds being set to the default credentials when no delegated creds were returned (since the call would be `Credentials(None)`). This changes the logic so that delegated_creds stays set as `None` unless delegated_creds are actually returned. Partial solution for #96
1 parent b0023ca commit 55af4f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gssapi/sec_contexts.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,10 @@ def _acceptor_step(self, token):
524524
res = rsec_contexts.accept_sec_context(token, self._creds,
525525
self, self._channel_bindings)
526526

527-
self._delegated_creds = Credentials(res.delegated_creds)
527+
if res.delegated_creds is not None:
528+
self._delegated_creds = Credentials(res.delegated_creds)
529+
else:
530+
self._delegated_creds = None
528531

529532
self._complete = not res.more_steps
530533

0 commit comments

Comments
 (0)