Control: tags -1 + patch

Attached is a trivial patch which fixes the build on OpenSSL 1.1.

Chris.
diff --git a/opennebula-4.12.3+dfsg/debian/control b/opennebula-4.12.3+dfsg/debian/control
index 5cd7e8e..df9dc68 100644
--- a/opennebula-4.12.3+dfsg/debian/control
+++ b/opennebula-4.12.3+dfsg/debian/control
@@ -11,7 +11,7 @@ Build-Depends: debhelper (>= 9), dh-systemd, dh-linktree, javahelper
               ,flex
               ,libmysql++-dev
               ,libsqlite3-dev
-              ,libssl1.0-dev
+              ,libssl-dev
               ,libws-commons-util-java
               ,libxml2-dev
               ,libxmlrpc-c++8-dev
diff --git a/opennebula-4.12.3+dfsg/src/common/NebulaUtil.cc b/opennebula-4.12.3+dfsg/src/common/NebulaUtil.cc
index 90a0a17..f528998 100644
--- a/opennebula-4.12.3+dfsg/src/common/NebulaUtil.cc
+++ b/opennebula-4.12.3+dfsg/src/common/NebulaUtil.cc
@@ -154,18 +154,18 @@ string * one_util::base64_decode(const string& in)
 
 string one_util::sha1_digest(const string& in)
 {
-    EVP_MD_CTX     mdctx;
+    EVP_MD_CTX     *mdctx;
     unsigned char  md_value[EVP_MAX_MD_SIZE];
     unsigned int   md_len;
     ostringstream  oss;
 
-    EVP_MD_CTX_init(&mdctx);
-    EVP_DigestInit_ex(&mdctx, EVP_sha1(), NULL);
+    mdctx = EVP_MD_CTX_new();
+    EVP_DigestInit_ex(mdctx, EVP_sha1(), NULL);
 
-    EVP_DigestUpdate(&mdctx, in.c_str(), in.length());
+    EVP_DigestUpdate(mdctx, in.c_str(), in.length());
 
-    EVP_DigestFinal_ex(&mdctx,md_value,&md_len);
-    EVP_MD_CTX_cleanup(&mdctx);
+    EVP_DigestFinal_ex(mdctx,md_value,&md_len);
+    EVP_MD_CTX_free(mdctx);
 
     for(unsigned int i = 0; i<md_len; i++)
     {
@@ -181,7 +181,7 @@ string one_util::sha1_digest(const string& in)
 
 string * one_util::aes256cbc_encrypt(const string& in, const string password)
 {
-    EVP_CIPHER_CTX ctx;
+    EVP_CIPHER_CTX *ctx;
 
     const unsigned char *key     = (unsigned char*) password.c_str();
     const unsigned char *in_data = (unsigned char*) in.c_str();
@@ -190,11 +190,12 @@ string * one_util::aes256cbc_encrypt(const string& in, const string password)
 
     int outlen1, outlen2;
 
-    EVP_EncryptInit(&ctx, EVP_aes_256_cbc(), key, NULL);
-    EVP_EncryptUpdate(&ctx, out, &outlen1, in_data, in.length());
-    EVP_EncryptFinal(&ctx, out + outlen1, &outlen2);
+    ctx = EVP_CIPHER_CTX_new();
+    EVP_EncryptInit(ctx, EVP_aes_256_cbc(), key, NULL);
+    EVP_EncryptUpdate(ctx, out, &outlen1, in_data, in.length());
+    EVP_EncryptFinal(ctx, out + outlen1, &outlen2);
 
-    EVP_CIPHER_CTX_cleanup(&ctx);
+    EVP_CIPHER_CTX_free(ctx);
 
     string encrypt((char*) out, (size_t)(outlen1+outlen2));
 

Reply via email to