guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/08: gnu: adb: Make compatible with OpenSSL 1.1.


From: guix-commits
Subject: 07/08: gnu: adb: Make compatible with OpenSSL 1.1.
Date: Sun, 15 Aug 2021 18:08:23 -0400 (EDT)

lfam pushed a commit to branch master
in repository guix.

commit 05effbbfc2fc6223aafacf8a3cb2b2d970b6bb66
Author: Giovanni Biscuolo <g@xelera.eu>
AuthorDate: Thu Aug 12 18:09:02 2021 +0200

    gnu: adb: Make compatible with OpenSSL 1.1.
    
    OpenSSL version 1.1 brought some API changes which broke the build here, fix
    that by accessing rsa->n (and e) directly, using RSA_get0_key instead.
    
    * gnu/packages/patches/adb-libssl_11-compatibility.patch: New file
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/android.scm (android-platform-system-core)[origin]: Use it.
    (adb)[inputs]: Replace openssl-1.0 with openssl.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/android.scm                           |  3 +-
 .../patches/adb-libssl_11-compatibility.patch      | 35 ++++++++++++++++++++++
 3 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 5c323d3..6dda311 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -805,6 +805,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/abseil-cpp-fix-gtest.patch              \
   %D%/packages/patches/abseil-cpp-fix-strerror_test.patch      \
   %D%/packages/patches/adb-add-libraries.patch                 \
+  %D%/packages/patches/adb-libssl_11-compatibility.patch       \
   %D%/packages/patches/aegis-constness-error.patch             \
   %D%/packages/patches/aegis-perl-tempdir1.patch               \
   %D%/packages/patches/aegis-perl-tempdir2.patch               \
diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index eb538f6..99c283d 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -148,6 +148,7 @@ use their packages mostly unmodified in our Android NDK 
build system.")
                      "libutils-remove-damaging-includes.patch"
                      "libutils-add-includes.patch"
                      "adb-add-libraries.patch"
+                     "adb-libssl_11-compatibility.patch"
                      "libziparchive-add-includes.patch"))))
 
 (define (android-platform-system-extras version)
@@ -388,7 +389,7 @@ various Android core host applications.")
      `(("android-libbase" ,android-libbase)
        ("android-libcutils" ,android-libcutils)
        ("android-liblog" ,android-liblog)
-       ("openssl" ,openssl-1.0)))
+       ("openssl" ,openssl)))
     (home-page "https://developer.android.com/studio/command-line/adb.html";)
     (synopsis "Android Debug Bridge")
     (description
diff --git a/gnu/packages/patches/adb-libssl_11-compatibility.patch 
b/gnu/packages/patches/adb-libssl_11-compatibility.patch
new file mode 100644
index 0000000..9affe58
--- /dev/null
+++ b/gnu/packages/patches/adb-libssl_11-compatibility.patch
@@ -0,0 +1,35 @@
+This patch is taken from Debian
+URL: 
https://sources.debian.org/data/main/a/android-platform-system-core/1%3A7.0.0%2Br33-1/debian/patches/adb_libssl_11.diff
+Description: adb: Make compatible with openssl 1.1
+ OpenSSL version 1.1 brought some API changes which broke the build here,
+ fix that by accessing rsa->n (and e) directly, using RSA_get0_key instead.
+Author: Chirayu Desai <chirayudesai1@gmail.com
+Last-Update: 2016-11-10
+--- a/adb/adb_auth_host.cpp
++++ b/adb/adb_auth_host.cpp
+@@ -71,6 +71,7 @@
+     BIGNUM* rem = BN_new();
+     BIGNUM* n = BN_new();
+     BIGNUM* n0inv = BN_new();
++    BIGNUM* e = BN_new();
+ 
+     if (RSA_size(rsa) != RSANUMBYTES) {
+         ret = 0;
+@@ -78,7 +79,7 @@
+     }
+ 
+     BN_set_bit(r32, 32);
+-    BN_copy(n, rsa->n);
++    RSA_get0_key(rsa, &n, &e, NULL);
+     BN_set_bit(r, RSANUMWORDS * 32);
+     BN_mod_sqr(rr, r, n, ctx);
+     BN_div(NULL, rem, n, r32, ctx);
+@@ -92,7 +93,7 @@
+         BN_div(n, rem, n, r32, ctx);
+         pkey->n[i] = BN_get_word(rem);
+     }
+-    pkey->exponent = BN_get_word(rsa->e);
++    pkey->exponent = BN_get_word(e);
+ 
+ out:
+     BN_free(n0inv);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]