b6b438
From 080c82dfa589f72f72f84e761adeb91e0b112072 Mon Sep 17 00:00:00 2001
b6b438
From: Andreas Schneider <asn@samba.org>
b6b438
Date: Wed, 13 Nov 2019 14:01:46 +0100
b6b438
Subject: [PATCH 145/187] s4:torture: Remove calls to gnutls_global_(de)init()
b6b438
 in backupkey test
b6b438
b6b438
This is handled by the gnutls library constructor/destructor.
b6b438
b6b438
Signed-off-by: Andreas Schneider <asn@samba.org>
b6b438
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
b6b438
(cherry picked from commit fbfb11b0f7ebd69cc4b1b545b398a367720d5473)
b6b438
---
b6b438
 source4/torture/rpc/backupkey.c | 48 ---------------------------------
b6b438
 1 file changed, 48 deletions(-)
b6b438
b6b438
diff --git a/source4/torture/rpc/backupkey.c b/source4/torture/rpc/backupkey.c
b6b438
index b955f933430..284488f84ea 100644
b6b438
--- a/source4/torture/rpc/backupkey.c
b6b438
+++ b/source4/torture/rpc/backupkey.c
b6b438
@@ -834,8 +834,6 @@ static bool test_RestoreGUID_ko(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -853,8 +851,6 @@ static bool test_RestoreGUID_ko(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -868,8 +864,6 @@ static bool test_RestoreGUID_wrongversion(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -887,8 +881,6 @@ static bool test_RestoreGUID_wrongversion(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -902,8 +894,6 @@ static bool test_RestoreGUID_wronguser(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -921,8 +911,6 @@ static bool test_RestoreGUID_wronguser(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -936,8 +924,6 @@ static bool test_RestoreGUID_v3(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -956,8 +942,6 @@ static bool test_RestoreGUID_v3(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -970,8 +954,6 @@ static bool test_RestoreGUID(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -993,8 +975,6 @@ static bool test_RestoreGUID(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -1008,8 +988,6 @@ static bool test_RestoreGUID_badmagiconsecret(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -1027,8 +1005,6 @@ static bool test_RestoreGUID_badmagiconsecret(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -1040,8 +1016,6 @@ static bool test_RestoreGUID_emptyrequest(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -1061,8 +1035,6 @@ static bool test_RestoreGUID_emptyrequest(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -1076,8 +1048,6 @@ static bool test_RestoreGUID_badcertguid(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -1102,8 +1072,6 @@ static bool test_RestoreGUID_badcertguid(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -1117,8 +1085,6 @@ static bool test_RestoreGUID_badmagicaccesscheck(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -1136,8 +1102,6 @@ static bool test_RestoreGUID_badmagicaccesscheck(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -1151,8 +1115,6 @@ static bool test_RestoreGUID_badhashaccesscheck(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
b6b438
@@ -1170,8 +1132,6 @@ static bool test_RestoreGUID_badhashaccesscheck(struct torture_context *tctx,
b6b438
 			NT_STATUS_ACCESS_DENIED, "Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -1187,8 +1147,6 @@ static bool test_RetrieveBackupKeyGUID_validate(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthType auth_type;
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	torture_assert(tctx, r != NULL, "test_RetrieveBackupKeyGUID_validate failed");
b6b438
 
b6b438
 	if (r == NULL) {
b6b438
@@ -1376,8 +1334,6 @@ static bool test_RetrieveBackupKeyGUID_validate(struct torture_context *tctx,
b6b438
 						"Get GUID");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
@@ -2091,8 +2047,6 @@ static bool test_ServerWrap_decrypt_wrong_stuff(struct torture_context *tctx,
b6b438
 	enum dcerpc_AuthLevel auth_level;
b6b438
 	ZERO_STRUCT(r);
b6b438
 
b6b438
-	gnutls_global_init();
b6b438
-
b6b438
 	dcerpc_binding_handle_auth_info(b, &auth_type, &auth_level);
b6b438
 
b6b438
 	/* Encrypt */
b6b438
@@ -2268,8 +2222,6 @@ static bool test_ServerWrap_decrypt_wrong_stuff(struct torture_context *tctx,
b6b438
 					  "decrypt should fail with WERR_INVALID_PARAMETER");
b6b438
 	}
b6b438
 
b6b438
-	gnutls_global_deinit();
b6b438
-
b6b438
 	return true;
b6b438
 }
b6b438
 
b6b438
-- 
b6b438
2.23.0
b6b438