summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-01-29 20:00:29 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2023-01-29 20:00:29 +0100
commita8893fbcfa06044e7f999916c4dcc6a2dc907f75 (patch)
treec315d9e86ea4a70aa51d7cf3383863fc4d4b4823 /src
parent55e4f8e861945cf9d32420cac612ebe5a9218f89 (diff)
Pairing: use empty record item for reject message
Diffstat (limited to 'src')
-rw-r--r--src/Pairing.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Pairing.hs b/src/Pairing.hs
index 3af3435..a264c42 100644
--- a/src/Pairing.hs
+++ b/src/Pairing.hs
@@ -21,7 +21,6 @@ import qualified Data.ByteArray as BA
import qualified Data.ByteString.Char8 as BC
import Data.Kind
import Data.Maybe
-import qualified Data.Text as T
import Data.Typeable
import Data.Word
@@ -83,7 +82,7 @@ instance Storable a => Storable (PairingService a) where
store' (PairingResponse x) = storeRec $ storeBinary "response" x
store' (PairingRequestNonce x) = storeRec $ storeBinary "reqnonce" x
store' (PairingAccept x) = store' x
- store' (PairingReject) = storeRec $ storeText "reject" ""
+ store' (PairingReject) = storeRec $ storeEmpty "reject"
load' = do
res <- loadRec $ do
@@ -92,7 +91,7 @@ instance Storable a => Storable (PairingService a) where
idRsp <- loadMbRef "id-rsp"
rsp <- loadMbBinary "response"
rnonce <- loadMbBinary "reqnonce"
- (rej :: Maybe T.Text) <- loadMbText "reject"
+ rej <- loadMbEmpty "reject"
return $ catMaybes
[ PairingRequest <$> idReq <*> idRsp <*> (refDigestFromByteString =<< req)
, PairingResponse <$> rsp