Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
soledad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
leap
soledad
Commits
c5b7da7d
Verified
Commit
c5b7da7d
authored
7 years ago
by
Victor
Browse files
Options
Downloads
Patches
Plain Diff
[refactor] move preamble constant to its module
parent
a3d267e0
Branches
Branches containing commit
No related tags found
1 merge request
!172
Upstreaming blobs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/leap/soledad/client/_crypto.py
+4
-5
4 additions, 5 deletions
src/leap/soledad/client/_crypto.py
src/leap/soledad/common/blobs/preamble.py
+1
-0
1 addition, 0 deletions
src/leap/soledad/common/blobs/preamble.py
with
5 additions
and
5 deletions
src/leap/soledad/client/_crypto.py
+
4
−
5
View file @
c5b7da7d
...
...
@@ -90,7 +90,7 @@ from leap.soledad.common.blobs.preamble import InvalidPreambleException
from
leap.soledad.common.blobs.preamble
import
decode_preamble
from
leap.soledad.common.blobs.preamble
import
Preamble
from
leap.soledad.common.blobs.preamble
import
ENC_SCHEME
,
ENC_METHOD
from
leap.soledad.common.blobs.preamble
import
MAGIC
from
leap.soledad.common.blobs.preamble
import
MAGIC
,
PREAMBLE_SIZE
SECRET_LENGTH
=
64
...
...
@@ -543,8 +543,7 @@ def _ceiling(size):
def
get_unarmored_ciphertext_size
(
cleartext_size
):
# used for blobs stream up (so we can tell the server how much data we are
# sending before starting to encrypt the stream)
PREAMBLE_SIZE
=
736
# 552 urlsafe base64 encoded (it's always armored)
TAG_SIZE
=
16
SEPARATOR_SIZE
=
1
size
=
TAG_SIZE
+
PREAMBLE_SIZE
+
SEPARATOR_SIZE
tag_size
=
16
# AES-GCM 16-byte tag appended to ciphertext
separator_size
=
1
# space separating content from preamble
size
=
tag_size
+
PREAMBLE_SIZE
+
separator_size
return
cleartext_size
+
size
This diff is collapsed.
Click to expand it.
src/leap/soledad/common/blobs/preamble.py
+
1
−
0
View file @
c5b7da7d
...
...
@@ -36,6 +36,7 @@ LEGACY_PACMAN = struct.Struct('2sbbQ16s255p255p') # DEPRECATED
MAGIC
=
'
\x13\x37
'
ENC_SCHEME
=
namedtuple
(
'
SCHEME
'
,
'
symkey external
'
)(
1
,
2
)
ENC_METHOD
=
namedtuple
(
'
METHOD
'
,
'
aes_256_ctr aes_256_gcm pgp
'
)(
1
,
2
,
3
)
PREAMBLE_SIZE
=
736
# 552 urlsafe base64 encoded (it's always armored)
class
InvalidPreambleException
(
Exception
):
...
...
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