Bug 234447 - www/mod_pagespeed not openssl 1.1.1 compliant
Summary: www/mod_pagespeed not openssl 1.1.1 compliant
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Mahdi Mokhtari
URL:
Keywords: patch-ready
Depends on:
Blocks: 231931
  Show dependency treegraph
 
Reported: 2018-12-27 15:30 UTC by doctor
Modified: 2019-01-20 19:16 UTC (History)
1 user (show)

See Also:
mmokhi: maintainer-feedback+
mmokhi: merge-quarterly+


Attachments
Patch fix build on openssl1.1 (7.76 KB, patch)
2018-12-29 14:34 UTC, Mahdi Mokhtari
mmokhi: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description doctor 2018-12-27 15:30:34 UTC
Noticing no openssl 1.1.1 for mod_pagespeed .  Are we using mod_pagespeed version 1.13.35.2 ?
Comment 1 Mahdi Mokhtari freebsd_committer freebsd_triage 2018-12-27 18:15:08 UTC
Hi,
Thanks for CC'ing on the issue :)
Since yesterday I noticed it, I already identified problematic part of the issue, And am testing the build with couple of changes I made...
Comment 2 Mahdi Mokhtari freebsd_committer freebsd_triage 2018-12-29 14:34:51 UTC
Created attachment 200604 [details]
Patch fix build on openssl1.1

This patch fixes build with openssl1.1
Can you please confirm it works on your environment too?
Comment 3 doctor 2018-12-29 17:27:55 UTC
testing now
Comment 4 doctor 2018-12-29 18:16:11 UTC
6 errors rsa related 

third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:483:10: error: 
      incomplete definition of type 'struct rsa_st'
      rsa->n = bignum_from_base64(validate_string_field(key_prop, "n"));
      ~~~^
/usr/local/include/openssl/ossl_typ.h:110:16: note: forward declaration of
      'struct rsa_st'
typedef struct rsa_st RSA;
               ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:484:14: error: 
      incomplete definition of type 'struct rsa_st'
      if (rsa->n == NULL) goto end;
          ~~~^
/usr/local/include/openssl/ossl_typ.h:110:16: note: forward declaration of
      'struct rsa_st'
typedef struct rsa_st RSA;
               ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:486:10: error: 
      incomplete definition of type 'struct rsa_st'
      rsa->e = bignum_from_base64(validate_string_field(key_prop, "e"));
      ~~~^
/usr/local/include/openssl/ossl_typ.h:110:16: note: forward declaration of
      'struct rsa_st'
typedef struct rsa_st RSA;
               ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:487:14: error: 
      incomplete definition of type 'struct rsa_st'
      if (rsa->e == NULL) goto end;
          ~~~^
/usr/local/include/openssl/ossl_typ.h:110:16: note: forward declaration of
      'struct rsa_st'
