Whamcloud - gitweb
Mass conversion of all copyright messages to Oracle.
[fs/lustre-release.git] / lustre / ptlrpc / gss / gss_asn1.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Modifications for Lustre
5  *
6  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
7  *
8  * Author: Eric Mei <ericm@clusterfs.com>
9  */
10
11 /*
12  *  minimal asn1 for generic encoding/decoding of gss tokens
13  *
14  *  Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h,
15  *  lib/gssapi/krb5/gssapiP_krb5.h, and others
16  *
17  *  Copyright (c) 2000 The Regents of the University of Michigan.
18  *  All rights reserved.
19  *
20  *  Andy Adamson   <andros@umich.edu>
21  */
22
23 /*
24  * Copyright 1995 by the Massachusetts Institute of Technology.
25  * All Rights Reserved.
26  *
27  * Export of this software from the United States of America may
28  *   require a specific license from the United States Government.
29  *   It is the responsibility of any person or organization contemplating
30  *   export to obtain such a license before exporting.
31  *
32  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
33  * distribute this software and its documentation for any purpose and
34  * without fee is hereby granted, provided that the above copyright
35  * notice appear in all copies and that both that copyright notice and
36  * this permission notice appear in supporting documentation, and that
37  * the name of M.I.T. not be used in advertising or publicity pertaining
38  * to distribution of the software without specific, written prior
39  * permission.  Furthermore if you modify this software you must label
40  * your software as modified software and not distribute it in such a
41  * fashion that it might be confused with the original M.I.T. software.
42  * M.I.T. makes no representations about the suitability of
43  * this software for any purpose.  It is provided "as is" without express
44  * or implied warranty.
45  *
46  */
47
48 #define SIZEOF_INT 4
49
50 /* from gssapi_err_generic.h */
51 #define G_BAD_SERVICE_NAME                       (-2045022976L)
52 #define G_BAD_STRING_UID                         (-2045022975L)
53 #define G_NOUSER                                 (-2045022974L)
54 #define G_VALIDATE_FAILED                        (-2045022973L)
55 #define G_BUFFER_ALLOC                           (-2045022972L)
56 #define G_BAD_MSG_CTX                            (-2045022971L)
57 #define G_WRONG_SIZE                             (-2045022970L)
58 #define G_BAD_USAGE                              (-2045022969L)
59 #define G_UNKNOWN_QOP                            (-2045022968L)
60 #define G_NO_HOSTNAME                            (-2045022967L)
61 #define G_BAD_HOSTNAME                           (-2045022966L)
62 #define G_WRONG_MECH                             (-2045022965L)
63 #define G_BAD_TOK_HEADER                         (-2045022964L)
64 #define G_BAD_DIRECTION                          (-2045022963L)
65 #define G_TOK_TRUNC                              (-2045022962L)
66 #define G_REFLECT                                (-2045022961L)
67 #define G_WRONG_TOKID                            (-2045022960L)
68
69 #define g_OID_equal(o1,o2) \
70    (((o1)->len == (o2)->len) && \
71     (memcmp((o1)->data,(o2)->data,(int) (o1)->len) == 0))
72
73 __u32 g_verify_token_header(rawobj_t *mech,
74                             int *body_size,
75                             unsigned char **buf_in,
76                             int toksize);
77
78 __u32 g_get_mech_oid(rawobj_t *mech,
79                      rawobj_t *in_buf);
80
81 int g_token_size(rawobj_t *mech,
82                  unsigned int body_size);
83
84 void g_make_token_header(rawobj_t *mech,
85                          int body_size,
86                          unsigned char **buf);