Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wolfssl: enable all features #46600

Merged
merged 1 commit into from Sep 13, 2018
Merged

Conversation

mcmtroffaes
Copy link
Contributor

Motivation for this change

Some websites won't load properly due to missing features. Simply enabling all features fixes this. This also matches how curl is currently tested with wolfssl on travis (see https://github.com/curl/curl/blob/66b3c186fa9a06d313501c80f02e7125acb78c3d/.travis.yml#L222 noting that --enable-tls13 is redundant in the more recent version of wolfssl used in nix, see https://github.com/wolfSSL/wolfssl/blob/v3.15.3-stable/configure.ac#L123 ).

For example, without the "--enable-all" configure flag, the user gets an error message when trying to load nixos.org (here, using curl built against wolfssl), presumably due to a missing feature:

curl: (51)      subject alt name(s) or common name do not match "nixos.org"

This commit fixes this problem.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

No package currently depends on wolfssl, so for testing I recompiled curl against wolfssl using the following shell.nix:

with import <nixpkgs> {};
let
  curlwolfssl = (curl.override {
    openssl = wolfssl;
  }).overrideDerivation (oldAttrs: {
    configureFlags =
      # --with-ca-fallback does not work with wolfssl
      (builtins.filter (x: x != "--with-ca-fallback") oldAttrs.configureFlags)
      ++ ["--with-wolfssl=${wolfssl}" "--without-ssl"];
  });
in
{
  my-env = stdenv.mkDerivation {
    name = "my-env";
    buildInputs = [
      curlwolfssl
    ];
  };
}

I tested the resulting curl binary and compared its output against my local curl binary provided by Fedora:

curl -2 https://nixos.org
curl --cacert /etc/ssl/certs/ca-bundle.crt https://nixos.org > 1.txt
/usr/bin/curl https://nixos.org > 2.txt
diff 1.txt 2.txt

The first line gives an error message "curl: (35) CyaSSL does not support SSLv2" confirming that CyaSSL - which is the old name for wolfssl still referred to by curl - is indeed used. Diff of output of local curl and this new curl shows identical outputs as expected.

@Mic92
Copy link
Member

Mic92 commented Sep 13, 2018

@GrahamcOfBorg build wolfssl

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: wolfssl

Partial log (click to expand)

strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/v49d5757gllbrvrfzklpdhnmw8paz5d1-wolfssl-3.15.3-dev/lib  /nix/store/v49d5757gllbrvrfzklpdhnmw8paz5d1-wolfssl-3.15.3-dev/bin
patching script interpreter paths in /nix/store/v49d5757gllbrvrfzklpdhnmw8paz5d1-wolfssl-3.15.3-dev
/nix/store/v49d5757gllbrvrfzklpdhnmw8paz5d1-wolfssl-3.15.3-dev/bin/wolfssl-config: interpreter directive changed from " /bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/113424priln6g5dimi4zz7yks9jrslpw-wolfssl-3.15.3-doc
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/qfc40l7w9g6a4fyc7jsjy3701y6pfpk9-wolfssl-3.15.3-lib/lib
patching script interpreter paths in /nix/store/qfc40l7w9g6a4fyc7jsjy3701y6pfpk9-wolfssl-3.15.3-lib
/nix/store/kmj390y7q1mqa2476hx9qz1viyzlahks-wolfssl-3.15.3

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: wolfssl

Partial log (click to expand)

strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/g5pcc3crbwrpgswys28mj1i1x6x6vnd8-wolfssl-3.15.3-doc
checking for references to /build in /nix/store/g5pcc3crbwrpgswys28mj1i1x6x6vnd8-wolfssl-3.15.3-doc...
shrinking RPATHs of ELF executables and libraries in /nix/store/83j1hiqjr6smi8zfkx707v0nsdqghily-wolfssl-3.15.3-lib
shrinking /nix/store/83j1hiqjr6smi8zfkx707v0nsdqghily-wolfssl-3.15.3-lib/lib/libwolfssl.so.18.0.0
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/83j1hiqjr6smi8zfkx707v0nsdqghily-wolfssl-3.15.3-lib/lib
patching script interpreter paths in /nix/store/83j1hiqjr6smi8zfkx707v0nsdqghily-wolfssl-3.15.3-lib
checking for references to /build in /nix/store/83j1hiqjr6smi8zfkx707v0nsdqghily-wolfssl-3.15.3-lib...
/nix/store/nx023z4yx3cw907niqyvrd0y67mzxa71-wolfssl-3.15.3

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: wolfssl

Partial log (click to expand)

strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/qpf0yiqdqd86952l9vkl8md16w368f5n-wolfssl-3.15.3-doc
checking for references to /build in /nix/store/qpf0yiqdqd86952l9vkl8md16w368f5n-wolfssl-3.15.3-doc...
shrinking RPATHs of ELF executables and libraries in /nix/store/lrb29xqdcc0m3azlg3ll0pg1fd0cvkrz-wolfssl-3.15.3-lib
shrinking /nix/store/lrb29xqdcc0m3azlg3ll0pg1fd0cvkrz-wolfssl-3.15.3-lib/lib/libwolfssl.so.18.0.0
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/lrb29xqdcc0m3azlg3ll0pg1fd0cvkrz-wolfssl-3.15.3-lib/lib
patching script interpreter paths in /nix/store/lrb29xqdcc0m3azlg3ll0pg1fd0cvkrz-wolfssl-3.15.3-lib
checking for references to /build in /nix/store/lrb29xqdcc0m3azlg3ll0pg1fd0cvkrz-wolfssl-3.15.3-lib...
/nix/store/6pl0n8lj83zsr2nvy1swpfm0sid8m2z3-wolfssl-3.15.3

@Mic92 Mic92 merged commit da7990e into NixOS:master Sep 13, 2018
@Mic92
Copy link
Member

Mic92 commented Sep 13, 2018

backport: 755710d

@mcmtroffaes mcmtroffaes deleted the feature/wolfssl-tls13 branch September 17, 2018 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants