-
Notifications
You must be signed in to change notification settings - Fork 143
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
Improve error reporting in JsThemis #384
Commits on Feb 18, 2019
-
Add some functions to help with error reporting. They provided unified error message format and convert Themis status code into human-readable strings. Secure Session and Secure Comparator code are handled separately because some of their values overlap with generic codes.
Configuration menu - View commit details
-
Copy full SHA for db104c1 - Browse repository at this point
Copy the full SHA db104c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2c17f16 - Browse repository at this point
Copy the full SHA 2c17f16View commit details -
Secure Message: length and type checks for arguments
Keys and messages must be non-empty. Themis does check for that but it returns a generic 'invalid parameter' error. Perform early checks and report more accurate errors. Furthermore, check the argument count and their types and report appropriate errors as well. Otherwise we risk crashing node.js process due to assertion failure in node::Buffer::Data().
Configuration menu - View commit details
-
Copy full SHA for 9a1f5de - Browse repository at this point
Copy the full SHA 9a1f5deView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a9d27e - Browse repository at this point
Copy the full SHA 9a9d27eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8bba743 - Browse repository at this point
Copy the full SHA 8bba743View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6bafbb4 - Browse repository at this point
Copy the full SHA 6bafbb4View commit details -
Secure Cell: tests for empty arguments
Rename "empty" variable to use distinct names across the tests because this "this" thing in JavaScript is magic.
Configuration menu - View commit details
-
Copy full SHA for 39f753a - Browse repository at this point
Copy the full SHA 39f753aView commit details -
Use THEMIS_FAIL as initial status value
Co-Authored-By: ilammy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a41d268 - Browse repository at this point
Copy the full SHA a41d268View commit details -
Co-Authored-By: ilammy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fe575d8 - Browse repository at this point
Copy the full SHA fe575d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc6d699 - Browse repository at this point
Copy the full SHA cc6d699View commit details -
Improve error messages, simplify calls
Use more descriptive error messages which suggestions on how to fix the error. Drop the superfluous error code parameter which is always the same. We're going to use these short forms only for parameter validation anyway.
Configuration menu - View commit details
-
Copy full SHA for 4a1b5bd - Browse repository at this point
Copy the full SHA 4a1b5bdView commit details -
We're going to improve the exception error messages so remove all these hardcoded "invalid parameter" strings for now. We'll replace that with some error verification callback later.
Configuration menu - View commit details
-
Copy full SHA for 67b1299 - Browse repository at this point
Copy the full SHA 67b1299View commit details -
Return original Themis status code
If we have a status code, add it as a "code" property to the Error object we throw. Verify the code in tests where appropriate.
Configuration menu - View commit details
-
Copy full SHA for 27fe0dc - Browse repository at this point
Copy the full SHA 27fe0dcView commit details -
Retain status code for early errors
Add THEMIS_INVALID_PARAMETER status code to all early parameter checks that we perform. Now all Themis errors will have a "code" property. Rename the helper function accordinly.
Configuration menu - View commit details
-
Copy full SHA for 765f2ec - Browse repository at this point
Copy the full SHA 765f2ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f187da - Browse repository at this point
Copy the full SHA 3f187daView commit details -
Configuration menu - View commit details
-
Copy full SHA for f6b733e - Browse repository at this point
Copy the full SHA f6b733eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 74aaa6f - Browse repository at this point
Copy the full SHA 74aaa6fView commit details -
Configuration menu - View commit details
-
Copy full SHA for bc9786b - Browse repository at this point
Copy the full SHA bc9786bView commit details -
Configuration menu - View commit details
-
Copy full SHA for af03452 - Browse repository at this point
Copy the full SHA af03452View commit details -
Configuration menu - View commit details
-
Copy full SHA for 755e2d4 - Browse repository at this point
Copy the full SHA 755e2d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b29e2c - Browse repository at this point
Copy the full SHA 7b29e2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ae5d6f - Browse repository at this point
Copy the full SHA 5ae5d6fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d24b49a - Browse repository at this point
Copy the full SHA d24b49aView commit details
Commits on Feb 19, 2019
-
Recently released mocha 6.0.0 is not compatible with Node in our CI environment. Pin the version to ^5.2.0 while it is still available.
Configuration menu - View commit details
-
Copy full SHA for 6caa83c - Browse repository at this point
Copy the full SHA 6caa83cView commit details -
Avoid using deprecated NAN methods
Call() method on callbacks has been deprecated, it is suggested to use Nan::Call() function for synchronous calls. Do this to avoid warnings about using deprecated API, who knows when it's going to be removed.
Configuration menu - View commit details
-
Copy full SHA for 593dedb - Browse repository at this point
Copy the full SHA 593dedbView commit details -
Secure Session: add checks to pubkey callback
It turned out that public key callback did not have enough checks and could crash Node process if the user returns unexpected value from it. Add type checks for result: an array is okay, null and undefined are explicit "not found" values, anything else is also considered "not found" but with a different error code (the exact value does not matter at the moment). Also add a length check to avoid buffer overflow when doing memcpy().
Configuration menu - View commit details
-
Copy full SHA for 6a6b540 - Browse repository at this point
Copy the full SHA 6a6b540View commit details -
Commit 6caa83c contains local changes which were not intended to be committed. Revert them.
Configuration menu - View commit details
-
Copy full SHA for a437395 - Browse repository at this point
Copy the full SHA a437395View commit details