diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 06:55:28 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 06:55:28 +0000 |
commit | 7f7bd7a6ecc23972b1c116afbfe8b9f86b02b77b (patch) | |
tree | 5ac69d0c8c335c4773d4d7292f27e42cd8793ecd /net/quic/quic_crypto_server_stream.cc | |
parent | 9d60bda32310ebcebe6583c2c1303255e8607442 (diff) | |
download | chromium_src-7f7bd7a6ecc23972b1c116afbfe8b9f86b02b77b.zip chromium_src-7f7bd7a6ecc23972b1c116afbfe8b9f86b02b77b.tar.gz chromium_src-7f7bd7a6ecc23972b1c116afbfe8b9f86b02b77b.tar.bz2 |
Remove padding in the base64 encoding of a ChannelID because
base::Base64Encode always does padding.
Qualify 'string' with the std:: in a header file.
R=agl@chromium.org,rtenneti@chromium.org
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/20656006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214601 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_crypto_server_stream.cc')
-rw-r--r-- | net/quic/quic_crypto_server_stream.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/quic/quic_crypto_server_stream.cc b/net/quic/quic_crypto_server_stream.cc index 6b74cc2..6f49864 100644 --- a/net/quic/quic_crypto_server_stream.cc +++ b/net/quic/quic_crypto_server_stream.cc @@ -109,6 +109,17 @@ bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID( base::Base64Encode(string( reinterpret_cast<const char*>(digest), sizeof(digest)), output); + // Remove padding. + size_t len = output->size(); + if (len >= 2) { + if ((*output)[len - 1] == '=') { + len--; + if ((*output)[len - 1] == '=') { + len--; + } + output->resize(len); + } + } return true; } |