Skip to content

Commit

Permalink
Merge branch 'hotfix-6.0.1' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicWatson committed Mar 20, 2024
2 parents 2511b39 + ecab6f6 commit 3a276bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v6.0.1

* Fix issue where organisation short name setting containing spaces would crash server on certificate generation

## v6.0.0

Extension overhaul:
Expand Down
6 changes: 5 additions & 1 deletion services/saml/signing/SamlCertificateService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ component {
var password = CreateUUId();
var keyToolArgs = '-genkeypair -validity #arguments.expiryDays# -alias #certAlias# -keyalg RSA -storetype JKS -keystore #filePath# -storepass #password# -keysize 2048 -keypass #certPassword# -dname CN=#arguments.cn#'.split( "\s+" );

// TODO, replace this with a java lib for generating the keypair
// should keytool fail, it crashes the server :o
DirectoryCreate( GetDirectoryFromPath( filePath ), true, true );
CreateObject( "java", "sun.security.tools.keytool.Main" ).main( keyToolArgs );

Expand All @@ -50,7 +52,9 @@ component {
}

private string function _getCnForCertificates() {
return samlProviderMetadataGenerator.getMetaDataSettings().organisation_short_name;
var shortName = samlProviderMetadataGenerator.getMetaDataSettings().organisation_short_name;

return ReReplace( shortName, "\s+", "-", "all" );
}

}

0 comments on commit 3a276bf

Please sign in to comment.