88
99Before attempting to upgrade to ` 2.0.0 ` :
1010- Upgrade your project to minimum Ruby 3.0, JRuby 9.4, or TruffleRuby 22.
11- - Upgrade RubySaml to ` 1.17.x ` . Note that RubySaml ` 1.17.x ` is compatible with up to Ruby 3.3.
11+ - Upgrade RubySaml to ` 1.17.x ` .
12+ - In RubySaml ` 1.17.x ` , if you were using the SHA-1 default behavior, change your settings to use SHA-256 as per below:
13+
14+ ``` ruby
15+ # Set this in RubySaml 1.17.x, can be removed when upgrading to 2.0.0
16+ settings.idp_cert_fingerprint_algorithm = XMLSecurity ::Document ::SHA256
17+ settings.security[:signature_method ] = XMLSecurity ::Document ::RSA_SHA256
18+ settings.security[:digest_method ] = XMLSecurity ::Document ::SHA256
19+ ```
1220
1321### Root "OneLogin" namespace changed to "RubySaml"
1422
@@ -38,16 +46,17 @@ For security reasons, RubySaml version `2.0.0` uses SHA-256 as its default hashi
3846instead of the now-obsolete SHA-1. This affects:
3947- The default signature and digest algorithms used when generating SP metadata.
4048- The default signature algorithm used when generating SP messages such as AuthnRequests.
41- - The default fingerprint of IdP metadata ( ` :idp_cert_fingerprint ` as generated by ` RubySaml::IdpMetadataParser ` )
49+ - The ` :idp_cert_fingerprint ` of IdP metadata as generated by ` RubySaml::IdpMetadataParser ` .
4250
43- To preserve the old insecure SHA-1 behavior * (not recommended)* , you may set ` RubySaml::Settings ` as follows:
51+ If you see any signature or fingerprint mismatch errors after upgrading to RubySaml ` 2.0.0 ` ,
52+ this change is likely the reason. To preserve the old insecure SHA-1 behavior * (not recommended)* ,
53+ you may set ` RubySaml::Settings ` as follows:
4454
4555``` ruby
4656# Preserve RubySaml 1.x insecure SHA-1 behavior
47- settings = RubySaml ::Settings .new
48- settings.idp_cert_fingerprint_algorithm = RubySaml ::XML ::Document ::SHA1
49- settings.security[:digest_method ] = RubySaml ::XML ::Document ::SHA1
50- settings.security[:signature_method ] = RubySaml ::XML ::Document ::RSA_SHA1
57+ settings.idp_cert_fingerprint_algorithm = RubySaml ::XML ::Crypto ::SHA1
58+ settings.security[:digest_method ] = RubySaml ::XML ::Crypto ::SHA1
59+ settings.security[:signature_method ] = RubySaml ::XML ::Crypto ::RSA_SHA1
5160```
5261
5362### Removal of embed_sign setting
@@ -94,12 +103,14 @@ The following parameters in `RubySaml::Settings` are deprecated and will be remo
94103
95104### Minor changes to Util#format_cert and #format_private_key
96105
97- Version 2.0.0 standardizes how RubySaml reads and formats certificate and private key
98- PEM strings. In general, version 2.0.0 is more permissive than 1.x, and the changes
106+
107+ Version ` 2.0.0 ` standardizes how RubySaml reads and formats certificate and private key
108+ PEM strings. In general, version ` 2.0.0 ` is more permissive than ` 1.x ` , and the changes
99109are not anticipated to affect most users. Please note the change affects parameters
100110such ` #idp_cert ` and ` #certificate ` , as well as the ` RubySaml::Util#format_cert `
101111and ` #format_private_key ` methods. Specifically:
102112
113+
103114| # | Input value | RubySaml 2.0.0 | RubySaml 1.x |
104115| ---| ------------------------------------------------------| ---------------------------------------------------------| ---------------------------|
105116| 1 | Input contains a bad (e.g. non-base64) PEM | Skip PEM formatting | Return a bad PEM |
@@ -113,7 +124,7 @@ and `#format_private_key` methods. Specifically:
113124** Notes**
114125- Case 3: For example, ` -----BEGIN TRUSTED X509 CERTIFICATE----- ` is now
115126 considered a valid header as an input, but it will be formatted to
116- ` -----BEGIN CERTIFICATE----- ` in the output. As a special case, in both 2.0.0
127+ ` -----BEGIN CERTIFICATE----- ` in the output. As a special case, in both ` 2.0.0 `
117128 and 1.x, if ` RSA PRIVATE KEY ` is present in the input string, the ` RSA ` prefix will
118129 be preserved in the output.
119130- Case 5: When formatting multiple certificates in one string (i.e. a certificate chain),
0 commit comments