Resolves: rhbz 1441234 Fix adb crash when generating a key
(OpenSSL 1.1.0 API compatibility) Signed-off-by: Jan Pokorný <jpokorny@redhat.com> Signed-off-by: Ivan Afonichev <iafonichev@griddynamics.com>
This commit is contained in:
parent
a33979f481
commit
471854948d
2 changed files with 50 additions and 2 deletions
43
0004-bz1441234.patch
Normal file
43
0004-bz1441234.patch
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
diff -ur a/libcrypto_utils/android_pubkey.c b/libcrypto_utils/android_pubkey.c
|
||||
--- a/libcrypto_utils/android_pubkey.c 2017-03-10 22:03:56.000000000 +0100
|
||||
+++ b/libcrypto_utils/android_pubkey.c 2017-04-25 23:18:26.078818754 +0200
|
||||
@@ -126,31 +126,35 @@
|
||||
BIGNUM* r32 = BN_new();
|
||||
BIGNUM* n0inv = BN_new();
|
||||
BIGNUM* rr = BN_new();
|
||||
+ const BIGNUM *n;
|
||||
+ const BIGNUM *e;
|
||||
|
||||
if (sizeof(RSAPublicKey) > size ||
|
||||
RSA_size(key) != ANDROID_PUBKEY_MODULUS_SIZE) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ RSA_get0_key(key, &n, &e, NULL);
|
||||
+
|
||||
// Store the modulus size.
|
||||
key_struct->modulus_size_words = ANDROID_PUBKEY_MODULUS_SIZE_WORDS;
|
||||
|
||||
// Compute and store n0inv = -1 / N[0] mod 2^32.
|
||||
- if (!ctx || !r32 || !n0inv || !BN_set_bit(r32, 32) ||
|
||||
- !BN_mod(n0inv, key->n, r32, ctx) ||
|
||||
+ if (!ctx || !r32 || !n0inv || !n || !e || !BN_set_bit(r32, 32) ||
|
||||
+ !BN_mod(n0inv, n, r32, ctx) ||
|
||||
!BN_mod_inverse(n0inv, n0inv, r32, ctx) || !BN_sub(n0inv, r32, n0inv)) {
|
||||
goto cleanup;
|
||||
}
|
||||
key_struct->n0inv = (uint32_t)BN_get_word(n0inv);
|
||||
|
||||
// Store the modulus.
|
||||
- if (!android_pubkey_encode_bignum(key->n, key_struct->modulus)) {
|
||||
+ if (!android_pubkey_encode_bignum(n, key_struct->modulus)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
// Compute and store rr = (2^(rsa_size)) ^ 2 mod N.
|
||||
if (!ctx || !rr || !BN_set_bit(rr, ANDROID_PUBKEY_MODULUS_SIZE * 8) ||
|
||||
- !BN_mod_sqr(rr, rr, key->n, ctx) ||
|
||||
+ !BN_mod_sqr(rr, rr, n, ctx) ||
|
||||
!android_pubkey_encode_bignum(rr, key_struct->rr)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
Name: android-tools
|
||||
Version: %{date}git%{git_commit}
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Android platform tools(adb, fastboot)
|
||||
|
||||
Group: Applications/System
|
||||
|
|
@ -44,6 +44,7 @@ Source6: adb.service
|
|||
Patch1: 0001-Add-string-h.patch
|
||||
Patch2: 0002-libusb-modifications.patch
|
||||
Patch3: 0003-atomic-fix.patch
|
||||
Patch4: 0004-bz1441234.patch
|
||||
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
|
|
@ -96,6 +97,7 @@ setup between the host and the target phone as adb.
|
|||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
|
||||
cp -p %{SOURCE5} 51-android.rules
|
||||
|
||||
|
|
@ -132,6 +134,9 @@ install -p -D -m 0644 %{SOURCE6} \
|
|||
|
||||
|
||||
%changelog
|
||||
* Tue Apr 25 2017 Jan Pokorný <jpokorny@fedoraproject.org> - 20170311gite7195be7725a-2
|
||||
- Resolves: rhbz 1441234 Fix adb crash when generating a key (OpenSSL 1.1.0 API)
|
||||
|
||||
* Sat Mar 11 2017 Ivan Afonichev <ivan.afonichev@gmail.com> - 20170311gite7195be7725a-1
|
||||
- Update to upstream git commit e7195be7725a
|
||||
- Resolves: rhbz 1323632 1423219 Add optflags. Support new versions.
|
||||
|
|
@ -139,7 +144,7 @@ install -p -D -m 0644 %{SOURCE6} \
|
|||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20160327git3761365735de-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Sun Apr 08 2016 Bastien Nocera <hadess@hadess.net> - 20160327git3761365735de-2
|
||||
* Sun May 08 2016 Bastien Nocera <hadess@hadess.net> - 20160327git3761365735de-2
|
||||
- Add missing BuildRequires for Ruby script to run
|
||||
- Compile and build img2simg and simg2img
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue