diff --git a/tests/aux/ldap.pl b/tests/aux/ldap.pl index 6d854e6..1fad4a4 100755 --- a/tests/aux/ldap.pl +++ b/tests/aux/ldap.pl @@ -43,7 +43,8 @@ use constant RESULT_OK => { }; my %objects = ( - 'uid=foo,ou=users,dc=example,dc=com' => 'vvincredible', + 'uid=foo,ou=users,dc=example,dc=com' => ['vvincredible'], + 'uid=test,ou=users,dc=example,dc=com' =>['cccccccfhcbe', 'ccccccbchvth'], ); sub bind { @@ -62,7 +63,7 @@ sub search { my $entry = Net::LDAP::Entry->new; $entry->dn($base); $entry->add(objectClass => [ "person" ]); - $entry->add(yubiKeyId => [ $id ]); + $entry->add(yubiKeyId => $id); push @entries, $entry; } return RESULT_OK, @entries; diff --git a/tests/aux/ykval.pl b/tests/aux/ykval.pl index 8047724..bc64da1 100755 --- a/tests/aux/ykval.pl +++ b/tests/aux/ykval.pl @@ -35,6 +35,7 @@ use warnings; my %otps = ( 'vvincredibletrerdegkkrkkneieultcjdghrejjbckh' => 'OK', 'vvincrediblltrerdegkkrkkneieultcjdghrejjbckh' => 'OK', + 'ccccccbchvthlivuitriujjifivbvtrjkjfirllluurj' => 'OK', ); my $port = shift; diff --git a/tests/pam_test.c b/tests/pam_test.c index eac1ab7..e6590b1 100644 --- a/tests/pam_test.c +++ b/tests/pam_test.c @@ -51,6 +51,7 @@ static struct data { {"bar", "vvincredibletrerdegkkrkkneieultcjdghrejjbckh"}, {"foo", "vvincrediblltrerdegkkrkkneieultcjdghrejjbckh"}, {"foo", "vvincredibletrerdegkkrkkneieultcjdghrejjbckl"}, + {"test", "ccccccbchvthlivuitriujjifivbvtrjkjfirllluurj"}, }; @@ -192,6 +193,10 @@ static int test_authenticate_ldap_fail2(void) { return pam_sm_authenticate(2, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg); } +static int test_authenticate_ldap2(void) { + return pam_sm_authenticate(4, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg); +} + static pid_t run_mock(const char *port, const char *type) { pid_t pid = fork(); if(pid == 0) { @@ -245,6 +250,10 @@ int main(void) { ret = 8; goto out; } + if(test_authenticate_ldap2() != PAM_SUCCESS) { + ret = 9; + goto out; + } #endif out: