diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-09-30 08:11:40 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-10-02 16:34:47 -0400 |
| commit | 31ecaca2d3e87d20782a54cb319f5c19e6c6e62f (patch) | |
| tree | 06131413f2e42a8c3e51bbe0134f9267531bad62 /src/hash/sha1/openssl.c | |
| parent | 2a713da1ec2e9f74c9edc75b06540ab095c68c34 (diff) | |
| download | libgit2-31ecaca2d3e87d20782a54cb319f5c19e6c6e62f.tar.gz | |
hash: hash functions operate on byte arrays not git_oids
Separate the concerns of the hash functions from the git_oid functions.
The git_oid structure will need to understand either SHA1 or SHA256; the
hash functions should only deal with the appropriate one of these.
Diffstat (limited to 'src/hash/sha1/openssl.c')
| -rw-r--r-- | src/hash/sha1/openssl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hash/sha1/openssl.c b/src/hash/sha1/openssl.c index 68d9611d4..64bf99b3c 100644 --- a/src/hash/sha1/openssl.c +++ b/src/hash/sha1/openssl.c @@ -46,11 +46,11 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len) return 0; } -int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx) +int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx) { GIT_ASSERT_ARG(ctx); - if (SHA1_Final(out->id, &ctx->c) != 1) { + if (SHA1_Final(out, &ctx->c) != 1) { git_error_set(GIT_ERROR_SHA1, "hash_openssl: failed to finalize hash"); return -1; } |
