Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from mozilla-services/tools
Browse files Browse the repository at this point in the history
Add firefox signature verification tool
  • Loading branch information
jvehent committed Sep 10, 2018
2 parents b04b40e + df82887 commit c04cb30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/parse.go → cmd/margo_verify_firefox/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (
)

func main() {
if len(os.Args) < 2 {
fmt.Printf("usage: %s <file> [json]\nParse and Verify the signature of a Firefox MAR.\nIf json is set as 2nd arg, dump the MAR as JSON too.\n", os.Args[0])
os.Exit(1)
}
var file mar.File
input, err := ioutil.ReadFile(os.Args[1])
if err != nil {
Expand All @@ -34,6 +38,7 @@ func main() {
file.ProductInformation, file.Revision)
}
if file.Revision < 2012 {
fmt.Printf("MAR format precedes 2012 and does not support signatures.")
os.Exit(0)
}
validKeys, isSigned, err := file.VerifyWithFirefoxKeys()
Expand Down

0 comments on commit c04cb30

Please sign in to comment.