]> granicus.if.org Git - libtirpc/commitdiff
Extract caller's qop setting from svcauth_gss_validate()
authorChuck Lever <chuck.lever@oracle.com>
Wed, 22 Apr 2015 15:02:27 +0000 (11:02 -0400)
committerSteve Dickson <steved@redhat.com>
Wed, 29 Apr 2015 15:40:32 +0000 (11:40 -0400)
svcauth_gss_validate's caller will need to know the caller's qop in
a moment.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by Steve Dickson <steved@redhat.com>

src/svc_auth_gss.c

index f5165b5a4d2e2b7ba473578dc45b7a9384c3a375..6d7c26e9f5eb4658dd002fa84d548a08cda8e3d3 100644 (file)
@@ -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)))