From 7bef162aeb74afd654b8e802bdf81b220ceb44b4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 17 Jul 2007 10:13:53 +0000 Subject: r23922: implement input buffer handling for the SASL read wrapper metze (This used to be commit 7d8518ebd9470062b499b7074a940e14520e99f2) --- source3/include/ads.h | 61 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 15 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ads.h b/source3/include/ads.h index 5c15359c41..8404ad907b 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -15,7 +15,31 @@ enum wb_posix_mapping { WB_POSIX_MAP_UNIXINFO = 4 }; -typedef struct { +/* there are 5 possible types of errors the ads subsystem can produce */ +enum ads_error_type {ENUM_ADS_ERROR_KRB5, ENUM_ADS_ERROR_GSS, + ENUM_ADS_ERROR_LDAP, ENUM_ADS_ERROR_SYSTEM, ENUM_ADS_ERROR_NT}; + +typedef struct { + enum ads_error_type error_type; + union err_state{ + int rc; + NTSTATUS nt_status; + } err; + /* For error_type = ENUM_ADS_ERROR_GSS minor_status describe GSS API error */ + /* Where rc represents major_status of GSS API error */ + int minor_status; +} ADS_STATUS; + +struct ads_struct; + +struct ads_saslwrap_ops { + const char *name; + ADS_STATUS (*wrap)(struct ads_struct *); + ADS_STATUS (*unwrap)(struct ads_struct *); + ADS_STATUS (*disconnect)(struct ads_struct *); +}; + +typedef struct ads_struct { int is_mine; /* do I own this structure's memory? */ /* info needed to find the server */ @@ -63,6 +87,27 @@ typedef struct { #ifdef HAVE_LDAP_SASL_WRAPPING Sockbuf_IO_Desc *sbiod; /* lowlevel state for LDAP wrapping */ + TALLOC_CTX *mem_ctx; + const struct ads_saslwrap_ops *wrap_ops; + void *wrap_private_data; + struct { + uint32 ofs; + uint32 needed; + uint32 left; + uint32 max; + uint32 min; + uint32 size; + uint8 *buf; + } in; + struct { + uint32 ofs; + uint32 needed; + uint32 left; + uint32 max; + uint32 min; + uint32 size; + uint8 *buf; + } out; #endif /* HAVE_LDAP_SASL_WRAPPING */ } ldap; #endif /* HAVE_LDAP */ @@ -80,20 +125,6 @@ struct posix_schema { }; -/* there are 5 possible types of errors the ads subsystem can produce */ -enum ads_error_type {ENUM_ADS_ERROR_KRB5, ENUM_ADS_ERROR_GSS, - ENUM_ADS_ERROR_LDAP, ENUM_ADS_ERROR_SYSTEM, ENUM_ADS_ERROR_NT}; - -typedef struct { - enum ads_error_type error_type; - union err_state{ - int rc; - NTSTATUS nt_status; - } err; - /* For error_type = ENUM_ADS_ERROR_GSS minor_status describe GSS API error */ - /* Where rc represents major_status of GSS API error */ - int minor_status; -} ADS_STATUS; #ifdef HAVE_ADS typedef LDAPMod **ADS_MODLIST; -- cgit