s4:torture: Remove calls to gnutls_global_(de)init() in backupkey test
authorAndreas Schneider <asn@samba.org>
Wed, 13 Nov 2019 13:01:46 +0000 (14:01 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 14 Nov 2019 08:01:44 +0000 (08:01 +0000)
This is handled by the gnutls library constructor/destructor.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/rpc/backupkey.c

index b955f933430645b3da2997b4405b1f37d0243fda..284488f84ead365f695db3d5e256d1851d0b4b75 100644 (file)
@@ -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;
 }