Skip to content

Conversation

@timlandolt
Copy link

Now the length of the encrypted inputs gets checked and if it is longer than the (in the backend) set maximum the request doesn't get sent and an error is displayed. Fixes #4

Copy link
Owner

@schmijos schmijos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much! Let's talk about this in person. I think, the rendered error json could enable generic error messages with less code.

Copy link
Owner

@schmijos schmijos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to show all error messages the backend is able to produce so please move the if-statement to the backend.

return;
}
hideError();
const { url } = await storeRemotely(ciphertext, expiresInSeconds());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather expect an error to be shown as aftermath caused by this fetch call.

</section>

<section id="error-container" style="display: none">
<p id="error"></p>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation please.

async function encryptAndStore() {
const { key, ciphertext } = await encryptLocally(plaintext());
const isInputTooLong = to_base64(ciphertext).length > <%= max_ciphertext_length %>;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My long-term design goal is to move away from ecr-templates but using HTML only. You're going into another direction. Please move this test into the backend. Security relevance is low and you can steer it globally then. Also you can simply show the backend error message for all messages generically.

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.

Input length validation

2 participants