aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers
diff options
context:
space:
mode:
authorCarlo Nucera <carlo.nucera@protonmail.com>2020-07-01 17:47:15 -0400
committerCarlo Nucera <carlo.nucera@protonmail.com>2020-07-01 17:47:15 -0400
commit274a8136fbf3d0fffb564f33464da26aab924b60 (patch)
tree3c9c95fdb88f84bc0b9cb71ca3d2606a052215f1 /src/libfetchers
parentc2e7f7a7129fc5366a4cad337fcd6ae319a58ce5 (diff)
Correct FIXMEs in libfetchers
Diffstat (limited to 'src/libfetchers')
-rw-r--r--src/libfetchers/fetchers.cc3
-rw-r--r--src/libfetchers/tarball.cc6
2 files changed, 3 insertions, 6 deletions
diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc
index 9174c3de4..91d0d6a1d 100644
--- a/src/libfetchers/fetchers.cc
+++ b/src/libfetchers/fetchers.cc
@@ -35,8 +35,7 @@ std::unique_ptr<Input> inputFromAttrs(const Attrs & attrs)
auto res = inputScheme->inputFromAttrs(attrs2);
if (res) {
if (auto narHash = maybeGetStrAttr(attrs, "narHash"))
- // FIXME: require SRI hash.
- res->narHash = newHashAllowEmpty(*narHash, {});
+ res->narHash = Hash::fromSRI(*narHash);
return res;
}
}
diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc
index f5356f0af..732fac8c3 100644
--- a/src/libfetchers/tarball.cc
+++ b/src/libfetchers/tarball.cc
@@ -242,15 +242,13 @@ struct TarballInputScheme : InputScheme
auto hash = input->url.query.find("hash");
if (hash != input->url.query.end()) {
- // FIXME: require SRI hash.
- input->hash = Hash(hash->second);
+ input->hash = Hash::fromSRI(hash->second);
input->url.query.erase(hash);
}
auto narHash = input->url.query.find("narHash");
if (narHash != input->url.query.end()) {
- // FIXME: require SRI hash.
- input->narHash = Hash(narHash->second);
+ input->narHash = Hash::fromSRI(narHash->second);
input->url.query.erase(narHash);
}