-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add apidsl file for toxencryptsave. #310
Conversation
Reviewed 1 of 1 files at r1. Comments from Reviewable |
09fd6fb
to
3597599
Compare
/** | ||
* Some input data, or maybe the output pointer, was null. | ||
* One of the arguments to the function was NULL when it was not expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When is NULL expected? Is it expected at all? Isn't this comment misleading?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes NULL is accepted. is_data_encrypted
just returns false
, because NULL is not encrypted. This comment is generated by apidsl. Feel free to file a bug or make a PR with different wording there: https://github.com/TokTok/apidsl/issues.
@@ -190,59 +222,66 @@ typedef struct { | |||
* | |||
* returns true on success | |||
*/ | |||
bool tox_derive_key_from_pass(const uint8_t *passphrase, size_t pplength, TOX_PASS_KEY *out_key, | |||
TOX_ERR_KEY_DERIVATION *error); | |||
bool tox_pass_key_derive_from_pass(struct Tox_Pass_Key *_key, const uint8_t *passphrase, size_t pplength, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tox_pass_key_derive_from_pass()
Redundant department of redundant redundancy is calling. This function doesn't make much sense as far as the name goes.
* The salt must be TOX_PASS_SALT_LENGTH bytes in length. | ||
*/ | ||
bool tox_derive_key_with_salt(const uint8_t *passphrase, size_t pplength, const uint8_t *salt, TOX_PASS_KEY *out_key, | ||
TOX_ERR_KEY_DERIVATION *error); | ||
bool tox_pass_key_derive_with_salt(struct Tox_Pass_Key *_key, const uint8_t *passphrase, size_t pplength, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*passphrase
This is plain wrong.
|
||
void tox_pass_key_free(struct Tox_Pass_Key *_key); | ||
|
||
void tox_pass_key_get_key(const struct Tox_Pass_Key *_key, uint8_t *key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No errors are possible? Should this actually read TOX_PASS_KEY_LENGTH
bytes from given place in memory?
Why there are no docs on how to use it?
If it's something that shouldn't be used, why there's an API for it?
Same goes for other functions.
2729b4d
to
cad3eea
Compare
Added to v0.1.0. I'll push it to v0.2.0 if we can't get it reviewed on time. |
8c8d655
to
6c1a5ab
Compare
Review status: 0 of 6 files reviewed at latest revision, 1 unresolved discussion. toxencryptsave/toxencryptsave.h, line 205 at r2 (raw file):
Same goes for naming in other functions. Comments from Reviewable |
Review status: 0 of 6 files reviewed at latest revision, 1 unresolved discussion. toxencryptsave/toxencryptsave.h, line 205 at r2 (raw file): Previously, zetok wrote…
Done. Comments from Reviewable |
Reviewed 2 of 6 files at r2, 4 of 4 files at r3. auto_tests/encryptsave_test.c, line 107 at r3 (raw file):
Comments from Reviewable |
This breaks the toxencryptsave API. It hides the Tox_Pass_Key struct definition.
Reviewed 1 of 1 files at r4. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions. auto_tests/encryptsave_test.c, line 107 at r3 (raw file): Previously, robinlinden (Robin Lindén) wrote…
Done. Comments from Reviewable |
Review status: all files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Equivalent to the change in TokTok/c-toxcore#310 where pass-key internals are no longer exposed publicly, since there is no need to expose them.
@nurupo we can make modifications or undo this change if you have reasons for that later. The 0.1.0 release is still gated on your LGTM. I will merge the toxencryptsave API soon. |
Ok. I will have some reviewing time in 6 hours. |
Reviewed 1 of 6 files at r2, 3 of 4 files at r3, 1 of 1 files at r4. toxencryptsave/toxencryptsave.h, line 51 at r4 (raw file):
toxencryptsave/toxencryptsave.h, line 263 at r4 (raw file):
Why Comments from Reviewable |
Reviewed 2 of 6 files at r2, 3 of 4 files at r3, 1 of 1 files at r4. toxencryptsave/toxencryptsave.api.h, line 54 at r4 (raw file):
Is the term here not cookie? A magic number is something that makes things work, where why could easily unknown. Comments from Reviewable |
toxencryptsave/toxencryptsave.api.h, line 54 at r4 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Magic number is the correct term here https://en.wikipedia.org/wiki/Magic_number_(programming). Comments from Reviewable |
This change is