]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbXsrv_session: let smbXsrv_session_global_verify_record() use talloc_keep_secret...
authorStefan Metzmacher <metze@samba.org>
Fri, 5 Mar 2021 16:50:47 +0000 (17:50 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 17 Mar 2021 00:49:32 +0000 (00:49 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14512

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smbXsrv_session.c

index dd7f6fa5e2d389d222d8288a682e2dfcdbc9562e..c3aa0ee26cb06a241b32a5d25511c42cc7082e23 100644 (file)
@@ -872,6 +872,23 @@ static void smbXsrv_session_global_verify_record(struct db_record *db_rec,
 
        global = global_blob.info.info0;
 
+#define __BLOB_KEEP_SECRET(__blob) do { \
+       if ((__blob).length != 0) { \
+               talloc_keep_secret((__blob).data); \
+       } \
+} while(0)
+       {
+               uint32_t i;
+               __BLOB_KEEP_SECRET(global->application_key);
+               __BLOB_KEEP_SECRET(global->signing_key_blob);
+               __BLOB_KEEP_SECRET(global->encryption_key_blob);
+               __BLOB_KEEP_SECRET(global->decryption_key_blob);
+               for (i = 0; i < global->num_channels; i++) {
+                       __BLOB_KEEP_SECRET(global->channels[i].signing_key_blob);
+               }
+       }
+#undef __BLOB_KEEP_SECRET
+
        exists = serverid_exists(&global->channels[0].server_id);
        if (!exists) {
                struct server_id_buf idbuf;