Commit Briefs
style: no-op change in practice
change so it matches the style used in the rest of the tree. ok stsp
convert to use imsg_get_fd()
While here also fix a fd leak in got-read-pack. We were dup'ing imsg.fd without closing imsg.fd later; instead just use imsg_get_fd() to extract the file descriptor. Tested by falsifian and Kyle Ackerman, thanks! 'go ahead' stsp@
add some helper functions to compute hashes
This adds a set of functions to abstract over SHA1Init, SHA1Update, SHA1Final, their respective SHA256 variants and how to compare digests. Replace all the SHA1*() usage with the new APIs. It's a preparatory step for sha256 handling. ok stsp@
include sha2.h too where sha1.h is included
In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>
introduce got_error_checksum
ok stsp@
Stop including <sys/syslimits.h> directly.
POSIX says the limits defined there are available from <limits.h>, which almost all affected source files already included anyway. ok millert stsp
make got-read-blob account for header len in size check
Fixes "no space" error with blobs which happen to straddle the size boundary for in-memory handling.
got_error_from_errno -> got_error_prefix_errno
also add got_error_prefix_errno2 and got_error_prefix_errno3 which should hopefully all be merged into a single function with variadic args (but can't alloc mem)