On Thu, 2022-05-12 at 17:48 -0400, Stefan Berger wrote: > > - /* find the end of the hash */ > > - token = strpbrk(line, ", \t"); > > - hashlen = token ? token - line : strlen(line); > > + /* > > + * Before either directly or indirectly signing the hash, > > + * convert the hex-ascii hash representation to binary. > > + */ > > + if (veritysig) { > > + > > + /* split the algorithm from the hash */ > > + hashp = strpbrk(line, ":"); > > + if (!hashp) { /* pointer to the delimiter */ > > + log_err("Missing fsverity hash algorithm\n"); > > + continue; > > + } > > + > > + algolen = hashp - line; > > + if (algolen > sizeof(algo)) > > + algolen = sizeof(algo); > > I think a hash name exceeding the max buffer size and needing to be > truncating it should be an error since the name to index conversion will > fail later on. Sure. In fact, the hash algorithm name size should be limited to the maximum size of those algorithms that fs-verity actually supports. thanks, Mimi