(t *testing.T)
| 477 | } |
| 478 | |
| 479 | func 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 | |
| 492 | func clearMasterKeyForTest() { |
| 493 | utils.ClearMasterKey() |
nothing calls this directly
no test coverage detected