提交 ef338bee 编写于 作者: K Kevin Coffman 提交者: Trond Myklebust

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: NKevin Coffman <kwc@citi.umich.edu>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 ffc40f56
...@@ -147,13 +147,17 @@ gss_import_sec_context_kerberos(const void *p, ...@@ -147,13 +147,17 @@ gss_import_sec_context_kerberos(const void *p,
p = simple_get_bytes(p, end, &tmp, sizeof(tmp)); p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
if (IS_ERR(p)) if (IS_ERR(p))
goto out_err_free_ctx; 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; goto out_err_free_ctx;
}
p = simple_get_bytes(p, end, &tmp, sizeof(tmp)); p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
if (IS_ERR(p)) if (IS_ERR(p))
goto out_err_free_ctx; goto out_err_free_ctx;
if (tmp != SEAL_ALG_DES) if (tmp != SEAL_ALG_DES) {
p = ERR_PTR(-ENOSYS);
goto out_err_free_ctx; goto out_err_free_ctx;
}
p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime)); p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime));
if (IS_ERR(p)) if (IS_ERR(p))
goto out_err_free_ctx; goto out_err_free_ctx;
......
...@@ -83,6 +83,7 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text, ...@@ -83,6 +83,7 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
u32 seq_send; u32 seq_send;
dprintk("RPC: gss_krb5_seal\n"); dprintk("RPC: gss_krb5_seal\n");
BUG_ON(ctx == NULL);
now = get_seconds(); now = get_seconds();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册