1bf215546Sopenharmony_ciThis local copy of a SHA1 implementation based on the sources below. 2bf215546Sopenharmony_ci 3bf215546Sopenharmony_ciWhy: 4bf215546Sopenharmony_ci - Some libraries suffer from race condition and other issues. For example see 5bf215546Sopenharmony_cicommit ade3108bb5b0 ("util: Fix race condition on libgcrypt initialization"). 6bf215546Sopenharmony_ci 7bf215546Sopenharmony_ci - Fold the handling and detection of _eight_ implementations at configure 8bf215546Sopenharmony_cistage and _seven_ different codepaths. 9bf215546Sopenharmony_ci 10bf215546Sopenharmony_ci - Have a single, uniform, code used by developers, testers and users. 11bf215546Sopenharmony_ci 12bf215546Sopenharmony_ci - Avoid conflicts when using software which ships with it's own SHA1 library. 13bf215546Sopenharmony_ciThe latter of which conflicting with the one mesa is build against. 14bf215546Sopenharmony_ci 15bf215546Sopenharmony_ci 16bf215546Sopenharmony_ci 17bf215546Sopenharmony_ciSource: 18bf215546Sopenharmony_ciThe SHA1 implementation is copied verbatim from the following links. 19bf215546Sopenharmony_ciAt the time of checkout HEAD is 1.25 and 1.24 respectively. 20bf215546Sopenharmony_ci 21bf215546Sopenharmony_cihttp://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/hash/sha1.c?rev=HEAD 22bf215546Sopenharmony_cihttp://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/include/sha1.h?rev=HEAD 23bf215546Sopenharmony_ci 24bf215546Sopenharmony_ci 25bf215546Sopenharmony_ciNotes: 26bf215546Sopenharmony_ci - The files should not have any local changes. If there are any they should be 27bf215546Sopenharmony_ciclearly documented below and one should aim to upstream them where possible. 28bf215546Sopenharmony_ci 29bf215546Sopenharmony_ci - Files will be periodically syncronised with the respective upstream sources. 30bf215546Sopenharmony_ciUpdates will be made regularly, but since the code is _not_ aimed as a 31bf215546Sopenharmony_cicryptography solution any issues found should not be considered security ones. 32bf215546Sopenharmony_ci 33bf215546Sopenharmony_ci 34bf215546Sopenharmony_ciLocal changes: 35bf215546Sopenharmony_ci - Removed __bounded__ attribute qualifiers. Unavailable on platforms targeted 36bf215546Sopenharmony_ciby Mesa. Upstream status: TBD (N/A ?) 37bf215546Sopenharmony_ci 38bf215546Sopenharmony_ci - Pick the sha1.h header from the current folder, by using "" over <> in the 39bf215546Sopenharmony_ciinclude directive. Upstream status: TBD 40bf215546Sopenharmony_ci 41bf215546Sopenharmony_ci - Remove unused function prototypes - SHA1End, SHA1File, SHA1FileChunk and 42bf215546Sopenharmony_ciSHA1Data. Upstream status: TBD 43bf215546Sopenharmony_ci 44bf215546Sopenharmony_ci - Use stdint.h integer types - u_int{8,16,32}_t -> uint{8,16,32}_t and 45bf215546Sopenharmony_ciu_int -> uint32_t, change header include. Upstream status: TBD 46bf215546Sopenharmony_ci 47bf215546Sopenharmony_ci - Revert sha1.c rev 1.26 change (introduce DEF_WEAK). 48bf215546Sopenharmony_ciUpstream status: TBD (N/A ?) 49bf215546Sopenharmony_ci 50bf215546Sopenharmony_ci - Add stdint.h include in sha1.h for uint*_t types. Upstream status: TBD 51bf215546Sopenharmony_ci 52bf215546Sopenharmony_ci - Add stddef.h include in sha1.h for size_t type. Upstream status: TBD 53bf215546Sopenharmony_ci 54bf215546Sopenharmony_ci - Use memset over explicit_bzero, since memset_s once isn't widely available. 55bf215546Sopenharmony_ciUpstream status: TBD (N/A ?) 56bf215546Sopenharmony_ci 57bf215546Sopenharmony_ci - Manually expand __BEGIN_DECLS/__END_DECLS and make sure that they include 58bf215546Sopenharmony_cithe struct declaration. 59bf215546Sopenharmony_ciUpstream status: TBD 60bf215546Sopenharmony_ci 61bf215546Sopenharmony_ci - Add non-typedef struct name. 62bf215546Sopenharmony_ciUpstream status: TBD 63