if (error)
return error;
- if (!hash_matches(expected->buf, expected->size, actual, actual_len))
- return pr_err("File does not match its hash.");
+ if (!hash_matches(expected->buf, expected->size, actual, actual_len)) {
+ return pr_err("File '%s' does not match its manifest hash.",
+ uri_get_printable(uri));
+ }
return 0;
}
} /* Otherwise ownership was transferred to @pp. */
}
+ /* rfc6486#section-7 */
+ if (rpp_get_crl(*pp) == NULL) {
+ error = pr_err("Manifest lacks a CRL.");
+ goto fail;
+ }
+
return 0;
fail:
*last_slash = '\0';
- switch (stat(path, &_stat)) {
- case 0:
+ if (stat(path, &_stat) == 0) {
if (!S_ISDIR(_stat.st_mode)) {
return pr_err("Path '%s' exists and is not a directory.",
path);
}
-
*result = true;
- break;
- case ENOENT:
+ } else if (errno == ENOENT) {
*result = false;
- break;
- default:
+ } else {
return pr_errno(errno, "stat() failed");
}