Group :: Development/Tools
RPM: android-tools
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: adb-system-openssl.patch
Download
Download
--- platform/system/core/adb/client/auth.cpp 2017-09-02 14:04:39.730192170 +0200
+++ platform/system/core/adb/client/auth.cpp 2017-09-02 14:09:58.291983196 +0200
@@ -34,7 +34,9 @@
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <crypto_utils/android_pubkey.h>
+#if defined(OPENSSL_IS_BORINGSSL)
#include <openssl/base64.h>
+#endif
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/pem.h>
@@ -83,10 +85,14 @@ static bool calculate_public_key(std::string* out, RSA* private_key) {
}
size_t expected_length;
+#if defined(OPENSSL_IS_BORINGSSL)
if (!EVP_EncodedLength(&expected_length, sizeof(binary_key_data))) {
LOG(ERROR) << "Public key too large to base64 encode";
return false;
}
+#else
+ expected_length = 1 + ((sizeof(binary_key_data) + 2) / 3 * 4);
+#endif
out->resize(expected_length);
size_t actual_length = EVP_EncodeBlock(reinterpret_cast<uint8_t*>(out->data()), binary_key_data,