diff options
author | Joe Crayne <joe@jerkface.net> | 2018-11-28 22:09:02 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2018-12-16 14:08:26 -0500 |
commit | 92fce0499c05c609cba423ea02f5c61aa33c6915 (patch) | |
tree | c24d047d011c2c4c0b6bbd80f5ec16739b84baf2 /src | |
parent | e4bee438e49bd7eeab132f375398f9c6fe481c01 (diff) |
getPublicKey should not throw.
Diffstat (limited to 'src')
-rw-r--r-- | src/Crypto/Tox.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Crypto/Tox.hs b/src/Crypto/Tox.hs index bd4cdfba..d418f504 100644 --- a/src/Crypto/Tox.hs +++ b/src/Crypto/Tox.hs | |||
@@ -582,7 +582,8 @@ data TransportCrypto = TransportCrypto | |||
582 | } | 582 | } |
583 | 583 | ||
584 | getPublicKey :: S.Get PublicKey | 584 | getPublicKey :: S.Get PublicKey |
585 | getPublicKey = throwCryptoError . publicKey <$> S.getBytes 32 | 585 | getPublicKey = eitherCryptoError . publicKey <$> S.getBytes 32 |
586 | >>= either (fail . show) return | ||
586 | 587 | ||
587 | putPublicKey :: PublicKey -> S.Put | 588 | putPublicKey :: PublicKey -> S.Put |
588 | putPublicKey bs = S.putByteString $ BA.convert bs | 589 | putPublicKey bs = S.putByteString $ BA.convert bs |