Closed
Bug 956147
Opened 12 years ago
Closed 11 years ago
GetSubjectAltNames in TransportSecurityInfo.cpp should use a scoped PLArenaPool for san_arena
Categories
(Core :: Security: PSM, defect)
Core
Security: PSM
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: keeler, Assigned: hpathak)
Details
Attachments
(1 file, 2 obsolete files)
|
2.13 KB,
patch
|
hpathak
:
review+
|
Details | Diff | Splinter Review |
In theory, san_arena can leak in GetSubjectAltNames. In reality, it probably doesn't, but this is a good opportunity to start moving towards more scoped types in PSM where it's a clear win.
This requires:
1. Defining a scoped PLArenaPool type (see https://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/src/ScopedNSSTypes.h#125 for the sort of thing required)
2. Using it and getting rid of the PORT_FreeArena at the end of GetSubjectAltNames
Comment 1•12 years ago
|
||
As much as I want to believe, bugs without well-understood resolutions in core-security aren't good first bugs.
Whiteboard: [good first bug]
| Reporter | ||
Comment 3•11 years ago
|
||
Comment on attachment 8441122 [details] [diff] [review]
Bug956147_scoped_PLArena.diff
Review of attachment 8441122 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good, but I have some nits. I'll have another look when you've addressed those.
Also, the commit message should say something about how this change is specific to GetSubjectAltNames.
::: security/manager/ssl/src/TransportSecurityInfo.cpp
@@ +599,5 @@
> {
> allNames.Truncate();
> nameCount = 0;
>
> + mozilla::pkix::ScopedPLArenaPool san_arena;
nit: just call this arena
Also, move this down to where the arena is created, and do something like this:
mozilla::pkix::ScopedPLArenaPool san_arena(PORT_NewArena(DER_DEFAULT_CHUNKSIZE));
(you might have to add a line break so it doesn't go over 80 characters)
@@ +609,5 @@
> if (rv != SECSuccess)
> return false;
>
> san_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
> if (!san_arena)
Since the name is going to change, you'll touch this line - might as well add braces around the if body.
Attachment #8441122 -
Flags: review?(dkeeler) → review-
Attachment #8441122 -
Attachment is obsolete: true
Attachment #8441844 -
Flags: review?(dkeeler)
| Reporter | ||
Comment 5•11 years ago
|
||
Comment on attachment 8441844 [details] [diff] [review]
Bug956147_scoped_PLArena.diff
Review of attachment 8441844 [details] [diff] [review]:
-----------------------------------------------------------------
Great! r=me with nits addressed (see comments).
I think the only tests that would exercise this code are in mochitest-bc, so this would be an appropriate try string: "try: -b do -p linux64 -u mochitest-bc -t none"
::: security/manager/ssl/src/TransportSecurityInfo.cpp
@@ +604,5 @@
> CERTGeneralName *sanNameList = nullptr;
>
> SECStatus rv = CERT_FindCertExtension(nssCert, SEC_OID_X509_SUBJECT_ALT_NAME,
> &altNameExtension);
> + if (rv != SECSuccess){
nit: have a space between the final ) and {
@@ +611,3 @@
>
> + mozilla::pkix::ScopedPLArenaPool arena(PORT_NewArena(DER_DEFAULT_CHUNKSIZE));
> + if (!arena){
here too
@@ +616,3 @@
>
> + sanNameList = CERT_DecodeAltNameExtension(arena.get(), &altNameExtension);
> + if (!sanNameList){
here too
Attachment #8441844 -
Flags: review?(dkeeler) → review+
Attachment #8441844 -
Attachment is obsolete: true
Attachment #8442433 -
Flags: review+
Keywords: checkin-needed
Keywords: checkin-needed
Comment 8•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in
before you can comment on or make changes to this bug.
Description
•