gss_asn1.h 3.1 KB

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