From 0ed0a669566a0fe2f3a0357e35080346b550fb1d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 31 Aug 2011 01:42:09 +0200 Subject: [PATCH] libcli/smb: move smb2_signing.c to the toplevel metze --- {source3/smbd => libcli/smb}/smb2_signing.c | 3 +- libcli/smb/smb2_signing.h | 34 +++++++++++++++++++++ libcli/smb/smb_common.h | 1 + libcli/smb/wscript_build | 7 +++-- source3/Makefile.in | 2 +- source3/smbd/globals.h | 7 ----- source3/wscript_build | 1 - 7 files changed, 42 insertions(+), 13 deletions(-) rename {source3/smbd => libcli/smb}/smb2_signing.c (98%) create mode 100644 libcli/smb/smb2_signing.h diff --git a/source3/smbd/smb2_signing.c b/libcli/smb/smb2_signing.c similarity index 98% rename from source3/smbd/smb2_signing.c rename to libcli/smb/smb2_signing.c index 1c0dd5ef68d..3687ace9b46 100644 --- a/source3/smbd/smb2_signing.c +++ b/libcli/smb/smb2_signing.c @@ -19,8 +19,7 @@ */ #include "includes.h" -#include "smbd/smbd.h" -#include "smbd/globals.h" +#include "system/filesys.h" #include "../libcli/smb/smb_common.h" #include "../lib/crypto/crypto.h" diff --git a/libcli/smb/smb2_signing.h b/libcli/smb/smb2_signing.h new file mode 100644 index 00000000000..3c3e0c28812 --- /dev/null +++ b/libcli/smb/smb2_signing.h @@ -0,0 +1,34 @@ +/* + Unix SMB/CIFS implementation. + SMB2 signing + + Copyright (C) Stefan Metzmacher 2009 + + 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 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 . +*/ + +#ifndef _LIBCLI_SMB_SMB2_SIGNING_H_ +#define _LIBCLI_SMB_SMB2_SIGNING_H_ + +struct iovec; + +NTSTATUS smb2_signing_sign_pdu(DATA_BLOB session_key, + struct iovec *vector, + int count); + +NTSTATUS smb2_signing_check_pdu(DATA_BLOB session_key, + const struct iovec *vector, + int count); + +#endif /* _LIBCLI_SMB_SMB2_SIGNING_H_ */ diff --git a/libcli/smb/smb_common.h b/libcli/smb/smb_common.h index 83f7db2dfa8..1f21e553bae 100644 --- a/libcli/smb/smb_common.h +++ b/libcli/smb/smb_common.h @@ -24,6 +24,7 @@ #include "libcli/smb/smb2_constants.h" #include "libcli/smb/smb2_create_blob.h" +#include "libcli/smb/smb2_signing.h" #include "libcli/smb/smb_constants.h" #include "libcli/smb/smb_util.h" #include "libcli/smb/smb_unix_ext.h" diff --git a/libcli/smb/wscript_build b/libcli/smb/wscript_build index 89ecf519ec6..66319e9a5b4 100644 --- a/libcli/smb/wscript_build +++ b/libcli/smb/wscript_build @@ -2,9 +2,12 @@ bld.SAMBA_LIBRARY('cli_smb_common', - source='smb2_create_blob.c util.c', + source='smb2_create_blob.c smb2_signing.c util.c', autoproto='smb_common_proto.h', + deps='LIBCRYPTO', public_deps='talloc samba-util', private_library=True, - public_headers='smb_common.h smb2_constants.h smb2_create_blob.h', + public_headers='''smb_common.h smb2_constants.h + smb2_create_blob.h smb2_signing.h + ''', ) diff --git a/source3/Makefile.in b/source3/Makefile.in index 92367509237..bf66af47089 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -601,6 +601,7 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \ libsmb/smb2cli_tcon.o \ libsmb/smb2cli_create.o \ ../libcli/smb/smb2_create_blob.o \ + ../libcli/smb/smb2_signing.o \ libsmb/smb2cli_close.o \ libsmb/smb2cli_flush.o \ libsmb/smb2cli_read.o \ @@ -929,7 +930,6 @@ SMBD_OBJ_SRV = smbd/server_reload.o \ smbd/file_access.o \ smbd/dnsregister.o smbd/globals.o \ smbd/smb2_server.o \ - smbd/smb2_signing.o \ smbd/smb2_glue.o \ smbd/smb2_negprot.o \ smbd/smb2_sesssetup.o \ diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 35c44eebb57..2e59d9bc5f8 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -133,13 +133,6 @@ DATA_BLOB negprot_spnego(TALLOC_CTX *ctx, struct smbd_server_connection *sconn); void smbd_lock_socket(struct smbd_server_connection *sconn); void smbd_unlock_socket(struct smbd_server_connection *sconn); -NTSTATUS smb2_signing_sign_pdu(DATA_BLOB session_key, - struct iovec *vector, - int count); -NTSTATUS smb2_signing_check_pdu(DATA_BLOB session_key, - const struct iovec *vector, - int count); - NTSTATUS smbd_do_locking(struct smb_request *req, files_struct *fsp, uint8_t type, diff --git a/source3/wscript_build b/source3/wscript_build index a1445498702..5414e6c45a1 100755 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -377,7 +377,6 @@ SMBD_SRC_SRV = '''smbd/server_reload.c smbd/files.c smbd/connection.c smbd/file_access.c smbd/dnsregister.c smbd/globals.c smbd/smb2_server.c - smbd/smb2_signing.c smbd/smb2_glue.c smbd/smb2_negprot.c smbd/smb2_sesssetup.c -- 2.34.1