diff options
author | vadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-11 00:03:33 +0000 |
---|---|---|
committer | vadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-11 00:03:33 +0000 |
commit | 1d4b7c7ca38a12faaf5b8878428f57b4896c1496 (patch) | |
tree | 0292489017b8ce80fab92daf4dafe2f4a54fbd3e /net/http/http_auth_handler_ntlm.cc | |
parent | 9a07c2959da5398a6dd9176e1bbf31f6ab6dc89a (diff) | |
download | chromium_src-1d4b7c7ca38a12faaf5b8878428f57b4896c1496.zip chromium_src-1d4b7c7ca38a12faaf5b8878428f57b4896c1496.tar.gz chromium_src-1d4b7c7ca38a12faaf5b8878428f57b4896c1496.tar.bz2 |
Revert 239759 "The comment in base64.h implies that base::Base64..."
> The comment in base64.h implies that base::Base64Encode() can return false, but
> this cannot happen in practice. Fix the comment.
>
> The implementation of Base64Encode() attempts to check for the return value
> MODP_B64_ERROR as a failure, but modp_b64_encode() cannot return this
> value. Remove the check.
>
> Remove unneeded integer cast.
>
> Change the return type to void.
>
> BUG=323357
> TEST=base_unittests, compile all
> TBR=jochen@chromium.org,miket@chromium.org,joi@chromium.org,akalin@chromium.org,sergeyu@chromium.org
>
> Review URL: https://codereview.chromium.org/86913002
TBR=ricea@chromium.org
Review URL: https://codereview.chromium.org/101113004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_handler_ntlm.cc')
-rw-r--r-- | net/http/http_auth_handler_ntlm.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc index 922800c..c0387d8 100644 --- a/net/http/http_auth_handler_ntlm.cc +++ b/net/http/http_auth_handler_ntlm.cc @@ -89,9 +89,13 @@ int HttpAuthHandlerNTLM::GenerateAuthTokenImpl( // Base64 encode data in output buffer and prepend "NTLM ". std::string encode_input(static_cast<char*>(out_buf), out_buf_len); std::string encode_output; - base::Base64Encode(encode_input, &encode_output); + bool base64_rv = base::Base64Encode(encode_input, &encode_output); // OK, we are done with |out_buf| free(out_buf); + if (!base64_rv) { + LOG(ERROR) << "Unexpected problem Base64 encoding."; + return ERR_UNEXPECTED; + } *auth_token = std::string("NTLM ") + encode_output; return OK; #endif |