Closed Bug 798413 Opened 13 years ago Closed 13 years ago

Add the ability to export signatures from a libmar file

Categories

(Toolkit :: Application Update, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19
blocking-basecamp +
Tracking Status
firefox18 --- fixed
firefox19 --- fixed

People

(Reporter: bbondy, Assigned: bbondy)

References

Details

Attachments

(3 files, 6 obsolete files)

We need a way to export a specific signature from a MAR file. This should include a way to specify which signature should be exported. The exported signature should be in a copy/pasteable encoding such as base64.
Keywords: sec-want
Blocks: 798415
Attachment #669650 - Flags: review?(bsmith)
Attachment #669651 - Flags: review?(bsmith)
Attachment #669652 - Flags: review?(bsmith)
- Fixed file handle not being closed after extracting sig - Synced parameter name/comments - Fixed a couple typos
Attachment #669650 - Attachment is obsolete: true
Attachment #669650 - Flags: review?(bsmith)
Attachment #669978 - Flags: review?(bsmith)
Rebased after multi signing review comments and carried forward similar review comments into this patch.
Attachment #669978 - Attachment is obsolete: true
Attachment #669978 - Flags: review?(bsmith)
Attachment #671426 - Flags: review?(bsmith)
Rebased for windows change
Attachment #671426 - Attachment is obsolete: true
Attachment #671426 - Flags: review?(bsmith)
Attachment #671462 - Flags: review?(bsmith)
Attachment #671462 - Attachment is obsolete: true
Attachment #671462 - Flags: review?(bsmith)
Attachment #671471 - Flags: review?(bsmith)
Comment on attachment 671471 [details] [diff] [review] Patch v4' - Implementation for extracting signatures Review of attachment 671471 [details] [diff] [review]: ----------------------------------------------------------------- ::: modules/libmar/sign/mar_sign.c @@ +507,5 @@ > + fprintf(stderr, "ERROR: could not open source file: %s\n", src); > + goto failure; > + } > + > + fpDest = fopen(dest, "wb"); IMO, it is better to just do things the Unix way and output to stdout. If the user wants the output in a file then they can redirect the output. I suspect people will want to write scripts like: mar -X0 [...] >> signatures echo >> signatures mar -X1 [...] >> signatures echo >> signatures
Attachment #671471 - Flags: review?(bsmith) → review+
Attachment #669652 - Flags: review?(bsmith) → review+
Comment on attachment 669651 [details] [diff] [review] Patch v1 - Tests for extracting signatures Review of attachment 669651 [details] [diff] [review]: ----------------------------------------------------------------- ::: modules/libmar/tests/unit/test_sign_verify.js @@ +325,5 @@ > let outMARData = getBinaryFileData(outMAR); > let originalMARData = getBinaryFileData(originalMAR); > compareBinaryData(outMARData, originalMARData); > }, > + // Test extracting the first MAR in a MAR that has only a single signature s/first MAR/first signature/
Attachment #669651 - Flags: review?(bsmith) → review+
(In reply to Brian Smith (:bsmith) from comment #8) > Comment on attachment 671471 [details] [diff] [review] > Patch v4' - Implementation for extracting signatures > > Review of attachment 671471 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: modules/libmar/sign/mar_sign.c > @@ +507,5 @@ > > + fprintf(stderr, "ERROR: could not open source file: %s\n", src); > > + goto failure; > > + } > > + > > + fpDest = fopen(dest, "wb"); > > IMO, it is better to just do things the Unix way and output to stdout. If > the user wants the output in a file then they can redirect the output. > > I suspect people will want to write scripts like: > > mar -X0 [...] >> signatures > echo >> signatures > mar -X1 [...] >> signatures > echo >> signatures I considered changing this, but there's no point and no advantage since you can just do something like less filename and pipe it wherever you want. There's more important things to do.
Fixed comment. Carrying forward r+.
Attachment #669651 - Attachment is obsolete: true
Attachment #671696 - Flags: review+
Small fix to initialize fpSrc and fpDest to NULL which caused intermittent crash on invalid path specified test cases. Carrying forward r+.
Attachment #671471 - Attachment is obsolete: true
Attachment #671703 - Flags: review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Depends on: 929466
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: