Bug 233190

Summary: security/wolfssl: Update to 4.2.0
Product: Ports & Packages Reporter: takefu
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed FIXED    
Severity: Affects Only Me CC: rene, sunpoet
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
wolfssl-3.15.5.patch
none
wolfssl-3.15.5.patch
none
wolfssl-3.15.7.patch
none
wolfssl-4.0.0.patch
none
wolfssl-4.2.0.patch
none
Patch with test support none

Description takefu 2018-11-13 08:21:00 UTC
Created attachment 199197 [details]
wolfssl-3.15.5.patch
Comment 1 takefu 2018-11-13 08:44:03 UTC
(In reply to takefu from comment #0)

fix
  portlint(1) compliant
Comment 2 takefu 2018-11-27 10:16:13 UTC
Created attachment 199600 [details]
wolfssl-3.15.5.patch
Comment 3 takefu 2019-03-14 08:25:58 UTC
Created attachment 202850 [details]
wolfssl-3.15.7.patch

update to 3.15.7

add
  --enable-tlsx --enable-tls13 --enable-tls13-draft18\
  --enable-tls13-draft22 --enable-tls13-draft23\
  --enable-tls13-draft26 --enable-tls13-draft28
Comment 4 takefu 2019-05-22 01:25:50 UTC
Created attachment 204529 [details]
wolfssl-4.0.0.patch

Update to 4.0.0
Comment 5 Rene Ladan freebsd_committer 2019-11-04 21:23:56 UTC
Maintainer reset.
Comment 6 takefu 2019-12-04 01:48:15 UTC
Created attachment 209675 [details]
wolfssl-4.2.0.patch

Update to 4.2.0
Comment 7 Dmitry Marakasov freebsd_committer 2019-12-05 18:17:06 UTC
This breaks the only wolfssl consumer in ports, curl with WOLFSSL enabled.

vtls/wolfssl.c:108:12: error: use of undeclared identifier 'SSL_FILETYPE_PEM'; did you mean 'WOLFSSL_FILETYPE_PEM'?
    return SSL_FILETYPE_PEM;
           ^~~~~~~~~~~~~~~~
           WOLFSSL_FILETYPE_PEM
/usr/local/include/wolfssl/ssl.h:1768:5: note: 'WOLFSSL_FILETYPE_PEM' declared here
    WOLFSSL_FILETYPE_PEM     = 1,
    ^
vtls/wolfssl.c:110:12: error: use of undeclared identifier 'SSL_FILETYPE_PEM'; did you mean 'WOLFSSL_FILETYPE_PEM'?
    return SSL_FILETYPE_PEM;
           ^~~~~~~~~~~~~~~~
           WOLFSSL_FILETYPE_PEM
/usr/local/include/wolfssl/ssl.h:1768:5: note: 'WOLFSSL_FILETYPE_PEM' declared here
    WOLFSSL_FILETYPE_PEM     = 1,
    ^
vtls/wolfssl.c:112:12: error: use of undeclared identifier 'SSL_FILETYPE_ASN1'; did you mean 'WOLFSSL_FILETYPE_ASN1'?
    return SSL_FILETYPE_ASN1;
           ^~~~~~~~~~~~~~~~~
           WOLFSSL_FILETYPE_ASN1
/usr/local/include/wolfssl/ssl.h:1767:5: note: 'WOLFSSL_FILETYPE_ASN1' declared here
    WOLFSSL_FILETYPE_ASN1    = 2,
    ^
vtls/wolfssl.c:309:50: error: use of undeclared identifier 'SSL_VERIFY_PEER'; did you mean 'WOLFSSL_VERIFY_PEER'?
                     SSL_CONN_CONFIG(verifypeer)?SSL_VERIFY_PEER:
                                                 ^~~~~~~~~~~~~~~
                                                 WOLFSSL_VERIFY_PEER
/usr/local/include/wolfssl/ssl.h:1773:5: note: 'WOLFSSL_VERIFY_PEER' declared here
    WOLFSSL_VERIFY_PEER                 = 1,
    ^
vtls/wolfssl.c:310:50: error: use of undeclared identifier 'SSL_VERIFY_NONE'; did you mean 'WOLFSSL_VERIFY_NONE'?
                                                 SSL_VERIFY_NONE,
                                                 ^~~~~~~~~~~~~~~
                                                 WOLFSSL_VERIFY_NONE
/usr/local/include/wolfssl/ssl.h:1772:5: note: 'WOLFSSL_VERIFY_NONE' declared here
    WOLFSSL_VERIFY_NONE                 = 0,
    ^
vtls/wolfssl.c:443:15: error: use of undeclared identifier 'SSL_FAILURE'
    if(ret == SSL_FAILURE)
              ^
vtls/wolfssl.c:452:8: error: use of undeclared identifier 'SSL_ERROR_WANT_READ'; did you mean 'WOLFSSL_ERROR_WANT_READ'?
    if(SSL_ERROR_WANT_READ == detail) {
       ^~~~~~~~~~~~~~~~~~~
       WOLFSSL_ERROR_WANT_READ
/usr/local/include/wolfssl/ssl.h:1787:5: note: 'WOLFSSL_ERROR_WANT_READ' declared here
    WOLFSSL_ERROR_WANT_READ        =  2,
    ^
vtls/wolfssl.c:456:13: error: use of undeclared identifier 'SSL_ERROR_WANT_WRITE'; did you mean 'WOLFSSL_ERROR_WANT_WRITE'?
    else if(SSL_ERROR_WANT_WRITE == detail) {
            ^~~~~~~~~~~~~~~~~~~~
            WOLFSSL_ERROR_WANT_WRITE
/usr/local/include/wolfssl/ssl.h:1788:5: note: 'WOLFSSL_ERROR_WANT_WRITE' declared here
    WOLFSSL_ERROR_WANT_WRITE       =  3,
    ^
vtls/wolfssl.c:666:10: error: use of undeclared identifier 'SSL_ERROR_WANT_READ'; did you mean 'WOLFSSL_ERROR_WANT_READ'?
    case SSL_ERROR_WANT_READ:
         ^~~~~~~~~~~~~~~~~~~
         WOLFSSL_ERROR_WANT_READ
/usr/local/include/wolfssl/ssl.h:1787:5: note: 'WOLFSSL_ERROR_WANT_READ' declared here
    WOLFSSL_ERROR_WANT_READ        =  2,
    ^
vtls/wolfssl.c:667:10: error: use of undeclared identifier 'SSL_ERROR_WANT_WRITE'; did you mean 'WOLFSSL_ERROR_WANT_WRITE'?
    case SSL_ERROR_WANT_WRITE:
         ^~~~~~~~~~~~~~~~~~~~
         WOLFSSL_ERROR_WANT_WRITE
/usr/local/include/wolfssl/ssl.h:1788:5: note: 'WOLFSSL_ERROR_WANT_WRITE' declared here
    WOLFSSL_ERROR_WANT_WRITE       =  3,
    ^
vtls/wolfssl.c:712:10: error: use of undeclared identifier 'SSL_ERROR_ZERO_RETURN'; did you mean 'WOLFSSL_ERROR_ZERO_RETURN'?
    case SSL_ERROR_ZERO_RETURN: /* no more data */
         ^~~~~~~~~~~~~~~~~~~~~
         WOLFSSL_ERROR_ZERO_RETURN
/usr/local/include/wolfssl/ssl.h:1793:5: note: 'WOLFSSL_ERROR_ZERO_RETURN' declared here
    WOLFSSL_ERROR_ZERO_RETURN      =  6,
    ^
vtls/wolfssl.c:714:10: error: use of undeclared identifier 'SSL_ERROR_WANT_READ'; did you mean 'WOLFSSL_ERROR_WANT_READ'?
    case SSL_ERROR_WANT_READ:
         ^~~~~~~~~~~~~~~~~~~
         WOLFSSL_ERROR_WANT_READ
/usr/local/include/wolfssl/ssl.h:1787:5: note: 'WOLFSSL_ERROR_WANT_READ' declared here
    WOLFSSL_ERROR_WANT_READ        =  2,
    ^
vtls/wolfssl.c:715:10: error: use of undeclared identifier 'SSL_ERROR_WANT_WRITE'; did you mean 'WOLFSSL_ERROR_WANT_WRITE'?
    case SSL_ERROR_WANT_WRITE:
         ^~~~~~~~~~~~~~~~~~~~
         WOLFSSL_ERROR_WANT_WRITE
/usr/local/include/wolfssl/ssl.h:1788:5: note: 'WOLFSSL_ERROR_WANT_WRITE' declared here
    WOLFSSL_ERROR_WANT_WRITE       =  3,
    ^
vtls/wolfssl.c:750:29: error: use of undeclared identifier 'SSL_SUCCESS'
  return (wolfSSL_Init() == SSL_SUCCESS);
                            ^
vtls/wolfssl.c:944:3: error: use of undeclared identifier 'Sha256'
  Sha256 SHA256pw;
  ^
vtls/wolfssl.c:946:18: error: use of undeclared identifier 'SHA256pw'
  wc_InitSha256(&SHA256pw);
                 ^
vtls/wolfssl.c:947:20: error: use of undeclared identifier 'SHA256pw'
  wc_Sha256Update(&SHA256pw, tmp, (word32)tmplen);
                   ^
vtls/wolfssl.c:948:19: error: use of undeclared identifier 'SHA256pw'
  wc_Sha256Final(&SHA256pw, sha256sum);
                  ^
18 errors generated.
gmake[3]: *** [Makefile:2522: vtls/libcurl_la-wolfssl.lo] Error 1
Comment 8 Dmitry Marakasov freebsd_committer 2019-12-11 14:07:47 UTC
Created attachment 209867 [details]
Patch with test support

In fact curl doesn't build with current version of wolfssl either, so this does not matter. What do you think of some additional changes:

- Fix LICENSE, add LICENSE_FILE
- Support testing
- Remove bash dependency - builds fine and tests pass without it (if it's still needed there should be full path to bash in CONFIGURE_SHELL, otherwise tests are broken).
Comment 9 takefu 2019-12-12 02:54:53 UTC
(In reply to Dmitry Marakasov from comment #8)

It's a good patch.

Adoption.

:)
Comment 10 Dmitry Marakasov freebsd_committer 2019-12-12 15:25:11 UTC
(In reply to takefu from comment #9)

Wait, the patch contains:

-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	johans@FreeBSD.org

which is unlikely correct as johans' ports were reset month ago. Would you like to take maintainership, or should I leave ports@ there?
Comment 11 takefu 2019-12-13 03:17:48 UTC
(In reply to Dmitry Marakasov from comment #10)

ports@
But is it appropriate?

It's out of control with me.

:-p
Comment 12 commit-hook freebsd_committer 2019-12-13 12:21:00 UTC
A commit references this bug:

Author: amdmi3
Date: Fri Dec 13 12:20:57 UTC 2019
New revision: 520026
URL: https://svnweb.freebsd.org/changeset/ports/520026

Log:
  - Update to 4.2.0
  - Fix LICENSE
  - Add LICENSE_FILE
  - Add testing support

  PR:		233190
  Submitted by:	takefu@airport.fm

Changes:
  head/security/wolfssl/Makefile
  head/security/wolfssl/distinfo
  head/security/wolfssl/pkg-plist
Comment 13 Dmitry Marakasov freebsd_committer 2019-12-13 12:23:32 UTC
(In reply to takefu from comment #11)
> ports@
> But is it appropriate?

If I understood the question correctly, submitting updates to unmaintained ports without taking maintainership is absolutely normal. Adopting unmaintained ports is still encouraged though :)