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

Pycryptodome AuthSigner is incorrect #109

Open

Description

@GoobyCorp

I've tried to sign tokens with the pycryptodome AuthSigner and it definitely doesn't work. If I remember correctly the token isn't hashed with SHA-256.

Activity

  1. fahhem commented on May 31, 2018

    @fahhem
    Contributor

    Can you verify it works when you replace the following lines:

    h = SHA256.new(data)
    return pkcs1_15.new(self.rsa_key).sign(h)

    With this line:

    return pkcs1_15.new(self.rsa_key).sign(data)
  2. GoobyCorp commented on May 31, 2018

    @GoobyCorp
    Author

    That won't work either, it requires a hasher instance.

  3. fahhem commented on May 31, 2018

    @fahhem
    Contributor

    In other signers it looks like the data comes pre-hashed. Have you tried the code?

  4. GoobyCorp commented on May 31, 2018

    @GoobyCorp
    Author

    If it's prehashed then it's not going to work with pycryptodome without modifications.

  5. fahhem commented on May 31, 2018

    @fahhem
    Contributor

    Do you have any suggestions then? @greateggsgreg added pycryptodome and I assume he tried it out. Did you try anything or is this just theory?

  6. GoobyCorp commented on May 31, 2018

    @GoobyCorp
    Author

    I've tested everything I've written, also in the documentation it says the format for the public key being sent is PEM with the header, footer, and newlines removed but from other implementations of ADB this doesn't appear to be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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