Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Maybe check signatures first? #124

@utkarsh2102

Description

@utkarsh2102

Hi @tobiashm,
Just to be extra secure, doesn't it make sense to check signatures first so that no third party could interfere?
Something like:

--- a/lib/openid/consumer/idres.rb
+++ b/lib/openid/consumer/idres.rb
@@ -70,9 +70,9 @@
       # 'endpoint', 'message', and 'signed_fields' contain the
       # verified information.
       def id_res
+        check_signature
         check_for_fields
         verify_return_to
-        check_signature
         check_nonce
         verify_discovery_results
       end

My take is that this method will raise ProtocolError in the very first place (which is a good thing!) unless the request is a valid id_res response. Once it has been verified, the methods endpoint, message, and signed_fields contain the verified information.
Thereby making everything secure from any third party interference.

I'll be happy to raise a PR if this makes sense to you?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions