svn commit: samba r21925 - in branches/SAMBA_3_0/source/smbd: .

jra at samba.org jra at samba.org
Thu Mar 22 01:14:56 GMT 2007


Author: jra
Date: 2007-03-22 01:14:55 +0000 (Thu, 22 Mar 2007)
New Revision: 21925

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21925

Log:
Start to code up the gss acquire creds calls.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/seal.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/seal.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/seal.c	2007-03-22 01:13:25 UTC (rev 21924)
+++ branches/SAMBA_3_0/source/smbd/seal.c	2007-03-22 01:14:55 UTC (rev 21925)
@@ -98,8 +98,14 @@
 	}
 
 	if (ec->es) {
-		if (ec->es->smb_enc_type == SMB_TRANS_ENC_NTLM) {
-			destroy_auth_ntlmssp(ec);
+		switch (ec->es->smb_enc_type) {
+			case SMB_TRANS_ENC_NTLM:
+				destroy_auth_ntlmssp(ec);
+				break;
+#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
+			case SMB_TRANS_ENC_GSS:
+				break;
+#endif
 		}
 		common_free_encryption_state(&ec->es);
 	}
@@ -128,12 +134,25 @@
 	}
 	ZERO_STRUCTP(ec->es);
 	ec->es->smb_enc_type = smb_enc_type;
-	if (smb_enc_type == SMB_TRANS_ENC_NTLM) {
-		NTSTATUS status = make_auth_ntlmssp(ec);
-		if (!NT_STATUS_IS_OK(status)) {
+	switch (smb_enc_type) {
+		case SMB_TRANS_ENC_NTLM:
+			{
+				NTSTATUS status = make_auth_ntlmssp(ec);
+				if (!NT_STATUS_IS_OK(status)) {
+					srv_free_encryption_context(&ec);
+					return NULL;
+				}
+			}
+			break;
+
+#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
+		case SMB_TRANS_ENC_GSS:
+			/* Acquire our credentials by calling gss_acquire_cred here. */
+			break;
+#endif
+		default:
 			srv_free_encryption_context(&ec);
 			return NULL;
-		}
 	}
 	return ec;
 }
@@ -183,6 +202,13 @@
 #if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
 static NTSTATUS srv_enc_spnego_gss_negotiate(unsigned char **ppdata, size_t *p_data_size, DATA_BLOB secblob)
 {
+	if (!partial_srv_trans_enc_ctx) {
+		partial_srv_trans_enc_ctx = make_srv_encryption_context(SMB_TRANS_ENC_GSS);
+		if (!partial_srv_trans_enc_ctx) {
+			return NT_STATUS_NO_MEMORY;
+		}
+	}
+
 	return NT_STATUS_NOT_SUPPORTED;
 }
 #endif



More information about the samba-cvs mailing list