aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/gss_krb5_mech.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@fieldses.org>2006-12-04 20:22:40 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-06 10:46:47 -0500
commitd922a84a8bf1d627810906d033223d4fa629fdbf (patch)
tree8150e29f36f3e14df0c1fea1caa1936f7cfa0e3a /net/sunrpc/auth_gss/gss_krb5_mech.c
parent39a21dd1b0eec3f5eac84ee42bda5ab4915098ae (diff)
rpcgss: krb5: sanity check sealalg value in the downcall
The sealalg is checked in several places, giving the impression it could be either SEAL_ALG_NONE or SEAL_ALG_DES. But in fact SEAL_ALG_NONE seems to be sufficient only for making mic's, and all the contexts we get must be capable of wrapping as well. So the sealalg must be SEAL_ALG_DES. As with signalg, just check for the right value on the downcall and ignore it otherwise. Similarly, tighten expectations for the sealalg on incoming tokens, in case we do support other values eventually. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss/gss_krb5_mech.c')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 17587163fca..bf5435db878 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -148,9 +148,11 @@ gss_import_sec_context_kerberos(const void *p,
148 goto out_err_free_ctx; 148 goto out_err_free_ctx;
149 if (tmp != SGN_ALG_DES_MAC_MD5) 149 if (tmp != SGN_ALG_DES_MAC_MD5)
150 goto out_err_free_ctx; 150 goto out_err_free_ctx;
151 p = simple_get_bytes(p, end, &ctx->sealalg, sizeof(ctx->sealalg)); 151 p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
152 if (IS_ERR(p)) 152 if (IS_ERR(p))
153 goto out_err_free_ctx; 153 goto out_err_free_ctx;
154 if (tmp != SEAL_ALG_DES)
155 goto out_err_free_ctx;
154 p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime)); 156 p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime));
155 if (IS_ERR(p)) 157 if (IS_ERR(p))
156 goto out_err_free_ctx; 158 goto out_err_free_ctx;