Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  *  linux/include/linux/sunrpc/gss_asn1.h
0003  *
0004  *  minimal asn1 for generic encoding/decoding of gss tokens
0005  *
0006  *  Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h,
0007  *  lib/gssapi/krb5/gssapiP_krb5.h, and others
0008  *
0009  *  Copyright (c) 2000 The Regents of the University of Michigan.
0010  *  All rights reserved.
0011  *
0012  *  Andy Adamson   <andros@umich.edu>
0013  */
0014 
0015 /*
0016  * Copyright 1995 by the Massachusetts Institute of Technology.
0017  * All Rights Reserved.
0018  *
0019  * Export of this software from the United States of America may
0020  *   require a specific license from the United States Government.
0021  *   It is the responsibility of any person or organization contemplating
0022  *   export to obtain such a license before exporting.
0023  *
0024  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
0025  * distribute this software and its documentation for any purpose and
0026  * without fee is hereby granted, provided that the above copyright
0027  * notice appear in all copies and that both that copyright notice and
0028  * this permission notice appear in supporting documentation, and that
0029  * the name of M.I.T. not be used in advertising or publicity pertaining
0030  * to distribution of the software without specific, written prior
0031  * permission.  Furthermore if you modify this software you must label
0032  * your software as modified software and not distribute it in such a
0033  * fashion that it might be confused with the original M.I.T. software.
0034  * M.I.T. makes no representations about the suitability of
0035  * this software for any purpose.  It is provided "as is" without express
0036  * or implied warranty.
0037  *
0038  */
0039 
0040 
0041 #include <linux/sunrpc/gss_api.h>
0042 
0043 #define SIZEOF_INT 4
0044 
0045 /* from gssapi_err_generic.h */
0046 #define G_BAD_SERVICE_NAME                       (-2045022976L)
0047 #define G_BAD_STRING_UID                         (-2045022975L)
0048 #define G_NOUSER                                 (-2045022974L)
0049 #define G_VALIDATE_FAILED                        (-2045022973L)
0050 #define G_BUFFER_ALLOC                           (-2045022972L)
0051 #define G_BAD_MSG_CTX                            (-2045022971L)
0052 #define G_WRONG_SIZE                             (-2045022970L)
0053 #define G_BAD_USAGE                              (-2045022969L)
0054 #define G_UNKNOWN_QOP                            (-2045022968L)
0055 #define G_NO_HOSTNAME                            (-2045022967L)
0056 #define G_BAD_HOSTNAME                           (-2045022966L)
0057 #define G_WRONG_MECH                             (-2045022965L)
0058 #define G_BAD_TOK_HEADER                         (-2045022964L)
0059 #define G_BAD_DIRECTION                          (-2045022963L)
0060 #define G_TOK_TRUNC                              (-2045022962L)
0061 #define G_REFLECT                                (-2045022961L)
0062 #define G_WRONG_TOKID                            (-2045022960L)
0063 
0064 #define g_OID_equal(o1,o2) \
0065    (((o1)->len == (o2)->len) && \
0066     (memcmp((o1)->data,(o2)->data,(int) (o1)->len) == 0))
0067 
0068 u32 g_verify_token_header(
0069      struct xdr_netobj *mech,
0070      int *body_size,
0071      unsigned char **buf_in,
0072      int toksize);
0073 
0074 int g_token_size(
0075      struct xdr_netobj *mech,
0076      unsigned int body_size);
0077 
0078 void g_make_token_header(
0079      struct xdr_netobj *mech,
0080      int body_size,
0081      unsigned char **buf);