Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ int HMAC_SHA256(const unsigned char *data, size_t data_len,
unsigned char *out, size_t *out_len)
{
unsigned int len = 0;
HMAC(EVP_sha256(), key, key_len, data, data_len, out, &len);
char *ac = HMAC(EVP_sha256(), key, key_len, data, data_len, out, &len);
*out_len = len;
return 0;
return (ac != NULL) ? 0 : -1;
}

int main()
Expand Down
5 changes: 2 additions & 3 deletions test.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <stdlib.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#include <check.h>
Expand All @@ -10,9 +9,9 @@ int HMAC_SHA256(const unsigned char *data, size_t data_len,
unsigned char *out, size_t *out_len)
{
unsigned int len = 0;
HMAC(EVP_sha256(), key, key_len, data, data_len, out, &len);
char *ac = HMAC(EVP_sha256(), key, key_len, data, data_len, out, &len);
*out_len = len;
return 0;
return (ac != NULL) ? 0 : -1;
}

START_TEST(AwsSigv4Test_AwsSigv4Sign)
Expand Down