Skip to content

Commit

Permalink
Ensure that delegated_creds is non-null when set
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DirectXMan12 committed Feb 25, 2016
1 parent b0023ca commit 55af4f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gssapi/sec_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ def _acceptor_step(self, token):
res = rsec_contexts.accept_sec_context(token, self._creds,
self, self._channel_bindings)

self._delegated_creds = Credentials(res.delegated_creds)
if res.delegated_creds is not None:
self._delegated_creds = Credentials(res.delegated_creds)
else:
self._delegated_creds = None

self._complete = not res.more_steps

Expand Down

0 comments on commit 55af4f3

Please sign in to comment.