diff --git a/debian/control b/debian/control index 585d6d6a419feae621a7dc5182c20d85919c4529..29e75ba663518628a6312147e1094332cde4b0e7 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,6 @@ Build-Depends: debhelper (>= 10), Build-Depends-Indep: fonts-urw-base35 | gsfonts , libapache-session-perl , libauth-yubikey-webclient-perl , - libauthen-oath-perl , libauthen-radius-perl , libcache-cache-perl , libclass-xsaccessor-perl , diff --git a/lemonldap-ng-portal/t/35-REST-sessions-with-AuthBasic-handler-with-2FA.t b/lemonldap-ng-portal/t/35-REST-sessions-with-AuthBasic-handler-with-2FA.t index 58282c66c657f614c95acf179b311965ad2ca6b7..86274e0090ea70cda7f04f0567083b63d6a9c52a 100644 --- a/lemonldap-ng-portal/t/35-REST-sessions-with-AuthBasic-handler-with-2FA.t +++ b/lemonldap-ng-portal/t/35-REST-sessions-with-AuthBasic-handler-with-2FA.t @@ -25,11 +25,6 @@ SKIP: { if ($@) { skip 'Convert::Base32 is missing', $maintests; } - eval { require Authen::OATH }; - if ($@) { - skip 'Authen::OATH is missing', $maintests; - } - ok( $p = issuer(), 'Issuer portal' ); # BEGIN TESTS diff --git a/lemonldap-ng-portal/t/38-No-persistent-session.t b/lemonldap-ng-portal/t/38-No-persistent-session.t index b245c2003f0690844de45a604c80f1caec869039..06e24dcd28001fd298ceaf31c196f05ea4251d03 100644 --- a/lemonldap-ng-portal/t/38-No-persistent-session.t +++ b/lemonldap-ng-portal/t/38-No-persistent-session.t @@ -11,10 +11,6 @@ SKIP: { if ($@) { skip 'Convert::Base32 is missing', $maintests; } - eval { require Authen::OATH }; - if ($@) { - skip 'Authen::OATH is missing', $maintests; - } require Lemonldap::NG::Common::TOTP; my $client = LLNG::Manager::Test->new( diff --git a/lemonldap-ng-portal/t/70-2F-TOTP-8-with-global-storage.t b/lemonldap-ng-portal/t/70-2F-TOTP-8-with-global-storage.t index e9e28f565dc98de5ae921940761b0999a93b15d8..5b67e2cb6d7dfeeea0ce81df83cfe72c0ff46351 100644 --- a/lemonldap-ng-portal/t/70-2F-TOTP-8-with-global-storage.t +++ b/lemonldap-ng-portal/t/70-2F-TOTP-8-with-global-storage.t @@ -4,17 +4,13 @@ use strict; use IO::String; require 't/test-lib.pm'; -my $maintests = 28; +my $maintests = 26; SKIP: { eval { require Convert::Base32 }; if ($@) { skip 'Convert::Base32 is missing', $maintests; } - eval { require Authen::OATH }; - if ($@) { - skip 'Authen::OATH is missing', $maintests; - } require Lemonldap::NG::Common::TOTP; my $client = LLNG::Manager::Test->new( @@ -132,16 +128,9 @@ SKIP: { expectForm( $res, undef, '/totp2fcheck', 'token' ); # Generate TOTP with LLNG - my $totp; - ok( $totp = Lemonldap::NG::Common::TOTP::_code( undef, $key, 0, 30, 8 ), + ok( $code = Lemonldap::NG::Common::TOTP::_code( undef, $key, 0, 30, 8 ), 'LLNG Code' ); - # Generate TOTP with an external application to validate LLNG TOTP formula - my $oath = Authen::OATH->new( digits => 8 ); - ok( $code = $oath->totp($key), 'Ext. App Code' ); - ok( $code == $totp, 'Both TOTP match' ) - or explain( [ $code, $totp ], 'LLNG and Ext. App TOTP mismatch' ); - $query =~ s/code=/code=$code/; ok( $res = $client->_post( @@ -173,7 +162,7 @@ SKIP: { expectForm( $res, undef, '/totp2fcheck', 'token' ); # Generate TOTP with LLNG - ok( $totp = Lemonldap::NG::Common::TOTP::_code( undef, $key, 0, 30, 8 ), + ok( $code = Lemonldap::NG::Common::TOTP::_code( undef, $key, 0, 30, 8 ), 'LLNG Code' ); $query =~ s/code=/code=$code/; diff --git a/lemonldap-ng-portal/t/70-2F-TOTP-encryption.t b/lemonldap-ng-portal/t/70-2F-TOTP-encryption.t index ae4680011e3ae2e84b27198c056ff10f449cb3c4..832d9d32813938e2f82842d88ec4e0db17f9f4e0 100644 --- a/lemonldap-ng-portal/t/70-2F-TOTP-encryption.t +++ b/lemonldap-ng-portal/t/70-2F-TOTP-encryption.t @@ -5,17 +5,13 @@ use IO::String; use JSON qw/from_json to_json/; require 't/test-lib.pm'; -my $maintests = 31; +my $maintests = 29; SKIP: { eval { require Convert::Base32 }; if ($@) { skip 'Convert::Base32 is missing', $maintests; } - eval { require Authen::OATH }; - if ($@) { - skip 'Authen::OATH is missing', $maintests; - } require Lemonldap::NG::Common::TOTP; my $client = LLNG::Manager::Test->new( @@ -133,16 +129,9 @@ SKIP: { expectForm( $res, undef, '/totp2fcheck', 'token' ); # Generate TOTP with LLNG - my $totp; - ok( $totp = Lemonldap::NG::Common::TOTP::_code( undef, $key, 0, 30, 6 ), + ok( $code = Lemonldap::NG::Common::TOTP::_code( undef, $key, 0, 30, 6 ), 'LLNG Code' ); - # Generate TOTP with an external application to validate LLNG TOTP formula - my $oath = Authen::OATH->new( digits => 6 ); - ok( $code = $oath->totp($key), 'Ext. App Code' ); - ok( $code == $totp, 'Both TOTP match' ) - or explain( [ $code, $totp ], 'LLNG and Ext. App TOTP mismatch' ); - $query =~ s/code=/code=$code/; ok( $res = $client->_post( @@ -174,7 +163,7 @@ SKIP: { expectForm( $res, undef, '/totp2fcheck', 'token' ); # Generate TOTP with LLNG - ok( $totp = Lemonldap::NG::Common::TOTP::_code( undef, $key, 0, 30, 6 ), + ok( $code = Lemonldap::NG::Common::TOTP::_code( undef, $key, 0, 30, 6 ), 'LLNG Code' ); $query =~ s/code=/code=$code/; diff --git a/lemonldap-ng-portal/t/70-2F-TOTP-with-LDAP.t b/lemonldap-ng-portal/t/70-2F-TOTP-with-LDAP.t index 20e7858326a8faff3586d2b9266b216e17e53364..101be176e1124ef0378b49ae22d5dafe5e3ecab7 100644 --- a/lemonldap-ng-portal/t/70-2F-TOTP-with-LDAP.t +++ b/lemonldap-ng-portal/t/70-2F-TOTP-with-LDAP.t @@ -13,10 +13,6 @@ SKIP: { if ($@) { skip 'Convert::Base32 is missing', $maintests; } - eval { require Authen::OATH }; - if ($@) { - skip 'Authen::OATH is missing', $maintests; - } skip 'LLNGTESTLDAP is not set', $maintests unless ( $ENV{LLNGTESTLDAP} ); require 't/test-ldap.pm'; diff --git a/lemonldap-ng-portal/t/70-2F-TOTP-with-Range.t b/lemonldap-ng-portal/t/70-2F-TOTP-with-Range.t index 55e844f9691c30f0f6f12f0cfb775e605370e8f5..5aed989ae1cd73fc4a813bb82b19caed4cb83abc 100644 --- a/lemonldap-ng-portal/t/70-2F-TOTP-with-Range.t +++ b/lemonldap-ng-portal/t/70-2F-TOTP-with-Range.t @@ -13,10 +13,6 @@ SKIP: { if ($@) { skip 'Convert::Base32 is missing', $maintests; } - eval { require Authen::OATH }; - if ($@) { - skip 'Authen::OATH is missing', $maintests; - } require Lemonldap::NG::Common::TOTP; my $client = LLNG::Manager::Test->new( diff --git a/scripts/README.md b/scripts/README.md index f3fa8c30241d19dc4ebdf93130eba08d5a32efb6..35ffbd6c22777947a90833952e1b1e1497b2e523 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -14,7 +14,6 @@ LLNG team scripts ## Other tools * `testConfBackend.pl`: test a new configuration backend * `test-perf.pl`: little script to test Portal/Handler performance -* `totp-client.pl`: TOTP app to replace FreeOTP for TOTP tests * `run-ldap`: Launch an LDAP server (port 19389) and stop it when a key is pressed. It uses Portal test LDAP server. ## Old unmaintained scripts diff --git a/scripts/totp-client.pl b/scripts/totp-client.pl deleted file mode 100755 index 7d1a63e5dffd72a626bae650b2b998fbe5314f57..0000000000000000000000000000000000000000 --- a/scripts/totp-client.pl +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl -w - -use Authen::OATH; -use Convert::Base32 qw( decode_base32 ); - -unless ( $ARGV[0] ) { - print STDERR "Usage $0 \n"; - exit 1; -} - -my $oath = Authen::OATH->new(); -my $totp = $oath->totp( decode_base32( $ARGV[0] ) ); - -print "$totp\n"; - -1;