1524bc
From 499fd673befa6fed6bd0e542d9bb06cb49bd150e Mon Sep 17 00:00:00 2001
1524bc
From: Andreas Schneider <asn@samba.org>
1524bc
Date: Thu, 11 Apr 2019 11:40:11 +0200
1524bc
Subject: [PATCH 198/208] s3:param: Only allow SMB 3.0+ for DCERPC client
1524bc
 connections over named pipes
1524bc
1524bc
We need an AES encrypted transport as some RPC services only encrypt
1524bc
secrets using RC4, e.g. password changes over SAMR.
1524bc
1524bc
Signed-off-by: Andreas Schneider <asn@samba.org>
1524bc
---
1524bc
 source3/param/loadparm.c | 9 +++++++++
1524bc
 1 file changed, 9 insertions(+)
1524bc
1524bc
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
1524bc
index b52e2bcb036..c1d02cf5bc6 100644
1524bc
--- a/source3/param/loadparm.c
1524bc
+++ b/source3/param/loadparm.c
1524bc
@@ -4614,6 +4614,15 @@ int lp_client_max_protocol(void)
1524bc
 int lp_client_ipc_min_protocol(void)
1524bc
 {
1524bc
 	int client_ipc_min_protocol = lp__client_ipc_min_protocol();
1524bc
+
1524bc
+	/*
1524bc
+	 * If weak crypto is not allowed, force at least SMB3 which offers AES
1524bc
+	 * encrypted connections.
1524bc
+	 */
1524bc
+	if (lp_weak_crypto() == SAMBA_WEAK_CRYPTO_DISALLOWED) {
1524bc
+		return MAX(client_ipc_min_protocol, PROTOCOL_SMB3_00);
1524bc
+	}
1524bc
+
1524bc
 	if (client_ipc_min_protocol == PROTOCOL_DEFAULT) {
1524bc
 		client_ipc_min_protocol = lp_client_min_protocol();
1524bc
 	}
1524bc
-- 
1524bc
2.23.0
1524bc