diff options
author | Chong Cai <chongc@google.com> | 2020-11-02 11:15:09 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-02 11:17:29 -0800 |
commit | ed4f8573435763f08971374243934d3dcf65c06a (patch) | |
tree | 7adb9a206b52a655207394f2a7f0ac52e022f04c /pkg/sentry/fsimpl/verity/filesystem.go | |
parent | 2eb3ee586bd35f158c380cb9f2449002418a87ee (diff) |
Pass hashing algorithms in verity fs opts
PiperOrigin-RevId: 340275942
Diffstat (limited to 'pkg/sentry/fsimpl/verity/filesystem.go')
-rw-r--r-- | pkg/sentry/fsimpl/verity/filesystem.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/sentry/fsimpl/verity/filesystem.go b/pkg/sentry/fsimpl/verity/filesystem.go index 2f6050cfd..4e8d63d51 100644 --- a/pkg/sentry/fsimpl/verity/filesystem.go +++ b/pkg/sentry/fsimpl/verity/filesystem.go @@ -276,9 +276,9 @@ func (fs *filesystem) verifyChild(ctx context.Context, parent *dentry, child *de UID: parentStat.UID, GID: parentStat.GID, //TODO(b/156980949): Support passing other hash algorithms. - HashAlgorithms: linux.FS_VERITY_HASH_ALG_SHA256, + HashAlgorithms: fs.alg.toLinuxHashAlg(), ReadOffset: int64(offset), - ReadSize: int64(merkletree.DigestSize(linux.FS_VERITY_HASH_ALG_SHA256)), + ReadSize: int64(merkletree.DigestSize(fs.alg.toLinuxHashAlg())), Expected: parent.hash, DataAndTreeInSameFile: true, }); err != nil && err != io.EOF { @@ -352,7 +352,7 @@ func (fs *filesystem) verifyStat(ctx context.Context, d *dentry, stat linux.Stat UID: stat.UID, GID: stat.GID, //TODO(b/156980949): Support passing other hash algorithms. - HashAlgorithms: linux.FS_VERITY_HASH_ALG_SHA256, + HashAlgorithms: fs.alg.toLinuxHashAlg(), ReadOffset: 0, // Set read size to 0 so only the metadata is verified. ReadSize: 0, |