37#ifndef SQUID_SRC_AUTH_NEGOTIATE_KERBEROS_NEGOTIATE_KERBEROS_H
38#define SQUID_SRC_AUTH_NEGOTIATE_KERBEROS_NEGOTIATE_KERBEROS_H
58#define GSSKRB_APPLE_DEPRECATED(x)
60#if HAVE_GSSAPI_GSSAPI_H
61#include <gssapi/gssapi.h>
65#if HAVE_GSSAPI_GSSAPI_KRB5_H
66#include <gssapi/gssapi_krb5.h>
68#if HAVE_GSSAPI_GSSAPI_GENERIC_H
69#include <gssapi/gssapi_generic.h>
71#if HAVE_GSSAPI_GSSAPI_EXT_H
72#include <gssapi/gssapi_ext.h>
75#ifndef gss_nt_service_name
76#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
79#define PROGRAM "negotiate_kerberos_auth"
81#ifndef MAX_AUTHTOKEN_LEN
82#define MAX_AUTHTOKEN_LEN 65535
84#ifndef SQUID_KERB_AUTH_VERSION
85#define SQUID_KERB_AUTH_VERSION "3.1.0sq"
90static const unsigned char ntlmProtocol[] = {
'N',
'T',
'L',
'M',
'S',
'S',
'P', 0};
96 static time_t last_t = 0;
99 gettimeofday(&now,
nullptr);
100 if (now.tv_sec != last_t) {
102 tm = localtime((time_t *) & now.tv_sec);
103 strftime(buf, 127,
"%Y/%m/%d %H:%M:%S", tm);
110 const char *function,
int log,
int sout);
114#if HAVE_KRB5_PAC_SUPPORT
128#define MAX_PAC_GROUP_SIZE (1024*98)
136void getustr(RPC_UNICODE_STRING *
string);
137char **getgids(
char **Rids, uint32_t GroupIds, uint32_t GroupCount);
138char *getdomaingids(
char *ad_groups, uint32_t DomainLogonId,
char **Rids, uint32_t GroupCount);
139char *getextrasids(
char *ad_groups, uint32_t ExtraSids, uint32_t SidCount);
140uint64_t get6byt_be(
void);
141uint32_t get4byt(
void);
142uint16_t get2byt(
void);
143uint8_t get1byt(
void);
144char *xstrcpy(
char *src,
const char*dst);
145char *xstrcat(
char *src,
const char*dst);
146int checkustr(RPC_UNICODE_STRING *
string);
147char *get_ad_groups(
char *ad_groups, krb5_context context, krb5_pac pac);
150int check_k5_err(krb5_context context,
const char *msg, krb5_error_code code);
void log(char *format,...)
char * gethost_name(void)
int check_gss_err(OM_uint32 major_status, OM_uint32 minor_status, const char *function, int log, int sout)
int check_k5_err(krb5_context context, const char *msg, krb5_error_code code)
static const unsigned char ntlmProtocol[]