1.1 --- a/WebStack/Helpers/Auth.py Wed Nov 25 20:12:52 2009 +0100
1.2 +++ b/WebStack/Helpers/Auth.py Fri Nov 27 01:58:47 2009 +0100
1.3 @@ -205,7 +205,7 @@
1.4
1.5 # NOTE: Using "safe" encoding to deal with Unicode plaintext.
1.6
1.7 - return plaintext + ":" + md5.md5(plaintext.encode("iso-8859-1") + secret_key).hexdigest()
1.8 + return plaintext + ":" + md5.md5(plaintext.encode("utf-8") + secret_key).hexdigest()
1.9
1.10 # OpenID token verification.
1.11 # NOTE: Add SHA256 usage for associations.
1.12 @@ -223,7 +223,7 @@
1.13
1.14 # NOTE: Using "safe" encoding to deal with Unicode plaintext.
1.15
1.16 - hash = hmac.new(secret_key, plaintext.encode("iso-8859-1"), sha1)
1.17 + hash = hmac.new(secret_key, plaintext.encode("utf-8"), sha1)
1.18 return base64.standard_b64encode(hash.digest())
1.19
1.20 def check_openid_signature(fields, secret_key):
2.1 --- a/WebStack/Resources/OpenIDLogin.py Wed Nov 25 20:12:52 2009 +0100
2.2 +++ b/WebStack/Resources/OpenIDLogin.py Fri Nov 27 01:58:47 2009 +0100
2.3 @@ -96,7 +96,11 @@
2.4
2.5 # Build an URL for returning to the application.
2.6
2.7 - url = trans.encode_url_without_query(fields["openid.return_to"][0]) + "?"
2.8 + url = fields["openid.return_to"][0]
2.9 + if "?" in url:
2.10 + url += "&"
2.11 + else:
2.12 + url += "?"
2.13
2.14 first = 1
2.15 for name, value in fields.items():
3.1 --- a/examples/Common/OpenIDLogin/__init__.py Wed Nov 25 20:12:52 2009 +0100
3.2 +++ b/examples/Common/OpenIDLogin/__init__.py Fri Nov 27 01:58:47 2009 +0100
3.3 @@ -41,6 +41,7 @@
3.4 StringResource("""
3.5 <html>
3.6 <head>
3.7 + <meta http-equiv="Content-Type" content="text/html; charset="iso-8859-1" />
3.8 <link rel="openid2.provider openid.server" href="%s/login" />
3.9 <link rel="openid2.local_id openid.delegate" href="badger" />
3.10 <title>Badger's Home Page</title>
3.11 @@ -54,6 +55,7 @@
3.12 StringResource(u"""
3.13 <html>
3.14 <head>
3.15 + <meta http-equiv="Content-Type" content="text/html; charset="iso-8859-1" />
3.16 <link rel="openid2.provider openid.server" href="%s/login" />
3.17 <link rel="openid2.local_id openid.delegate" href="זרו" />
3.18 <title>Home Page for זרו</title>
3.19 @@ -67,6 +69,7 @@
3.20 StringResource("""
3.21 <html>
3.22 <head>
3.23 + <meta http-equiv="Content-Type" content="text/html; charset="iso-8859-1" />
3.24 <link rel="openid2.provider openid.server" href="%s/login" />
3.25 <link rel="openid2.local_id openid.delegate" href="vole" />
3.26 <title>Vole's Home Page</title>