aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/auth_gss.h2
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c40
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_crypto.c16
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_seal.c3
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_wrap.c3
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_unseal.c4
6 files changed, 2 insertions, 66 deletions
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index 97b62e97dd8d..2db2fbf34947 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -90,8 +90,6 @@ struct gss_cred {
90#define gc_flags gc_base.cr_flags 90#define gc_flags gc_base.cr_flags
91#define gc_expire gc_base.cr_expire 91#define gc_expire gc_base.cr_expire
92 92
93void print_hexl(u32 *p, u_int length, u_int offset);
94
95#endif /* __KERNEL__ */ 93#endif /* __KERNEL__ */
96#endif /* _LINUX_SUNRPC_AUTH_GSS_H */ 94#endif /* _LINUX_SUNRPC_AUTH_GSS_H */
97 95
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index e5a84a482e57..d12ee5f54c0c 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -94,46 +94,6 @@ struct gss_auth {
94static void gss_destroy_ctx(struct gss_cl_ctx *); 94static void gss_destroy_ctx(struct gss_cl_ctx *);
95static struct rpc_pipe_ops gss_upcall_ops; 95static struct rpc_pipe_ops gss_upcall_ops;
96 96
97void
98print_hexl(u32 *p, u_int length, u_int offset)
99{
100 u_int i, j, jm;
101 u8 c, *cp;
102
103 dprintk("RPC: print_hexl: length %d\n",length);
104 dprintk("\n");
105 cp = (u8 *) p;
106
107 for (i = 0; i < length; i += 0x10) {
108 dprintk(" %04x: ", (u_int)(i + offset));
109 jm = length - i;
110 jm = jm > 16 ? 16 : jm;
111
112 for (j = 0; j < jm; j++) {
113 if ((j % 2) == 1)
114 dprintk("%02x ", (u_int)cp[i+j]);
115 else
116 dprintk("%02x", (u_int)cp[i+j]);
117 }
118 for (; j < 16; j++) {
119 if ((j % 2) == 1)
120 dprintk(" ");
121 else
122 dprintk(" ");
123 }
124 dprintk(" ");
125
126 for (j = 0; j < jm; j++) {
127 c = cp[i+j];
128 c = isprint(c) ? c : '.';
129 dprintk("%c", c);
130 }
131 dprintk("\n");
132 }
133}
134
135EXPORT_SYMBOL(print_hexl);
136
137static inline struct gss_cl_ctx * 97static inline struct gss_cl_ctx *
138gss_get_ctx(struct gss_cl_ctx *ctx) 98gss_get_ctx(struct gss_cl_ctx *ctx)
139{ 99{
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index e11a40b25cce..4c53896f1b08 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -61,9 +61,6 @@ krb5_encrypt(
61 u8 local_iv[16] = {0}; 61 u8 local_iv[16] = {0};
62 struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv }; 62 struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv };
63 63
64 dprintk("RPC: krb5_encrypt: input data:\n");
65 print_hexl((u32 *)in, length, 0);
66
67 if (length % crypto_blkcipher_blocksize(tfm) != 0) 64 if (length % crypto_blkcipher_blocksize(tfm) != 0)
68 goto out; 65 goto out;
69 66
@@ -80,12 +77,9 @@ krb5_encrypt(
80 sg_set_buf(sg, out, length); 77 sg_set_buf(sg, out, length);
81 78
82 ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length); 79 ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length);
83
84 dprintk("RPC: krb5_encrypt: output data:\n");
85 print_hexl((u32 *)out, length, 0);
86out: 80out:
87 dprintk("RPC: krb5_encrypt returns %d\n",ret); 81 dprintk("RPC: krb5_encrypt returns %d\n",ret);
88 return(ret); 82 return ret;
89} 83}
90 84
91EXPORT_SYMBOL(krb5_encrypt); 85EXPORT_SYMBOL(krb5_encrypt);
@@ -103,9 +97,6 @@ krb5_decrypt(
103 u8 local_iv[16] = {0}; 97 u8 local_iv[16] = {0};
104 struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv }; 98 struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv };
105 99
106 dprintk("RPC: krb5_decrypt: input data:\n");
107 print_hexl((u32 *)in, length, 0);
108
109 if (length % crypto_blkcipher_blocksize(tfm) != 0) 100 if (length % crypto_blkcipher_blocksize(tfm) != 0)
110 goto out; 101 goto out;
111 102
@@ -121,12 +112,9 @@ krb5_decrypt(
121 sg_set_buf(sg, out, length); 112 sg_set_buf(sg, out, length);
122 113
123 ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length); 114 ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length);
124
125 dprintk("RPC: krb5_decrypt: output_data:\n");
126 print_hexl((u32 *)out, length, 0);
127out: 115out:
128 dprintk("RPC: gss_k5decrypt returns %d\n",ret); 116 dprintk("RPC: gss_k5decrypt returns %d\n",ret);
129 return(ret); 117 return ret;
130} 118}
131 119
132EXPORT_SYMBOL(krb5_decrypt); 120EXPORT_SYMBOL(krb5_decrypt);
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c
index 08601ee4cd73..dc58af0b8b4c 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
@@ -129,9 +129,6 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
129 memcpy(krb5_hdr + 16, 129 memcpy(krb5_hdr + 16,
130 md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH, 130 md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH,
131 KRB5_CKSUM_LENGTH); 131 KRB5_CKSUM_LENGTH);
132
133 dprintk("RPC: make_seal_token: cksum data: \n");
134 print_hexl((u32 *) (krb5_hdr + 16), KRB5_CKSUM_LENGTH, 0);
135 break; 132 break;
136 default: 133 default:
137 BUG(); 134 BUG();
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
index cc45c1605f80..0f512e8e0d19 100644
--- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
+++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
@@ -199,9 +199,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset,
199 memcpy(krb5_hdr + 16, 199 memcpy(krb5_hdr + 16,
200 md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH, 200 md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH,
201 KRB5_CKSUM_LENGTH); 201 KRB5_CKSUM_LENGTH);
202
203 dprintk("RPC: make_seal_token: cksum data: \n");
204 print_hexl((u32 *) (krb5_hdr + 16), KRB5_CKSUM_LENGTH, 0);
205 break; 202 break;
206 default: 203 default:
207 BUG(); 204 BUG();
diff --git a/net/sunrpc/auth_gss/gss_spkm3_unseal.c b/net/sunrpc/auth_gss/gss_spkm3_unseal.c
index 8537f581ef9b..544eb6fd9094 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_unseal.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_unseal.c
@@ -103,10 +103,6 @@ spkm3_read_token(struct spkm3_ctx *ctx,
103 103
104 dprintk("RPC: spkm3_read_token: digest wire_cksum.len %d:\n", 104 dprintk("RPC: spkm3_read_token: digest wire_cksum.len %d:\n",
105 wire_cksum.len); 105 wire_cksum.len);
106 dprintk(" md5cksum.data\n");
107 print_hexl((u32 *) md5cksum.data, 16, 0);
108 dprintk(" cksum.data:\n");
109 print_hexl((u32 *) wire_cksum.data, wire_cksum.len, 0);
110 106
111 ret = GSS_S_BAD_SIG; 107 ret = GSS_S_BAD_SIG;
112 code = memcmp(md5cksum.data, wire_cksum.data, wire_cksum.len); 108 code = memcmp(md5cksum.data, wire_cksum.data, wire_cksum.len);