Closed
Bug 241013
Opened 21 years ago
Closed 21 years ago
[FIX]nsNSSComponent::VerifySignature leaks on errors
Categories
(Core Graveyard :: Security: UI, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(2 files, 2 obsolete files)
5.76 KB,
patch
|
Details | Diff | Splinter Review | |
4.87 KB,
patch
|
jgmyers
:
review+
brendan
:
superreview+
|
Details | Diff | Splinter Review |
![]() |
Assignee | |
Comment 1•21 years ago
|
||
This conflicts with the patches in bug 240661, but oh, well. I'll merge in
either direction as needed.
![]() |
Assignee | |
Comment 2•21 years ago
|
||
![]() |
Assignee | |
Comment 3•21 years ago
|
||
Comment on attachment 146528 [details] [diff] [review]
Same as diff -b, FOR REVIEW ONLY
John, would you review? Nelson, if you have time to take a look, that would
also be much appreciated...
Who'd be a good sr for changes to this code?
Attachment #146528 -
Flags: review?(jgmyers)
Comment 4•21 years ago
|
||
Comment on attachment 146528 [details] [diff] [review]
Same as diff -b, FOR REVIEW ONLY
I don't think the fingerprint can have non-ASCII characters, so full UTF-8
conversion isn't absolutely necessary there.
Attachment #146528 -
Flags: review?(jgmyers) → review+
![]() |
Assignee | |
Comment 5•21 years ago
|
||
Comment on attachment 146528 [details] [diff] [review]
Same as diff -b, FOR REVIEW ONLY
Brendan, would you sr?
Attachment #146528 -
Flags: superreview?(brendan)
![]() |
Assignee | |
Comment 6•21 years ago
|
||
Taking...
Assignee: kaie → bzbarsky
Priority: -- → P1
Summary: nsNSSComponent::VerifySignature leaks on errors → [FIX]nsNSSComponent::VerifySignature leaks on errors
Comment 7•21 years ago
|
||
Several suggestions about this patch:
1. I think you should ignore the return value from Update, and base your
decision entirely on the return value from Finish. I do not know that it
can never be true that update returns an error bug finish also returns a
non-null value, so I think the assertion might conceivably hit.
2. You could replace the sequence of calls to the decoder (start, update,
finish) with a single call to SEC_PKCS7DecodeItem().
3. NSS has an old PKCS7 decoder, and a new CMS decoder. CMS is a major
new revision of the old PKCS7 standard. It allows signatures to contain a
superset of the things that were allowed in PKCS7. AFAIK, the function
being patched here is that last remaining use of the old PKCS7 decoder in
mozilla. All other calls have been converted to use the CMS decoder, IINM.
So, it might be good to start using the new NSS CMS decoder in this function,
rather than continuing to use the old PKCS7 decoder
However, the conversion may be non-trivial. The CMS decoder function that
is closest to SEC_PKCS7DecodeItem() is NSS_CMSMessage_CreateFromDER()
(which should have been named FromBER). So, the suggestion to convert to
the CMS decoder should probably be in another RFE.
![]() |
Assignee | |
Comment 8•21 years ago
|
||
Comment on attachment 146528 [details] [diff] [review]
Same as diff -b, FOR REVIEW ONLY
Yeah, item 3 sounds like a little more than I'm willing to do given my general
lack of knowledge in this code.... I'll work on doing item 2 (which obviates
item 1 if I read correctly).
Attachment #146528 -
Flags: superreview?(brendan)
![]() |
Assignee | |
Comment 9•21 years ago
|
||
Hmm.. Using SEC_PKCS7DecodeItem() means shoehorning my data into a SECItem,
which means converting my |const char*| to |unsigned char*|. I guess I could
just reinterpret_cast it.... :(
![]() |
Assignee | |
Comment 10•21 years ago
|
||
Attachment #146527 -
Attachment is obsolete: true
Attachment #146528 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 11•21 years ago
|
||
![]() |
Assignee | |
Comment 12•21 years ago
|
||
Comment on attachment 146632 [details] [diff] [review]
Same as diff -b, for review only
I went with siEncodedCertBuffer as the type, but that could well be totally
wrong. If someone knows what the actual type is (not that SEC_PKCS7DecodeItem
cares), please tell me....
Attachment #146632 -
Flags: review?(jgmyers)
Comment 13•21 years ago
|
||
r=MisterSSL for the diffs between the two patches.
There are very few places where si.type is used.
I think you made the right choice.
Updated•21 years ago
|
Attachment #146632 -
Flags: review?(jgmyers) → review+
![]() |
Assignee | |
Comment 14•21 years ago
|
||
Comment on attachment 146632 [details] [diff] [review]
Same as diff -b, for review only
brendan, could you please sr?
Attachment #146632 -
Flags: superreview?(brendan)
Comment 15•21 years ago
|
||
Comment on attachment 146632 [details] [diff] [review]
Same as diff -b, for review only
sr=brendan@mozilla.org
/be
Attachment #146632 -
Flags: superreview?(brendan) → superreview+
![]() |
Assignee | |
Comment 16•21 years ago
|
||
Checked in on the trunk for Mozilla 1.8a.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•