summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-08-03 11:26:13 +0200
committerStefan Metzmacher <metze@samba.org>2013-08-10 09:18:55 +0200
commit45c74c8084d2db14fef6a79cd98068be2ab73f30 (patch)
treeb5a4a6ef372451493d3c0a9f3c670750d557e93e
parent04938cbeecc777f7b799a11f1ca0461b351d968a (diff)
downloadsamba-45c74c8084d2db14fef6a79cd98068be2ab73f30.tar.gz
samba-45c74c8084d2db14fef6a79cd98068be2ab73f30.tar.bz2
samba-45c74c8084d2db14fef6a79cd98068be2ab73f30.zip
auth/gensec: first check GENSEC_FEATURE_SESSION_KEY before returning NOT_IMPLEMENTED
Preferr NT_STATUS_NO_USER_SESSION_KEY as return value of gensec_session_key(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--auth/gensec/gensec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/auth/gensec/gensec.c b/auth/gensec/gensec.c
index ea62861797..9a8f0ef15a 100644
--- a/auth/gensec/gensec.c
+++ b/auth/gensec/gensec.c
@@ -155,13 +155,14 @@ _PUBLIC_ NTSTATUS gensec_session_key(struct gensec_security *gensec_security,
TALLOC_CTX *mem_ctx,
DATA_BLOB *session_key)
{
- if (!gensec_security->ops->session_key) {
- return NT_STATUS_NOT_IMPLEMENTED;
- }
if (!gensec_have_feature(gensec_security, GENSEC_FEATURE_SESSION_KEY)) {
return NT_STATUS_NO_USER_SESSION_KEY;
}
+ if (!gensec_security->ops->session_key) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+
return gensec_security->ops->session_key(gensec_security, mem_ctx, session_key);
}