Closed Bug 982778 Opened 6 years ago Closed 6 years ago

mozilla::pkix::der::AlgorithmIdentifier leaves parameters of output value uninitialized

Categories

(Core :: Security: PSM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: st3fan, Assigned: briansmith)

References

Details

Attachments

(1 file)

The AlgorithmIdentifierNoParams test fails because algorithmID.parameters.len is not initialized.

The der::AlgorithmIdentifier() ignores the parameters (is that correct? are those never used in certificates?) so even though it then correctly sets algorithmID.algorithm, it leaves algorithmID.parameters alone, which means the parameters contain junk value.

Since this is passed to NSS at some point, I think the algorithmID.parameters should be initialized to zero or whatever is appropriate for NSS.
The AlgorithmIdentifierNullParams test is failing for the same reason.
Thanks. I think this is definitely a bug that needs to be fixed ASAP.

Regarding whether the parameters should be ignored or not: let's see what NSS's processing does.
Assignee: nobody → brian
OS: Mac OS X → All
Hardware: x86 → All
Summary: Test failure for insanity::pkixder AlgorithmIdentifierNoParams → Test failure for insanity::der::AlgorithmIdentifier leaves parameters of output value uninitialized
Summary: Test failure for insanity::der::AlgorithmIdentifier leaves parameters of output value uninitialized → insanity::der::AlgorithmIdentifier leaves parameters of output value uninitialized
AlgorithmIdentifierNoParams The test is in bug 968490, cases AlgorithmIdentifierNullParams.
Target Milestone: --- → mozilla30
Comment on attachment 8391556 [details] [diff] [review]
fix-uninitialized-output.patch

Review of attachment 8391556 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM.
Attachment #8391556 - Flags: review?(dkeeler) → review+
Summary: insanity::der::AlgorithmIdentifier leaves parameters of output value uninitialized → mozilla::pkix::der::AlgorithmIdentifier leaves parameters of output value uninitialized
Target Milestone: mozilla30 → mozilla31
https://hg.mozilla.org/mozilla-central/rev/08032b8280c6
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
No longer blocks: 998482
You need to log in before you can comment on or make changes to this bug.