Skip to content

Commit

Permalink
Merge pull request #56 from inanimatt/master
Browse files Browse the repository at this point in the history
Fix #53: empty passphrase breaks signing provider
  • Loading branch information
tmilos committed Oct 14, 2014
2 parents c72fb50 + c10140b commit cbaef81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/AerialShip/SamlSPBundle/Bridge/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ public function manage(Request $request)
$builder = new AuthnRequestBuilder($spED, $idpED, $spMeta);
$message = $builder->build();

if ($serviceInfo->getSpSigningProvider()->isEnabled()) {
$message->sign($serviceInfo->getSpSigningProvider()->getCertificate(), $serviceInfo->getSpSigningProvider()->getPrivateKey());
}

$binding = $this->bindingManager->instantiate($spMeta->getAuthnRequestBinding());

$bindingResponse = $binding->send($message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,12 @@ protected function createSPSigningProvider(ContainerBuilder $container, $id, $na
if (isset($config['id'])) {
$container->setAlias($serviceID, $config['id']);
} else if (isset($config['cert_file']) &&
isset($config['key_file']) &&
isset($config['key_pass'])
isset($config['key_file'])
) {
$service = new DefinitionDecorator('aerial_ship_saml_sp.sp_signing.file');
$service->replaceArgument(1, $config['cert_file']);
$service->replaceArgument(2, $config['key_file']);
$service->replaceArgument(3, $config['key_pass']);
$service->replaceArgument(3, array_key_exists('key_pass', $config) ? $config['key_pass'] : null);
$container->setDefinition($serviceID, $service);
} else {
$service = new DefinitionDecorator('aerial_ship_saml_sp.sp_signing.null');
Expand Down

0 comments on commit cbaef81

Please sign in to comment.