From 7f7bd7a6ecc23972b1c116afbfe8b9f86b02b77b Mon Sep 17 00:00:00 2001 From: "wtc@chromium.org" Date: Wed, 31 Jul 2013 06:55:28 +0000 Subject: 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 --- net/quic/quic_crypto_server_stream.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'net/quic/quic_crypto_server_stream.cc') 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(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; } -- cgit v1.1