Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tahoe-ssk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
PrivateStorage
tahoe-ssk
Commits
77e27cab
Commit
77e27cab
authored
2 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
replace the last fromIntegral from Share.hs
parent
740b0f73
No related branches found
No related tags found
1 merge request
!7
Implement enough encryption and encoding to be able to read plaintext from Tahoe-LAFS-generated SDMF shares
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Tahoe/SDMF/Internal/Share.hs
+5
-1
5 additions, 1 deletion
src/Tahoe/SDMF/Internal/Share.hs
with
5 additions
and
1 deletion
src/Tahoe/SDMF/Internal/Share.hs
+
5
−
1
View file @
77e27cab
...
...
@@ -13,6 +13,7 @@ import Data.Binary.Put (putByteString, putLazyByteString, putWord16be, putWord32
import
qualified
Data.ByteArray
as
ByteArray
import
qualified
Data.ByteString
as
B
import
qualified
Data.ByteString.Lazy
as
LB
import
Data.Int
(
Int64
)
import
Data.Word
(
Word16
,
Word32
,
Word64
,
Word8
)
import
Data.X509
(
PrivKey
(
PrivKeyRSA
),
PubKey
(
PubKeyRSA
))
import
Tahoe.CHK.Merkle
(
MerkleTree
,
leafHashes
)
...
...
@@ -183,7 +184,10 @@ instance Binary Share where
shareSignature
<-
getByteString
(
from
$
hashChainOffset
-
signatureOffset
)
shareHashChain
<-
isolate
(
from
$
blockHashTreeOffset
-
hashChainOffset
)
get
shareBlockHashTree
<-
isolate
(
from
$
shareDataOffset
-
blockHashTreeOffset
)
get
shareData
<-
getLazyByteString
(
fromIntegral
encryptedPrivateKeyOffset
-
fromIntegral
shareDataOffset
)
blockLength
<-
tryInto
@
Int64
"Binary.get Share could not represent share block length"
(
encryptedPrivateKeyOffset
-
into
@
Word64
shareDataOffset
)
shareData
<-
getLazyByteString
blockLength
keyBytesLength
<-
tryInto
@
Int
"Binary.get Share cannot represent private key length"
(
eofOffset
-
encryptedPrivateKeyOffset
)
shareEncryptedPrivateKey
<-
getByteString
keyBytesLength
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment