summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorvadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-11 01:48:50 +0000
committervadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-11 01:48:50 +0000
commit33fca12d265b8129e6cff8fc1fc9ad7b34a19bab (patch)
treeef737a2c12192c512ea7e05460c758e42200590a /google_apis
parent5cddcd140cbe8fc9a8e10e67142cee75dc99684b (diff)
downloadchromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.zip
chromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.tar.gz
chromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.tar.bz2
Revert 239921 "Revert 239759 "The comment in base64.h implies th..."
***************** Reverting the revert. Congrats, the original CL wasn't the cause for the failure; sorry for the mess. ***************** > 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 TBR=vadimt@chromium.org Review URL: https://codereview.chromium.org/111883004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239944 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/cup/client_update_protocol.cc4
-rw-r--r--google_apis/gaia/oauth_request_signer.cc10
2 files changed, 7 insertions, 7 deletions
diff --git a/google_apis/cup/client_update_protocol.cc b/google_apis/cup/client_update_protocol.cc
index 0ff3d8f..afde3ab 100644
--- a/google_apis/cup/client_update_protocol.cc
+++ b/google_apis/cup/client_update_protocol.cc
@@ -122,8 +122,7 @@ std::vector<uint8> RsaPad(size_t rsa_key_size,
// needed. Call the standard Base64 encoder/decoder and then apply fixups.
std::string UrlSafeB64Encode(const std::vector<uint8>& data) {
std::string result;
- if (!base::Base64Encode(ByteVectorToSP(data), &result))
- return std::string();
+ base::Base64Encode(ByteVectorToSP(data), &result);
// Do an tr|+/|-_| on the output, and strip any '=' padding.
for (std::string::iterator it = result.begin(); it != result.end(); ++it) {
@@ -302,4 +301,3 @@ bool ClientUpdateProtocol::DeriveSharedKey(const std::vector<uint8>& source) {
return true;
}
-
diff --git a/google_apis/gaia/oauth_request_signer.cc b/google_apis/gaia/oauth_request_signer.cc
index fe65d4f..115c14d 100644
--- a/google_apis/gaia/oauth_request_signer.cc
+++ b/google_apis/gaia/oauth_request_signer.cc
@@ -204,10 +204,12 @@ bool SignHmacSha1(const std::string& text,
DCHECK(hmac.DigestLength() == kHmacDigestLength);
unsigned char digest[kHmacDigestLength];
bool result = hmac.Init(key) &&
- hmac.Sign(text, digest, kHmacDigestLength) &&
- base::Base64Encode(std::string(reinterpret_cast<const char*>(digest),
- kHmacDigestLength),
- signature_return);
+ hmac.Sign(text, digest, kHmacDigestLength);
+ if (result) {
+ base::Base64Encode(
+ std::string(reinterpret_cast<const char*>(digest), kHmacDigestLength),
+ signature_return);
+ }
return result;
}