New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 754455 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 649672



Sign in to add a comment

Fix app-crypt/trousers for OpenSSL 1.1

Project Member Reported by djkurtz@chromium.org, Aug 10 2017

Issue description

app-crypt/trousers-0.3.3-r61 fails to build with dev-libs/openssl-1.1.0f.

trousers is a fork of an upstream package [0] that is now a cros_workon package. 0.3.3-r61 corresponds to commit:
31f4933a54cce7b157619eb1dd14ea32bec39279
trousers: include tcsd as a boot services dependency.

[0] https://sourceforge.net/p/trousers/trousers/ci/master/tree/

Upstream is at version 0.3.14 which does support OpenSSL 1.1 via commit:
05411ea68746acbaf4e69295be50b9a47cddb2fd
[PATCH] support OpenSSL 1.1.0

Upstream gentoo now uses 0.3.14-r1 which includes this patch.

For the record, the failure is:
crypto/openssl/rsa.c:71:5: error: incomplete definition of type 'struct rsa_st'
        rsa->n = BN_bin2bn(publicKey, keysize, rsa->n);
        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:71:44: error: incomplete definition of type 'struct rsa_st'
        rsa->n = BN_bin2bn(publicKey, keysize, rsa->n);
                                               ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:73:5: error: incomplete definition of type 'struct rsa_st'
        rsa->e = BN_bin2bn(exp, sizeof(exp), rsa->e);
        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:73:42: error: incomplete definition of type 'struct rsa_st'
        rsa->e = BN_bin2bn(exp, sizeof(exp), rsa->e);
                                             ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:75:9: error: incomplete definition of type 'struct rsa_st'
        if (rsa->n == NULL || rsa->e == NULL) {
            ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:75:27: error: incomplete definition of type 'struct rsa_st'
        if (rsa->n == NULL || rsa->e == NULL) {
                              ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:149:5: error: incomplete definition of type 'struct rsa_st'
        rsa->n = BN_bin2bn(pModulus, iKeyLength, rsa->n);
        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:149:46: error: incomplete definition of type 'struct rsa_st'
        rsa->n = BN_bin2bn(pModulus, iKeyLength, rsa->n);
                                                 ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:151:5: error: incomplete definition of type 'struct rsa_st'
        rsa->e = BN_bin2bn(exp, sizeof(exp), rsa->e);
        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:151:42: error: incomplete definition of type 'struct rsa_st'
        rsa->e = BN_bin2bn(exp, sizeof(exp), rsa->e);
                                             ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:153:9: error: incomplete definition of type 'struct rsa_st'
        if (rsa->n == NULL || rsa->e == NULL) {
            ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:153:27: error: incomplete definition of type 'struct rsa_st'
        if (rsa->n == NULL || rsa->e == NULL) {
                              ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:240:5: error: incomplete definition of type 'struct rsa_st'
        rsa->n = BN_bin2bn(pubkey, pubsize, rsa->n);
        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:240:41: error: incomplete definition of type 'struct rsa_st'
        rsa->n = BN_bin2bn(pubkey, pubsize, rsa->n);
                                            ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:242:5: error: incomplete definition of type 'struct rsa_st'
        rsa->e = BN_bin2bn(exp, e_size, rsa->e);
        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:242:37: error: incomplete definition of type 'struct rsa_st'
        rsa->e = BN_bin2bn(exp, e_size, rsa->e);
                                        ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:244:9: error: incomplete definition of type 'struct rsa_st'
        if (rsa->n == NULL || rsa->e == NULL) {
            ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
crypto/openssl/rsa.c:244:27: error: incomplete definition of type 'struct rsa_st'
        if (rsa->n == NULL || rsa->e == NULL) {
                              ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
18 errors generated.

crypto/openssl/symmetric.c:55:17: error: variable has incomplete type 'EVP_CIPHER_CTX' (aka 'struct evp_cipher_ctx_st')
        EVP_CIPHER_CTX ctx;
                       ^
/usr/include/openssl/ossl_typ.h:90:16: note: forward declaration of 'struct evp_cipher_ctx_st'
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
               ^
crypto/openssl/symmetric.c:102:17: error: variable has incomplete type 'EVP_CIPHER_CTX' (aka 'struct evp_cipher_ctx_st')
        EVP_CIPHER_CTX ctx;
                       ^
/usr/include/openssl/ossl_typ.h:90:16: note: forward declaration of 'struct evp_cipher_ctx_st'
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
               ^
crypto/openssl/symmetric.c:258:17: error: variable has incomplete type 'EVP_CIPHER_CTX' (aka 'struct evp_cipher_ctx_st')
        EVP_CIPHER_CTX ctx;
                       ^
/usr/include/openssl/ossl_typ.h:90:16: note: forward declaration of 'struct evp_cipher_ctx_st'
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
               ^
crypto/openssl/symmetric.c:332:17: error: variable has incomplete type 'EVP_CIPHER_CTX' (aka 'struct evp_cipher_ctx_st')
        EVP_CIPHER_CTX ctx;
                       ^
/usr/include/openssl/ossl_typ.h:90:16: note: forward declaration of 'struct evp_cipher_ctx_st'
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
               ^
4 errors generated.

crypto/openssl/hash.c:59:13: error: variable has incomplete type 'EVP_MD_CTX' (aka 'struct evp_md_ctx_st')
        EVP_MD_CTX md_ctx;
                   ^
/usr/include/openssl/ossl_typ.h:92:16: note: forward declaration of 'struct evp_md_ctx_st'
typedef struct evp_md_ctx_st EVP_MD_CTX;
               ^
crypto/openssl/hash.c:115:25: error: invalid application of 'sizeof' to an incomplete type 'EVP_MD_CTX' (aka 'struct evp_md_ctx_st')
        if ((ctx->ctx = malloc(sizeof(EVP_MD_CTX))) == NULL)
                               ^     ~~~~~~~~~~~~
/usr/include/openssl/ossl_typ.h:92:16: note: forward declaration of 'struct evp_md_ctx_st'
typedef struct evp_md_ctx_st EVP_MD_CTX;
               ^

 
CLs:
https://chromium-review.googlesource.com/611212
  UPSTREAM: Replaced stack allocation and malloc of EVP_MD_CTX structures        
https://chromium-review.googlesource.com/611213
  UPSTREAM: [PATCH] support OpenSSL 1.1.0        

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 18 2017

Labels: merge-merged-master-0.3.13
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/trousers/+/79767d279593523c8ba46879cee8f71f317ebb01

commit 79767d279593523c8ba46879cee8f71f317ebb01
Author: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com>
Date: Fri Aug 18 03:41:55 2017

UPSTREAM: Replaced stack allocation and malloc of EVP_MD_CTX structures

This patch replaced all occurrences of stack allocation and malloc
of EVP_MD_CTX structures by EVP_MD_CTX_create() to avoid binary
incompatibility issues if the size of EVP_MD_CTX structure change.
EVP_MD_CTX_destroy() was used for freeing resources.

(cherry picked from commit 2883cb0dc6197ec878f2fbee5ffc8dbfec0d0e15)
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

BUG=chromium:754455
TEST=w/ openssl-1.0.2k: emerge-hana trousers
TEST=w/ openssl-1.1.0e: emerge-hana trousers

Change-Id: I3d6acab26d2095c3fdec4154ee0f3964b7df1f00
Reviewed-on: https://chromium-review.googlesource.com/611212
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>

[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/tspi/daa/daa_issuer/key_correctness_proof.c
[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/tspi/daa/daa_issuer/issue_credential.c
[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/tspi/daa/daa_structs.c
[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/tspi/daa/test_sign.c
[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/tspi/daa/daa_platform/test_join.c
[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/tcs/crypto/openssl/crypto.c
[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/trspi/crypto/openssl/hash.c
[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/tspi/daa/daa_platform/platform.c
[modify] https://crrev.com/79767d279593523c8ba46879cee8f71f317ebb01/src/tspi/daa/daa_verifier/verifier_transaction.c

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/trousers/+/9a5752f73a2395353f96e3f284e89e4638af695f

commit 9a5752f73a2395353f96e3f284e89e4638af695f
Author: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com>
Date: Fri Aug 18 03:41:55 2017

UPSTREAM: [PATCH] support OpenSSL 1.1.0

The patch supports OpenSSL 1.1.0. It was then modified to keep function
calls such as EVP_MD_CTX_create and EVP_MD_CTX_destroy, as opposed to
EVP_MD_CTX_new and EVP_MD_CTX_free, in order to retain the backward
compatibility of the package.

	Signed-off-by: Daiki Ueno <dueno@redhat.com>
	Signed-off-by: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com>

(cherry picked from commit 05411ea68746acbaf4e69295be50b9a47cddb2fd)
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

BUG=chromium:754455
TEST=w/ openssl-1.0.2k: emerge-hana trousers
TEST=w/ openssl-1.1.0e: emerge-hana trousers

Change-Id: I86b6c2c9ffa91ff6e1bfa759569e427f77e2bc40
Reviewed-on: https://chromium-review.googlesource.com/611213
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>

[modify] https://crrev.com/9a5752f73a2395353f96e3f284e89e4638af695f/src/trspi/crypto/openssl/symmetric.c
[modify] https://crrev.com/9a5752f73a2395353f96e3f284e89e4638af695f/src/trspi/crypto/openssl/rsa.c

Components: OS>Systems>Security
Looks like this is fixed?

Sign in to add a comment