r24712: No longer expose the 'BOOL' data type in any interfaces.
[samba.git] / source4 / auth / gensec / gensec.h
index b154619edfdf43384a25291d1c11b8622c5ea494..d129b194af825d170f807487da5338bf2a5152b4 100644 (file)
@@ -8,7 +8,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -17,8 +17,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef __GENSEC_H__
 
 #include "core.h"
 
-#define GENSEC_OID_NTLMSSP "1 3 6 1 4 1 311 2 2 10"
-#define GENSEC_OID_SPNEGO "1 3 6 1 5 5 2"
-#define GENSEC_OID_KERBEROS5 "1 2 840 113554 1 2 2"
-#define GENSEC_OID_KERBEROS5_OLD "1 2 840 48018 1 2 2"
-#define GENSEC_OID_KERBEROS5_USER2USER "1 2 840 113554 1 2 2 3"
+#define GENSEC_OID_NTLMSSP "1.3.6.1.4.1.311.2.2.10"
+#define GENSEC_OID_SPNEGO "1.3.6.1.5.5.2"
+#define GENSEC_OID_KERBEROS5 "1.2.840.113554.1.2.2"
+#define GENSEC_OID_KERBEROS5_OLD "1.2.840.48018.1.2.2"
+#define GENSEC_OID_KERBEROS5_USER2USER "1.2.840.113554.1.2.2.3"
+
+enum gensec_priority {
+       GENSEC_SPNEGO = 90,
+       GENSEC_GSSAPI = 80,
+       GENSEC_KRB5 = 70,
+       GENSEC_SCHANNEL = 60,
+       GENSEC_NTLMSSP = 50,
+       GENSEC_SASL = 20,
+       GENSEC_OTHER = 0
+};
+
+enum credentials_use_kerberos;
 
 struct gensec_security;
 struct gensec_target {
@@ -105,16 +116,29 @@ struct gensec_security_ops {
                                  const DATA_BLOB *in, 
                                  DATA_BLOB *out); 
        NTSTATUS (*unwrap)(struct gensec_security *gensec_security, 
-                                 TALLOC_CTX *mem_ctx, 
-                                 const DATA_BLOB *in, 
-                                 DATA_BLOB *out); 
+                          TALLOC_CTX *mem_ctx, 
+                          const DATA_BLOB *in, 
+                          DATA_BLOB *out); 
+       NTSTATUS (*wrap_packets)(struct gensec_security *gensec_security, 
+                                TALLOC_CTX *mem_ctx, 
+                                const DATA_BLOB *in, 
+                                DATA_BLOB *out,
+                                size_t *len_processed); 
+       NTSTATUS (*unwrap_packets)(struct gensec_security *gensec_security, 
+                                  TALLOC_CTX *mem_ctx, 
+                                  const DATA_BLOB *in, 
+                                  DATA_BLOB *out,
+                                  size_t *len_processed); 
+       NTSTATUS (*packet_full_request)(struct gensec_security *gensec_security,
+                                       DATA_BLOB blob, size_t *size);
        NTSTATUS (*session_key)(struct gensec_security *gensec_security, DATA_BLOB *session_key);
        NTSTATUS (*session_info)(struct gensec_security *gensec_security, 
                                 struct auth_session_info **session_info); 
-       BOOL (*have_feature)(struct gensec_security *gensec_security,
+       bool (*have_feature)(struct gensec_security *gensec_security,
                                    uint32_t feature); 
-       BOOL enabled;
-       BOOL kerberos;
+       bool enabled;
+       bool kerberos;
+       enum gensec_priority priority;
 };
        
 struct gensec_security_ops_wrapper {
@@ -130,7 +154,7 @@ struct gensec_security {
        struct cli_credentials *credentials;
        struct gensec_target target;
        enum gensec_role gensec_role;
-       BOOL subcontext;
+       bool subcontext;
        uint32_t want_features;
        struct event_context *event_ctx;
        struct messaging_context *msg_ctx; /* only valid as server */
@@ -144,7 +168,6 @@ struct gensec_critical_sizes {
        int sizeof_gensec_security;
 };
 
-#include "auth/credentials/credentials.h"
 #include "auth/gensec/gensec_proto.h"
 
 #endif /* __GENSEC_H__ */