diff options
author | gregor herrmann <gregoa@debian.org> | 2012-01-20 16:05:22 +0100 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2012-01-20 16:05:22 +0100 |
commit | a7cfc1201709640a1edf1123325c32831c6113a2 (patch) | |
tree | d20a5d5fa1af017dbfe2ef876eca51b412408d09 | |
parent | a4f01a318bd8beecd6eeea8531433fb6cef76820 (diff) | |
parent | fa1dae99071d23ea8ba5f6f8dc755b48e837fe8d (diff) |
Merge commit 'upstream/2.01'
-rwxr-xr-x[-rw-r--r--] | Changes | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | MANIFEST | 0 | ||||
-rw-r--r-- | META.yml | 38 | ||||
-rwxr-xr-x[-rw-r--r--] | Makefile.PL | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | README | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | lib/Auth/Yubikey_WebClient.pm | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | t/00-load.t | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | t/pod-coverage.t | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | t/pod.t | 0 |
9 files changed, 32 insertions, 20 deletions
@@ -1,18 +1,26 @@ --- #YAML:1.0 -name: Auth-Yubikey_WebClient -version: 2.00 -abstract: Authenticating the Yubikey against the Yubico Web API -license: ~ -author: +name: Auth-Yubikey_WebClient +version: 2.01 +abstract: Authenticating the Yubikey against the Yubico Web API +author: - Phil Massyn <phil@massyn.net> -generated_by: ExtUtils::MakeMaker version 6.42 -distribution_type: module -requires: - Digest::HMAC_SHA1: 1 - LWP::Simple: 1 - MIME::Base64: 1 - Test::More: 0 - URI::Escape: 1 +license: unknown +distribution_type: module +configure_requires: + ExtUtils::MakeMaker: 0 +build_requires: + ExtUtils::MakeMaker: 0 +requires: + Digest::HMAC_SHA1: 1 + LWP::Simple: 1 + MIME::Base64: 1 + Test::More: 0 + URI::Escape: 1 +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.56 meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.3.html - version: 1.3 + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff --git a/Makefile.PL b/Makefile.PL index e67886f..e67886f 100644..100755 --- a/Makefile.PL +++ b/Makefile.PL diff --git a/lib/Auth/Yubikey_WebClient.pm b/lib/Auth/Yubikey_WebClient.pm index b4079dc..bd33832 100644..100755 --- a/lib/Auth/Yubikey_WebClient.pm +++ b/lib/Auth/Yubikey_WebClient.pm @@ -17,7 +17,7 @@ Version 2.00 =cut -our $VERSION = '2.00'; +our $VERSION = '2.01'; =head1 SYNOPSIS @@ -70,7 +70,10 @@ sub yubikey_webclient my $response = get("http://api2.yubico.com/wsapi/2.0/verify?$params"); + # sanitize the output in case we get some strange characters back + $response =~ s/\s//g; chomp($response); + if($response !~ /status=ok/i) { # If the status is not ok, let's not even go through the rest... @@ -98,7 +101,7 @@ sub yubikey_webclient delete $result{h}; my $datastring=''; - my $key; + my $key; foreach $key (sort keys %result) { $result{$key} =~ s/\s//g; @@ -106,8 +109,8 @@ sub yubikey_webclient } $datastring = substr($datastring,0,length($datastring)-1); - # Check that nonce and OTP are the ones we asked for - return "ERR_MSG_AUTH" unless ($nonce eq $result{nonce} and $otp eq $result{otp}); + # Check that nonce and OTP are the ones we asked for + return "ERR_MSG_AUTH" unless ($nonce eq $result{nonce} and $otp eq $result{otp}); my $hmac = encode_base64(hmac_sha1($datastring,decode_base64($api))); @@ -125,7 +128,7 @@ sub yubikey_webclient =head1 USAGE -Before you can use this module, you need to register for an API key at Yubico. This is as simple as logging onto <https://api.yubico.com/yms/getapi.php> and entering your Yubikey's OTP and a brief description. Once you have the API and ID, you need to provide those details to the module to work. +Before you can use this module, you need to register for an API key at Yubico. This is as simple as logging onto <https://upgrade.yubico.com/getapikey/> and entering your Yubikey's OTP and a brief description. Once you have the API and ID, you need to provide those details to the module to work. =head1 AUTHOR @@ -174,6 +177,7 @@ L<http://search.cpan.org/dist/Auth-Yubikey_WebClient> 0.04 - Fixed bug L<http://rt.cpan.org/Public/Bug/Display.html?id=51121> 1.00 - Added validation of the request to Yubico (Thanks to Kirill Miazine) 2.00 - Added nounce coding (Thanks to Ludvig af Klinteberg) +2.01 - Response turning into an array due to \r bug (Thanks to Peter Norin) =head1 ACKNOWLEDGEMENTS diff --git a/t/00-load.t b/t/00-load.t index 1676cc3..1676cc3 100644..100755 --- a/t/00-load.t +++ b/t/00-load.t diff --git a/t/pod-coverage.t b/t/pod-coverage.t index fc40a57..fc40a57 100644..100755 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t |