2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-20 08:38:24 +08:00

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: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
J. Bruce Fields 2006-12-04 20:22:31 -05:00 committed by Trond Myklebust
parent 2b577f1f14
commit 8fc7500bb8
6 changed files with 2 additions and 66 deletions

View File

@ -90,8 +90,6 @@ struct gss_cred {
#define gc_flags gc_base.cr_flags
#define gc_expire gc_base.cr_expire
void print_hexl(u32 *p, u_int length, u_int offset);
#endif /* __KERNEL__ */
#endif /* _LINUX_SUNRPC_AUTH_GSS_H */

View File

@ -94,46 +94,6 @@ struct gss_auth {
static void gss_destroy_ctx(struct gss_cl_ctx *);
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 *
gss_get_ctx(struct gss_cl_ctx *ctx)
{

View File

@ -61,9 +61,6 @@ krb5_encrypt(
u8 local_iv[16] = {0};
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)
goto out;
@ -80,12 +77,9 @@ krb5_encrypt(
sg_set_buf(sg, out, length);
ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length);
dprintk("RPC: krb5_encrypt: output data:\n");
print_hexl((u32 *)out, length, 0);
out:
dprintk("RPC: krb5_encrypt returns %d\n",ret);
return(ret);
return ret;
}
EXPORT_SYMBOL(krb5_encrypt);
@ -103,9 +97,6 @@ krb5_decrypt(
u8 local_iv[16] = {0};
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)
goto out;
@ -121,12 +112,9 @@ krb5_decrypt(
sg_set_buf(sg, out, length);
ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length);
dprintk("RPC: krb5_decrypt: output_data:\n");
print_hexl((u32 *)out, length, 0);
out:
dprintk("RPC: gss_k5decrypt returns %d\n",ret);
return(ret);
return ret;
}
EXPORT_SYMBOL(krb5_decrypt);

View File

@ -129,9 +129,6 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
memcpy(krb5_hdr + 16,
md5cksum.data + md5cksum.len - 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;
default:
BUG();

View File

@ -199,9 +199,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset,
memcpy(krb5_hdr + 16,
md5cksum.data + md5cksum.len - 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;
default:
BUG();

View File

@ -103,10 +103,6 @@ spkm3_read_token(struct spkm3_ctx *ctx,
dprintk("RPC: spkm3_read_token: digest wire_cksum.len %d:\n",
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;
code = memcmp(md5cksum.data, wire_cksum.data, wire_cksum.len);