From 1de85eeda2b9a01fcdd5e1773f32a7b77f62c908 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Wed, 22 Apr 2015 11:02:27 -0400 Subject: [PATCH] Extract caller's qop setting from svcauth_gss_validate() svcauth_gss_validate's caller will need to know the caller's qop in a moment. Signed-off-by: Chuck Lever Signed-off-by Steve Dickson --- src/svc_auth_gss.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c index f5165b5..6d7c26e 100644 --- a/src/svc_auth_gss.c +++ b/src/svc_auth_gss.c @@ -354,7 +354,8 @@ svcauth_gss_accept_sec_context(struct svc_req *rqst, } static bool_t -svcauth_gss_validate(struct svc_rpc_gss_data *gd, struct rpc_msg *msg) +svcauth_gss_validate(struct svc_rpc_gss_data *gd, struct rpc_msg *msg, + gss_qop_t *qop) { struct opaque_auth *oa; gss_buffer_desc rpcbuf, checksum; @@ -403,6 +404,7 @@ svcauth_gss_validate(struct svc_rpc_gss_data *gd, struct rpc_msg *msg) maj_stat, min_stat); return (FALSE); } + *qop = qop_state; return (TRUE); } @@ -447,6 +449,7 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch) struct rpc_gss_cred *gc; struct rpc_gss_init_res gr; int call_stat, offset; + gss_qop_t qop; gss_log_debug("in svcauth_gss()"); @@ -556,7 +559,7 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch) break; case RPCSEC_GSS_DATA: - if (!svcauth_gss_validate(gd, msg)) + if (!svcauth_gss_validate(gd, msg, &qop)) return (RPCSEC_GSS_CREDPROBLEM); if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq))) @@ -567,7 +570,7 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch) if (rqst->rq_proc != NULLPROC) return (AUTH_FAILED); /* XXX ? */ - if (!svcauth_gss_validate(gd, msg)) + if (!svcauth_gss_validate(gd, msg, &qop)) return (RPCSEC_GSS_CREDPROBLEM); if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq))) -- 2.40.0