diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index d2ccc7e8faab..fdad66dc9a9f 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -755,6 +755,21 @@ svcauth_gss_set_client(struct svc_rqst *rqstp) | |||
755 | return SVC_OK; | 755 | return SVC_OK; |
756 | } | 756 | } |
757 | 757 | ||
758 | static inline int | ||
759 | gss_write_init_verf(struct svc_rqst *rqstp, struct rsi *rsip) | ||
760 | { | ||
761 | struct rsc *rsci; | ||
762 | |||
763 | if (rsip->major_status != GSS_S_COMPLETE) | ||
764 | return gss_write_null_verf(rqstp); | ||
765 | rsci = gss_svc_searchbyctx(&rsip->out_handle); | ||
766 | if (rsci == NULL) { | ||
767 | rsip->major_status = GSS_S_NO_CONTEXT; | ||
768 | return gss_write_null_verf(rqstp); | ||
769 | } | ||
770 | return gss_write_verf(rqstp, rsci->mechctx, GSS_SEQ_WIN); | ||
771 | } | ||
772 | |||
758 | /* | 773 | /* |
759 | * Accept an rpcsec packet. | 774 | * Accept an rpcsec packet. |
760 | * If context establishment, punt to user space | 775 | * If context establishment, punt to user space |
@@ -890,18 +905,8 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp) | |||
890 | case -ENOENT: | 905 | case -ENOENT: |
891 | goto drop; | 906 | goto drop; |
892 | case 0: | 907 | case 0: |
893 | if (rsip->major_status == GSS_S_COMPLETE) { | 908 | if (gss_write_init_verf(rqstp, rsip)) |
894 | rsci = gss_svc_searchbyctx(&rsip->out_handle); | 909 | goto drop; |
895 | if (!rsci) { | ||
896 | goto drop; | ||
897 | } | ||
898 | if (gss_write_verf(rqstp, rsci->mechctx, | ||
899 | GSS_SEQ_WIN)) | ||
900 | goto drop; | ||
901 | } else { | ||
902 | if (gss_write_null_verf(rqstp)) | ||
903 | goto drop; | ||
904 | } | ||
905 | if (resv->iov_len + 4 > PAGE_SIZE) | 910 | if (resv->iov_len + 4 > PAGE_SIZE) |
906 | goto drop; | 911 | goto drop; |
907 | svc_putu32(resv, rpc_success); | 912 | svc_putu32(resv, rpc_success); |