Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Maunium
synapse
Commits
0e97284d
Unverified
Commit
0e97284d
authored
5 years ago
by
Amber Brown
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove & changelog (#5548)
parent
3eb8c7b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/5548.misc
+1
-0
1 addition, 0 deletions
changelog.d/5548.misc
scripts-dev/check_event_hash.py
+0
-54
0 additions, 54 deletions
scripts-dev/check_event_hash.py
with
1 addition
and
54 deletions
changelog.d/5548.misc
0 → 100644
+
1
−
0
View file @
0e97284d
Remove non-functioning check_event_hash.py dev script.
This diff is collapsed.
Click to expand it.
scripts-dev/check_event_hash.py
deleted
100644 → 0
+
0
−
54
View file @
3eb8c7b0
import
argparse
import
hashlib
import
json
import
logging
import
sys
from
unpaddedbase64
import
encode_base64
from
synapse.crypto.event_signing
import
(
check_event_content_hash
,
compute_event_reference_hash
,
)
class
dictobj
(
dict
):
def
__init__
(
self
,
*
args
,
**
kargs
):
dict
.
__init__
(
self
,
*
args
,
**
kargs
)
self
.
__dict__
=
self
def
get_dict
(
self
):
return
dict
(
self
)
def
get_full_dict
(
self
):
return
dict
(
self
)
def
get_pdu_json
(
self
):
return
dict
(
self
)
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
input_json
"
,
nargs
=
"
?
"
,
type
=
argparse
.
FileType
(
"
r
"
),
default
=
sys
.
stdin
)
args
=
parser
.
parse_args
()
logging
.
basicConfig
()
event_json
=
dictobj
(
json
.
load
(
args
.
input_json
))
algorithms
=
{
"
sha256
"
:
hashlib
.
sha256
}
for
alg_name
in
event_json
.
hashes
:
if
check_event_content_hash
(
event_json
,
algorithms
[
alg_name
]):
print
(
"
PASS content hash %s
"
%
(
alg_name
,))
else
:
print
(
"
FAIL content hash %s
"
%
(
alg_name
,))
for
algorithm
in
algorithms
.
values
():
name
,
h_bytes
=
compute_event_reference_hash
(
event_json
,
algorithm
)
print
(
"
Reference hash %s: %s
"
%
(
name
,
encode_base64
(
h_bytes
)))
if
__name__
==
"
__main__
"
:
main
()
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