Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | Fix compiling for openssl 1.1 |
| 2 | |
| 3 | Upstream-Status: Pending |
| 4 | Signed-off-by: Armin Kuster <akuster808@gmail.com> |
| 5 | |
| 6 | Index: git/src/e_tpm.c |
| 7 | =================================================================== |
| 8 | --- git.orig/src/e_tpm.c |
| 9 | +++ git/src/e_tpm.c |
| 10 | @@ -265,19 +265,20 @@ static int tpm_decode_base64(unsigned ch |
| 11 | int *out_len) |
| 12 | { |
| 13 | int total_len, len, ret; |
| 14 | - EVP_ENCODE_CTX dctx; |
| 15 | + EVP_ENCODE_CTX *dctx; |
| 16 | |
| 17 | - EVP_DecodeInit(&dctx); |
| 18 | + dctx = EVP_ENCODE_CTX_new(); |
| 19 | + EVP_DecodeInit(dctx); |
| 20 | |
| 21 | total_len = 0; |
| 22 | - ret = EVP_DecodeUpdate(&dctx, outdata, &len, indata, in_len); |
| 23 | + ret = EVP_DecodeUpdate(dctx, outdata, &len, indata, in_len); |
| 24 | if (ret < 0) { |
| 25 | TSSerr(TPM_F_TPM_DECODE_BASE64, TPM_R_DECODE_BASE64_FAILED); |
| 26 | return 1; |
| 27 | } |
| 28 | |
| 29 | total_len += len; |
| 30 | - ret = EVP_DecodeFinal(&dctx, outdata, &len); |
| 31 | + ret = EVP_DecodeFinal(dctx, outdata, &len); |
| 32 | if (ret < 0) { |
| 33 | TSSerr(TPM_F_TPM_DECODE_BASE64, TPM_R_DECODE_BASE64_FAILED); |
| 34 | return 1; |