Go to the documentation of this file.
38 #ifndef SQUID_SRC_AUTH_NEGOTIATE_KERBEROS_NEGOTIATE_KERBEROS_H
39 #define SQUID_SRC_AUTH_NEGOTIATE_KERBEROS_NEGOTIATE_KERBEROS_H
59 #define GSSKRB_APPLE_DEPRECATED(x)
61 #if HAVE_GSSAPI_GSSAPI_H
62 #include <gssapi/gssapi.h>
66 #if HAVE_GSSAPI_GSSAPI_KRB5_H
67 #include <gssapi/gssapi_krb5.h>
69 #if HAVE_GSSAPI_GSSAPI_GENERIC_H
70 #include <gssapi/gssapi_generic.h>
72 #if HAVE_GSSAPI_GSSAPI_EXT_H
73 #include <gssapi/gssapi_ext.h>
76 #ifndef gss_nt_service_name
77 #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
80 #define PROGRAM "negotiate_kerberos_auth"
82 #ifndef MAX_AUTHTOKEN_LEN
83 #define MAX_AUTHTOKEN_LEN 65535
85 #ifndef SQUID_KERB_AUTH_VERSION
86 #define SQUID_KERB_AUTH_VERSION "3.1.0sq"
91 static const unsigned char ntlmProtocol[] = {
'N',
'T',
'L',
'M',
'S',
'S',
'P', 0};
97 static time_t last_t = 0;
100 gettimeofday(&now,
nullptr);
101 if (now.tv_sec != last_t) {
103 tm = localtime((time_t *) & now.tv_sec);
104 strftime(buf, 127,
"%Y/%m/%d %H:%M:%S", tm);
110 int check_gss_err(OM_uint32 major_status, OM_uint32 minor_status,
111 const char *
function,
int log,
int sout);
115 #if (HAVE_GSSKRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT || HAVE_GSS_MAP_NAME_TO_ANY) && HAVE_KRB5_PAC
116 #define HAVE_PAC_SUPPORT 1
117 #define MAX_PAC_GROUP_SIZE 200*60
122 } RPC_UNICODE_STRING;
125 void getustr(RPC_UNICODE_STRING *
string);
126 char **getgids(
char **Rids, uint32_t GroupIds, uint32_t GroupCount);
127 char *getdomaingids(
char *ad_groups, uint32_t DomainLogonId,
char **Rids, uint32_t GroupCount);
128 char *getextrasids(
char *ad_groups, uint32_t ExtraSids, uint32_t SidCount);
129 uint64_t get6byt_be(
void);
130 uint32_t get4byt(
void);
131 uint16_t get2byt(
void);
132 uint8_t get1byt(
void);
133 char *xstrcpy(
char *src,
const char*dst);
134 char *xstrcat(
char *src,
const char*dst);
135 int checkustr(RPC_UNICODE_STRING *
string);
136 char *get_ad_groups(
char *ad_groups, krb5_context context, krb5_pac pac);
138 #define HAVE_PAC_SUPPORT 0
140 int check_k5_err(krb5_context context,
const char *msg, krb5_error_code
code);
int check_gss_err(OM_uint32 major_status, OM_uint32 minor_status, const char *function, int log, int sout)
void log(char *format,...)
int check_k5_err(krb5_context context, const char *msg, krb5_error_code code)
static const unsigned char ntlmProtocol[]
char * gethost_name(void)