Exception: WSDL::UnsupportedAlgorithmError

Inherits:
SecurityError show all
Defined in:
lib/wsdl/errors.rb

Overview

Raised when an algorithm is not supported or not recognized.

This error is raised during signature verification when:

  • The response specifies an unknown or unsupported algorithm URI
  • An algorithm downgrade attack may be in progress
  • A required algorithm parameter is missing

This strict validation prevents algorithm confusion attacks where an attacker modifies the algorithm URI to cause verification with the wrong algorithm.

Examples:

Catching unsupported algorithm errors

begin
  response.security.verify_signature!
rescue WSDL::UnsupportedAlgorithmError => e
  log_security_event("Unsupported algorithm: #{e.message}")
  log_security_event("Algorithm URI: #{e.algorithm_uri}")
  log_security_event("Algorithm type: #{e.algorithm_type}")
end

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, algorithm_uri: nil, algorithm_type: nil) ⇒ UnsupportedAlgorithmError

Creates a new UnsupportedAlgorithmError.

Parameters:

  • message (String) (defaults to: nil)

    error message

  • algorithm_uri (String, nil) (defaults to: nil)

    the URI that was not recognized

  • algorithm_type (Symbol, nil) (defaults to: nil)

    the type of algorithm



307
308
309
310
311
# File 'lib/wsdl/errors.rb', line 307

def initialize(message = nil, algorithm_uri: nil, algorithm_type: nil)
  @algorithm_uri = algorithm_uri
  @algorithm_type = algorithm_type
  super(message)
end

Instance Attribute Details

#algorithm_typeSymbol? (readonly)

Returns the type of algorithm (:digest, :signature, :canonicalization).

Returns:

  • (Symbol, nil)

    the type of algorithm (:digest, :signature, :canonicalization)



300
301
302
# File 'lib/wsdl/errors.rb', line 300

def algorithm_type
  @algorithm_type
end

#algorithm_uriString? (readonly)

Returns the unrecognized algorithm URI.

Returns:

  • (String, nil)

    the unrecognized algorithm URI



297
298
299
# File 'lib/wsdl/errors.rb', line 297

def algorithm_uri
  @algorithm_uri
end