AGWA / git-crypt

Transparent file encryption in git
https://www.agwa.name/projects/git-crypt/
GNU General Public License v3.0
8.21k stars 476 forks source link

Fails to compile on Fedora 26 #130

Closed hegjon closed 7 years ago

hegjon commented 7 years ago

Versions: master (rev 788a6a99f4289745e6bd12fae2ad8014af320a4f)

gcc-c++-7.1.1-3.fc26.x86_64 openssl-devel-1.1.0f-7.fc26.x86_64

Output: $ make

g++ -Wall -pedantic -Wno-long-long -O2   -c -o git-crypt.o git-crypt.cpp
In file included from git-crypt.cpp:34:0:
crypto.hpp:60:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Aes_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from git-crypt.cpp:34:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
In file included from git-crypt.cpp:34:0:
crypto.hpp:105:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Hmac_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from git-crypt.cpp:34:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
g++ -Wall -pedantic -Wno-long-long -O2   -c -o commands.o commands.cpp
In file included from commands.cpp:32:0:
crypto.hpp:60:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Aes_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from commands.cpp:32:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
In file included from commands.cpp:32:0:
crypto.hpp:105:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Hmac_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from commands.cpp:32:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
g++ -Wall -pedantic -Wno-long-long -O2   -c -o crypto.o crypto.cpp
In file included from crypto.cpp:31:0:
crypto.hpp:60:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Aes_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from crypto.cpp:31:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
In file included from crypto.cpp:31:0:
crypto.hpp:105:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Hmac_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from crypto.cpp:31:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
g++ -Wall -pedantic -Wno-long-long -O2   -c -o gpg.o gpg.cpp
g++ -Wall -pedantic -Wno-long-long -O2   -c -o key.o key.cpp
In file included from key.cpp:33:0:
crypto.hpp:60:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Aes_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from key.cpp:33:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
In file included from key.cpp:33:0:
crypto.hpp:105:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Hmac_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from key.cpp:33:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
g++ -Wall -pedantic -Wno-long-long -O2   -c -o util.o util.cpp
In file included from util.cpp:156:0:
util-unix.cpp: In function ‘std::vector<std::__cxx11::basic_string<char> > get_directory_contents(const char*)’:
util-unix.cpp:208:51: warning: ‘int readdir_r(DIR*, dirent*, dirent**)’ is deprecated [-Wdeprecated-declarations]
   while ((err = readdir_r(dir, dirent_buffer, &ent)) == 0 && ent != NULL) {
                                                   ^
In file included from util-unix.cpp:42:0,
                 from util.cpp:156:
/usr/include/dirent.h:183:12: note: declared here
 extern int readdir_r (DIR *__restrict __dirp,
            ^~~~~~~~~
g++ -Wall -pedantic -Wno-long-long -O2   -c -o parse_options.o parse_options.cpp
g++ -Wall -pedantic -Wno-long-long -O2   -c -o coprocess.o coprocess.cpp
g++ -Wall -pedantic -Wno-long-long -O2   -c -o fhstream.o fhstream.cpp
g++ -Wall -pedantic -Wno-long-long -O2   -c -o crypto-openssl.o crypto-openssl.cpp
In file included from crypto-openssl.cpp:31:0:
crypto.hpp:60:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Aes_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from crypto-openssl.cpp:31:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
In file included from crypto-openssl.cpp:31:0:
crypto.hpp:105:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
  std::auto_ptr<Hmac_impl> impl;
       ^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
                 from crypto.hpp:39,
                 from crypto-openssl.cpp:31:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
crypto-openssl.cpp:74:11: error: field ‘ctx’ has incomplete type ‘HMAC_CTX {aka hmac_ctx_st}’
  HMAC_CTX ctx;
           ^~~
In file included from /usr/include/openssl/evp.h:14:0,
                 from /usr/include/openssl/hmac.h:15,
                 from crypto-openssl.cpp:36:
/usr/include/openssl/ossl_typ.h:102:16: note: forward declaration of ‘HMAC_CTX {aka struct hmac_ctx_st}’
 typedef struct hmac_ctx_st HMAC_CTX;
                ^~~~~~~~~~~
crypto-openssl.cpp: In destructor ‘Hmac_sha1_state::~Hmac_sha1_state()’:
crypto-openssl.cpp:88:2: error: ‘HMAC_cleanup’ was not declared in this scope
  HMAC_cleanup(&(impl->ctx));
  ^~~~~~~~~~~~
crypto-openssl.cpp:88:2: note: suggested alternative: ‘OBJ_cleanup’
  HMAC_cleanup(&(impl->ctx));
  ^~~~~~~~~~~~
  OBJ_cleanup
make: *** [<builtin>: crypto-openssl.o] Error 1
kalbasit commented 7 years ago

this is a duplicate of #111. There's a fix in #128 but still not merged

AGWA commented 7 years ago

git-crypt will now use OpenSSL 1.1 if present. Should fix your build.

hegjon commented 7 years ago

Thanks, your fix works