Skip to content

Commit 38b3974

Browse files
authored
Merge pull request #8 from LaurentRDC/vault-transit-fixups
Match encoding and decoding to UTF8
2 parents d79f9d7 + 4007f01 commit 38b3974

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vault-tool/src/Network/VaultTool/Transit.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import qualified Data.ByteString.Base64 as B64
3434
import qualified Data.ByteString.Char8 as C8
3535
import Data.Text (Text)
3636
import qualified Data.Text as T
37-
import Data.Text.Encoding (decodeLatin1, encodeUtf8)
37+
import Data.Text.Encoding (decodeUtf8, encodeUtf8)
3838
import GHC.Generics (Generic)
3939

4040
import Network.VaultTool.Internal (
@@ -110,7 +110,7 @@ encryptText :: VaultConnection Authenticated -> VaultMountedPath -> KeyName -> T
110110
encryptText conn path key = encryptByteString conn path key . encodeUtf8
111111

112112
decryptText :: VaultConnection Authenticated -> VaultMountedPath -> KeyName -> CipherText -> IO Text
113-
decryptText conn path key = fmap decodeLatin1 . decryptByteString conn path key
113+
decryptText conn path key = fmap decodeUtf8 . decryptByteString conn path key
114114

115115
newtype VaultCiphertext
116116
= VaultCiphertext {getCyphertext :: CipherText}

0 commit comments

Comments
 (0)