diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index 0f649e1ba..b9de9880b 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -864,30 +863,6 @@ public: RPCParser (beast::Journal j) :j_ (j){} - static std::string EncodeBase64 (std::string const& s) - { - // FIXME: This performs terribly - BIO* b64, *bmem; - BUF_MEM* bptr; - - // VFALCO TODO What the heck is BIO and BUF_MEM!? - // Surely we don't need OpenSSL or dynamic allocations - // to perform a base64 encoding... - // - b64 = BIO_new (BIO_f_base64 ()); - BIO_set_flags (b64, BIO_FLAGS_BASE64_NO_NL); - bmem = BIO_new (BIO_s_mem ()); - b64 = BIO_push (b64, bmem); - BIO_write (b64, s.data (), s.size ()); - (void) BIO_flush (b64); - BIO_get_mem_ptr (b64, &bptr); - - std::string result (bptr->data, bptr->length); - BIO_free_all (b64); - - return result; - } - //-------------------------------------------------------------------------- // Convert a rpc method and params to a request. @@ -1299,7 +1274,7 @@ void fromNetwork ( } // HTTP basic authentication - auto const auth = RPCParser::EncodeBase64 (strUsername + ":" + strPassword); + auto const auth = beast::detail::base64_encode(strUsername + ":" + strPassword); std::map mapRequestHeaders;