From f3979b50a9b2aacb0497df770f09950b78878fcc Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Tue, 15 Sep 2009 18:29:10 +0200 Subject: [PATCH] schannel: move schannel_sign to main directory. Guenther --- {source4/auth/gensec => libcli/auth}/schannel.h | 9 +++-- .../schannel.h => libcli/auth/schannel_proto.h | 41 ++++++++++++---------- .../auth/gensec => libcli/auth}/schannel_sign.c | 2 +- source4/auth/gensec/config.mk | 2 +- source4/auth/gensec/schannel.c | 3 +- source4/rpc_server/netlogon/dcerpc_netlogon.c | 3 +- 6 files changed, 32 insertions(+), 28 deletions(-) copy {source4/auth/gensec => libcli/auth}/schannel.h (92%) rename source4/auth/gensec/schannel.h => libcli/auth/schannel_proto.h (52%) rename {source4/auth/gensec => libcli/auth}/schannel_sign.c (99%) diff --git a/source4/auth/gensec/schannel.h b/libcli/auth/schannel.h similarity index 92% copy from source4/auth/gensec/schannel.h copy to libcli/auth/schannel.h index 1ec605e5247..bfccd950b6c 100644 --- a/source4/auth/gensec/schannel.h +++ b/libcli/auth/schannel.h @@ -1,4 +1,4 @@ -/* +/* Unix SMB/CIFS implementation. dcerpc schannel operations @@ -10,18 +10,17 @@ it under the terms of the GNU General Public License as published by 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, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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, see . */ #include "libcli/auth/libcli_auth.h" -#include "auth/gensec/schannel_state.h" #include "libcli/auth/schannel_state.h" enum schannel_position { @@ -36,4 +35,4 @@ struct schannel_state { struct netlogon_creds_CredentialState *creds; }; -#include "auth/gensec/schannel_proto.h" +#include "libcli/auth/schannel_proto.h" diff --git a/source4/auth/gensec/schannel.h b/libcli/auth/schannel_proto.h similarity index 52% rename from source4/auth/gensec/schannel.h rename to libcli/auth/schannel_proto.h index 1ec605e5247..d31707d5c2b 100644 --- a/source4/auth/gensec/schannel.h +++ b/libcli/auth/schannel_proto.h @@ -1,4 +1,4 @@ -/* +/* Unix SMB/CIFS implementation. dcerpc schannel operations @@ -10,30 +10,33 @@ it under the terms of the GNU General Public License as published by 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, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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, see . */ -#include "libcli/auth/libcli_auth.h" -#include "auth/gensec/schannel_state.h" -#include "libcli/auth/schannel_state.h" - -enum schannel_position { - SCHANNEL_STATE_START = 0, - SCHANNEL_STATE_UPDATE_1 -}; - -struct schannel_state { - enum schannel_position state; - uint32_t seq_num; - bool initiator; - struct netlogon_creds_CredentialState *creds; -}; +#ifndef _LIBCLI_AUTH_SCHANNEL_PROTO_H__ +#define _LIBCLI_AUTH_SCHANNEL_PROTO_H__ -#include "auth/gensec/schannel_proto.h" +NTSTATUS schannel_unseal_packet(struct schannel_state *state, + TALLOC_CTX *mem_ctx, + uint8_t *data, size_t length, + const DATA_BLOB *sig); +NTSTATUS schannel_check_packet(struct schannel_state *state, + TALLOC_CTX *mem_ctx, + const uint8_t *data, size_t length, + const DATA_BLOB *sig); +NTSTATUS schannel_seal_packet(struct schannel_state *state, + TALLOC_CTX *mem_ctx, + uint8_t *data, size_t length, + DATA_BLOB *sig); +NTSTATUS schannel_sign_packet(struct schannel_state *state, + TALLOC_CTX *mem_ctx, + const uint8_t *data, size_t length, + DATA_BLOB *sig); +#endif diff --git a/source4/auth/gensec/schannel_sign.c b/libcli/auth/schannel_sign.c similarity index 99% rename from source4/auth/gensec/schannel_sign.c rename to libcli/auth/schannel_sign.c index ca066b102d8..45f3989e118 100644 --- a/source4/auth/gensec/schannel_sign.c +++ b/libcli/auth/schannel_sign.c @@ -21,10 +21,10 @@ */ #include "includes.h" +#include "../libcli/auth/schannel.h" #include "../lib/crypto/crypto.h" #include "auth/gensec/gensec.h" #include "auth/gensec/gensec_proto.h" -#include "auth/gensec/schannel.h" #define NETSEC_SIGN_SIGNATURE { 0x77, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } #define NETSEC_SEAL_SIGNATURE { 0x77, 0x00, 0x7a, 0x00, 0xff, 0xff, 0x00, 0x00 } diff --git a/source4/auth/gensec/config.mk b/source4/auth/gensec/config.mk index d2e41dadd75..84314f54e2e 100644 --- a/source4/auth/gensec/config.mk +++ b/source4/auth/gensec/config.mk @@ -72,7 +72,7 @@ OUTPUT_TYPE = MERGED_OBJ # End MODULE gensec_schannel ################################################ -gensec_schannel_OBJ_FILES = $(addprefix $(gensecsrcdir)/, schannel.o schannel_sign.o) +gensec_schannel_OBJ_FILES = $(addprefix $(gensecsrcdir)/, schannel.o) ../libcli/auth/schannel_sign.o $(eval $(call proto_header_template,$(gensecsrcdir)/schannel_proto.h,$(gensec_schannel_OBJ_FILES:.o=.c))) ################################################ diff --git a/source4/auth/gensec/schannel.c b/source4/auth/gensec/schannel.c index 90b90fca9c8..3efaf9bccae 100644 --- a/source4/auth/gensec/schannel.c +++ b/source4/auth/gensec/schannel.c @@ -26,7 +26,8 @@ #include "auth/credentials/credentials.h" #include "auth/gensec/gensec.h" #include "auth/gensec/gensec_proto.h" -#include "auth/gensec/schannel.h" +#include "../libcli/auth/schannel.h" +#include "auth/gensec/schannel_state.h" #include "librpc/rpc/dcerpc.h" #include "param/param.h" #include "auth/session_proto.h" diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 4ec6b74020b..baba4157e62 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -32,7 +32,8 @@ #include "rpc_server/samr/proto.h" #include "../lib/util/util_ldb.h" #include "libcli/auth/libcli_auth.h" -#include "auth/gensec/schannel.h" +#include "../libcli/auth/schannel.h" +#include "auth/gensec/schannel_state.h" #include "libcli/security/security.h" #include "param/param.h" #include "lib/messaging/irpc.h" -- 2.11.4.GIT