Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Olm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nheko Reborn
Olm
Commits
a3e5beab
Commit
a3e5beab
authored
7 years ago
by
pik
Committed by
Richard van der Hoff
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add ed25519_verify to __init__.py and add test for ed25519_verify
Signed-off-by:
Alexander Maznev
<
alexander.maznev@gmail.com
>
parent
e632bc9e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python/olm/__init__.py
+1
-0
1 addition, 0 deletions
python/olm/__init__.py
python/olm/__main__.py
+10
-0
10 additions, 0 deletions
python/olm/__main__.py
python/test_olm.sh
+4
-0
4 additions, 0 deletions
python/test_olm.sh
with
15 additions
and
0 deletions
python/olm/__init__.py
+
1
−
0
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
This diff is collapsed.
Click to expand it.
python/olm/__main__.py
+
10
−
0
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
()
...
...
This diff is collapsed.
Click to expand it.
python/test_olm.sh
+
4
−
0
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
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