Blob Blame History Raw
From 067a5405a729c6d3b91a30ab0f16c0fa10db0498 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Mon, 4 Nov 2019 17:26:48 +0100
Subject: [PATCH 193/208] s3:utils: Add weak crypto information to testparm

Signed-off-by: Andreas Schneider <asn@samba.org>
---
 source3/utils/testparm.c    | 9 +++++++++
 source3/utils/wscript_build | 1 +
 2 files changed, 10 insertions(+)

diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index f4e94b6ef74..c5001e01679 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -35,6 +35,7 @@
 #include "system/filesys.h"
 #include "popt_common.h"
 #include "lib/param/loadparm.h"
+#include "lib/crypto/gnutls_helpers.h"
 #include "cmdline_contexts.h"
 
 #include <regex.h>
@@ -647,6 +648,7 @@ static void do_per_share_checks(int s)
 	const char *caddr;
 	static int show_defaults;
 	static int skip_logic_checks = 0;
+	const char *weak_crypo_str = "";
 
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
@@ -752,6 +754,13 @@ static void do_per_share_checks(int s)
 
 	fprintf(stderr,"Loaded services file OK.\n");
 
+	if (samba_gnutls_weak_crypto_allowed()) {
+		weak_crypo_str = "allowed";
+	} else {
+		weak_crypo_str = "disallowed";
+	}
+	fprintf(stderr, "Weak crypto is %s\n", weak_crypo_str);
+
 	if (skip_logic_checks == 0) {
 		ret = do_global_checks();
 	}
diff --git a/source3/utils/wscript_build b/source3/utils/wscript_build
index 9d9aa56bf37..618cc955647 100644
--- a/source3/utils/wscript_build
+++ b/source3/utils/wscript_build
@@ -175,6 +175,7 @@ bld.SAMBA3_BINARY('testparm',
                  smbconf
                  popt_samba3
                  cmdline_contexts
+                 GNUTLS_HELPERS
                  ''')
 
 bld.SAMBA3_BINARY('net',
-- 
2.23.0