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

Function TestDecrypt_TruncatedCiphertext

pkg/utils/crypto_test.go:55–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53}
54
55func TestDecrypt_TruncatedCiphertext(t *testing.T) {
56 key := make([]byte, 32)
57
58 // "AAAAAA==" decodes to 4 bytes, which is less than the 12-byte AES-GCM nonce size.
59 // This tests the "ciphertext too short" error path.
60 _, err := Decrypt("enc:AAAAAA==", key)
61 assert.Error(t, err)
62}
63
64func TestDecrypt_WrongKey(t *testing.T) {
65 key1 := make([]byte, 32)

Callers

nothing calls this directly

Calls 1

DecryptFunction · 0.85

Tested by

no test coverage detected