[PATCH 2/6] cifs: remove dead code

2005-01-15 Thread Pekka Enberg
This patch removes commented out code.

Signed-off-by: Pekka Enberg <[EMAIL PROTECTED]>
---

 asn1.c|  122 --
 cifsencrypt.c |5 --
 cifsfs.c  |   25 ---
 cifssmb.c |   48 +-
 connect.c |   25 ---
 dir.c |   18 
 fcntl.c   |5 --
 file.c|  105 -
 inode.c   |   27 
 link.c|   13 --
 misc.c|6 --
 readdir.c |   62 -
 transport.c   |2 
 13 files changed, 6 insertions(+), 457 deletions(-)

Index: 2.6/fs/cifs/asn1.c
===
--- 2.6.orig/fs/cifs/asn1.c 2005-01-12 23:39:37.335242560 +0200
+++ 2.6/fs/cifs/asn1.c  2005-01-12 23:39:40.806714816 +0200
@@ -236,128 +236,6 @@
}
 }
 
-/* static unsigned char asn1_null_decode(struct asn1_ctx *ctx,
- unsigned char *eoc)
-{
-   ctx->pointer = eoc;
-   return 1;
-}
-
-static unsigned char asn1_long_decode(struct asn1_ctx *ctx,
- unsigned char *eoc, long *integer)
-{
-   unsigned char ch;
-   unsigned int len;
-
-   if (!asn1_octet_decode(ctx, ))
-   return 0;
-
-   *integer = (signed char) ch;
-   len = 1;
-
-   while (ctx->pointer < eoc) {
-   if (++len > sizeof(long)) {
-   ctx->error = ASN1_ERR_DEC_BADVALUE;
-   return 0;
-   }
-
-   if (!asn1_octet_decode(ctx, ))
-   return 0;
-
-   *integer <<= 8;
-   *integer |= ch;
-   }
-   return 1;
-}
-
-static unsigned char asn1_uint_decode(struct asn1_ctx *ctx,
- unsigned char *eoc,
- unsigned int *integer)
-{
-   unsigned char ch;
-   unsigned int len;
-
-   if (!asn1_octet_decode(ctx, ))
-   return 0;
-
-   *integer = ch;
-   if (ch == 0)
-   len = 0;
-   else
-   len = 1;
-
-   while (ctx->pointer < eoc) {
-   if (++len > sizeof(unsigned int)) {
-   ctx->error = ASN1_ERR_DEC_BADVALUE;
-   return 0;
-   }
-
-   if (!asn1_octet_decode(ctx, ))
-   return 0;
-
-   *integer <<= 8;
-   *integer |= ch;
-   }
-   return 1;
-}
-
-static unsigned char asn1_ulong_decode(struct asn1_ctx *ctx,
-  unsigned char *eoc,
-  unsigned long *integer)
-{
-   unsigned char ch;
-   unsigned int len;
-
-   if (!asn1_octet_decode(ctx, ))
-   return 0;
-
-   *integer = ch;
-   if (ch == 0)
-   len = 0;
-   else
-   len = 1;
-
-   while (ctx->pointer < eoc) {
-   if (++len > sizeof(unsigned long)) {
-   ctx->error = ASN1_ERR_DEC_BADVALUE;
-   return 0;
-   }
-
-   if (!asn1_octet_decode(ctx, ))
-   return 0;
-
-   *integer <<= 8;
-   *integer |= ch;
-   }
-   return 1;
-} 
-
-static unsigned char
-asn1_octets_decode(struct asn1_ctx *ctx,
-  unsigned char *eoc,
-  unsigned char **octets, unsigned int *len)
-{
-   unsigned char *ptr;
-
-   *len = 0;
-
-   *octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC);
-   if (*octets == NULL) {
-   return 0;
-   }
-
-   ptr = *octets;
-   while (ctx->pointer < eoc) {
-   if (!asn1_octet_decode(ctx, (unsigned char *) ptr++)) {
-   kfree(*octets);
-   *octets = NULL;
-   return 0;
-   }
-   (*len)++;
-   }
-   return 1;
-} */
-
 static unsigned char
 asn1_subid_decode(struct asn1_ctx *ctx, unsigned long *subid)
 {
Index: 2.6/fs/cifs/cifsencrypt.c
===
--- 2.6.orig/fs/cifs/cifsencrypt.c  2005-01-12 23:39:37.336242408 +0200
+++ 2.6/fs/cifs/cifsencrypt.c   2005-01-12 23:39:40.807714664 +0200
@@ -120,9 +120,6 @@
if(rc)
return rc;
 
-   
-/* cifs_dump_mem("what we think it should be: 
",what_we_think_sig_should_be,16); */
-
if(memcmp(server_response_sig, what_we_think_sig_should_be, 8))
return -EACCES;
else
@@ -198,11 +195,9 @@
 {
struct HMACMD5Context context;
memcpy(v2_session_response + 8, ses->server->cryptKey,8);
-   /* gen_blob(v2_session_response + 16); */
hmac_md5_init_limK_to_64(ses->mac_signing_key, 16, );
 
hmac_md5_update(ses->server->cryptKey,8,);
-/* 

[PATCH 2/6] cifs: remove dead code

2005-01-15 Thread Pekka Enberg
This patch removes commented out code.

Signed-off-by: Pekka Enberg [EMAIL PROTECTED]
---

 asn1.c|  122 --
 cifsencrypt.c |5 --
 cifsfs.c  |   25 ---
 cifssmb.c |   48 +-
 connect.c |   25 ---
 dir.c |   18 
 fcntl.c   |5 --
 file.c|  105 -
 inode.c   |   27 
 link.c|   13 --
 misc.c|6 --
 readdir.c |   62 -
 transport.c   |2 
 13 files changed, 6 insertions(+), 457 deletions(-)

Index: 2.6/fs/cifs/asn1.c
===
--- 2.6.orig/fs/cifs/asn1.c 2005-01-12 23:39:37.335242560 +0200
+++ 2.6/fs/cifs/asn1.c  2005-01-12 23:39:40.806714816 +0200
@@ -236,128 +236,6 @@
}
 }
 
-/* static unsigned char asn1_null_decode(struct asn1_ctx *ctx,
- unsigned char *eoc)
-{
-   ctx-pointer = eoc;
-   return 1;
-}
-
-static unsigned char asn1_long_decode(struct asn1_ctx *ctx,
- unsigned char *eoc, long *integer)
-{
-   unsigned char ch;
-   unsigned int len;
-
-   if (!asn1_octet_decode(ctx, ch))
-   return 0;
-
-   *integer = (signed char) ch;
-   len = 1;
-
-   while (ctx-pointer  eoc) {
-   if (++len  sizeof(long)) {
-   ctx-error = ASN1_ERR_DEC_BADVALUE;
-   return 0;
-   }
-
-   if (!asn1_octet_decode(ctx, ch))
-   return 0;
-
-   *integer = 8;
-   *integer |= ch;
-   }
-   return 1;
-}
-
-static unsigned char asn1_uint_decode(struct asn1_ctx *ctx,
- unsigned char *eoc,
- unsigned int *integer)
-{
-   unsigned char ch;
-   unsigned int len;
-
-   if (!asn1_octet_decode(ctx, ch))
-   return 0;
-
-   *integer = ch;
-   if (ch == 0)
-   len = 0;
-   else
-   len = 1;
-
-   while (ctx-pointer  eoc) {
-   if (++len  sizeof(unsigned int)) {
-   ctx-error = ASN1_ERR_DEC_BADVALUE;
-   return 0;
-   }
-
-   if (!asn1_octet_decode(ctx, ch))
-   return 0;
-
-   *integer = 8;
-   *integer |= ch;
-   }
-   return 1;
-}
-
-static unsigned char asn1_ulong_decode(struct asn1_ctx *ctx,
-  unsigned char *eoc,
-  unsigned long *integer)
-{
-   unsigned char ch;
-   unsigned int len;
-
-   if (!asn1_octet_decode(ctx, ch))
-   return 0;
-
-   *integer = ch;
-   if (ch == 0)
-   len = 0;
-   else
-   len = 1;
-
-   while (ctx-pointer  eoc) {
-   if (++len  sizeof(unsigned long)) {
-   ctx-error = ASN1_ERR_DEC_BADVALUE;
-   return 0;
-   }
-
-   if (!asn1_octet_decode(ctx, ch))
-   return 0;
-
-   *integer = 8;
-   *integer |= ch;
-   }
-   return 1;
-} 
-
-static unsigned char
-asn1_octets_decode(struct asn1_ctx *ctx,
-  unsigned char *eoc,
-  unsigned char **octets, unsigned int *len)
-{
-   unsigned char *ptr;
-
-   *len = 0;
-
-   *octets = kmalloc(eoc - ctx-pointer, GFP_ATOMIC);
-   if (*octets == NULL) {
-   return 0;
-   }
-
-   ptr = *octets;
-   while (ctx-pointer  eoc) {
-   if (!asn1_octet_decode(ctx, (unsigned char *) ptr++)) {
-   kfree(*octets);
-   *octets = NULL;
-   return 0;
-   }
-   (*len)++;
-   }
-   return 1;
-} */
-
 static unsigned char
 asn1_subid_decode(struct asn1_ctx *ctx, unsigned long *subid)
 {
Index: 2.6/fs/cifs/cifsencrypt.c
===
--- 2.6.orig/fs/cifs/cifsencrypt.c  2005-01-12 23:39:37.336242408 +0200
+++ 2.6/fs/cifs/cifsencrypt.c   2005-01-12 23:39:40.807714664 +0200
@@ -120,9 +120,6 @@
if(rc)
return rc;
 
-   
-/* cifs_dump_mem(what we think it should be: 
,what_we_think_sig_should_be,16); */
-
if(memcmp(server_response_sig, what_we_think_sig_should_be, 8))
return -EACCES;
else
@@ -198,11 +195,9 @@
 {
struct HMACMD5Context context;
memcpy(v2_session_response + 8, ses-server-cryptKey,8);
-   /* gen_blob(v2_session_response + 16); */
hmac_md5_init_limK_to_64(ses-mac_signing_key, 16, context);
 
hmac_md5_update(ses-server-cryptKey,8,context);
-/*