Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
a3e5beab
Commit
a3e5beab
authored
Apr 22, 2017
by
pik
Committed by
Richard van der Hoff
Apr 24, 2017
Browse files
Add ed25519_verify to __init__.py and add test for ed25519_verify
Signed-off-by:
Alexander Maznev
<
alexander.maznev@gmail.com
>
parent
e632bc9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
python/olm/__init__.py
View file @
a3e5beab
...
...
@@ -2,3 +2,4 @@ from .account import Account
from
.session
import
Session
from
.outbound_group_session
import
OutboundGroupSession
from
.inbound_group_session
import
InboundGroupSession
from
.utility
import
ed25519_verify
python/olm/__main__.py
View file @
a3e5beab
...
...
@@ -312,6 +312,8 @@ def build_arg_parser():
)
export_inbound_group
.
set_defaults
(
func
=
do_export_inbound_group
)
ed25519_verify
=
commands
.
add_parser
(
"ed25519_verify"
,
help
=
"Verify an ed25519 signature"
)
ed25519_verify
.
set_defaults
(
func
=
do_verify_ed25519_signature
)
return
parser
def
do_outbound_group
(
args
):
...
...
@@ -390,6 +392,14 @@ def do_export_inbound_group(args):
index
=
session
.
first_known_index
()
args
.
export_file
.
write
(
session
.
export_session
(
index
))
def
do_verify_ed25519_signature
(
args
):
account
=
Account
()
account
.
create
()
message
=
"A Message"
.
encode
(
"ASCII"
)
ed25519_key
=
account
.
identity_keys
()[
"ed25519"
].
encode
(
"utf-8"
)
signature
=
account
.
sign
(
message
)
ed25519_verify
(
ed25519_key
,
message
,
signature
)
if
__name__
==
'__main__'
:
parser
=
build_arg_parser
()
args
=
parser
.
parse_args
()
...
...
python/test_olm.sh
View file @
a3e5beab
...
...
@@ -37,3 +37,7 @@ $OLM group_decrypt $BOB_GROUP_SESSION group_message
$OLM
export_inbound_group
$BOB_GROUP_SESSION
|
$OLM
import_inbound_group
$CHARLIE_GROUP_SESSION
$OLM
group_decrypt
$CHARLIE_GROUP_SESSION
group_message
### Utility
$OLM
ed25519_verify
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