mirror of https://github.com/voidlizard/hbs2
Fix wrong deserialise call
This commit is contained in:
parent
feb9fdaa30
commit
6f9beb70e7
|
@ -122,4 +122,4 @@ mkEncryptedKey kr pk = EncryptedBox <$> Encrypt.boxSeal pk ((LBS.toStrict . seri
|
||||||
|
|
||||||
openEncryptedKey :: EncryptedBox -> KeyringEntry MerkleEncryptionType -> Maybe (KeyringEntry MerkleEncryptionType)
|
openEncryptedKey :: EncryptedBox -> KeyringEntry MerkleEncryptionType -> Maybe (KeyringEntry MerkleEncryptionType)
|
||||||
openEncryptedKey (EncryptedBox bs) kr =
|
openEncryptedKey (EncryptedBox bs) kr =
|
||||||
deserialise . LBS.fromStrict =<< Encrypt.boxSealOpen (_krPk kr) (_krSk kr) bs
|
either (const Nothing) Just . deserialiseOrFail . LBS.fromStrict =<< Encrypt.boxSealOpen (_krPk kr) (_krSk kr) bs
|
||||||
|
|
|
@ -230,7 +230,7 @@ runStore opts ss = do
|
||||||
& S.mapM (fmap LBS.fromStrict . Encrypt.boxSeal ((_krPk . encryptionKey) gk) . LBS.toStrict)
|
& S.mapM (fmap LBS.fromStrict . Encrypt.boxSeal ((_krPk . encryptionKey) gk) . LBS.toStrict)
|
||||||
|
|
||||||
mhash <- putAsMerkle ss encryptedChunks
|
mhash <- putAsMerkle ss encryptedChunks
|
||||||
mtree <- ((deserialise =<<) <$> getBlock ss (fromMerkleHash mhash))
|
mtree <- ((either (const Nothing) Just . deserialiseOrFail =<<) <$> getBlock ss (fromMerkleHash mhash))
|
||||||
`orDie` "merkle tree was not stored properly with `putAsMerkle`"
|
`orDie` "merkle tree was not stored properly with `putAsMerkle`"
|
||||||
|
|
||||||
mannh <- maybe (die "can not store MerkleAnn") pure
|
mannh <- maybe (die "can not store MerkleAnn") pure
|
||||||
|
|
Loading…
Reference in New Issue