提交 8fc7500b 编写于 作者: J J. Bruce Fields 提交者: Trond Myklebust

rpc: gss: eliminate print_hexl()'s

Dumping all this data to the logs is wasteful (even when debugging is turned
off), and creates too much output to be useful when it's turned on.

Fix a minor style bug or two while we're at it.
Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 2b577f1f
...@@ -90,8 +90,6 @@ struct gss_cred { ...@@ -90,8 +90,6 @@ struct gss_cred {
#define gc_flags gc_base.cr_flags #define gc_flags gc_base.cr_flags
#define gc_expire gc_base.cr_expire #define gc_expire gc_base.cr_expire
void print_hexl(u32 *p, u_int length, u_int offset);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _LINUX_SUNRPC_AUTH_GSS_H */ #endif /* _LINUX_SUNRPC_AUTH_GSS_H */
...@@ -94,46 +94,6 @@ struct gss_auth { ...@@ -94,46 +94,6 @@ struct gss_auth {
static void gss_destroy_ctx(struct gss_cl_ctx *); static void gss_destroy_ctx(struct gss_cl_ctx *);
static struct rpc_pipe_ops gss_upcall_ops; static struct rpc_pipe_ops gss_upcall_ops;
void
print_hexl(u32 *p, u_int length, u_int offset)
{
u_int i, j, jm;
u8 c, *cp;
dprintk("RPC: print_hexl: length %d\n",length);
dprintk("\n");
cp = (u8 *) p;
for (i = 0; i < length; i += 0x10) {
dprintk(" %04x: ", (u_int)(i + offset));
jm = length - i;
jm = jm > 16 ? 16 : jm;
for (j = 0; j < jm; j++) {
if ((j % 2) == 1)
dprintk("%02x ", (u_int)cp[i+j]);
else
dprintk("%02x", (u_int)cp[i+j]);
}
for (; j < 16; j++) {
if ((j % 2) == 1)
dprintk(" ");
else
dprintk(" ");
}
dprintk(" ");
for (j = 0; j < jm; j++) {
c = cp[i+j];
c = isprint(c) ? c : '.';
dprintk("%c", c);
}
dprintk("\n");
}
}
EXPORT_SYMBOL(print_hexl);
static inline struct gss_cl_ctx * static inline struct gss_cl_ctx *
gss_get_ctx(struct gss_cl_ctx *ctx) gss_get_ctx(struct gss_cl_ctx *ctx)
{ {
......
...@@ -61,9 +61,6 @@ krb5_encrypt( ...@@ -61,9 +61,6 @@ krb5_encrypt(
u8 local_iv[16] = {0}; u8 local_iv[16] = {0};
struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv }; struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv };
dprintk("RPC: krb5_encrypt: input data:\n");
print_hexl((u32 *)in, length, 0);
if (length % crypto_blkcipher_blocksize(tfm) != 0) if (length % crypto_blkcipher_blocksize(tfm) != 0)
goto out; goto out;
...@@ -80,12 +77,9 @@ krb5_encrypt( ...@@ -80,12 +77,9 @@ krb5_encrypt(
sg_set_buf(sg, out, length); sg_set_buf(sg, out, length);
ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length); ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length);
dprintk("RPC: krb5_encrypt: output data:\n");
print_hexl((u32 *)out, length, 0);
out: out:
dprintk("RPC: krb5_encrypt returns %d\n",ret); dprintk("RPC: krb5_encrypt returns %d\n",ret);
return(ret); return ret;
} }
EXPORT_SYMBOL(krb5_encrypt); EXPORT_SYMBOL(krb5_encrypt);
...@@ -103,9 +97,6 @@ krb5_decrypt( ...@@ -103,9 +97,6 @@ krb5_decrypt(
u8 local_iv[16] = {0}; u8 local_iv[16] = {0};
struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv }; struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv };
dprintk("RPC: krb5_decrypt: input data:\n");
print_hexl((u32 *)in, length, 0);
if (length % crypto_blkcipher_blocksize(tfm) != 0) if (length % crypto_blkcipher_blocksize(tfm) != 0)
goto out; goto out;
...@@ -121,12 +112,9 @@ krb5_decrypt( ...@@ -121,12 +112,9 @@ krb5_decrypt(
sg_set_buf(sg, out, length); sg_set_buf(sg, out, length);
ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length); ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length);
dprintk("RPC: krb5_decrypt: output_data:\n");
print_hexl((u32 *)out, length, 0);
out: out:
dprintk("RPC: gss_k5decrypt returns %d\n",ret); dprintk("RPC: gss_k5decrypt returns %d\n",ret);
return(ret); return ret;
} }
EXPORT_SYMBOL(krb5_decrypt); EXPORT_SYMBOL(krb5_decrypt);
......
...@@ -129,9 +129,6 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text, ...@@ -129,9 +129,6 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
memcpy(krb5_hdr + 16, memcpy(krb5_hdr + 16,
md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH, md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH,
KRB5_CKSUM_LENGTH); KRB5_CKSUM_LENGTH);
dprintk("RPC: make_seal_token: cksum data: \n");
print_hexl((u32 *) (krb5_hdr + 16), KRB5_CKSUM_LENGTH, 0);
break; break;
default: default:
BUG(); BUG();
......
...@@ -199,9 +199,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset, ...@@ -199,9 +199,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset,
memcpy(krb5_hdr + 16, memcpy(krb5_hdr + 16,
md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH, md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH,
KRB5_CKSUM_LENGTH); KRB5_CKSUM_LENGTH);
dprintk("RPC: make_seal_token: cksum data: \n");
print_hexl((u32 *) (krb5_hdr + 16), KRB5_CKSUM_LENGTH, 0);
break; break;
default: default:
BUG(); BUG();
......
...@@ -103,10 +103,6 @@ spkm3_read_token(struct spkm3_ctx *ctx, ...@@ -103,10 +103,6 @@ spkm3_read_token(struct spkm3_ctx *ctx,
dprintk("RPC: spkm3_read_token: digest wire_cksum.len %d:\n", dprintk("RPC: spkm3_read_token: digest wire_cksum.len %d:\n",
wire_cksum.len); wire_cksum.len);
dprintk(" md5cksum.data\n");
print_hexl((u32 *) md5cksum.data, 16, 0);
dprintk(" cksum.data:\n");
print_hexl((u32 *) wire_cksum.data, wire_cksum.len, 0);
ret = GSS_S_BAD_SIG; ret = GSS_S_BAD_SIG;
code = memcmp(md5cksum.data, wire_cksum.data, wire_cksum.len); code = memcmp(md5cksum.data, wire_cksum.data, wire_cksum.len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册