typedef struct rsa_st RSA;
               ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:490:10: error: 
      incomplete definition of type 'struct rsa_st'
  if (rsa->e == NULL || rsa->n == NULL) {
      ~~~^
/usr/local/include/openssl/ossl_typ.h:110:16: note: forward declaration of
      'struct rsa_st'
typedef struct rsa_st RSA;

               ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:490:28: error: 
      incomplete definition of type 'struct rsa_st'
  if (rsa->e == NULL || rsa->n == NULL) {
                        ~~~^
/usr/local/include/openssl/ossl_typ.h:110:16: note: forward declaration of
      'struct rsa_st'
typedef struct rsa_st RSA;
               ^
6 errors generated.
Comment 5 Mahdi Mokhtari freebsd_committer freebsd_triage 2018-12-29 19:17:03 UTC
The error you wrote shows the patch maybe isn't applied correctly, can you ensure about it?
[eg, is the file "www/mod_pagespeed/files/patch-third__party_grpc_src_src_core_lib_security_credentials_jwt_jwt__verifier.c" created for you after applying the patch?]

For me build goes fine both on amd64 and i386 with openssl1.1 as default... I mostly want to sure if it works on run-time for you :D
Comment 6 Mahdi Mokhtari freebsd_committer freebsd_triage 2018-12-29 20:52:44 UTC
Just to make sure we are on same base, you might need to consider that the patch is generated by "svn diff", are you applying it with "svn patch" or other tools?
Comment 7 doctor 2019-01-14 17:44:23 UTC
Comment on attachment 200604 [details]
Patch fix build on openssl1.1

gmake[1]: Entering directory '/usr/ports/www/mod_pagespeed/work/incubator-pageseed-mod-a5cfe15'
  CC(target) /usr/ports/www/mod_pagespeed/work/incubator-pagespeed-mod-a5cfe15/elease/obj.target/grpc_core/third_party/grpc/src/src/core/lib/security/credentils/jwt/jwt_verifier.o
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:489:2: warning: 
      incompatible pointer types passing 'BIGNUM **' (aka 'struct bignum_st **'
      to parameter of type 'BIGNUM *' (aka 'struct bignum_st *'); remove &
      [-Wincompatible-pointer-types]
      RSA_set0_key(rsa, &n, NULL, NULL);
                        ^~
/usr/local/include/openssl/rsa.h:204:34: note: passing argument to parameter 'n
      here
int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
                                 ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:499:3: warning: 
      incompatible pointer types passing 'BIGNUM **' (aka 'struct bignum_st **'
      to parameter of type 'BIGNUM *' (aka 'struct bignum_st *'); remove &
      [-Wincompatible-pointer-types]
      RSA_set0_key(rsa, NULL, &e, NULL);
                              ^~
/usr/local/include/openssl/rsa.h:204:45: note: passing argument to parameter 'e
      here
int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
                                            ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:507:2: error: 
      use of undeclared identifier 'nn'
  RSA_get0_key(rsa, &nn, &ee, NULL);
                     ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:507:2: error: 
      use of undeclared identifier 'ee'
  RSA_get0_key(rsa, &nn, &ee, NULL);
                          ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:508:7 error: 
      use of undeclared identifier 'ee'
  if (ee == NULL || nn == NULL) {
      ^
third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c:508:2: error: 
      use of undeclared identifier 'nn'
  if (ee == NULL || nn == NULL) {
                    ^
2 warnings and 4 errors generated.

Once patch was implemented properly
Comment 8 Mahdi Mokhtari freebsd_committer freebsd_triage 2019-01-14 23:53:07 UTC
This is build log for my build on a poudriere jail with openssl111 as default
< https://reviews.freebsd.org/P246 > 
it seems it works fine over here...

I see the error that you posted says about two variables undefined but they are defined just couple of lines above...
Sorry to repeat my question, can you try applying patches and build in a clean/new environment?
thanks
Comment 9 commit-hook freebsd_committer 2019-01-20 19:12:04 UTC
A commit references this bug:

Author: mmokhi
Date: Sun Jan 20 19:11:17 UTC 2019
New revision: 490804
URL: https://svnweb.freebsd.org/changeset/ports/490804

Log:
  www/mod_pagespeed: Fix build for openssl111

  PR:		234447
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/www/mod_pagespeed/Makefile
  head/www/mod_pagespeed/files/patch-third__party_grpc_src_src_core_lib_security_credentials_jwt_jwt__verifier.c
  head/www/mod_pagespeed/files/patch-third__party_serf_instaweb__ssl__buckets.c
Comment 10 commit-hook freebsd_committer 2019-01-20 19:15:09 UTC
A commit references this bug:

Author: mmokhi
Date: Sun Jan 20 19:14:56 UTC 2019
New revision: 490805
URL: https://svnweb.freebsd.org/changeset/ports/490805

Log:
  MFH: r490804

  www/mod_pagespeed: Fix build for openssl111

  PR:		234447
  Sponsored by:	The FreeBSD Foundation

  Approved by:	portmgr (bugfix blanket)

Changes:
_U  branches/2019Q1/
  branches/2019Q1/www/mod_pagespeed/Makefile
  branches/2019Q1/www/mod_pagespeed/files/patch-third__party_grpc_src_src_core_lib_security_credentials_jwt_jwt__verifier.c
  branches/2019Q1/www/mod_pagespeed/files/patch-third__party_serf_instaweb__ssl__buckets.c
Comment 11 Mahdi Mokhtari freebsd_committer freebsd_triage 2019-01-20 19:16:23 UTC
Committed and MFH'd after test.
Thanks for all helps and feedback on this.