Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7170ad7f authored by Cole Faust's avatar Cole Faust Committed by Automerger Merge Worker
Browse files

Salt init_boot and vendor_boot using the build number am: c117f933 am: 53b96856

parents 345dc29e 53b96856
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -330,9 +330,17 @@ func (b *bootimg) addAvbFooter(ctx android.ModuleContext, unsignedImage android.
		cmd.Flag("--dynamic_partition_size")
	}

	// If you don't provide a salt, avbtool will use random bytes for the salt.
	// This is bad for determinism (cached builds and diff tests are affected), so instead,
	// we try to provide a salt. The requirements for a salt are not very clear, one aspect of it
	// is that if it's unpredictable, attackers trying to change the contents of a partition need
	// to find a new hash collision every release, because the salt changed.
	if kernel != nil {
		cmd.Textf(`--salt $(sha256sum "%s" | cut -d " " -f 1)`, kernel.String())
		cmd.Implicit(kernel)
	} else {
		cmd.Textf(`--salt $(sha256sum "%s" "%s" | cut -d " " -f 1 | tr -d '\n')`, ctx.Config().BuildNumberFile(ctx), ctx.Config().Getenv("BUILD_DATETIME_FILE"))
		cmd.OrderOnly(ctx.Config().BuildNumberFile(ctx))
	}

	cmd.FlagWithArg("--partition_name ", b.bootImageType.String())