Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gajim-plugins
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim-plugins
Commits
e06b95c0
Commit
e06b95c0
authored
Aug 07, 2017
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[url_image_preview] Support 12bit IVs
Support 12bit IVs on encrypted httpupload files
parent
4dac406c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
url_image_preview/url_image_preview.py
url_image_preview/url_image_preview.py
+11
-11
No files found.
url_image_preview/url_image_preview.py
View file @
e06b95c0
...
...
@@ -19,6 +19,7 @@ import gtk
import
gobject
import
os
import
hashlib
import
binascii
from
urlparse
import
urlparse
from
io
import
BytesIO
import
shutil
...
...
@@ -198,18 +199,17 @@ class Base(object):
key
=
''
iv
=
''
encrypted
=
False
if
len
(
urlparts
.
fragment
):
fragment
=
[]
try
:
for
i
in
range
(
0
,
len
(
urlparts
.
fragment
),
2
):
fragment
.
append
(
chr
(
int
(
urlparts
.
fragment
[
i
:
i
+
2
],
16
)))
fragment
=
''
.
join
(
fragment
)
key
=
fragment
[
16
:]
iv
=
fragment
[:
16
]
if
len
(
key
)
==
32
and
len
(
iv
)
==
16
:
if
urlparts
.
fragment
:
fragment
=
binascii
.
unhexlify
(
urlparts
.
fragment
)
key
=
fragment
[
16
:]
iv
=
fragment
[:
16
]
if
len
(
key
)
==
32
and
len
(
iv
)
==
16
:
encrypted
=
True
if
not
encrypted
:
key
=
fragment
[
12
:]
iv
=
fragment
[:
12
]
if
len
(
key
)
==
32
and
len
(
iv
)
==
12
:
encrypted
=
True
except
:
pass
# file exists but thumbnail got deleted
if
os
.
path
.
exists
(
filepath
)
and
not
os
.
path
.
exists
(
thumbpath
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment