Commits


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@


another memcmp -> got_object_id_cmp


verify object ID checksums while loose objects are being accessed


add checksum parameters to got_inflate functions which did not provide them yet


make close(2) failure checks consistent; check 'close() == -1' everywhere ok millert, naddy


make fclose(3) failure checks consistent; check 'fclose() == EOF' everywhere ok millert, naddy


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


do not rely on <zlib.h> to pull in <unistd.h> ok stsp


add optional 'consumed' output parameter to got_inflate_to_mem()


include <limits.h> instead of <sys/limits.h>; patch by Thomas Klausner


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.


plug a memory leak in got-read-blob


rename got_error_prefix_errno() to got_error_from_errno()