Skip to content

Commit d95f735

Browse files
committed
Deprecate idp_cert_fingerprint in code
1 parent 96d27db commit d95f735

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* [#692](https://github.com/SAML-Toolkits/ruby-saml/pull/692) Remove `XMLSecurity` namespace and replace with `RubySaml::XML`.
99
* [#686](https://github.com/SAML-Toolkits/ruby-saml/pull/686) Use SHA-256 as the default hashing algorithm everywhere instead of SHA-1, including signatures, fingerprints, and digests.
1010
* [#695](https://github.com/SAML-Toolkits/ruby-saml/pull/695) Deprecate `settings.compress_request` and `settings.compess_response` parameters.
11+
* [#701](https://github.com/SAML-Toolkits/ruby-saml/pull/695) Deprecate `settings.idp_cert_fingerprint` and `settings.idp_cert_fingerprint_algorithm` parameters.
1112
* [#690](https://github.com/SAML-Toolkits/ruby-saml/pull/690) Remove deprecated `settings.security[:embed_sign]` parameter.
1213
* [#697](https://github.com/SAML-Toolkits/ruby-saml/pull/697) Add deprecation for various parameters in `RubySaml::Settings`.
1314
* [#709](https://github.com/SAML-Toolkits/ruby-saml/pull/709) Allow passing in `Net::HTTP` `:open_timeout`, `:read_timeout`, and `:max_retries` settings to `IdpMetadataParser#parse_remote`.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,13 @@ In addition, you may pass the option `:relax_signature_validation` to `SloLogout
248248
`Logoutresponse` if want to skip signature validation on logout.
249249

250250
The `idp_cert_fingerprint` option is deprecated for the following reasons. It will be
251-
removed in Ruby SAML version 3.0.
251+
removed in Ruby SAML version 2.1.0.
252252
1. It only works with HTTP-POST binding, not HTTP-Redirect, since the full certificate
253253
is not sent in the Redirect URL parameters.
254254
2. It is theoretically be susceptible to collision attacks, by which a malicious
255255
actor could impersonate the IdP. (However, as of January 2025, such attacks have not
256256
been publicly demonstrated for SHA-256.)
257+
3. It has been removed already from several other SAML libraries in other languages.
257258

258259
## Handling Multiple IdP Certificates
259260

UPGRADING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ The SAML SP request/response message compression behavior is now controlled auto
113113
"compression" is used to make redirect URLs which contain SAML messages be shorter. For POST messages,
114114
compression may be achieved by enabling `Content-Encoding: gzip` on your webserver.
115115

116+
### Deprecation of IdP certificate fingerprint settings
117+
118+
The `settings.idp_cert_fingerprint` and `settings.idp_cert_fingerprint_algorithm` are deprecated
119+
and will be removed in RubySaml 2.1.0. Please use `settings.idp_cert` or `settings.idp_cert_multi` instead.
120+
The reasons for this deprecation are that (1) fingerprint cannot be used with HTTP-Redirect binding,
121+
and (2) fingerprint is theoretically susceptible to collision attacks.
122+
116123
### Other settings deprecations
117124

118125
The following parameters in `RubySaml::Settings` are deprecated and will be removed in RubySaml 2.1.0:

lib/ruby_saml/settings.rb

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def initialize(overrides = {}, keep_security_attributes = false)
3636
attr_accessor :idp_slo_service_url
3737
attr_accessor :idp_slo_response_service_url
3838
attr_accessor :idp_cert
39-
attr_accessor :idp_cert_fingerprint
40-
attr_accessor :idp_cert_fingerprint_algorithm
39+
attr_reader :idp_cert_fingerprint
40+
attr_reader :idp_cert_fingerprint_algorithm
4141
attr_accessor :idp_cert_multi
4242
attr_accessor :idp_attribute_names
4343
attr_accessor :idp_name_qualifier
@@ -305,6 +305,18 @@ def get_sp_digest_method
305305
end
306306
end
307307

308+
# @deprecated Will be removed in v2.1.0
309+
def idp_cert_fingerprint=(value)
310+
idp_cert_fingerprint_deprecation
311+
@idp_cert_fingerprint = value
312+
end
313+
314+
# @deprecated Will be removed in v2.1.0
315+
def idp_cert_fingerprint_algorithm=(value)
316+
idp_cert_fingerprint_deprecation
317+
@idp_cert_fingerprint_algorithm = value
318+
end
319+
308320
# @deprecated Will be removed in v2.1.0
309321
def certificate_new
310322
certificate_new_deprecation
@@ -349,6 +361,13 @@ def replaced_deprecation(old_param, new_param)
349361
"Please set the same value to `RubySaml::Settings##{new_param}` instead."
350362
end
351363

364+
# @deprecated Will be removed in v2.1.0
365+
def idp_cert_fingerprint_deprecation
366+
Logging.deprecate '`RubySaml::Settings#idp_cert_fingerprint` and `#idp_cert_fingerprint_algorithm` are ' \
367+
'deprecated and will be removed in RubySaml v2.1.0. Please provide the full IdP certificate in ' \
368+
'`RubySaml::Settings#idp_cert` instead.'
369+
end
370+
352371
# @deprecated Will be removed in v2.1.0
353372
def certificate_new_deprecation
354373
Logging.deprecate '`RubySaml::Settings#certificate_new` is deprecated and will be removed in RubySaml v2.1.0. ' \

0 commit comments

Comments
 (0)