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

Cannot build with pip because of EVP_CIPHER_CTX error #395

Open
gullevek opened this issue Feb 2, 2017 · 16 comments
Open

Cannot build with pip because of EVP_CIPHER_CTX error #395

gullevek opened this issue Feb 2, 2017 · 16 comments

Comments

@gullevek
Copy link

gullevek commented Feb 2, 2017

When I try to build attic on Debian/Testing box with python 3.5 (pip 9.0.1) and openssl 1.1.0c-2 I get the following error during build

attic/crypto.c:448:18: error: field 'ctx' has incomplete type
EVP_CIPHER_CTX ctx;

@karolszk
Copy link

karolszk commented Apr 9, 2017

Hi! Has anybody know how to fix this issue?

still opened on Debian/Testing/Stretch, I tried to compile Attic in virtualenv with python3.

creating build/temp.linux-x86_64-3.5/attic
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/usr/include/python3.5m -I/home/karol/qo/ENV_ATTIC/include/python3.5m -c attic/crypto.c -o build/temp.linux-x86_64-3.5/attic/crypto.o
attic/crypto.c:448:18: error: field ‘ctx’ has incomplete type
EVP_CIPHER_CTX ctx;
^~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

@ThomasWaldmann
Copy link
Contributor

attic is not compatible with openssl 1.1.0.

use borgbackup. ;-)

@ways
Copy link

ways commented Aug 10, 2017

Same on fedora 26:

...
running build_ext
cythoning attic/crypto.pyx to attic/crypto.c
building 'attic.crypto' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/attic
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include -I/usr/include/python3.6m -c attic/crypto.c -o build/temp.linux-x86_64-3.6/attic/crypto.o
attic/crypto.c:646:18: error: field ‘ctx’ has incomplete type
   EVP_CIPHER_CTX ctx;
                  ^~~
error: command 'gcc' failed with exit status 1

@antonisant
Copy link

same on Debian 9.1.0
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/usr/include/python3.5m -c attic/crypto.c -o build/temp.linux-x86_64-3.5/attic/crypto.o
attic/crypto.c:448:18: error: field ‘ctx’ has incomplete type
EVP_CIPHER_CTX ctx;
^~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

@bigtonylewis
Copy link

Solution on debian:
apt install libssl1.0-dev
This uninstalls the 1.1.0 header files and installs the older ones, allowing the build to proceed

@jmfernandez
Copy link

I have just developed a patch to fix this issue with OpenSSL 1.1.0:

https://github.com/jmfernandez/portage-inb-overlay/blob/master/app-backup/attic/files/attic-0.16-openssl-1.1-fix.patch

@ThomasWaldmann
Copy link
Contributor

@jmfernandez ever heard of borgbackup? it's solved there since long.

@jmfernandez
Copy link

@jmfernandez ever heard of borgbackup? it's solved there since long.

Yes, but I have to have a working Attic installation , in order to restore/migrate old backups

@ThomasWaldmann
Copy link
Contributor

Ah! Other options would be:

  • convert archives to borg
  • patch borg to be happy with the attic magics (just an idea, didn't look deeply in that)

@guedou
Copy link

guedou commented Jan 28, 2019

I have just developed a patch to fix this issue with OpenSSL 1.1.0:

https://github.com/jmfernandez/portage-inb-overlay/blob/master/app-backup/attic/files/attic-0.16-openssl-1.1-fix.patch

Thanks it worked perfectly!

@ThomasWaldmann
Copy link
Contributor

ThomasWaldmann commented Jan 28, 2019

+    const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *a)

@jmfernandez where did you find this? is it official part of the api?

@jmfernandez
Copy link

+    const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *a)

@jmfernandez where did you find this? is it official part of the api?

The function is not publicly documented, but it is declared in the same include file as other publicly documented functions, like EVP_CIPHER_CTX_iv_length. I found it by chance, when I was having a look at the implementation of EVP_CIPHER_CTX_iv_length

@ThomasWaldmann
Copy link
Contributor

Interesting. So the question now is whether the missing docs are the bug or the function being in that header file.

@andlaus
Copy link

andlaus commented Feb 10, 2019

I had the same problem and your patch made it work perfectly. thanks! can you open a pull request to avoid having it to apply manually?

@ThomasWaldmann: I suppose that making this type visible for user code was a mistake in old openSSL versions and treating EVP_CIPHER_CTX as opaque data has been the intention from day 1 of that API (i.e, the patch should also work with previous openSSL versions: at least openSSL 1.0.2 seems to exhibit the same API.)

@jmfernandez
Copy link

I had the same problem and your patch made it work perfectly. thanks! can you open a pull request to avoid having it to apply manually?

@ThomasWaldmann: I suppose that making this type visible for user code was a mistake in old openSSL versions and treating EVP_CIPHER_CTX as opaque data has been the intention from day 1 of that API (i.e, the patch should also work with previous openSSL versions: at least openSSL 1.0.2 seems to exhibit the same API.)

I have just created it (#399)

@ikunyemingor
Copy link

Solution on debian:
apt install libssl1.0-dev
This uninstalls the 1.1.0 header files and installs the older ones, allowing the build to proceed

Worked perfectly for Ubuntu 18.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants