@@ -32,7 +32,9 @@ def self.format_cert(cert)
3232 formatted_cert . join ( "\n " )
3333 else
3434 cert = cert . gsub ( /\- {5}\s ?(BEGIN|END) CERTIFICATE\s ?\- {5}/ , "" )
35- cert = cert . gsub ( /[\n \r \s ]/ , "" )
35+ cert = cert . gsub ( /\r / , "" )
36+ cert = cert . gsub ( /\n / , "" )
37+ cert = cert . gsub ( /\s / , "" )
3638 cert = cert . scan ( /.{1,64}/ )
3739 cert = cert . join ( "\n " )
3840 "-----BEGIN CERTIFICATE-----\n #{ cert } \n -----END CERTIFICATE-----"
@@ -51,7 +53,9 @@ def self.format_private_key(key)
5153 # is this an rsa key?
5254 rsa_key = key . match ( "RSA PRIVATE KEY" )
5355 key = key . gsub ( /\- {5}\s ?(BEGIN|END)( RSA)? PRIVATE KEY\s ?\- {5}/ , "" )
54- key = key . gsub ( /[\n \r \s ]/ , "" )
56+ key = key . gsub ( /\n / , "" )
57+ key = key . gsub ( /\r / , "" )
58+ key = key . gsub ( /\s / , "" )
5559 key = key . scan ( /.{1,64}/ )
5660 key = key . join ( "\n " )
5761 key_label = rsa_key ? "RSA PRIVATE KEY" : "PRIVATE KEY"
@@ -98,7 +102,7 @@ def self.build_query_from_raw_parts(params)
98102 # @param rawparams [Hash] Raw GET Parameters
99103 # @param params [Hash] GET Parameters
100104 # @return [Hash] New raw parameters
101- #
105+ #
102106 def self . prepare_raw_get_params ( rawparams , params )
103107 rawparams ||= { }
104108
@@ -107,7 +111,7 @@ def self.prepare_raw_get_params(rawparams, params)
107111 end
108112 if rawparams [ 'SAMLResponse' ] . nil? && !params [ 'SAMLResponse' ] . nil?
109113 rawparams [ 'SAMLResponse' ] = CGI . escape ( params [ 'SAMLResponse' ] )
110- end
114+ end
111115 if rawparams [ 'RelayState' ] . nil? && !params [ 'RelayState' ] . nil?
112116 rawparams [ 'RelayState' ] = CGI . escape ( params [ 'RelayState' ] )
113117 end
@@ -136,16 +140,16 @@ def self.verify_signature(params)
136140 # @param status_code [String] StatusCode value
137141 # @param status_message [Strig] StatusMessage value
138142 # @return [String] The status error message
139- def self . status_error_msg ( error_msg , status_code = nil , status_message = nil )
140- unless status_code . nil?
141- if status_code . include? "|"
142- status_codes = status_code . split ( ' | ' )
143+ def self . status_error_msg ( error_msg , raw_status_code = nil , status_message = nil )
144+ unless raw_status_code . nil?
145+ if raw_status_code . include? "|"
146+ status_codes = raw_status_code . split ( ' | ' )
143147 values = status_codes . collect do |status_code |
144148 status_code . split ( ':' ) . last
145149 end
146150 printable_code = values . join ( " => " )
147151 else
148- printable_code = status_code . split ( ':' ) . last
152+ printable_code = raw_status_code . split ( ':' ) . last
149153 end
150154 error_msg << ', was ' + printable_code
151155 end
0 commit comments