From: David Mulder Date: Thu, 17 Mar 2022 19:55:25 +0000 (-0600) Subject: smbd: Move smb2_srv_init_signing to smb2_signing.c X-Git-Tag: tevent-0.12.0~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=047df615619cd923bf3c6ec73b7283f8ae6d946a;p=thirdparty%2Fsamba.git smbd: Move smb2_srv_init_signing to smb2_signing.c Signed-off-by: David Mulder Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 7314593fbd1..81f2e6c969d 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -66,6 +66,10 @@ void smb1_srv_set_signing(struct smbXsrv_connection *conn, const DATA_BLOB user_session_key, const DATA_BLOB response); +/* The following definitions come from smbd/smb2_signing.c */ + +bool smb2_srv_init_signing(struct smbXsrv_connection *conn); + /* The following definitions come from smbd/aio.c */ struct aio_extra; diff --git a/source3/smbd/signing.c b/source3/smbd/signing.c index bbb5379eb4a..2a578fe530f 100644 --- a/source3/smbd/signing.c +++ b/source3/smbd/signing.c @@ -232,23 +232,6 @@ static bool smb1_srv_init_signing(struct smbXsrv_connection *conn) return true; } -static bool smb2_srv_init_signing(struct smbXsrv_connection *conn) -{ - struct loadparm_context *lp_ctx = loadparm_init_s3(conn, loadparm_s3_helpers()); - if (lp_ctx == NULL) { - DBG_DEBUG("loadparm_init_s3 failed\n"); - return false; - } - - /* - * For SMB2 all we need to know is if signing is mandatory. - * It is always allowed and desired, whatever the smb.conf says. - */ - (void)lpcfg_server_signing_allowed(lp_ctx, &conn->smb2.signing_mandatory); - talloc_unlink(conn, lp_ctx); - return true; -} - bool srv_init_signing(struct smbXsrv_connection *conn) { if (conn->protocol >= PROTOCOL_SMB2_02) { diff --git a/source3/smbd/smb2_signing.c b/source3/smbd/smb2_signing.c new file mode 100644 index 00000000000..b80f995116e --- /dev/null +++ b/source3/smbd/smb2_signing.c @@ -0,0 +1,44 @@ +/* + Unix SMB/CIFS implementation. + SMB Signing Code + Copyright (C) Jeremy Allison 2003. + Copyright (C) Andrew Bartlett 2002-2003 + 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 . +*/ + +#include "includes.h" +#include "smbd/smbd.h" +#include "smbd/globals.h" +#include "../libcli/smb/smb_signing.h" +#include "lib/param/param.h" +#include "smb2_signing.h" + +bool smb2_srv_init_signing(struct smbXsrv_connection *conn) +{ + struct loadparm_context *lp_ctx = loadparm_init_s3(conn, loadparm_s3_helpers()); + if (lp_ctx == NULL) { + DBG_DEBUG("loadparm_init_s3 failed\n"); + return false; + } + + /* + * For SMB2 all we need to know is if signing is mandatory. + * It is always allowed and desired, whatever the smb.conf says. + */ + (void)lpcfg_server_signing_allowed(lp_ctx, &conn->smb2.signing_mandatory); + talloc_unlink(conn, lp_ctx); + return true; +} diff --git a/source3/wscript_build b/source3/wscript_build index 719a6acce34..92d9937fda9 100644 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -664,6 +664,7 @@ bld.SAMBA3_LIBRARY('smbd_base', smbd/smb2_aio.c smbd/statvfs.c smbd/dmapi.c smbd/signing.c + smbd/smb2_signing.c smbd/file_access.c smbd/dnsregister.c smbd/globals.c smbd/smb2_server.c