rpcsec_gss_int.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. rpcsec_gss.h
  3. SPDX-License-Identifier: BSD-3-Clause
  4. Copyright (c) 2000 The Regents of the University of Michigan.
  5. All rights reserved.
  6. Copyright (c) 2000 Dug Song <dugsong@UMICH.EDU>.
  7. All rights reserved, all wrongs reversed.
  8. Redistribution and use in source and binary forms, with or without
  9. modification, are permitted provided that the following conditions
  10. are met:
  11. 1. Redistributions of source code must retain the above copyright
  12. notice, this list of conditions and the following disclaimer.
  13. 2. Redistributions in binary form must reproduce the above copyright
  14. notice, this list of conditions and the following disclaimer in the
  15. documentation and/or other materials provided with the distribution.
  16. 3. Neither the name of the University nor the names of its
  17. contributors may be used to endorse or promote products derived
  18. from this software without specific prior written permission.
  19. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  20. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  21. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  23. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  26. BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  27. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  28. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  29. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. $Id: auth_gss.h,v 1.12 2001/04/30 19:44:47 andros Exp $
  31. */
  32. /* $FreeBSD$ */
  33. #ifndef _RPCSEC_GSS_INT_H
  34. #define _RPCSEC_GSS_INT_H
  35. #include <kgssapi/gssapi_impl.h>
  36. /* RPCSEC_GSS control procedures. */
  37. typedef enum {
  38. RPCSEC_GSS_DATA = 0,
  39. RPCSEC_GSS_INIT = 1,
  40. RPCSEC_GSS_CONTINUE_INIT = 2,
  41. RPCSEC_GSS_DESTROY = 3
  42. } rpc_gss_proc_t;
  43. #define RPCSEC_GSS_VERSION 1
  44. /* Credentials. */
  45. struct rpc_gss_cred {
  46. u_int gc_version; /* version */
  47. rpc_gss_proc_t gc_proc; /* control procedure */
  48. u_int gc_seq; /* sequence number */
  49. rpc_gss_service_t gc_svc; /* service */
  50. gss_buffer_desc gc_handle; /* handle to server-side context */
  51. };
  52. /* Context creation response. */
  53. struct rpc_gss_init_res {
  54. gss_buffer_desc gr_handle; /* handle to server-side context */
  55. u_int gr_major; /* major status */
  56. u_int gr_minor; /* minor status */
  57. u_int gr_win; /* sequence window */
  58. gss_buffer_desc gr_token; /* token */
  59. };
  60. /* Maximum sequence number value. */
  61. #define MAXSEQ 0x80000000
  62. /* Prototypes. */
  63. __BEGIN_DECLS
  64. bool_t xdr_rpc_gss_cred(XDR *xdrs, struct rpc_gss_cred *p);
  65. bool_t xdr_rpc_gss_init_res(XDR *xdrs, struct rpc_gss_init_res *p);
  66. bool_t xdr_rpc_gss_wrap_data(struct mbuf **argsp,
  67. gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_service_t svc,
  68. u_int seq);
  69. bool_t xdr_rpc_gss_unwrap_data(struct mbuf **resultsp,
  70. gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_service_t svc, u_int seq);
  71. const char *_rpc_gss_num_to_qop(const char *mech, u_int num);
  72. void _rpc_gss_set_error(int rpc_gss_error, int system_error);
  73. void rpc_gss_log_debug(const char *fmt, ...);
  74. void rpc_gss_log_status(const char *m, gss_OID mech, OM_uint32 major,
  75. OM_uint32 minor);
  76. __END_DECLS
  77. #endif /* !_RPCSEC_GSS_INT_H */