# HG changeset patch # User Dan # Date 1235683986 18000 # Node ID 73aecd46bb56e59a49654233dad2459aaa402114 # Parent d0fe7acaf0e87a491ac0bb2b1f0fddd878f032b4 Should work with Yubico's official server now - forgot to account for newlines. diff -r d0fe7acaf0e8 -r 73aecd46bb56 plugins/yubikey/corelib.php --- a/plugins/yubikey/corelib.php Thu Feb 26 11:30:17 2009 -0500 +++ b/plugins/yubikey/corelib.php Thu Feb 26 16:33:06 2009 -0500 @@ -85,8 +85,7 @@ ); } $response = trim($response); - $response_nosig = preg_replace('/^h=(.+?)$/m', '', $response); - if ( !preg_match_all('/^([a-z0-9_]+)=(.*?)$/m', $response, $matches) ) + if ( !preg_match_all('/^([a-z0-9_]+)=(.*?)\r?$/m', $response, $matches) ) { return array( 'success' => false, @@ -145,8 +144,6 @@ static $api_key = false; ksort($arr); - if ( isset($arr['h']) ) - unset($arr['h']); if ( !$api_key ) { @@ -154,6 +151,9 @@ $api_key = hexencode(base64_decode($api_key), '', ''); } + if ( isset($arr['h']) ) + unset($arr['h']); + $req = array(); foreach ( $arr as $key => $val ) {