From patchwork Thu Aug 12 17:04:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giovanni Biscuolo X-Patchwork-Id: 32075 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DBE6527BC82; Thu, 12 Aug 2021 18:06:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 617AC27BC78 for ; Thu, 12 Aug 2021 18:06:24 +0100 (BST) Received: from localhost ([::1]:54888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEE9v-000581-5u for patchwork@mira.cbaines.net; Thu, 12 Aug 2021 13:06:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEE9a-0004pe-Pw for guix-patches@gnu.org; Thu, 12 Aug 2021 13:06:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEE9a-0003m4-Ft for guix-patches@gnu.org; Thu, 12 Aug 2021 13:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mEE9a-0003os-B4 for guix-patches@gnu.org; Thu, 12 Aug 2021 13:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50029] [PATCH] adb, use openssl 1.1 Resent-From: Giovanni Biscuolo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Aug 2021 17:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50029 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50029@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162878793014642 (code B ref -1); Thu, 12 Aug 2021 17:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Aug 2021 17:05:30 +0000 Received: from localhost ([127.0.0.1]:39847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEE8z-0003o0-U7 for submit@debbugs.gnu.org; Thu, 12 Aug 2021 13:05:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:40188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEE8u-0003no-JF for submit@debbugs.gnu.org; Thu, 12 Aug 2021 13:05:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEE8u-0003KE-Cr for guix-patches@gnu.org; Thu, 12 Aug 2021 13:05:20 -0400 Received: from ns13.heimat.it ([46.4.214.66]:38964) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEE8m-0003Du-AB for guix-patches@gnu.org; Thu, 12 Aug 2021 13:05:20 -0400 Received: from localhost (ip6-localhost [127.0.0.1]) by ns13.heimat.it (Postfix) with ESMTP id 4FD583021BA for ; Thu, 12 Aug 2021 17:05:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at ns13.heimat.it Received: from ns13.heimat.it ([127.0.0.1]) by localhost (ns13.heimat.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9n2S2Yft6aSM for ; Thu, 12 Aug 2021 17:04:43 +0000 (UTC) Received: from bourrache.mug.xelera.it (unknown [93.56.171.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ns13.heimat.it (Postfix) with ESMTPSA id 514003021B8 for ; Thu, 12 Aug 2021 17:04:43 +0000 (UTC) Received: from roquette.mug.biscuolo.net (roquette [10.38.2.14]) by bourrache.mug.xelera.it (Postfix) with SMTP id CD62411C9252 for ; Thu, 12 Aug 2021 19:04:42 +0200 (CEST) Received: (nullmailer pid 27707 invoked by uid 1000); Thu, 12 Aug 2021 17:04:42 -0000 From: Giovanni Biscuolo Organization: Xelera.eu Date: Thu, 12 Aug 2021 19:04:42 +0200 Message-ID: <87czqifvbp.fsf@xelera.eu> MIME-Version: 1.0 Received-SPF: pass client-ip=46.4.214.66; envelope-from=g@xelera.eu; helo=ns13.heimat.it X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello maintainers, As promised in [bug#49859] I was able to assemble a patch for adb to use openssl 1.1 instead of the old and unsopported openssl 1.0. As described in the patch, I got the patch from Debian [1] and fortunately it applies as-is! (I'm not able to asses the code but I'm pretty sure Debian maintener did it for me). I was able to build and install the package and tested it by connecting to my Android phone with adb via wi-fi: is this a viable test to check if the patch is OK? Happy hacking! Gio' [1] https://sources.debian.org/data/main/a/android-platform-system-core/1%3A7.0.0%2Br33-1/debian/patches/adb_libssl_11.diff From f0c275121a74d7c20b4383e3bb65d6c27ad7a0e7 Mon Sep 17 00:00:00 2001 From: Giovanni Biscuolo Date: Thu, 12 Aug 2021 18:09:02 +0200 Subject: [PATCH] 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. Patch from: https://sources.debian.org/data/main/a/android-platform-system-core/1%3A7.0.0%2Br33-1/debian/patches/adb_libssl_11.diff * gnu/local.mk (dist_patch_DATA): Add adb-libssl_11-compat.patch * gnu/packages/android.scm: (android-platform-system-core) Add adb-libssl_11-compat.patch; (adb) Use openssl as input * gnu/packages/patches/adb-libssl_11-compat.patch: New file --- gnu/local.mk | 1 + gnu/packages/android.scm | 3 +- .../patches/adb-libssl_11-compat.patch | 35 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/adb-libssl_11-compat.patch diff --git a/gnu/local.mk b/gnu/local.mk index 32ac19d20e..ba6b7732c4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -806,6 +806,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-compat.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 eb538f6540..43cd9b72f9 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-compat.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-compat.patch b/gnu/packages/patches/adb-libssl_11-compat.patch new file mode 100644 index 0000000000..9affe58b5d --- /dev/null +++ b/gnu/packages/patches/adb-libssl_11-compat.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 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); -- 2.32.0