MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestDecryptConfig_EncryptedButNoKey

Function TestDecryptConfig_EncryptedButNoKey

pkg/config/loader_test.go:479–490  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

477}
478
479func TestDecryptConfig_EncryptedButNoKey(t *testing.T) {
480 os.Unsetenv("TRYSSH_MASTER_KEY")
481 clearMasterKeyForTest()
482
483 // Config with encrypted content but no master key available — should error
484 conf := &MainConfig{}
485 conf.Main.Passwords = []string{"enc:AAAAAA=="}
486
487 err := decryptConfig(conf)
488 assert.Error(t, err)
489 assert.Contains(t, err.Error(), "no master key")
490}
491
492func clearMasterKeyForTest() {
493 utils.ClearMasterKey()

Callers

nothing calls this directly

Calls 2

clearMasterKeyForTestFunction · 0.85
decryptConfigFunction · 0.85

Tested by

no test coverage detected