[systemd-devel] [PATCH 1/5] shared/import-util: tag renamed to reference to support v2 pull by digest

Lennart Poettering lennart at poettering.net
Fri May 15 07:51:25 PDT 2015


On Fri, 15.05.15 16:48, Pavel Odvody (podvody at redhat.com) wrote:

> yes, sha256 - 256bits / 8 = 64bytes (can easily extrapolate other SHAs)
> Zero-length/invalid value would be an error resulting in 404.
> 
> But I wonder whether we want to do that level of validation as the check
> is mostly sanity.
> 
> Something like this?
> 
> typedef struct HashInfo {
>         char *name;
>         size_t length;
> } HashInfo;
> 
> static HashInfo hashes[] = {
>         {"sha256", 64},
>         {"sha384", 96},
>         {"sha512", 128},
>         ...
> };
> 
> What do you think?

Well, I presume that dkr currently only uses one kind of hash, no? If
so, I'd just support that one, and don't bother with anyting more
complex until this really becomes an issue...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list