MCPcopy Create free account
hub / github.com/apache/cloudberry / sha1hmac

Function sha1hmac

gpcontrib/gpcloud/src/s3utils.cpp:11–19  ·  view source on GitHub ↗

not returning the normal hex result, might have '\0'

Source from the content-addressed store, hash-verified

9
10// not returning the normal hex result, might have '\0'
11bool sha1hmac(const char *str, unsigned char out_hash[SHA_DIGEST_LENGTH], const char *secret,
12 int secret_len) {
13 if (!str) return false;
14
15 // SHA_DIGEST_LENGTH is 20
16 HMAC(EVP_sha1(), secret, secret_len, (unsigned char *)str, strlen(str), out_hash, NULL);
17
18 return true;
19}
20
21bool sha1hmac_hex(const char *str, char out_hash_hex[SHA_DIGEST_STRING_LENGTH], const char *secret,
22 int secret_len) {

Callers 1

sha1hmac_hexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected