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 f437ee508798a53d9ef36af91d59622eb03e2deb..bf55ab97b04bfd233e3ed8d1363a8c8840775024 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 637b6ccf26867205dff2f3180447fe42dbad4302..f5aba1de248e4c58a300327cbd72b3998de5e23e 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 d0febc7dc9c3a2c27b0efc2e423d08e7ef232c99..ef62d9781226371f2febfe635766234da4a47dda 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 8f6dedc190929d704e3da4493699d0e4bfaa3604..1d8071d7c0ff4865d5cc74ee302d7c485a1c1c3a 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 8940522d39c487234dd38a2454fa66bcf237c139..df891f8d93306a10878bf2ce0cf78d106a2dfaae 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 6d090b023f8e8daae3a5a21779fa5fd29097dad0..8fa7baa04d721d3fe5d745d53e7bd3ee16852eaa 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 1c4b11174cb6741e2e53c6781e3c6facb28eba86..8ba2e246b34aeb048a027680d512b8b1696576c6 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 0802330ec6a75048b0bed19418d6d909bd293037..20836efad0a77a094335ff909bdf0e80a8cbc71b 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 306977cd771a762d771fb598852e3c1d4da68762..9e124c20c6822efbe6d4e46bb199a665f141a31d 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 fa6420cea306ba546a1a1afee6edbe84a8d3de90..3e7300ea2c08f646b20065f848af240f6c7b9031 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 01b70f14f775748e7c6715559d3a562b0d0b12c8..e482bbfd487799a7612f5bf0b88c77423e9ad044 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 1252d0539cdfab22ee3b3911236a0612b46a9e43..0b1d84b9799f1f07cff9fe21b5e8cccc9ee27f30 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 96dcf981a3e3ffdc646b44a2f5828f57a72e43c7..39489c20b4e36e04a74847e10fe8aa45dd74b59b 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 cfe89b6ef79b678033b266e2e9292f6b61f22946..2f9bae4ba8edfa075a7aac6b23ca03aa53d31fbc 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 5135ad491fe2e3cdeeb311efc3b454ea11cda869..2f5fac081282a13cf89a35b59072ba1f8aa5c737 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 b67702fe7c0377f1a140ac983fa3c885ac657325..c75a075682116f3c4781c8e3093c3e68c39bab35 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 4665703fdef63032a3b2fc3cb76fb9e9dd511367..2fad5ee37c3d68e2cb49a6d685403b4854391350 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 56a70f888e92a9b27f972bc779d93889f447a865..9c8fddca94b0e76f906db8e4778d040a5d710aa6 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 5b4ec271ae6946459fd6d9fd32c0be4bb7991e27..c0c4a0272d1a510c3ba7ffccda0711fa5040d7ea 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 eb81e2379149145f1677f2de11c1277f53a3a48c..770c22b00f13273e360e8e8d68c33c63021d7885 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 edd973d699468f3fee309d6da5e7aea35c3576e5..b61fc3cc95f476376fa1cf311aaf09129c47c43f 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 2fc10bb85328e513cffe09e02026fe98bb7f50ec..cf488b82d7735d3179e0e4e2380664736681cc7b 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 a15753feadfd808c7394aeaf33e7290904268254..51ac0f2c2e5aa686e5cf1a0e4bbcc864c18cd2c6 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 0f509b961cf32b44584d68107ba86e9461b7612b..97ce7f58ddff1ed40769f0a756681c814df881f8 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 44bc9231cde2cf641c042526ae735ef2bcb9129b..e097fddc228668b7d6747b217659692f6762781b 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 b7eb2f842acf9e446c4926e3c17a3832ab0bdfe3..44096f71f494b73eed4dbc7ca92c4c356730040f 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 a7f925df7a0fb1068b1c6d26499db9886e4c8a13..ec8a2e5b85aeeed377caafd32cd8d8fa1196edca 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 987ea42dca3a77d2ad4c28fe5a555fceb1947508..7c441f38ce297c9f90034ab9d360d7484158a393 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 019bd2026c15ba9847e8d9a1c7d66b60a7c300eb..a7459d6b85168219a709dcebcdaa3aaeb67676a6 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'
        )