Skip to content

Commit

Permalink
bug #33759 [Security/Http] fix parsing X509 emailAddress (nicolas-gre…
Browse files Browse the repository at this point in the history
…kas)

This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Http] fix parsing X509 emailAddress

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33636
| License       | MIT
| Doc PR        | -

Commits
-------

fceb86b [Security/Http] fix parsing X509 emailAddress
  • Loading branch information
fabpot committed Sep 30, 2019
2 parents a2cd56c + fceb86b commit a824e08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -46,7 +46,7 @@ protected function getPreAuthenticatedData(Request $request)
$user = $request->server->get($this->userKey);
} elseif (
$request->server->has($this->credentialKey)
&& preg_match('#emailAddress=(.+\@.+\.[^,/]+)($|,|/)#', $request->server->get($this->credentialKey), $matches)
&& preg_match('#emailAddress=([^,/@]++@[^,/]++)#', $request->server->get($this->credentialKey), $matches)
) {
$user = $matches[1];
}
Expand Down
Expand Up @@ -81,6 +81,7 @@ public static function dataProviderGetPreAuthenticatedDataNoUser()
yield ['cert+something@example.com', 'CN=Sample certificate DN,emailAddress=cert+something@example.com'];
yield ['cert+something@example.com', 'emailAddress=cert+something@example.com,CN=Sample certificate DN'];
yield ['cert+something@example.com', 'emailAddress=cert+something@example.com'];
yield ['firstname.lastname@mycompany.co.uk', 'emailAddress=firstname.lastname@mycompany.co.uk,CN=Firstname.Lastname,OU=london,OU=company design and engineering,OU=Issuer London,OU=Roaming,OU=Interactive,OU=Users,OU=Standard,OU=Business,DC=england,DC=core,DC=company,DC=co,DC=uk'];
}

public function testGetPreAuthenticatedDataNoData()
Expand Down

0 comments on commit a824e08

Please sign in to comment.