From 52986b153324d78a9cc3d79401f9ddaac8dde18f Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 06:55:18 +0000 Subject: [PATCH] fix(OSQUERY-002-2): non-Windows bitlocker stubs silently succeed instead of returning Status/error indicating no-op --- orbit/pkg/bitlocker/bitlocker_worker_notwindows.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/orbit/pkg/bitlocker/bitlocker_worker_notwindows.go b/orbit/pkg/bitlocker/bitlocker_worker_notwindows.go index 3d8a801dd0f..d87126622e8 100644 --- a/orbit/pkg/bitlocker/bitlocker_worker_notwindows.go +++ b/orbit/pkg/bitlocker/bitlocker_worker_notwindows.go @@ -2,6 +2,12 @@ package bitlocker +import "errors" + +// ErrNotSupported is returned by COMWorker methods on non-Windows platforms +// to indicate that BitLocker operations are not supported on this platform. +var ErrNotSupported = errors.New("bitlocker: not supported on this platform") + // COMWorker is a no-op on non-Windows platforms. type COMWorker struct{} @@ -12,10 +18,10 @@ func NewCOMWorker() (*COMWorker, error) { return &COMWorker{}, nil } func (w *COMWorker) Close() {} // GetEncryptionStatus is a no-op on non-Windows platforms. -func (w *COMWorker) GetEncryptionStatus() ([]VolumeStatus, error) { return nil, nil } +func (w *COMWorker) GetEncryptionStatus() ([]VolumeStatus, error) { return nil, ErrNotSupported } // EncryptVolume is a no-op on non-Windows platforms. -func (w *COMWorker) EncryptVolume(string) (string, error) { return "", nil } +func (w *COMWorker) EncryptVolume(string) (string, error) { return "", ErrNotSupported } // RotateRecoveryKey is a no-op on non-Windows platforms. -func (w *COMWorker) RotateRecoveryKey(string) (string, error) { return "", nil } +func (w *COMWorker) RotateRecoveryKey(string) (string, error) { return "", ErrNotSupported }