Skip to contentSkip to conversation

nvme/63: fixup tls_key encryption check

PATCH Applied Wilfred Mallawa 2 participants 2 messages May 8, 2025 – May 15, 2025 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme/63: fixup tls_key encryption check

From: Wilfred Mallawa <[email protected]>

The _nvme_ctrl_tls_key function returns 0 if tls_key exists in sysfs for the respective nvme controller. This will be evaluated as true. However, the test should error only if the key is not exposed by sysfs. Which would mean the connection is not encrypted, as per the existing warning message in the test. Currently, we are checking that it exists and erroring out incorrectly. This patch fixes the above.

Fixes 9aa2023312bf ("nvme: add testcase for secure concatenation")
---
 tests/nvme/063 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/nvme/063 +1 -1
index 7477078..5bfe8be 100755
@@ -93,7 +93,7 @@ test() {
 	_nvme_connect_subsys --dhchap-secret "${hostkey}" --concat
 
 	ctrl=$(_find_nvme_dev "${def_subsysnqn}")
-	if _nvme_ctrl_tls_key "$ctrl" > /dev/null ; then
+	if ! _nvme_ctrl_tls_key "$ctrl" > /dev/null ; then
 		echo "WARNING: connection is not encrypted"
 		_systemctl_stop
 		return 1
Signature · 1 line
2.49.0
#1 lore raw
Quoted 9 lines · Wilfred Mallawa

From: Wilfred Mallawa <[email protected]>

The _nvme_ctrl_tls_key function returns 0 if tls_key exists in sysfs for the respective nvme controller. This will be evaluated as true. However, the test should error only if the key is not exposed by sysfs. Which would mean the connection is not encrypted, as per the existing warning message in the test. Currently, we are checking that it exists and erroring out incorrectly. This patch fixes the above.

Quoted 3 lines
Fixes 9aa2023312bf ("nvme: add testcase for secure concatenation")

I applied it. Thanks!