Skip to content

Commit

Permalink
SAML-14 fix issue with cert formatting when provided cert contains BE…
Browse files Browse the repository at this point in the history
…GIN/END cert lines
  • Loading branch information
DominicWatson committed Mar 7, 2024
1 parent b4bf5a1 commit 0108574
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helpers/saml2SsoHelpers.cfm
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<cfscript>
function formatX509Certificate( required string raw ) {
var x509cert = "-----BEGIN CERTIFICATE-----" & Chr( 10 );
var stripped = ReReplace( arguments.raw, "[\s\n]", "", "all" );
var stripped = arguments.raw;
stripped = Replace( stripped, "-----BEGIN CERTIFICATE-----", "" );
stripped = Replace( stripped, "-----END CERTIFICATE-----", "" );
stripped = ReReplace( stripped, "[\s\n]", "", "all" );
for( var i=1; i <= Len( stripped ); i++ ) {
x509cert &= stripped[i];
Expand Down

0 comments on commit 0108574

Please sign in to comment.