Shadowsocks-libev: undefined reference to `crypto_aead_xchacha20poly1305_ietf_decrypt'

Created on 25 Mar 2017  ·  23Comments  ·  Source: shadowsocks/shadowsocks-libev

What version of shadowsocks-libev are you using?

3.0.5

What operating system are you using?

Ubuntu Server 16.04

What did you do?

Compile ss manually

What did you expect to see?

run "./autogen.sh &&..." and to see it compiles successfully

What did you see instead?

ss_local-aead.o: In function aead_cipher_decrypt': /root/shadowsocks-libev/src/aead.c:246: undefined reference tocrypto_aead_xchacha20poly1305_ietf_decrypt'

What is your config in detail (with all sensitive info masked)?

n/a

cannot reproduce

Most helpful comment

try the code below:
apt-get purge libsodium-dev
git clone https://github.com/jedisct1/libsodium
cd libsodium
./autogen.sh
./configure
sudo make install
ldconfig

All 23 comments

Build-Depends:
libsodium-dev (>= 1.0.8~)

@rogers0 How to build the libsodium-dev with a version higher than 1.0.8? I know there is the instruction for 1.0.12 but I failed to do so.

try the code below:
apt-get purge libsodium-dev
git clone https://github.com/jedisct1/libsodium
cd libsodium
./autogen.sh
./configure
sudo make install
ldconfig

@Galaxy0419 negtive...

I followed your scripts, and then run: mk-build-deps --root-cmd sudo --install --tool "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y",,,, then ./autogen.sh && dpkg-buildpackage -b -us -uc.... the same error was reproduced.

BTW, when I purged libsodium-dev, it said to be ver 1.0.8.5 which looked that might not be the version problem.

debian has 1.0.11 in jessie (backports)

use ./autogen.sh && ./configure --prefix=/usr/local/shadowsocks-libev&& make && make install

@rogers0 @Galaxy0419

Well, I can succesussfully and manually compiled ss on Debian 8 with no warning and started ss-server well e.g. with aes-256-gcm.

However, when I changed the method in the above config.json from "aes-256-gcm"to "xchacha20-ietf-poly1305", it read: invalid cipher name: xchacha20-ietf-poly1305 and the ss-server failed.

@Galaxy0419 , thanks for your scripts but you continuously confused me. I still don't know what to do, step by step.

Your libsodium version?

@debiansid libsodium-dev and libsodium18 are both 1.0.8.5

Manually install 1.0.12

@debiansid, I added "deb http://ftp.de.debian.org/debian sid main" to /etc/apt/sources.list and upgrade libsodium to 1.0.11 per @rogers0 suggestion, but the error was still there...

And how to upgrade libsodium-dev to 1.0.12?... if only 1.0.12 works, then the readme must be modified.

debian8 use sid backports? You should try 1.0.12, see where it goes. I don't have debian or ubuntu now.

Use "ss-server -h" for help ,"xchacha20-ietf-poly1305" was not supported

It means you're building shadowsocks-libev with the latest header of libsodium but linked against an old one.

Double check the version of your installed libsodium headers and libraries. Make sure there are no two copies of libsodium in /usr/lib and `/usr/local/lib"

@Galaxy0419 you are going to say you got the same problem?

@madeye
1) I purgge libsodium-dev and libsodium18,
2) the rm -rf all libso* under both /usr/local/lib and /usr/lib.
3) And then compiled libsodium 1.0.12,
4) copied all libso* from /usr/lib to /usr/local/lib,
5) installed libsodium-dev from the source (should be 1.0.8-5).

run ./autogen.sh &&... but the issue was the same.

libsodium-dev is different version from libsodium?

installed libsodium-dev from the source (should be 1.0.8-5).

You made mistake again by installing two conflict versions of libsodium.

@madeye yeah....so my question is, how to install libsodium-dev v1.0.12? ....you see, if I follow your instruction in the readme one by one, how can avoid this?

@muronghan

Well, I can succesussfully and manually compiled ss on Debian 8 with no warning and started ss-server well e.g. with aes-256-gcm.

Yes, this is expected.
If you want higher version of a package, you need to contact the package maintainer of debian or ubuntu.
complaining here is not the right place.

I had the same problem on Ubuntu 16 with an older version of shadowsocks-libev already installed, and here is a quick summary of the solution:

  1. apt-get purge libsodium-dev
  2. apt-get purge libsodium18
  3. rm -fr /usr/lib/libsodium.*
  4. rm -fr /usr/local/lib/libsodium.*
  5. Follow the build steps again

Also if you had an older version already installed you need to make sure that you will be using the newly compiled binary as you might end up having different versions of ss-server in /usr/bin and /usr/local/bin.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iceberg1369 picture iceberg1369  ·  3Comments

rule2c picture rule2c  ·  4Comments

mcmxciv picture mcmxciv  ·  3Comments

zent00 picture zent00  ·  3Comments

yuhaiyang picture yuhaiyang  ·  4Comments