Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
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
Model registry
Operate
Environments
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
Show more breadcrumbs
gajim
gajim-plugins
Commits
7e77801a
Commit
7e77801a
authored
5 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
[omemo] Add back 12 byte IV read support for aesgcm links
parent
ab47492b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
omemo/file_crypto.py
+13
-4
13 additions, 4 deletions
omemo/file_crypto.py
with
13 additions
and
4 deletions
omemo/file_crypto.py
+
13
−
4
View file @
7e77801a
...
...
@@ -169,10 +169,19 @@ class FileDecryption:
raise
ValueError
(
'
Invalid fragment
'
)
fragment
=
binascii
.
unhexlify
(
fragment
)
key
=
fragment
[
16
:]
iv
=
fragment
[:
16
]
if
len
(
key
)
!=
32
or
len
(
iv
)
!=
16
:
raise
ValueError
(
'
Invalid fragment
'
)
size
=
len
(
fragment
)
# Clients started out with using a 16 byte IV but long term
# want to swtich to the more performant 12 byte IV
# We have to support both
if
size
==
48
:
key
=
fragment
[
16
:]
iv
=
fragment
[:
16
]
elif
size
==
44
:
key
=
fragment
[
12
:]
iv
=
fragment
[:
12
]
else
:
raise
ValueError
(
'
Invalid fragment size: %s
'
%
size
)
return
key
,
iv
@staticmethod
...
...
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