SHA256
1
0
forked from pool/fipscheck
fipscheck/openssl-1_1-port.patch

51 lines
1.2 KiB
Diff

Index: fipscheck-1.4.1/src/filehmac.c
===================================================================
--- fipscheck-1.4.1.orig/src/filehmac.c
+++ fipscheck-1.4.1/src/filehmac.c
@@ -166,7 +166,7 @@ compute_file_hmac(const char *path, void
int prelink = 0;
#endif
int rv = -1;
- HMAC_CTX c;
+ HMAC_CTX *c;
unsigned char rbuf[READ_BUFFER_LENGTH];
size_t len;
unsigned int hlen;
@@ -178,7 +178,7 @@ compute_file_hmac(const char *path, void
}
}
- HMAC_CTX_init(&c);
+ c = HMAC_CTX_new();
#ifdef CALL_PRELINK
if (access(PATH_PRELINK, X_OK) == 0) {
@@ -197,15 +197,15 @@ compute_file_hmac(const char *path, void
goto end;
}
- HMAC_Init(&c, hmackey, sizeof(hmackey)-1, EVP_sha256());
+ HMAC_Init_ex(c, hmackey, sizeof(hmackey)-1, EVP_sha256(), NULL);
while ((len=fread(rbuf, 1, sizeof(rbuf), f)) != 0) {
- HMAC_Update(&c, rbuf, len);
+ HMAC_Update(c, rbuf, len);
}
len = sizeof(rbuf);
/* reuse rbuf for hmac */
- HMAC_Final(&c, rbuf, &hlen);
+ HMAC_Final(c, rbuf, &hlen);
*buf = malloc(hlen);
if (*buf == NULL) {
@@ -219,7 +219,7 @@ compute_file_hmac(const char *path, void
rv = 0;
end:
- HMAC_CTX_cleanup(&c);
+ HMAC_CTX_free(c);
if (f)
fclose(f);