pgssapi.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. Comments are quotes from RFC 2744. */
  9. static const gss_OID_desc oids[] = {
  10. /* The implementation must reserve static storage for a
  11. * gss_OID_desc object containing the value */
  12. {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"},
  13. /* corresponding to an object-identifier value of
  14. * {iso(1) member-body(2) United States(840) mit(113554)
  15. * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
  16. * GSS_C_NT_USER_NAME should be initialized to point
  17. * to that gss_OID_desc.
  18. * The implementation must reserve static storage for a
  19. * gss_OID_desc object containing the value */
  20. {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"},
  21. /* corresponding to an object-identifier value of
  22. * {iso(1) member-body(2) United States(840) mit(113554)
  23. * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
  24. * The constant GSS_C_NT_MACHINE_UID_NAME should be
  25. * initialized to point to that gss_OID_desc.
  26. * The implementation must reserve static storage for a
  27. * gss_OID_desc object containing the value */
  28. {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"},
  29. /* corresponding to an object-identifier value of
  30. * {iso(1) member-body(2) United States(840) mit(113554)
  31. * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
  32. * The constant GSS_C_NT_STRING_UID_NAME should be
  33. * initialized to point to that gss_OID_desc.
  34. *
  35. * The implementation must reserve static storage for a
  36. * gss_OID_desc object containing the value */
  37. {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
  38. /* corresponding to an object-identifier value of
  39. * {iso(1) org(3) dod(6) internet(1) security(5)
  40. * nametypes(6) gss-host-based-services(2))}. The constant
  41. * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
  42. * to that gss_OID_desc. This is a deprecated OID value, and
  43. * implementations wishing to support hostbased-service names
  44. * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
  45. * defined below, to identify such names;
  46. * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
  47. * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
  48. * parameter, but should not be emitted by GSS-API
  49. * implementations
  50. *
  51. * The implementation must reserve static storage for a
  52. * gss_OID_desc object containing the value */
  53. {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04"},
  54. /* corresponding to an object-identifier value of {iso(1)
  55. * member-body(2) Unites States(840) mit(113554) infosys(1)
  56. * gssapi(2) generic(1) service_name(4)}. The constant
  57. * GSS_C_NT_HOSTBASED_SERVICE should be initialized
  58. * to point to that gss_OID_desc.
  59. *
  60. * The implementation must reserve static storage for a
  61. * gss_OID_desc object containing the value */
  62. {6, (void *)"\x2b\x06\01\x05\x06\x03"},
  63. /* corresponding to an object identifier value of
  64. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  65. * 6(nametypes), 3(gss-anonymous-name)}. The constant
  66. * and GSS_C_NT_ANONYMOUS should be initialized to point
  67. * to that gss_OID_desc.
  68. *
  69. * The implementation must reserve static storage for a
  70. * gss_OID_desc object containing the value */
  71. {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
  72. /* corresponding to an object-identifier value of
  73. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  74. * 6(nametypes), 4(gss-api-exported-name)}. The constant
  75. * GSS_C_NT_EXPORT_NAME should be initialized to point
  76. * to that gss_OID_desc.
  77. */
  78. };
  79. /* Here are the constants which point to the static structure above.
  80. *
  81. * Constants of the form GSS_C_NT_* are specified by rfc 2744.
  82. */
  83. const_gss_OID GSS_C_NT_USER_NAME = oids+0;
  84. const_gss_OID GSS_C_NT_MACHINE_UID_NAME = oids+1;
  85. const_gss_OID GSS_C_NT_STRING_UID_NAME = oids+2;
  86. const_gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = oids+3;
  87. const_gss_OID GSS_C_NT_HOSTBASED_SERVICE = oids+4;
  88. const_gss_OID GSS_C_NT_ANONYMOUS = oids+5;
  89. const_gss_OID GSS_C_NT_EXPORT_NAME = oids+6;
  90. #endif /* NO_LIBDL */
  91. static gss_OID_desc gss_mech_krb5_desc =
  92. { 9, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" };
  93. /* iso(1) member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) krb5(2)*/
  94. const gss_OID GSS_MECH_KRB5 = &gss_mech_krb5_desc;
  95. #endif /* NO_GSSAPI */