s4:torture: check for pac_blob==NULL in test_generate_session_info_pac() functions
authorStefan Metzmacher <metze@samba.org>
Fri, 24 Dec 2021 14:21:21 +0000 (15:21 +0100)
committerJoseph Sutton <jsutton@samba.org>
Mon, 17 Jan 2022 20:05:32 +0000 (20:05 +0000)
We should return an error instead of crashing for tickets without a PAC.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
source4/torture/krb5/kdc-canon-heimdal.c
source4/torture/rpc/remote_pac.c
source4/torture/winbind/winbind.c

index ae31b6fd97330f8945837e1ea37556621d804693..a042d9d2a5fb7bb5d5e2b3c78dae48d76570c235 100644 (file)
@@ -98,6 +98,11 @@ static NTSTATUS test_generate_session_info_pac(struct auth4_context *auth_ctx,
        TALLOC_CTX *tmp_ctx;
        struct pac_data *pac_data;
 
+       if (pac_blob == NULL) {
+               DBG_ERR("pac_blob missing\n");
+               return NT_STATUS_NO_IMPERSONATION_TOKEN;
+       }
+
        tmp_ctx = talloc_named(mem_ctx, 0, "gensec_gssapi_session_info context");
        NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
 
index 16249799e3695be6232cac844fe5a2fd1ef4db99..4744f48aba4a5e73fea1cb66e4a649072020f6d0 100644 (file)
@@ -68,6 +68,11 @@ static NTSTATUS test_generate_session_info_pac(struct auth4_context *auth_ctx,
        TALLOC_CTX *tmp_ctx;
        struct pac_data *pac_data;
 
+       if (pac_blob == NULL) {
+               DBG_ERR("pac_blob missing\n");
+               return NT_STATUS_NO_IMPERSONATION_TOKEN;
+       }
+
        tmp_ctx = talloc_named(mem_ctx, 0, "gensec_gssapi_session_info context");
        NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
 
index 0675d46e21e2507b2bc066d64a14559287269a68..aa47638edecbdebad076bdff00d5e9d8c6704c5a 100644 (file)
@@ -54,6 +54,11 @@ static NTSTATUS test_generate_session_info_pac(struct auth4_context *auth_ctx,
        TALLOC_CTX *tmp_ctx;
        struct pac_data *pac_data;
 
+       if (pac_blob == NULL) {
+               DBG_ERR("pac_blob missing\n");
+               return NT_STATUS_NO_IMPERSONATION_TOKEN;
+       }
+
        tmp_ctx = talloc_named(mem_ctx, 0, "gensec_gssapi_session_info context");
        NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);