pgssapi.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* This file actually defines the GSSAPI function pointers for
  2. * functions we plan to import from a GSSAPI library.
  3. */
  4. #include "putty.h"
  5. #ifndef NO_GSSAPI
  6. #include "pgssapi.h"
  7. #ifndef NO_LIBDL
  8. /* Reserved static storage for GSS_oids.
  9. * Constants of the form GSS_C_NT_* are specified by rfc 2744.
  10. * Comments are quotes from RFC 2744 itself.
  11. *
  12. * These may be #defined to complex expressions by the local header
  13. * file, if we're including one in static-GSSAPI mode. (For example,
  14. * Heimdal defines them to things like
  15. * (&__gss_c_nt_user_name_oid_desc).) So we only define them if
  16. * needed. */
  17. #ifndef GSS_C_NT_USER_NAME
  18. static gss_OID_desc oid_GSS_C_NT_USER_NAME = {
  19. /* The implementation must reserve static storage for a
  20. * gss_OID_desc object containing the value */
  21. 10, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01",
  22. /* corresponding to an object-identifier value of
  23. * {iso(1) member-body(2) United States(840) mit(113554)
  24. * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
  25. * GSS_C_NT_USER_NAME should be initialized to point
  26. * to that gss_OID_desc. */
  27. };
  28. const_gss_OID GSS_C_NT_USER_NAME = &oid_GSS_C_NT_USER_NAME;
  29. #endif
  30. #ifndef GSS_C_NT_MACHINE_UID_NAME
  31. static gss_OID_desc oid_GSS_C_NT_MACHINE_UID_NAME = {
  32. /* The implementation must reserve static storage for a
  33. * gss_OID_desc object containing the value */
  34. 10, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02",
  35. /* corresponding to an object-identifier value of
  36. * {iso(1) member-body(2) United States(840) mit(113554)
  37. * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
  38. * The constant GSS_C_NT_MACHINE_UID_NAME should be
  39. * initialized to point to that gss_OID_desc. */
  40. };
  41. const_gss_OID GSS_C_NT_MACHINE_UID_NAME = &oid_GSS_C_NT_MACHINE_UID_NAME;
  42. #endif
  43. #ifndef GSS_C_NT_STRING_UID_NAME
  44. static gss_OID_desc oid_GSS_C_NT_STRING_UID_NAME = {
  45. /* The implementation must reserve static storage for a
  46. * gss_OID_desc object containing the value */
  47. 10, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03",
  48. /* corresponding to an object-identifier value of
  49. * {iso(1) member-body(2) United States(840) mit(113554)
  50. * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
  51. * The constant GSS_C_NT_STRING_UID_NAME should be
  52. * initialized to point to that gss_OID_desc. */
  53. };
  54. const_gss_OID GSS_C_NT_STRING_UID_NAME = &oid_GSS_C_NT_STRING_UID_NAME;
  55. #endif
  56. #ifndef GSS_C_NT_HOSTBASED_SERVICE_X
  57. static gss_OID_desc oid_GSS_C_NT_HOSTBASED_SERVICE_X = {
  58. /* The implementation must reserve static storage for a
  59. * gss_OID_desc object containing the value */
  60. 6, "\x2b\x06\x01\x05\x06\x02",
  61. /* corresponding to an object-identifier value of
  62. * {iso(1) org(3) dod(6) internet(1) security(5)
  63. * nametypes(6) gss-host-based-services(2))}. The constant
  64. * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
  65. * to that gss_OID_desc. This is a deprecated OID value, and
  66. * implementations wishing to support hostbased-service names
  67. * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
  68. * defined below, to identify such names;
  69. * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
  70. * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
  71. * parameter, but should not be emitted by GSS-API
  72. * implementations */
  73. };
  74. const_gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &oid_GSS_C_NT_HOSTBASED_SERVICE_X;
  75. #endif
  76. #ifndef GSS_C_NT_HOSTBASED_SERVICE
  77. static gss_OID_desc oid_GSS_C_NT_HOSTBASED_SERVICE = {
  78. /* The implementation must reserve static storage for a
  79. * gss_OID_desc object containing the value */
  80. 10, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04",
  81. /* corresponding to an object-identifier value of {iso(1)
  82. * member-body(2) Unites States(840) mit(113554) infosys(1)
  83. * gssapi(2) generic(1) service_name(4)}. The constant
  84. * GSS_C_NT_HOSTBASED_SERVICE should be initialized
  85. * to point to that gss_OID_desc. */
  86. };
  87. const_gss_OID GSS_C_NT_HOSTBASED_SERVICE = &oid_GSS_C_NT_HOSTBASED_SERVICE;
  88. #endif
  89. #ifndef GSS_C_NT_ANONYMOUS
  90. static gss_OID_desc oid_GSS_C_NT_ANONYMOUS = {
  91. /* The implementation must reserve static storage for a
  92. * gss_OID_desc object containing the value */
  93. 6, "\x2b\x06\01\x05\x06\x03",
  94. /* corresponding to an object identifier value of
  95. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  96. * 6(nametypes), 3(gss-anonymous-name)}. The constant
  97. * and GSS_C_NT_ANONYMOUS should be initialized to point
  98. * to that gss_OID_desc. */
  99. };
  100. const_gss_OID GSS_C_NT_ANONYMOUS = &oid_GSS_C_NT_ANONYMOUS;
  101. #endif
  102. #ifndef GSS_C_NT_EXPORT_NAME
  103. static gss_OID_desc oid_GSS_C_NT_EXPORT_NAME = {
  104. /* The implementation must reserve static storage for a
  105. * gss_OID_desc object containing the value */
  106. 6, "\x2b\x06\x01\x05\x06\x04",
  107. /* corresponding to an object-identifier value of
  108. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  109. * 6(nametypes), 4(gss-api-exported-name)}. The constant
  110. * GSS_C_NT_EXPORT_NAME should be initialized to point
  111. * to that gss_OID_desc.
  112. */
  113. };
  114. const_gss_OID GSS_C_NT_EXPORT_NAME = &oid_GSS_C_NT_EXPORT_NAME;
  115. #endif
  116. #endif /* NO_LIBDL */
  117. static gss_OID_desc gss_mech_krb5_desc =
  118. { 9, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" };
  119. /* iso(1) member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) krb5(2)*/
  120. const gss_OID GSS_MECH_KRB5 = &gss_mech_krb5_desc;
  121. #endif /* NO_GSSAPI */