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