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
cc04e3ac
Commit
cc04e3ac
authored
Jan 24, 2017
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[omemo] Port omemoplugin changes from master
parent
a58ff4f6
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1144 additions
and
887 deletions
+1144
-887
omemo/__init__.py
omemo/__init__.py
+1
-883
omemo/omemoplugin.py
omemo/omemoplugin.py
+1135
-0
omemo/xmpp.py
omemo/xmpp.py
+8
-4
No files found.
omemo/__init__.py
View file @
cc04e3ac
This diff is collapsed.
Click to expand it.
omemo/omemoplugin.py
0 → 100644
View file @
cc04e3ac
This diff is collapsed.
Click to expand it.
omemo/xmpp.py
View file @
cc04e3ac
...
...
@@ -79,10 +79,14 @@ class OmemoMessage(Node):
# , contact_jid, key, iv, payload, dev_id, my_dev_id):
Node
.
__init__
(
self
,
'encrypted'
,
attrs
=
{
'xmlns'
:
NS_OMEMO
})
header
=
Node
(
'header'
,
attrs
=
{
'sid'
:
msg_dict
[
'sid'
]})
for
rid
,
key
in
msg_dict
[
'keys'
].
items
():
header
.
addChild
(
'key'
,
attrs
=
{
'rid'
:
rid
}).
addData
(
b64encode
(
key
)
.
decode
(
'utf-8'
))
for
rid
,
(
key
,
prekey
)
in
msg_dict
[
'keys'
].
items
():
if
prekey
:
child
=
header
.
addChild
(
'key'
,
attrs
=
{
'prekey'
:
'true'
,
'rid'
:
rid
})
else
:
child
=
header
.
addChild
(
'key'
,
attrs
=
{
'rid'
:
rid
})
child
.
addData
(
b64encode
(
key
).
decode
(
'utf-8'
))
header
.
addChild
(
'iv'
).
addData
(
b64encode
(
msg_dict
[
'iv'
]).
decode
(
'utf-8'
))
self
.
addChild
(
node
=
header
)
self
.
addChild
(
'payload'
).
addData
(
b64encode
(
msg_dict
[
'payload'
])
...
...
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