79466414f84157f5f9b8434ac6a04ea349616f6c
4 * Same as SHA1DCFinal, but convert collision attack case into a verbose die().
6 void git_SHA1DCFinal(unsigned char hash
[20], SHA1_CTX
*ctx
)
8 if (!SHA1DCFinal(hash
, ctx
))
10 die("SHA-1 appears to be part of a collision attack: %s",
15 * Same as SHA1DCUpdate, but adjust types to match git's usual interface.
17 void git_SHA1DCUpdate(SHA1_CTX
*ctx
, const void *vdata
, unsigned long len
)
19 const char *data
= vdata
;
20 /* We expect an unsigned long, but sha1dc only takes an int */
21 while (len
> INT_MAX
) {
22 SHA1DCUpdate(ctx
, data
, INT_MAX
);
26 SHA1DCUpdate(ctx
, data
, len
);