lib/crypto: move gnutls error wrapper to own subsystem
authorAndrew Bartlett <abartlet@samba.org>
Wed, 26 Jun 2019 04:41:05 +0000 (16:41 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 27 Jun 2019 12:54:22 +0000 (12:54 +0000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
29 files changed:
auth/credentials/credentials_ntlm.c
auth/credentials/wscript_build
auth/gensec/schannel.c
auth/gensec/wscript_build
auth/ntlmssp/ntlmssp_client.c
auth/ntlmssp/ntlmssp_server.c
auth/ntlmssp/ntlmssp_sign.c
auth/ntlmssp/wscript_build
lib/crypto/gnutls_error.c [moved from libcli/util/gnutls_error.c with 98% similarity]
lib/crypto/gnutls_helpers.h [moved from libcli/util/gnutls_error.h with 92% similarity]
lib/crypto/wscript_build
libcli/auth/credentials.c
libcli/auth/wscript_build
libcli/smb/smb2_signing.c
libcli/smb/smbXcli_base.c
libcli/smb/smb_signing.c
libcli/smb/wscript
libcli/util/wscript_build
source3/smbd/smb2_server.c
source3/smbd/smb2_sesssetup.c
source3/wscript_build
source4/libcli/smb2/signing.c
source4/libcli/smb2/wscript_build
source4/libnet/libnet_passwd.c
source4/libnet/wscript_build
source4/ntp_signd/ntp_signd.c
source4/ntp_signd/wscript_build
source4/rpc_server/samr/samr_password.c
source4/rpc_server/wscript_build

index f437ee5..bf55ab9 100644 (file)
@@ -28,7 +28,7 @@
 #include "auth/credentials/credentials.h"
 #include "auth/credentials/credentials_internal.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 637b6cc..f5aba1d 100644 (file)
@@ -22,7 +22,7 @@ bld.SAMBA_SUBSYSTEM('CREDENTIALS_SECRETS',
 
 bld.SAMBA_SUBSYSTEM('CREDENTIALS_NTLM',
        source='credentials_ntlm.c',
-       deps='samba-credentials')
+       deps='samba-credentials GNUTLS_HELPERS')
 
 pytalloc_util = bld.pyembed_libname('pytalloc-util')
 pyparam_util = bld.pyembed_libname('pyparam_util')
index d0febc7..ef62d97 100644 (file)
@@ -36,7 +36,7 @@
 #include "lib/crypto/crypto.h"
 #include "libds/common/roles.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 8f6dedc..1d8071d 100644 (file)
@@ -19,7 +19,7 @@ bld.SAMBA_MODULE('gensec_schannel',
        source='schannel.c',
        subsystem='gensec',
        init_function='gensec_schannel_init',
-       deps='COMMON_SCHANNEL NDR_SCHANNEL samba-credentials auth_session'
+       deps='COMMON_SCHANNEL NDR_SCHANNEL samba-credentials auth_session GNUTLS_HELPERS'
        )
 
 bld.SAMBA_MODULE('gensec_ncalrpc',
index 8940522..df891f8 100644 (file)
@@ -35,7 +35,7 @@ struct auth_session_info;
 #include "../auth/ntlmssp/ntlmssp_ndr.h"
 #include "../nsswitch/libwbclient/wbclient.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 6d090b0..8fa7baa 100644 (file)
@@ -36,7 +36,7 @@
 #include "param/loadparm.h"
 #include "libcli/security/session.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 1c4b111..8ba2e24 100644 (file)
@@ -24,7 +24,7 @@
 #include "zlib.h"
 #include "../auth/ntlmssp/ntlmssp_private.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 0802330..20836ef 100644 (file)
@@ -15,6 +15,7 @@ bld.SAMBA_SUBSYSTEM('NTLMSSP_COMMON',
                         samba-credentials
                         wbclient
                         z
+                        GNUTLS_HELPERS
                         ''')
 
 bld.SAMBA_MODULE('gensec_ntlmssp',
similarity index 98%
rename from libcli/util/gnutls_error.c
rename to lib/crypto/gnutls_error.c
index 306977c..9e124c2 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include "includes.h"
-#include "gnutls_error.h"
+#include "gnutls_helpers.h"
 
 #include <gnutls/gnutls.h>
 
similarity index 92%
rename from libcli/util/gnutls_error.h
rename to lib/crypto/gnutls_helpers.h
index fa6420c..3e7300e 100644 (file)
@@ -15,8 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _GNUTLS_ERROR_H
-#define _GNUTLS_ERROR_H
+#ifndef _GNUTLS_HELPERS_H
+#define _GNUTLS_HELPERS_H
 
 #include "ntstatus.h"
 
@@ -28,4 +28,4 @@ NTSTATUS _gnutls_error_to_ntstatus(int gnutls_rc,
        _gnutls_error_to_ntstatus(gnutls_rc, blocked_status, \
                                  __FUNCTION__, __location__)
 
-#endif /* _GNUTLS_ERROR_H */
+#endif /* _GNUTLS_HELPERS_H */
index 01b70f1..e482bbf 100644 (file)
@@ -5,6 +5,10 @@ extra_deps = ''
 if bld.CONFIG_SET("HAVE_AESNI_INTEL"):
         extra_deps += ' aesni-intel'
 
+bld.SAMBA_SUBSYSTEM('GNUTLS_HELPERS',
+                    source='gnutls_error.c',
+                    deps='gnutls samba-errors');
+
 bld.SAMBA_SUBSYSTEM('LIBCRYPTO',
         source='''md4.c arcfour.c
         aes.c rijndael-alg-fst.c aes_cmac_128.c aes_ccm_128.c aes_gcm_128.c
index 1252d05..0b1d84b 100644 (file)
@@ -26,7 +26,7 @@
 #include "libcli/auth/libcli_auth.h"
 #include "../libcli/security/dom_sid.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 96dcf98..39489c2 100644 (file)
@@ -18,7 +18,7 @@ bld.SAMBA_SUBSYSTEM('NTLM_CHECK',
 
 bld.SAMBA_SUBSYSTEM('LIBCLI_AUTH',
        source='credentials.c session.c smbencrypt.c smbdes.c',
-       public_deps='MSRPC_PARSE gnutls',
+       public_deps='MSRPC_PARSE gnutls GNUTLS_HELPERS',
        public_headers='credentials.h:domain_credentials.h'
        )
 
index cfe89b6..2f9bae4 100644 (file)
@@ -24,7 +24,7 @@
 #include "../lib/crypto/crypto.h"
 #include "lib/util/iov_buf.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 5135ad4..2f5fac0 100644 (file)
@@ -38,7 +38,7 @@
 #include "lib/crypto/aes_ccm_128.h"
 #include "lib/crypto/aes_gcm_128.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index b67702f..c75a075 100644 (file)
@@ -23,7 +23,7 @@
 #include "smb_common.h"
 #include "smb_signing.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 4665703..2fad5ee 100644 (file)
@@ -47,7 +47,7 @@ def build(bld):
     ''',
     deps='''
         LIBCRYPTO gnutls NDR_SMB2_LEASE_STRUCT samba-errors gensec krb5samba
-        smb_transport
+        smb_transport GNUTLS_HELPERS
     ''',
     public_deps='talloc samba-util iov_buf',
     private_library=True,
index 56a70f8..9c8fddc 100644 (file)
@@ -2,10 +2,10 @@
 
 
 bld.SAMBA_LIBRARY('samba-errors',
-                  public_headers='error.h ntstatus.h ntstatus_gen.h doserr.h werror.h werror_gen.h hresult.h gnutls_error.h',
+                  public_headers='error.h ntstatus.h ntstatus_gen.h doserr.h werror.h werror_gen.h hresult.h',
                   private_headers='nterr_private.h',
                   header_path='core',
-                  source='doserr.c errormap.c nterr.c errmap_unix.c hresult.c gnutls_error.c',
+                  source='doserr.c errormap.c nterr.c errmap_unix.c hresult.c',
                   public_deps='talloc samba-debug',
                   deps='gnutls',
                   # private_library=True,
index 5b4ec27..c0c4a02 100644 (file)
@@ -32,7 +32,7 @@
 #include "auth.h"
 #include "libcli/smb/smbXcli_base.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index eb81e23..770c22b 100644 (file)
@@ -32,7 +32,7 @@
 #include "lib/crypto/aes_ccm_128.h"
 #include "lib/crypto/aes_gcm_128.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index edd973d..b61fc3c 100644 (file)
@@ -749,6 +749,7 @@ bld.SAMBA3_LIBRARY('smbd_base',
                         notifyd
                         vfs_acl_common
                         NDR_QUOTA
+                        GNUTLS_HELPERS
                    ''' +
                    bld.env['dmapi_lib'] +
                    bld.env['legacy_quota_libs'] +
index 2fc10bb..cf488b8 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 
 /*
   sign an outgoing message
index a15753f..51ac0f2 100644 (file)
@@ -3,7 +3,7 @@
 bld.SAMBA_SUBSYSTEM('LIBCLI_SMB2',
        source='transport.c request.c session.c tcon.c create.c close.c connect.c getinfo.c write.c read.c setinfo.c find.c ioctl.c logoff.c tdis.c flush.c lock.c notify.c cancel.c keepalive.c break.c util.c signing.c lease_break.c',
        autoproto='smb2_proto.h',
-       deps='tevent-util cli_smb_common',
+       deps='tevent-util cli_smb_common GNUTLS_HELPERS',
        public_deps='smbclient-raw gensec samba-credentials tevent',
        private_headers='smb2.h',
        )
index 0f509b9..97ce7f5 100644 (file)
@@ -24,7 +24,7 @@
 #include "libcli/auth/libcli_auth.h"
 #include "librpc/gen_ndr/ndr_samr_c.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 44bc923..e097fdd 100644 (file)
@@ -8,7 +8,7 @@ auto_proto='libnet_proto.h'
 bld.SAMBA_LIBRARY(name,
         source='libnet.c libnet_passwd.c libnet_time.c libnet_rpc.c libnet_join.c libnet_site.c libnet_become_dc.c libnet_unbecome_dc.c libnet_vampire.c libnet_user.c libnet_group.c libnet_share.c libnet_lookup.c libnet_domain.c userinfo.c groupinfo.c userman.c groupman.c prereq_domain.c',
         autoproto=auto_proto,
-        public_deps='samba-credentials dcerpc dcerpc-samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI cli_composite LIBCLI_RESOLVE LIBCLI_FINDDCS cli_cldap LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH ndr smbpasswdparser %s LIBCLI_SAMSYNC LIBTSOCKET' % (provision),
+        public_deps='samba-credentials dcerpc dcerpc-samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI cli_composite LIBCLI_RESOLVE LIBCLI_FINDDCS cli_cldap LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH ndr smbpasswdparser %s LIBCLI_SAMSYNC LIBTSOCKET GNUTLS_HELPERS' % (provision),
         private_library=True,
         pyembed=True,
         enabled=bld.PYTHON_BUILD_IS_ENABLED()
index b7eb2f8..44096f7 100644 (file)
@@ -40,7 +40,7 @@
 #include "system/network.h"
 #include "system/passwd.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index a7f925d..ec8a2e5 100644 (file)
@@ -4,7 +4,7 @@ bld.SAMBA_MODULE('service_ntp_signd',
        source='ntp_signd.c',
        subsystem='service',
        init_function='server_service_ntp_signd_init',
-       deps='samdb NDR_NTP_SIGND LIBTSOCKET LIBSAMBA_TSOCKET',
+       deps='samdb NDR_NTP_SIGND LIBTSOCKET LIBSAMBA_TSOCKET GNUTLS_HELPERS',
        internal_module=False,
        enabled=bld.AD_DC_BUILD_IS_ENABLED()
        )
index 987ea42..7c441f3 100644 (file)
@@ -32,7 +32,7 @@
 #include "rpc_server/samr/proto.h"
 #include "auth/auth_sam.h"
 
-#include "libcli/util/gnutls_error.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
index 019bd20..a7459d6 100644 (file)
@@ -87,7 +87,7 @@ bld.SAMBA_MODULE('dcesrv_samr',
        autoproto='samr/proto.h',
        subsystem='dcerpc_server',
        init_function='dcerpc_server_samr_init',
-       deps='samdb DCERPC_COMMON ndr-standard auth4_sam'
+       deps='samdb DCERPC_COMMON ndr-standard auth4_sam GNUTLS_HELPERS'
        )