Open
Bug 1259058
Opened 8 years ago
Updated 2 years ago
Use s_mp_setz() to fill the top digits with zeroes after shifting in s_mp_rshd()
Categories
(NSS :: Libraries, defect, P3)
NSS
Libraries
Tracking
(firefox48 affected)
NEW
3.36
Tracking | Status | |
---|---|---|
firefox48 | --- | affected |
People
(Reporter: ttaubert, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [nss-qm])
Attachments
(2 files)
307 bytes,
patch
|
Details | Diff | Splinter Review | |
307 bytes,
patch
|
Details | Diff | Splinter Review |
After shifting an mp_int to the right by |p| digits, s_mp_rshd() reduces USED() by |p| and zeroes out the previously used digits like so: > MP_USED(mp) -= p; > while (p-- > 0) > *dst++ = 0; I suggest we could rather use s_mp_setz() here: > MP_USED(mp) -= p; > s_mp_setz(MP_DIGITS(mp) + MP_USED(mp), p);
Reporter | ||
Updated•7 years ago
|
Keywords: good-first-bug
Priority: -- → P3
Comment 1•7 years ago
|
||
I would like to work on this. How should I get started?
Comment 2•6 years ago
|
||
If you're new to NSS, the first step would be to set up everything and build NSS (see https://github.com/nss-dev/nss/blob/master/readme.md for how to do that). If you have a patch then, you can either upload it here in the bug or on to phabricator https://phabricator.services.mozilla.com/ (which is the preferred method but a little more invovled to set up) and request review on it.
Comment 3•6 years ago
|
||
I'm new to NSS, I have set up everything. Can you tell which particular file do I need to look up for fixing this?
Comment 4•6 years ago
|
||
The function s_mp_rshd is here https://searchfox.org/nss/rev/a1d1d15a356dad547752bdc6bd8c1fe2a0e1d327/lib/freebl/mpi/mpi.c#2957.
Comment 5•6 years ago
|
||
Created a pull request on github: https://github.com/nss-dev/nss/pull/20 @@ -2978,8 +2978,7 @@ MP_USED(mp) -= p; /* Fill the top digits with zeroes */ - while (p-- > 0) - *dst++ = 0; + s_mp_setz(MP_DIGITS(mp) + MP_USED(mp), p); } /* end s_mp_rshd() */
Comment 6•6 years ago
|
||
Updated•6 years ago
|
Assignee: nobody → guptaaditi1709
Target Milestone: --- → 3.36
Updated•6 years ago
|
Attachment #8938324 -
Flags: review?(franziskuskiefer)
Comment 7•6 years ago
|
||
Comment on attachment 8938324 [details] [diff] [review] Used s_mp_setz() to fill the top digits with zeroes after shifting in s_mp_rshd() Review of attachment 8938324 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for the delay (holidays and such). To request review you can set the review flag on the uploaded patch. The patch looks good, but the patch doesn't apply because it has the wrong path. Can you re-generate the patch so it applies? (either hg export or git format-patch -1 <sha>) Or even better, we usually use phabricator for reviews in NSS. You can use your bugzilla account at https://phabricator.services.mozilla.com/ and use arcanist (https://secure.phabricator.com/book/phabricator/article/arcanist_quick_start/) to upload your patch.
Attachment #8938324 -
Flags: review?(franziskuskiefer)
Updated•6 years ago
|
Flags: needinfo?(guptaaditi1709)
Comment 8•6 years ago
|
||
Used s_mp_setz() to fill the top digits with zeroes after shifting in s_mp_rshd()
Flags: needinfo?(guptaaditi1709)
Attachment #8940410 -
Flags: review+
Comment 9•6 years ago
|
||
Besides also created a pull reguest on GitHub: https://github.com/nss-dev/nss/pull/20 ,if this helps.
Comment 10•6 years ago
|
||
Comment on attachment 8940410 [details] [diff] [review] mpi_patch.patch Review of attachment 8940410 [details] [diff] [review]: ----------------------------------------------------------------- > Besides also created a pull reguest on GitHub: https://github.com/nss-dev/nss/pull/20 ,if this helps. Github is a readonly mirror of the official mercurial repository, so unfortunately not. To request review you have to set the review flag to ? with a name. This looks like the same patch, it won't apply :(
Attachment #8940410 -
Flags: review+
Comment 11•5 years ago
•
|
||
Here is a good Ansible role for who want to start playing with NSS:
Tip for good-first-bug: https://galaxy.ansible.com/marcusburghardt/ansible_role_nss
Comment 12•3 years ago
|
||
This good-first-bug hasn't had any activity for 6 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Assignee: guptaaditi1709 → nobody
Updated•3 years ago
|
Whiteboard: [nss-qm]
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•