certutil doesn't truncate existing temporary files when writing them

RESOLVED FIXED in 3.12

Status

NSS
Tools
P2
minor
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Neil Williams, Assigned: Neil Williams)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

2.10 KB, patch
Julien Pierre
: review+
Nelson Bolyard (seldom reads bugmail)
: review+
Details | Diff | Splinter Review
(Assignee)

Description

10 years ago
Certutil -C and -S commands create temporary cert or cert request files for storing working versions of the objects. If the files exist when certutil is run and they are longer than the cert (req) created extraneous data remains at the end of the file. When the temp file is read back in--for certs, at least--the file length is checked against the DER encoded length, which fails.
(Assignee)

Updated

10 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

10 years ago
Created attachment 281406 [details] [diff] [review]
add PR_TRUNCATE to temp file create calls
Assignee: nobody → neil.williams
Attachment #281406 - Flags: review?(julien.pierre.boogz)
Comment on attachment 281406 [details] [diff] [review]
add PR_TRUNCATE to temp file create calls

r=nelson for the trunk.
Leaving second review request for branch.
Attachment #281406 - Flags: review+
(Assignee)

Comment 3

10 years ago
Checking in cmd/certutil/certutil.c;
/cvsroot/mozilla/security/nss/cmd/certutil/certutil.c,v  <--  certutil.c
new revision: 1.121; previous revision: 1.120
done

Updated

10 years ago
Attachment #281406 - Flags: review?(julien.pierre.boogz) → review+
Fixed on trunk.  Fix didn't get into branch in time for 3.11.8.
Priority: -- → P2
Target Milestone: 3.12 → 3.11.9
Neil fixed this on the trunk.  IMO, that's good enough.
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Target Milestone: 3.11.9 → 3.12
You need to log in before you can comment on or make changes to this bug.