Hi,
OpenSSL 1.1.0 is about to released. During a rebuild of all packages
using OpenSSL this package fail to build.
A log of that build can be found at:
https://breakpoint.cc/openssl-1.1-rebuild-2016-05-29/Attempted/trousers_0.3.13-4_amd64-20160529-1546
On https://wiki.openssl.org/index.php/1.1_API_Changes you can see
various of the reasons why it might fail. There are also updated man
pages at https://www.openssl.org/docs/manmaster/ that should contain
useful information.
I tried to add a patch on the sources (a preliminary version is
attached). However, one (and maybe more) file is more problematic:
src/trspi/crypto/openssl/rsa.c
In this file, trousers is accessing members of the RSA structure
directly, while this structure is now opaque.
Could you have a look please ?
Thanks.
Pierre
Index: trousers/src/trspi/crypto/openssl/hash.c
===================================================================
--- trousers.orig/src/trspi/crypto/openssl/hash.c
+++ trousers/src/trspi/crypto/openssl/hash.c
@@ -56,13 +56,18 @@ int MGF1(unsigned char *, long, const un
TSS_RESULT
Trspi_Hash(UINT32 HashType, UINT32 BufSize, BYTE* Buf, BYTE* Digest)
{
- EVP_MD_CTX md_ctx;
+ EVP_MD_CTX *md_ctx;
unsigned int result_size;
int rv;
+ if ((md_ctx = EVP_MD_CTX_new()) == NULL) {
+ rv = TSPERR(TSS_E_OUTOFMEMORY);
+ goto err;
+ }
+
switch (HashType) {
case TSS_HASH_SHA1:
- rv = EVP_DigestInit(&md_ctx, EVP_sha1());
+ rv = EVP_DigestInit(md_ctx, EVP_sha1());
break;
default:
rv = TSPERR(TSS_E_BAD_PARAMETER);
@@ -75,14 +80,14 @@ Trspi_Hash(UINT32 HashType, UINT32 BufSi
goto err;
}
- rv = EVP_DigestUpdate(&md_ctx, Buf, BufSize);
+ rv = EVP_DigestUpdate(md_ctx, Buf, BufSize);
if (rv != EVP_SUCCESS) {
rv = TSPERR(TSS_E_INTERNAL_ERROR);
goto err;
}
- result_size = EVP_MD_CTX_size(&md_ctx);
- rv = EVP_DigestFinal(&md_ctx, Digest, &result_size);
+ result_size = EVP_MD_CTX_size(md_ctx);
+ rv = EVP_DigestFinal(md_ctx, Digest, &result_size);
if (rv != EVP_SUCCESS) {
rv = TSPERR(TSS_E_INTERNAL_ERROR);
goto err;
@@ -94,6 +99,8 @@ Trspi_Hash(UINT32 HashType, UINT32 BufSi
err:
DEBUG_print_openssl_errors();
out:
+ if (md_ctx != NULL)
+ EVP_MD_CTX_free(md_ctx);
return rv;
}
@@ -112,7 +119,7 @@ Trspi_HashInit(Trspi_HashCtx *ctx, UINT3
break;
}
- if ((ctx->ctx = malloc(sizeof(EVP_MD_CTX))) == NULL)
+ if ((ctx->ctx = EVP_MD_CTX_new()) == NULL)
return TSPERR(TSS_E_OUTOFMEMORY);
rv = EVP_DigestInit((EVP_MD_CTX *)ctx->ctx, (const EVP_MD *)md);
------------------------------------------------------------------------------
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech