1 diff --git a/swtpm-utils/lib/hmac.c b/swtpm-utils/lib/hmac.c
2 index 5545375..f9bedea 100644
3 --- a/swtpm-utils/lib/hmac.c
4 +++ b/swtpm-utils/lib/hmac.c
5 @@ -381,15 +381,19 @@ uint32_t TSS_authhmac(unsigned char *digest, unsigned char *key, unsigned int ke
6 /****************************************************************************/
7 uint32_t TSS_rawhmac(unsigned char *digest, const unsigned char *key, unsigned int keylen, ...)
15 -#ifdef HAVE_HMAC_CTX_CLEANUP
16 - HMAC_CTX_init(&hmac);
18 - HMAC_Init(&hmac,key,keylen,EVP_sha1());
20 + hmac = HMAC_CTX_new();
27 + HMAC_Init_ex(hmac,key,keylen,EVP_sha1(),NULL);
29 va_start(argp,keylen);
31 @@ -398,15 +402,11 @@ uint32_t TSS_rawhmac(unsigned char *digest, const unsigned char *key, unsigned i
33 data = (unsigned char *)va_arg(argp,unsigned char *);
34 if (data == NULL) return ERR_NULL_ARG;
35 - HMAC_Update(&hmac,data,dlen);
36 + HMAC_Update(hmac,data,dlen);
38 - HMAC_Final(&hmac,digest,&dlen);
39 + HMAC_Final(hmac,digest,&dlen);
41 -#ifdef HAVE_HMAC_CTX_CLEANUP
42 - HMAC_CTX_cleanup(&hmac);
44 - HMAC_cleanup(&hmac);
46 + HMAC_CTX_free(hmac);
50 diff --git a/swtpm-utils/lib/keys.c b/swtpm-utils/lib/keys.c
51 index 99691b6..6627a1f 100644
52 --- a/swtpm-utils/lib/keys.c
53 +++ b/swtpm-utils/lib/keys.c
54 @@ -1249,8 +1249,7 @@ RSA *TSS_convpubkey(pubkeydata *k)
57 /* set up the RSA public key structure */
60 + RSA_set0_key(rsa, mod, exp, NULL);