Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: net/quic/crypto/aead_base_decrypter_openssl.cc

Issue 1787453002: Switch "const StringPiece&" to just "StringPiece" in QUIC code. No functional change. Not flag prot… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116566297
Patch Set: Remove const StringPiece& from _nss crypto files. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/crypto/aead_base_decrypter_nss.cc ('k') | net/quic/crypto/aes_128_gcm_12_decrypter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/crypto/aead_base_decrypter.h" 5 #include "net/quic/crypto/aead_base_decrypter.h"
6 6
7 #include <openssl/err.h> 7 #include <openssl/err.h>
8 #include <openssl/evp.h> 8 #include <openssl/evp.h>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 DCHECK_EQ(nonce_prefix.size(), nonce_prefix_size_); 74 DCHECK_EQ(nonce_prefix.size(), nonce_prefix_size_);
75 if (nonce_prefix.size() != nonce_prefix_size_) { 75 if (nonce_prefix.size() != nonce_prefix_size_) {
76 return false; 76 return false;
77 } 77 }
78 memcpy(nonce_prefix_, nonce_prefix.data(), nonce_prefix.size()); 78 memcpy(nonce_prefix_, nonce_prefix.data(), nonce_prefix.size());
79 return true; 79 return true;
80 } 80 }
81 81
82 bool AeadBaseDecrypter::DecryptPacket(QuicPathId path_id, 82 bool AeadBaseDecrypter::DecryptPacket(QuicPathId path_id,
83 QuicPacketNumber packet_number, 83 QuicPacketNumber packet_number,
84 const StringPiece& associated_data, 84 StringPiece associated_data,
85 const StringPiece& ciphertext, 85 StringPiece ciphertext,
86 char* output, 86 char* output,
87 size_t* output_length, 87 size_t* output_length,
88 size_t max_output_length) { 88 size_t max_output_length) {
89 if (ciphertext.length() < auth_tag_size_) { 89 if (ciphertext.length() < auth_tag_size_) {
90 return false; 90 return false;
91 } 91 }
92 92
93 uint8_t nonce[sizeof(nonce_prefix_) + sizeof(packet_number)]; 93 uint8_t nonce[sizeof(nonce_prefix_) + sizeof(packet_number)];
94 const size_t nonce_size = nonce_prefix_size_ + sizeof(packet_number); 94 const size_t nonce_size = nonce_prefix_size_ + sizeof(packet_number);
95 memcpy(nonce, nonce_prefix_, nonce_prefix_size_); 95 memcpy(nonce, nonce_prefix_, nonce_prefix_size_);
(...skipping 26 matching lines...) Expand all
122 122
123 StringPiece AeadBaseDecrypter::GetNoncePrefix() const { 123 StringPiece AeadBaseDecrypter::GetNoncePrefix() const {
124 if (nonce_prefix_size_ == 0) { 124 if (nonce_prefix_size_ == 0) {
125 return StringPiece(); 125 return StringPiece();
126 } 126 }
127 return StringPiece(reinterpret_cast<const char*>(nonce_prefix_), 127 return StringPiece(reinterpret_cast<const char*>(nonce_prefix_),
128 nonce_prefix_size_); 128 nonce_prefix_size_);
129 } 129 }
130 130
131 } // namespace net 131 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/aead_base_decrypter_nss.cc ('k') | net/quic/crypto/aes_128_gcm_12_decrypter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698