From 17c86f8b57722bfecfca5626d59ef18e4f6885b1 Mon Sep 17 00:00:00 2001 From: Calle Wilund Date: Wed, 15 Jan 2025 13:03:29 +0000 Subject: [PATCH] encryption: Fix encrypted components mask check in describe Fixes #22401 In the fix for scylladb/scylla-enterprise#892, the extraction and check for sstable component encryption mask was copied to a subroutine for description purposes, but a very important 1 << shift was somehow left on the floor. Without this, the check for whether we actually contain a component encrypted can be wholly broken for some components. Closes scylladb/scylladb#22398 (cherry picked from commit 7db14420b7b86a5e0ea5923d532b9b7e66fb3004) Closes scylladb/scylladb#22599 --- ent/encryption/encryption.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ent/encryption/encryption.cc b/ent/encryption/encryption.cc index c295473880..07f2db63fa 100644 --- a/ent/encryption/encryption.cc +++ b/ent/encryption/encryption.cc @@ -660,7 +660,7 @@ public: sstables::component_type::Statistics, sstables::component_type::TemporaryStatistics, }) { - if (mask & int(c)) { + if (mask & (1 << int(c))) { ccs.emplace_back(c); } }