Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limited MOAT Solution Length to spec's 20 byte limit #339

Merged
merged 1 commit into from May 30, 2020
Merged

Limited MOAT Solution Length to spec's 20 byte limit #339

merged 1 commit into from May 30, 2020

Conversation

bitmold
Copy link
Collaborator

@bitmold bitmold commented May 11, 2020

this is a small UI adjustment, the MOAT spec limits solution size to 20 bytes so I set a maxLength of 20 on it

From: https://gitweb.torproject.org/bridgedb.git/tree/README.rst#n391


Responding to a CAPTCHA challenge
"""""""""""""""""""""""""""""""""

To propose a solution to a CAPTCHA, the client MUST send a request for ``POST
/moat/check``, where the body of the request contains the following JSON::

    {
      "data": [{
        "id": "2",
        "type": "moat-solution",
        "version": "0.1.0",
        "transport": "TRANSPORT",
        "challenge": "CHALLENGE",
        "solution": "SOLUTION",
        "qrcode": "BOOLEAN",
      }]
    }


where:

* ``TRANSPORT`` is the agreed upon transport which will be distributed,
* ``CHALLENGE`` is a base64-encoded CAPTCHA challenge which MUST be
  later passed back to the server along with the proposed solution.
* ``SOLUTION`` is a valid unicode string, up to 20 bytes in length,
  containing the client's answer (i.e. what characters the CAPTCHA
  image displayed).  The solution is *not* case-sensitive.
* ``BOOLEAN`` is ``"true"`` if the client wants a qrcode containing the bridge
  lines to be generated and returned; ``"false"`` otherwise.

@n8fr8 n8fr8 merged commit cd92f88 into guardianproject:master May 30, 2020
@bitmold bitmold deleted the moat_max_solution_len branch May 30, 2020 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants