Thank you.

Now it configures and compiles.  Fails during linking, but I think the
problem is outside amanda.  But for the record is here the error:

/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by 
/usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1
./.libs/libamanda.so: undefined reference to `OPENSSL_init_ssl'
collect2: error: ld returned 1 exit status

Kind regards
Jose M Calhariz

On Mon, Jun 27, 2016 at 11:47:24AM -0400, Jean-Louis Martineau wrote:
> Can you try the attached patch?
> 
> Jean-Louis
> 
> On 27/06/16 05:33 AM, Jose M Calhariz wrote:
> >Debian is preparing for the release of the future openssl 1.1.0.  It
> >seams it have changes that breaks some software.  I was warned by a
> >bugreport that amanda does not compile with the new openssl.  Further
> >investigation points to a problem during the configuration of amanda.
> >
> >checking whether to include the Amazon S3 device... no
> >configure: error: Cannot build the Amazon S3 device: one or more 
> >prerequisites are missing.
> >debian/rules:18: recipe for target 'configure-stamp' failed
> >
> >More information is available on the Debian bug report.
> >
> >https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828232
> >
> >If you need more information I am happy to help.
> >
> >Kind regards
> >Jose M Calhariz
> >
> >
> 

> diff --git a/common-src/glib-util.c b/common-src/glib-util.c
> index ff26d53..c6f79dd 100644
> --- a/common-src/glib-util.c
> +++ b/common-src/glib-util.c
> @@ -35,6 +35,8 @@
>  
>  #ifdef LIBCURL_USE_OPENSSL
>  #include <openssl/crypto.h>
> +#include <openssl/ssl.h>
> +#if OPENSSL_VERSION_NUMBER < 0x10100000L
>  static GMutex **openssl_mutex_array;
>  static void openssl_lock_callback(int mode, int type, const char *file, int 
> line)
>  {
> @@ -47,19 +49,23 @@ static void openssl_lock_callback(int mode, int type, 
> const char *file, int line
>       g_mutex_unlock(openssl_mutex_array[type]);
>      }
>  }
> +#endif /* OPENSSL_VERSION_NUMBER */
>  
>  static void
>  init_ssl(void)
>  {
> +#if OPENSSL_VERSION_NUMBER < 0x10100000L
>      int i;
> -
>      openssl_mutex_array = g_new0(GMutex *, CRYPTO_num_locks());
>  
> +    SSL_library_init();
>      for (i=0; i<CRYPTO_num_locks(); i++) {
>       openssl_mutex_array[i] = g_mutex_new();
>      }
>      CRYPTO_set_locking_callback(openssl_lock_callback);
> -
> +#else
> +    OPENSSL_init_ssl(0, NULL);
> +#endif /* OPENSSL_VERSION_NUMBER */
>  }
>  
>  #else /* LIBCURL_USE_OPENSSL */
> diff --git a/config/amanda/libs.m4 b/config/amanda/libs.m4
> index 098d8e4..a090a3e 100644
> --- a/config/amanda/libs.m4
> +++ b/config/amanda/libs.m4
> @@ -54,7 +54,12 @@ AC_DEFUN([AMANDA_CHECK_LIBCURL], [
>  #
>  AC_DEFUN([AMANDA_CHECK_HMAC], [
>      HAVE_HMAC=yes
> -    AC_CHECK_LIB([crypto], [HMAC_CTX_init], [], [HAVE_HMAC=no])
> +    AC_CHECK_LIB([crypto], [HMAC_CTX_init], [], [HAVE_HMAC_CTX_INIT=no])
> +    AC_CHECK_LIB([crypto], [HMAC_CTX_reset], [], [HAVE_HMAC_CTX_RESET=no])
> +    if test x"HAVE_HMAC_CTX_INIT" == x"no" -a \
> +         x"HAVE_HMAC_CTX_RESET" == x"no"; then
> +     HAVE_HMAC=no
> +    fi
>  
>      found_hmac_h=no
>      AC_CHECK_HEADERS([openssl/hmac.h crypto/hmac.h hmac.h],
> diff --git a/config/compile b/config/compile
> old mode 100644
> new mode 100755
> diff --git a/config/config.guess b/config/config.guess
> old mode 100644
> new mode 100755
> diff --git a/device-src/s3-util.c b/device-src/s3-util.c
> index 50e7bfb..778ec8f 100644
> --- a/device-src/s3-util.c
> +++ b/device-src/s3-util.c
> @@ -238,7 +238,11 @@ EncodeHMACSHA256(
>      unsigned char tk[SHA256_DIGEST_LENGTH];
>  
>      // Initialise HMACh
> +#if OPENSSL_VERSION_NUMBER < 0x10100000L
>      HMAC_CTX HMAC;
> +#else
> +    HMAC_CTX *HMAC;
> +#endif
>      unsigned int hmaclength = 32;
>      memset(hmachash, 0, hmaclength);
>  
> @@ -249,11 +253,20 @@ EncodeHMACSHA256(
>      }
>  
>      // Digest the key and message using SHA256
> +#if OPENSSL_VERSION_NUMBER < 0x10100000L
>      HMAC_CTX_init(&HMAC);
>      HMAC_Init_ex(&HMAC, key, keylen, EVP_sha256(),NULL);
>      HMAC_Update(&HMAC, datatohash, datalen);
>      HMAC_Final(&HMAC, hmachash, &hmaclength);
>      HMAC_CTX_cleanup(&HMAC);
> +#else
> +    HMAC = HMAC_CTX_new();
> +    HMAC_CTX_reset(HMAC);
> +    HMAC_Init_ex(HMAC, key, keylen, EVP_sha256(),NULL);
> +    HMAC_Update(HMAC, datatohash, datalen);
> +    HMAC_Final(HMAC, hmachash, &hmaclength);
> +    HMAC_CTX_free(HMAC);
> +#endif
>  
>      return hmachash;
>  }
> diff --git a/device-src/s3.c b/device-src/s3.c
> index 10f5a20..d7d88fa 100644
> --- a/device-src/s3.c
> +++ b/device-src/s3.c
> @@ -832,7 +832,11 @@ authenticate_request(S3Handle *hdl,
>      char *szS3Date = NULL;
>      char *zulu_date = NULL;
>      char *buf = NULL;
> +#if OPENSSL_VERSION_NUMBER < 0x10100000L
>      HMAC_CTX ctx;
> +#else
> +    HMAC_CTX *ctx;
> +#endif
>      GByteArray *md = NULL;
>      char *auth_base64 = NULL;
>      struct curl_slist *headers = NULL;
> @@ -1154,12 +1158,22 @@ authenticate_request(S3Handle *hdl,
>  
>       /* run HMAC-SHA1 on the canonicalized string */
>       md = g_byte_array_sized_new(EVP_MAX_MD_SIZE+1);
> +#if OPENSSL_VERSION_NUMBER < 0x10100000L
>       HMAC_CTX_init(&ctx);
>       HMAC_Init_ex(&ctx, hdl->secret_key, (int) strlen(hdl->secret_key),
>                    EVP_sha1(), NULL);
>       HMAC_Update(&ctx, (unsigned char*) auth_string->str, auth_string->len);
>       HMAC_Final(&ctx, md->data, &md->len);
>       HMAC_CTX_cleanup(&ctx);
> +#else
> +     ctx = HMAC_CTX_new();
> +     HMAC_CTX_reset(ctx);
> +     HMAC_Init_ex(ctx, hdl->secret_key, (int) strlen(hdl->secret_key),
> +                  EVP_sha1(), NULL);
> +     HMAC_Update(ctx, (unsigned char*) auth_string->str, auth_string->len);
> +     HMAC_Final(ctx, md->data, &md->len);
> +     HMAC_CTX_free(ctx);
> +#endif
>       auth_base64 = s3_base64_encode(md);
>       /* append the new headers */
>       if (is_non_empty_string(hdl->user_token)) {


-- 
--

As palavras enchem o espaço. Eu prefiro encher a carteira

--Andy Warhol

Attachment: signature.asc
Description: Digital signature

Reply via email to