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

WasmThemis utilities #489

Merged
merged 3 commits into from
Jul 5, 2019
Merged

WasmThemis utilities #489

merged 3 commits into from
Jul 5, 2019

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Jul 5, 2019

Split out a couple of commits from #462 which contain common utilities. I'd like to have them in master before submitting pull requests for other cryptosystems support in WasmThemis. This should allow us to see only relevant code in those PR, without duplicating these two commits in all four PRs.

Classical off-by-one mistake. We incorrectly reported error codes as
'undefined' when doing "new ThemisError(subsystem, errorCode)". This
affects only human-readable description, not the 'errorCode' property,
but it's very annoying for developers.

Use ThemisError.describe only when there are 3 (three) or more arguments
with human-readable error causes.
This function is going to be useful in multiple places for type checking
of user byte arrays. Let's move it into a common utility module. While
we're here, let it throw 'TypeError' instead of 'ThemisError' which
should be more recognizable (and does not expect Themis "subsystem").
@ilammy ilammy added the W-WasmThemis 🌐 Wrapper: WasmThemis, JavaScript API, npm packages label Jul 5, 2019
Quick! Unbreak Android builds right now!
Copy link
Collaborator

@Lagovas Lagovas left a comment

Choose a reason for hiding this comment

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

lgtm

@ilammy ilammy merged commit 019d5e0 into cossacklabs:master Jul 5, 2019
@ilammy ilammy deleted the wasm-utils branch July 9, 2019 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
W-WasmThemis 🌐 Wrapper: WasmThemis, JavaScript API, npm packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants