summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin.von.loewis <devnull@localhost>2010-07-22 22:15:18 +0000
committermartin.von.loewis <devnull@localhost>2010-07-22 22:15:18 +0000
commit54969784870d40c0fcb2a59c9e85ed498bc78b23 (patch)
treeada5ed671c7a7bf1d69c1555f20553204dea66ef
parent4b69840805e0ba6d9750747351759d36093b57f2 (diff)
downloaddecorator-54969784870d40c0fcb2a59c9e85ed498bc78b23.tar.gz
Incorporate bug fixes from upstream.
-rw-r--r--openid2rp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/openid2rp.py b/openid2rp.py
index 63bb815..b1a9552 100644
--- a/openid2rp.py
+++ b/openid2rp.py
@@ -151,7 +151,7 @@ class OpenIDParser(htmllib.HTMLParser):
def do_meta(self, attrs):
attrs = dict(attrs)
# Yadis 6.2.5 option 1: meta tag
- if attrs['http-equiv'].lower() == 'x-xrds-location':
+ if attrs.get('http-equiv','').lower() == 'x-xrds-location':
self.xrds_location = attrs['content']
def discover(url):
@@ -340,6 +340,9 @@ def associate(services, url):
if 'error' in data:
raise ValueError, "associate failed: "+data['error']
if url.startswith('http:'):
+ enc_mac_key = data.get('enc_mac_key')
+ if not enc_mac_key:
+ raise ValueError, "Provider protocol error: not using DH-SHA1"
enc_mac_key = base64.b64decode(data['enc_mac_key'])
dh_server_public = unbtwoc(base64.b64decode(data['dh_server_public']))
# shared secret: sha1(2^(server_priv*priv) mod prime) xor enc_mac_key