biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / security / tpm-luks / openssl-1.1.patch
blob10132242b3457cb513c05493562849b11fd49170
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, ...)
9 - HMAC_CTX hmac;
10 + HMAC_CTX* hmac;
11 unsigned int dlen;
12 unsigned char *data;
13 va_list argp;
15 -#ifdef HAVE_HMAC_CTX_CLEANUP
16 - HMAC_CTX_init(&hmac);
17 -#endif
18 - HMAC_Init(&hmac,key,keylen,EVP_sha1());
20 + hmac = HMAC_CTX_new();
22 + if (hmac == NULL)
23 + {
24 + return ERR_MEM_ERR;
25 + }
27 + HMAC_Init_ex(hmac,key,keylen,EVP_sha1(),NULL);
29 va_start(argp,keylen);
30 for (;;)
31 @@ -398,15 +402,11 @@ uint32_t TSS_rawhmac(unsigned char *digest, const unsigned char *key, unsigned i
32 if (dlen == 0) break;
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);
43 -#else
44 - HMAC_cleanup(&hmac);
45 -#endif
46 + HMAC_CTX_free(hmac);
47 va_end(argp);
48 return 0;
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)
55 exp);
57 /* set up the RSA public key structure */
58 - rsa->n = mod;
59 - rsa->e = exp;
60 + RSA_set0_key(rsa, mod, exp, NULL);
61 return rsa;