Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
[safe/jmp/linux-2.6] / net / sunrpc / auth_gss / gss_generic_token.c
index 826df44..c0ba39c 100644 (file)
@@ -11,7 +11,7 @@
 
 /*
  * Copyright 1993 by OpenVision Technologies, Inc.
- * 
+ *
  * Permission to use, copy, modify, distribute, and sell this software
  * and its documentation for any purpose is hereby granted without fee,
  * provided that the above copyright notice appears in all copies and
@@ -21,7 +21,7 @@
  * without specific, written prior permission. OpenVision makes no
  * representations about the suitability of this software for any
  * purpose.  It is provided "as is" without express or implied warranty.
- * 
+ *
  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -148,11 +148,11 @@ int
 g_token_size(struct xdr_netobj *mech, unsigned int body_size)
 {
        /* set body_size to sequence contents size */
-       body_size += 4 + (int) mech->len;         /* NEED overflow check */
+       body_size += 2 + (int) mech->len;         /* NEED overflow check */
        return(1 + der_length_size(body_size) + body_size);
 }
 
-EXPORT_SYMBOL(g_token_size);
+EXPORT_SYMBOL_GPL(g_token_size);
 
 /* fills in a buffer with the token header.  The buffer is assumed to
    be the right size.  buf is advanced past the token header */
@@ -161,13 +161,13 @@ void
 g_make_token_header(struct xdr_netobj *mech, int body_size, unsigned char **buf)
 {
        *(*buf)++ = 0x60;
-       der_write_length(buf, 4 + mech->len + body_size);
+       der_write_length(buf, 2 + mech->len + body_size);
        *(*buf)++ = 0x06;
        *(*buf)++ = (unsigned char) mech->len;
        TWRITE_STR(*buf, mech->data, ((int) mech->len));
 }
 
-EXPORT_SYMBOL(g_make_token_header);
+EXPORT_SYMBOL_GPL(g_make_token_header);
 
 /*
  * Given a buffer containing a token, reads and verifies the token,
@@ -201,7 +201,7 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size,
                return(G_BAD_TOK_HEADER);
        if (*buf++ != 0x06)
                return(G_BAD_TOK_HEADER);
+
        if ((toksize-=1) < 0)
                return(G_BAD_TOK_HEADER);
        toid.len = *buf++;
@@ -211,9 +211,9 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size,
        toid.data = buf;
        buf+=toid.len;
 
-       if (! g_OID_equal(&toid, mech)) 
+       if (! g_OID_equal(&toid, mech))
                ret = G_WRONG_MECH;
+
    /* G_WRONG_MECH is not returned immediately because it's more important
       to return G_BAD_TOK_HEADER if the token header is in fact bad */
 
@@ -231,5 +231,5 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size,
        return(ret);
 }
 
-EXPORT_SYMBOL(g_verify_token_header);
+EXPORT_SYMBOL_GPL(g_verify_token_header);