Open Bug 691196 Opened 13 years ago Updated 6 months ago

crlutil does not truncate output files upon creation

Categories

(NSS :: Tools, defect, P5)

3.12.10

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: mckeon, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Build ID: 20110928134238

Steps to reproduce:

Attempted to create a CRL using the crlutil tool specifying an output file that already exists and is LARGER.

ie. Running these two commands will show the problem. The first command creates a CRL of size 484 bytes, the second should create a CRL of size 467 bytes, but does not.

ie. crlutil -d. -G -n "Oracle Comms Root CA" -f $HOME/.nss/password -o ca.crl << EOF
update=20110901000000Z
nextupdate=20110915235959Z
addcert 4 20110805135000Z
EOF

crlutil -d. -G -n "Oracle Comms Root CA" -f $HOME/.nss/password -o ca.crl << EOF
update=20110916000000Z
addcert 4 20110805135000Z
EOF




Actual results:

Generation of the CRL (and output file) occurred BUT since the original file size was larger than the newer CRL, and  trucation of the file did not occur during opening, excess data was left at the end fo the file. As a result, the output file CRL was unusable, and attempting to use it in NSS would result in SEC_ERROR_EXTRA_INPUT
errors.


Expected results:

Upon writing the output file, the file should be truncated first.
Please note that I have NOT tested or attempted compilation with the attached
patch diffs.
Severity: normal → S3
Severity: S3 → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: