gssapi_impl.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*-
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2008 Isilon Inc http://www.isilon.com/
  5. * Authors: Doug Rabson <dfr@rabson.org>
  6. * Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org>
  7. *
  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. *
  17. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. */
  29. #include "gssd.h"
  30. MALLOC_DECLARE(M_GSSAPI);
  31. struct _gss_ctx_id_t {
  32. KOBJ_FIELDS;
  33. gssd_ctx_id_t handle;
  34. };
  35. struct _gss_cred_id_t {
  36. gssd_cred_id_t handle;
  37. };
  38. struct _gss_name_t {
  39. gssd_name_t handle;
  40. };
  41. struct kgss_mech {
  42. LIST_ENTRY(kgss_mech) km_link;
  43. gss_OID km_mech_type;
  44. const char *km_mech_name;
  45. struct kobj_class *km_class;
  46. };
  47. LIST_HEAD(kgss_mech_list, kgss_mech);
  48. /* Macros for VIMAGE. */
  49. /* Just define the KGSS_VNETxxx() macros as VNETxxx() macros. */
  50. #define KGSS_VNET_DEFINE(t, n) VNET_DEFINE(t, n)
  51. #define KGSS_VNET_DEFINE_STATIC(t, n) VNET_DEFINE_STATIC(t, n)
  52. #define KGSS_VNET_DECLARE(t, n) VNET_DECLARE(t, n)
  53. #define KGSS_VNET(n) VNET(n)
  54. #define KGSS_CURVNET_SET(n) CURVNET_SET(n)
  55. #define KGSS_CURVNET_SET_QUIET(n) CURVNET_SET_QUIET(n)
  56. #define KGSS_CURVNET_RESTORE() CURVNET_RESTORE()
  57. #define KGSS_TD_TO_VNET(n) TD_TO_VNET(n)
  58. extern struct mtx kgss_gssd_lock;
  59. extern struct kgss_mech_list kgss_mechs;
  60. KGSS_VNET_DECLARE(CLIENT *, kgss_gssd_handle);
  61. CLIENT *kgss_gssd_client(void);
  62. int kgss_oid_equal(const gss_OID oid1, const gss_OID oid2);
  63. extern void kgss_install_mech(gss_OID mech_type, const char *name,
  64. struct kobj_class *cls);
  65. extern void kgss_uninstall_mech(gss_OID mech_type);
  66. extern gss_OID kgss_find_mech_by_name(const char *name);
  67. extern const char *kgss_find_mech_by_oid(const gss_OID oid);
  68. extern gss_ctx_id_t kgss_create_context(gss_OID mech_type);
  69. extern void kgss_delete_context(gss_ctx_id_t ctx, gss_buffer_t output_token);
  70. extern OM_uint32 kgss_transfer_context(gss_ctx_id_t ctx);
  71. extern void kgss_copy_buffer(const gss_buffer_t from, gss_buffer_t to);