aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/content-address.cc
diff options
context:
space:
mode:
authorCarlo Nucera <carlo.nucera@protonmail.com>2020-07-02 11:57:21 -0400
committerCarlo Nucera <carlo.nucera@protonmail.com>2020-07-02 11:57:21 -0400
commit1fc835aa223520f37e4945fa8626a096f170b188 (patch)
treec246bfc22ea1af160dccbc098650af26703cece7 /src/libstore/content-address.cc
parentb6b10b1d4cb1cd487bbb5d2cc063ca743ae79004 (diff)
Tighten parsing for drv files and pathinfo
Diffstat (limited to 'src/libstore/content-address.cc')
-rw-r--r--src/libstore/content-address.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc
index 2d96fb0c0..02ab6710f 100644
--- a/src/libstore/content-address.cc
+++ b/src/libstore/content-address.cc
@@ -68,7 +68,7 @@ ContentAddress parseContentAddress(std::string_view rawCa) {
throw Error("text content address hash should use %s, but instead uses %s",
printHashType(htSHA256), printHashType(hashType));
return TextHash {
- .hash = Hash::parseAny(rest, std::move(hashType)),
+ .hash = Hash::parseNonSRIUnprefixed(rest, std::move(hashType)),
};
} else if (prefix == "fixed") {
// Parse method
@@ -80,7 +80,7 @@ ContentAddress parseContentAddress(std::string_view rawCa) {
HashType hashType = parseHashType_();
return FixedOutputHash {
.method = method,
- .hash = Hash::parseAny(rest, std::move(hashType)),
+ .hash = Hash::parseNonSRIUnprefixed(rest, std::move(hashType)),
};
} else
throw UsageError("content address prefix \"%s\" is unrecognized. Recogonized prefixes are \"text\" or \"fixed\"", prefix);