summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/gss_krb5_mech.c
diff options
context:
space:
mode:
authorKevin Coffman2007-11-10 00:42:09 +0100
committerTrond Myklebust2007-11-17 19:08:46 +0100
commitef338bee3f4f509e82066e100f76fecbbbbc4cca (patch)
tree833662511977c31a81374ee1627be950d59fafd2 /net/sunrpc/auth_gss/gss_krb5_mech.c
parentsunrpc: gss_pipe_downcall(), don't assume all errors are transient (diff)
downloadkernel-qcow2-linux-ef338bee3f4f509e82066e100f76fecbbbbc4cca.tar.gz
kernel-qcow2-linux-ef338bee3f4f509e82066e100f76fecbbbbc4cca.tar.xz
kernel-qcow2-linux-ef338bee3f4f509e82066e100f76fecbbbbc4cca.zip
sunrpc: return error if unsupported enctype or cksumtype is encountered
Return an error from gss_import_sec_context_kerberos if the negotiated context contains encryption or checksum types not supported by the kernel code. This fixes an Oops because success was assumed and later code found no internal_ctx_id. Signed-off-by: Kevin Coffman <kwc@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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 9843eacef11d..60c3dba545d7 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -147,13 +147,17 @@ gss_import_sec_context_kerberos(const void *p,
p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
if (IS_ERR(p))
goto out_err_free_ctx;
- if (tmp != SGN_ALG_DES_MAC_MD5)
+ if (tmp != SGN_ALG_DES_MAC_MD5) {
+ p = ERR_PTR(-ENOSYS);
goto out_err_free_ctx;
+ }
p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
if (IS_ERR(p))
goto out_err_free_ctx;
- if (tmp != SEAL_ALG_DES)
+ if (tmp != SEAL_ALG_DES) {
+ p = ERR_PTR(-ENOSYS);
goto out_err_free_ctx;
+ }
p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime));
if (IS_ERR(p))
goto out_err_free_ctx;