--- 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 #include #include +#if defined(OPENSSL_IS_BORINGSSL) #include +#endif #include #include #include @@ -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(out->data()), binary_key_data,