Skip to content

Commit 47a8775

Browse files
committed
Revert "adb: Switch to mbedtls"
This reverts commit c70f842.
1 parent 0592670 commit 47a8775

File tree

4 files changed

+31
-345
lines changed

4 files changed

+31
-345
lines changed

package/utils/adb/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
44
PKG_NAME:=adb
55
PKG_SOURCE_VERSION:=6fe92d1a3fb17545d82d020a3c995f32e6b71f9d
66
PKG_VERSION:=5.0.2~$(call version_abbrev,$(PKG_SOURCE_VERSION))
7-
PKG_RELEASE:=4
7+
PKG_RELEASE:=3
88

99
PKG_SOURCE_PROTO:=git
1010
PKG_SOURCE_URL:=https://android.googlesource.com/platform/system/core
@@ -25,7 +25,7 @@ define Package/adb
2525
CATEGORY:=Utilities
2626
TITLE:=Android Debug Bridge CLI tool
2727
URL:=http://tools.android.com/
28-
DEPENDS:=+zlib +libmbedtls +libpthread
28+
DEPENDS:=+zlib +libopenssl +libpthread
2929
endef
3030

3131
define Package/adb/description

package/utils/adb/patches/001-create_Makefile.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
+CPPFLAGS+= -I../include
3636
+CPPFLAGS+= -D_FILE_OFFSET_BITS=64
3737
+
38-
+LIBS+= -lmbedcrypto -lpthread -lz
38+
+LIBS+= -lcrypto -lpthread -lz
3939
+
4040
+OBJS= $(SRCS:.c=.o)
4141
+

package/utils/adb/patches/010-mbedtls.patch

Lines changed: 0 additions & 342 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--- a/adb/adb_auth_host.c
2+
+++ b/adb/adb_auth_host.c
3+
@@ -83,7 +83,13 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
4+
}
5+
6+
BN_set_bit(r32, 32);
7+
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
8+
+ const BIGNUM *rsa_n, *rsa_e;
9+
+ RSA_get0_key(rsa, &rsa_n, &rsa_e, NULL);
10+
+ BN_copy(n, rsa_n);
11+
+#else
12+
BN_copy(n, rsa->n);
13+
+#endif
14+
BN_set_bit(r, RSANUMWORDS * 32);
15+
BN_mod_sqr(rr, r, n, ctx);
16+
BN_div(NULL, rem, n, r32, ctx);
17+
@@ -97,7 +103,11 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
18+
BN_div(n, rem, n, r32, ctx);
19+
pkey->n[i] = BN_get_word(rem);
20+
}
21+
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
22+
+ pkey->exponent = BN_get_word(rsa_e);
23+
+#else
24+
pkey->exponent = BN_get_word(rsa->e);
25+
+#endif
26+
27+
out:
28+
BN_free(n0inv);

0 commit comments

Comments
 (0)