Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Vladislav Yarmak
gajim-plugins
Commits
cc04e3ac
Commit
cc04e3ac
authored
Jan 24, 2017
by
Philipp Hörist
Browse files
[omemo] Port omemoplugin changes from master
parent
a58ff4f6
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
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