summaryrefslogtreecommitdiffstats
path: root/Auth
diff options
context:
space:
mode:
authortailor <harningt@gmail.com>2008-02-02 06:34:43 +0000
committertailor <harningt@gmail.com>2008-02-02 06:34:43 +0000
commiteaad8555902fdbd659e3a9121f6cde8ccab42236 (patch)
tree4078a3e2eb01bcc3d0923c365233f59ac60e5e94 /Auth
parentae4e3f1cf0c475373faef7fc9df5cf2c865affcd (diff)
downloadphp-openid-eaad8555902fdbd659e3a9121f6cde8ccab42236.zip
php-openid-eaad8555902fdbd659e3a9121f6cde8ccab42236.tar.gz
php-openid-eaad8555902fdbd659e3a9121f6cde8ccab42236.tar.bz2
[project @ support-hmacsha256]
Diffstat (limited to 'Auth')
-rw-r--r--Auth/OpenID/Association.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php
index 4d3ac33..d234294 100644
--- a/Auth/OpenID/Association.php
+++ b/Auth/OpenID/Association.php
@@ -82,9 +82,9 @@ class Auth_OpenID_Association {
* generated for this association.
*
* @param assoc_type This is the type of association this
- * instance represents. The only valid value of this field at
- * this time is 'HMAC-SHA1', but new types may be defined in the
- * future.
+ * instance represents. The only valid values of this field at
+ * this time is 'HMAC-SHA1' and 'HMAC-SHA256', but new types may
+ * be defined in the future.
*
* @return association An {@link Auth_OpenID_Association}
* instance.
@@ -119,9 +119,9 @@ class Auth_OpenID_Association {
* association was issued.
*
* @param string $assoc_type This is the type of association this
- * instance represents. The only valid value of this field at
- * this time is 'HMAC-SHA1', but new types may be defined in the
- * future.
+ * instance represents. The only valid values of this field at
+ * this time is 'HMAC-SHA1' and 'HMAC-SHA256', but new types may
+ * be defined in the future.
*/
function Auth_OpenID_Association(
$handle, $secret, $issued, $lifetime, $assoc_type)
@@ -258,6 +258,10 @@ class Auth_OpenID_Association {
function sign($pairs)
{
$kv = Auth_OpenID_KVForm::fromArray($pairs);
+ if(Auth_OpenID_HMACSHA256_SUPPORTED
+ && $this->assoc_type == 'HMAC-SHA256')
+ return Auth_OpenID_HMACSHA256($this->secret, $kv);
+ /* Invalid association types should be caught at constructor */
return Auth_OpenID_HMACSHA1($this->secret, $kv);
}