diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsencrypt.c | 18 | ||||
-rw-r--r-- | fs/cifs/md5.c | 38 | ||||
-rw-r--r-- | fs/cifs/md5.h | 6 |
3 files changed, 31 insertions, 31 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index d4839cf0cb2c..7c9809523f42 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
@@ -48,11 +48,11 @@ static int cifs_calculate_signature(const struct smb_hdr *cifs_pdu, | |||
48 | if ((cifs_pdu == NULL) || (signature == NULL) || (key == NULL)) | 48 | if ((cifs_pdu == NULL) || (signature == NULL) || (key == NULL)) |
49 | return -EINVAL; | 49 | return -EINVAL; |
50 | 50 | ||
51 | MD5Init(&context); | 51 | cifs_MD5_init(&context); |
52 | MD5Update(&context, (char *)&key->data, key->len); | 52 | cifs_MD5_update(&context, (char *)&key->data, key->len); |
53 | MD5Update(&context, cifs_pdu->Protocol, cifs_pdu->smb_buf_length); | 53 | cifs_MD5_update(&context, cifs_pdu->Protocol, cifs_pdu->smb_buf_length); |
54 | 54 | ||
55 | MD5Final(signature, &context); | 55 | cifs_MD5_final(signature, &context); |
56 | return 0; | 56 | return 0; |
57 | } | 57 | } |
58 | 58 | ||
@@ -96,8 +96,8 @@ static int cifs_calc_signature2(const struct kvec *iov, int n_vec, | |||
96 | if ((iov == NULL) || (signature == NULL) || (key == NULL)) | 96 | if ((iov == NULL) || (signature == NULL) || (key == NULL)) |
97 | return -EINVAL; | 97 | return -EINVAL; |
98 | 98 | ||
99 | MD5Init(&context); | 99 | cifs_MD5_init(&context); |
100 | MD5Update(&context, (char *)&key->data, key->len); | 100 | cifs_MD5_update(&context, (char *)&key->data, key->len); |
101 | for (i = 0; i < n_vec; i++) { | 101 | for (i = 0; i < n_vec; i++) { |
102 | if (iov[i].iov_len == 0) | 102 | if (iov[i].iov_len == 0) |
103 | continue; | 103 | continue; |
@@ -110,13 +110,13 @@ static int cifs_calc_signature2(const struct kvec *iov, int n_vec, | |||
110 | if (i == 0) { | 110 | if (i == 0) { |
111 | if (iov[0].iov_len <= 8) /* cmd field at offset 9 */ | 111 | if (iov[0].iov_len <= 8) /* cmd field at offset 9 */ |
112 | break; /* nothing to sign or corrupt header */ | 112 | break; /* nothing to sign or corrupt header */ |
113 | MD5Update(&context, iov[0].iov_base+4, | 113 | cifs_MD5_update(&context, iov[0].iov_base+4, |
114 | iov[0].iov_len-4); | 114 | iov[0].iov_len-4); |
115 | } else | 115 | } else |
116 | MD5Update(&context, iov[i].iov_base, iov[i].iov_len); | 116 | cifs_MD5_update(&context, iov[i].iov_base, iov[i].iov_len); |
117 | } | 117 | } |
118 | 118 | ||
119 | MD5Final(signature, &context); | 119 | cifs_MD5_final(signature, &context); |
120 | 120 | ||
121 | return 0; | 121 | return 0; |
122 | } | 122 | } |
diff --git a/fs/cifs/md5.c b/fs/cifs/md5.c index 462bbfefd4b6..98b66a54c319 100644 --- a/fs/cifs/md5.c +++ b/fs/cifs/md5.c | |||
@@ -10,8 +10,8 @@ | |||
10 | * with every copy. | 10 | * with every copy. |
11 | * | 11 | * |
12 | * To compute the message digest of a chunk of bytes, declare an | 12 | * To compute the message digest of a chunk of bytes, declare an |
13 | * MD5Context structure, pass it to MD5Init, call MD5Update as | 13 | * MD5Context structure, pass it to cifs_MD5_init, call cifs_MD5_update as |
14 | * needed on buffers full of bytes, and then call MD5Final, which | 14 | * needed on buffers full of bytes, and then call cifs_MD5_final, which |
15 | * will fill a supplied 16-byte array with the digest. | 15 | * will fill a supplied 16-byte array with the digest. |
16 | */ | 16 | */ |
17 | 17 | ||
@@ -45,7 +45,7 @@ byteReverse(unsigned char *buf, unsigned longs) | |||
45 | * initialization constants. | 45 | * initialization constants. |
46 | */ | 46 | */ |
47 | void | 47 | void |
48 | MD5Init(struct MD5Context *ctx) | 48 | cifs_MD5_init(struct MD5Context *ctx) |
49 | { | 49 | { |
50 | ctx->buf[0] = 0x67452301; | 50 | ctx->buf[0] = 0x67452301; |
51 | ctx->buf[1] = 0xefcdab89; | 51 | ctx->buf[1] = 0xefcdab89; |
@@ -61,7 +61,7 @@ MD5Init(struct MD5Context *ctx) | |||
61 | * of bytes. | 61 | * of bytes. |
62 | */ | 62 | */ |
63 | void | 63 | void |
64 | MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) | 64 | cifs_MD5_update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) |
65 | { | 65 | { |
66 | register __u32 t; | 66 | register __u32 t; |
67 | 67 | ||
@@ -110,7 +110,7 @@ MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) | |||
110 | * 1 0* (64-bit count of bits processed, MSB-first) | 110 | * 1 0* (64-bit count of bits processed, MSB-first) |
111 | */ | 111 | */ |
112 | void | 112 | void |
113 | MD5Final(unsigned char digest[16], struct MD5Context *ctx) | 113 | cifs_MD5_final(unsigned char digest[16], struct MD5Context *ctx) |
114 | { | 114 | { |
115 | unsigned int count; | 115 | unsigned int count; |
116 | unsigned char *p; | 116 | unsigned char *p; |
@@ -165,7 +165,7 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx) | |||
165 | 165 | ||
166 | /* | 166 | /* |
167 | * The core of the MD5 algorithm, this alters an existing MD5 hash to | 167 | * The core of the MD5 algorithm, this alters an existing MD5 hash to |
168 | * reflect the addition of 16 longwords of new data. MD5Update blocks | 168 | * reflect the addition of 16 longwords of new data. cifs_MD5_update blocks |
169 | * the data and converts bytes into longwords for this routine. | 169 | * the data and converts bytes into longwords for this routine. |
170 | */ | 170 | */ |
171 | static void | 171 | static void |
@@ -267,9 +267,9 @@ hmac_md5_init_rfc2104(unsigned char *key, int key_len, | |||
267 | unsigned char tk[16]; | 267 | unsigned char tk[16]; |
268 | struct MD5Context tctx; | 268 | struct MD5Context tctx; |
269 | 269 | ||
270 | MD5Init(&tctx); | 270 | cifs_MD5_init(&tctx); |
271 | MD5Update(&tctx, key, key_len); | 271 | cifs_MD5_update(&tctx, key, key_len); |
272 | MD5Final(tk, &tctx); | 272 | cifs_MD5_final(tk, &tctx); |
273 | 273 | ||
274 | key = tk; | 274 | key = tk; |
275 | key_len = 16; | 275 | key_len = 16; |
@@ -287,8 +287,8 @@ hmac_md5_init_rfc2104(unsigned char *key, int key_len, | |||
287 | ctx->k_opad[i] ^= 0x5c; | 287 | ctx->k_opad[i] ^= 0x5c; |
288 | } | 288 | } |
289 | 289 | ||
290 | MD5Init(&ctx->ctx); | 290 | cifs_MD5_init(&ctx->ctx); |
291 | MD5Update(&ctx->ctx, ctx->k_ipad, 64); | 291 | cifs_MD5_update(&ctx->ctx, ctx->k_ipad, 64); |
292 | } | 292 | } |
293 | #endif | 293 | #endif |
294 | 294 | ||
@@ -317,8 +317,8 @@ hmac_md5_init_limK_to_64(const unsigned char *key, int key_len, | |||
317 | ctx->k_opad[i] ^= 0x5c; | 317 | ctx->k_opad[i] ^= 0x5c; |
318 | } | 318 | } |
319 | 319 | ||
320 | MD5Init(&ctx->ctx); | 320 | cifs_MD5_init(&ctx->ctx); |
321 | MD5Update(&ctx->ctx, ctx->k_ipad, 64); | 321 | cifs_MD5_update(&ctx->ctx, ctx->k_ipad, 64); |
322 | } | 322 | } |
323 | 323 | ||
324 | /*********************************************************************** | 324 | /*********************************************************************** |
@@ -328,7 +328,7 @@ void | |||
328 | hmac_md5_update(const unsigned char *text, int text_len, | 328 | hmac_md5_update(const unsigned char *text, int text_len, |
329 | struct HMACMD5Context *ctx) | 329 | struct HMACMD5Context *ctx) |
330 | { | 330 | { |
331 | MD5Update(&ctx->ctx, text, text_len); /* then text of datagram */ | 331 | cifs_MD5_update(&ctx->ctx, text, text_len); /* then text of datagram */ |
332 | } | 332 | } |
333 | 333 | ||
334 | /*********************************************************************** | 334 | /*********************************************************************** |
@@ -339,12 +339,12 @@ hmac_md5_final(unsigned char *digest, struct HMACMD5Context *ctx) | |||
339 | { | 339 | { |
340 | struct MD5Context ctx_o; | 340 | struct MD5Context ctx_o; |
341 | 341 | ||
342 | MD5Final(digest, &ctx->ctx); | 342 | cifs_MD5_final(digest, &ctx->ctx); |
343 | 343 | ||
344 | MD5Init(&ctx_o); | 344 | cifs_MD5_init(&ctx_o); |
345 | MD5Update(&ctx_o, ctx->k_opad, 64); | 345 | cifs_MD5_update(&ctx_o, ctx->k_opad, 64); |
346 | MD5Update(&ctx_o, digest, 16); | 346 | cifs_MD5_update(&ctx_o, digest, 16); |
347 | MD5Final(digest, &ctx_o); | 347 | cifs_MD5_final(digest, &ctx_o); |
348 | } | 348 | } |
349 | 349 | ||
350 | /*********************************************************** | 350 | /*********************************************************** |
diff --git a/fs/cifs/md5.h b/fs/cifs/md5.h index f7d4f4197bac..6fba8cb402fd 100644 --- a/fs/cifs/md5.h +++ b/fs/cifs/md5.h | |||
@@ -20,10 +20,10 @@ struct HMACMD5Context { | |||
20 | }; | 20 | }; |
21 | #endif /* _HMAC_MD5_H */ | 21 | #endif /* _HMAC_MD5_H */ |
22 | 22 | ||
23 | void MD5Init(struct MD5Context *context); | 23 | void cifs_MD5_init(struct MD5Context *context); |
24 | void MD5Update(struct MD5Context *context, unsigned char const *buf, | 24 | void cifs_MD5_update(struct MD5Context *context, unsigned char const *buf, |
25 | unsigned len); | 25 | unsigned len); |
26 | void MD5Final(unsigned char digest[16], struct MD5Context *context); | 26 | void cifs_MD5_final(unsigned char digest[16], struct MD5Context *context); |
27 | 27 | ||
28 | /* The following definitions come from lib/hmacmd5.c */ | 28 | /* The following definitions come from lib/hmacmd5.c */ |
29 | 29 | ||