SHA256
1
0
forked from pool/tboot
tboot/tboot-openssl-1-1-0.patch
Matthias Gerstner f2d987fcbc Accepting request 540233 from home:mgerstner:branches:security
- tboot-openssl-1-1-0.patch: make package compatible with OpenSSL 1.1.0.
  There's no upstream release containing this patch yet. The patch builds
  against OpenSSL 1.0.x as well. This is for SLE-15 support (bnc#1067229).

OBS-URL: https://build.opensuse.org/request/show/540233
OBS-URL: https://build.opensuse.org/package/show/security/tboot?expand=0&rev=67
2017-11-09 14:20:14 +00:00

33 lines
1001 B
Diff

changeset: 503:2bb331ec268d
user: Ning Sun <ning.sun@intel.com>
date: Mon Aug 28 02:10:28 2017 -0700
summary: port to openssl-1.1.0
diff -r e57efe410a90 -r 2bb331ec268d lcptools/hash.c
--- a/lcptools/hash.c Mon Jul 24 05:34:17 2017 -0700
+++ b/lcptools/hash.c Mon Aug 28 02:10:28 2017 -0700
@@ -74,13 +74,18 @@
return false;
if ( hash_alg == TB_HALG_SHA1_LG ) {
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx = EVP_MD_CTX_create();
+ if (ctx == NULL) {
+ fprintf(stderr, "%s(): EVP_MD_CTX_create() failed.\n", __func__);
+ return false;
+ }
const EVP_MD *md;
md = EVP_sha1();
- EVP_DigestInit(&ctx, md);
- EVP_DigestUpdate(&ctx, buf, size);
- EVP_DigestFinal(&ctx, hash->sha1, NULL);
+ EVP_DigestInit(ctx, md);
+ EVP_DigestUpdate(ctx, buf, size);
+ EVP_DigestFinal(ctx, hash->sha1, NULL);
+ EVP_MD_CTX_destroy(ctx);
return true;
}
else