verity: support salt=random generation

Many CrOS build scripts generate a salt randomly (using things like xxd
on /dev/urandom).  Add support for that directly to verity so we don't
have to copy these ad-hoc implementations around.

BUG=chromium:660209
TEST=`verity mode=create alg=sha1 payload=img hashtree=hash salt=random` outputs a random salt each time

Change-Id: Iee631a1eb72945a011d4c64c930b1331330f32cd
Reviewed-on: https://chromium-review.googlesource.com/404728
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2 files changed