gss_types.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_TOOLS_GSSAPI_GSS_TYPES_H_
  5. #define NET_TOOLS_GSSAPI_GSS_TYPES_H_
  6. #include <cstddef>
  7. #include <cstdint>
  8. // Define a minimal subset of the definitions needed to build a loadable fake
  9. // GSSAPI library. The bindings follow RFC 2744. The code follows the RFC
  10. // faithfully with the possible exception of `const` qualifiers for some
  11. // function arguments.
  12. //
  13. // Note that //net/http/http_auth_gssapi_posix* functions depend on the gssapi.h
  14. // as found on the host platform. For test purposes file does not depend on the
  15. // system gssapi.h in order to reduce sensitivity to the host environment.
  16. //
  17. // These declarations follow RFC 2744 Appendix A with the exception of using
  18. // C++isms in some places.
  19. using OM_uint32 = uint32_t;
  20. using gss_qop_t = uint32_t;
  21. struct gss_buffer_desc_struct {
  22. size_t length;
  23. void* value;
  24. };
  25. using gss_buffer_desc = gss_buffer_desc_struct;
  26. using gss_buffer_t = gss_buffer_desc_struct*;
  27. struct gss_OID_desc_struct {
  28. OM_uint32 length;
  29. void* elements;
  30. };
  31. using gss_OID_desc = gss_OID_desc_struct;
  32. using gss_OID = gss_OID_desc_struct*;
  33. struct gss_channel_bindings_struct {
  34. OM_uint32 initiator_addrtype;
  35. gss_buffer_desc initiator_address;
  36. OM_uint32 acceptor_addrtype;
  37. gss_buffer_desc acceptor_address;
  38. gss_buffer_desc application_data;
  39. };
  40. using gss_channel_bindings_t = gss_channel_bindings_struct*;
  41. // Following structures are defined as <implementation-specific>.
  42. struct FakeGssName {};
  43. using gss_name_t = FakeGssName*;
  44. struct FakeGssCredId {};
  45. using gss_cred_id_t = FakeGssCredId*;
  46. struct FakeGssCtxId {};
  47. using gss_ctx_id_t = FakeGssCtxId*;
  48. #if defined(WIN32)
  49. #define GSS_EXPORT __declspec(dllexport)
  50. #else
  51. #define GSS_EXPORT __attribute__((visibility("default")))
  52. #endif
  53. #endif // NET_TOOLS_GSSAPI_GSS_TYPES_H_