Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Oct 12, 2023
1 parent 35232eb commit fa8aa98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/provision/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ func readHTTP(ctx context.Context, u *url.URL) ([]byte, error) {
return nil, err
}
switch resp.StatusCode {
case 404:
case http.StatusNotFound:
klog.Infof("Not found: %q", u.String())
return nil, os.ErrNotExist
case 200:
case http.StatusOK:
break
default:
return nil, fmt.Errorf("unexpected http status %q", resp.Status)
Expand Down
12 changes: 6 additions & 6 deletions cmd/provision/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ var (

appletVerifier = flag.String("applet_verifier", "", "Verifier key for the applet manifest.")
bootVerifier = flag.String("boot_verifier", "", "Verifier key for the boot manifest.")
osVerifier1 = flag.String("os_verifier_1", "", "Verifier key 1 for the os manifest.")
osVerifier2 = flag.String("os_verifier_2", "", "Verifier key 2 for the os manifest.")
osVerifier1 = flag.String("os_verifier_1", "", "Verifier key 1 for the OS manifest.")
osVerifier2 = flag.String("os_verifier_2", "", "Verifier key 2 for the OS manifest.")
recoveryVerifier = flag.String("recovery_verifier", "", "Verifier key for the recovery manifest.")

blockDeviceGlob = flag.String("blockdevs", "/dev/sd*", "Glob for plausible block devices where the armored witness could appear")
Expand Down Expand Up @@ -135,11 +135,11 @@ func fetchLatestArtefacts(ctx context.Context) (*firmwares, error) {
}
osVerifier1, err := note.NewVerifier(*osVerifier1)
if err != nil {
return nil, fmt.Errorf("invalid os verifier 1: %v", err)
return nil, fmt.Errorf("invalid OS verifier 1: %v", err)
}
osVerifier2, err := note.NewVerifier(*osVerifier2)
if err != nil {
return nil, fmt.Errorf("invalid os verifier 2: %v", err)
return nil, fmt.Errorf("invalid OS verifier 2: %v", err)
}
recoveryVerifier, err := note.NewVerifier(*recoveryVerifier)
if err != nil {
Expand Down Expand Up @@ -179,12 +179,12 @@ func fetchLatestArtefacts(ctx context.Context) (*firmwares, error) {
return nil, fmt.Errorf("Scan: %v", err)
}

latestOsVer, latestAppletVer, err := updateFetcher.GetLatestVersions(ctx)
latestOSVer, latestAppletVer, err := updateFetcher.GetLatestVersions(ctx)
if err != nil {
return nil, fmt.Errorf("GetLatestVersions: %v", err)
}

klog.Infof("Found latest versions: OS %v, Applet %v", latestOsVer, latestAppletVer)
klog.Infof("Found latest versions: OS %v, Applet %v", latestOSVer, latestAppletVer)

fw := &firmwares{
BootloaderBlock: bootloaderBlock,
Expand Down

0 comments on commit fa8aa98

Please sign in to comment.