https://reisub.nsupdate.info/git
/
relay.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42ad51e
)
http signatures: handle fetch_actor_key failure more gracefully
author
kaniini
<kaniini@dereferenced.org>
Wed, 31 Oct 2018 02:12:35 +0000
(
02:12
+0000)
committer
kaniini
<kaniini@dereferenced.org>
Wed, 31 Oct 2018 02:12:35 +0000
(
02:12
+0000)
relay/http_signatures.py
patch
|
blob
|
history
diff --git
a/relay/http_signatures.py
b/relay/http_signatures.py
index
683fe77
..
6ccdd65
100644
(file)
--- a/
relay/http_signatures.py
+++ b/
relay/http_signatures.py
@@
-60,11
+60,14
@@
def sign_headers(headers, key, key_id):
async def fetch_actor_key(actor):
actor_data = await fetch_actor(actor)
+ if not actor_data:
+ return None
+
if 'publicKey' not in actor_data:
-
return None
+ return None
if 'publicKeyPem' not in actor_data['publicKey']:
-
return None
+ return None
return RSA.importKey(actor_data['publicKey']['publicKeyPem'])