Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Pass with append string still valid #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion test/Adapter/Http/ApacheResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,29 @@ public function testResolveNoUsers($file)
$this->assertFalse($result->isValid());
}

/**
public function testResolveNoValidPasswordWithoutPrependSign()
{
list($username, $password) = explode(':', base64_decode(base64_encode('admink:admin')));
$path = __DIR__ . '/TestAsset/htbasic-append.crypt';

$this->_apache->setFile($path);
$result = $this->_apache->resolve($username, null, $password);
$this->assertInstanceOf('Zend\Authentication\Result', $result);
$this->assertTrue($result->isValid());
}

public function testResolveNoValidPasswordWithPrependSign()
{
list($username, $password) = explode(':', base64_decode(base64_encode('admink:admin').'X'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is pretty much invalid. base64_decode drops X here because it does not form full octet.

$path = __DIR__ . '/TestAsset/htbasic-append.crypt';

$this->_apache->setFile($path);
$result = $this->_apache->resolve($username, null, $password);
$this->assertInstanceOf('Zend\Authentication\Result', $result);
$this->assertFalse($result->isValid());
}

/**
* Ensure that resolve() failed for not valid password
*
* @dataProvider providePasswordFiles
Expand Down
1 change: 1 addition & 0 deletions test/Adapter/Http/TestAsset/htbasic-append.crypt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
admink:E6nt1mxRx7/6.