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

Side by Side Diff: net/quic/crypto/aead_base_decrypter_nss.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.h ('k') | net/quic/crypto/aead_base_decrypter_openssl.cc » ('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 <pk11pub.h> 7 #include <pk11pub.h>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "crypto/scoped_nss_types.h" 10 #include "crypto/scoped_nss_types.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 DCHECK_EQ(nonce_prefix.size(), nonce_prefix_size_); 42 DCHECK_EQ(nonce_prefix.size(), nonce_prefix_size_);
43 if (nonce_prefix.size() != nonce_prefix_size_) { 43 if (nonce_prefix.size() != nonce_prefix_size_) {
44 return false; 44 return false;
45 } 45 }
46 memcpy(nonce_prefix_, nonce_prefix.data(), nonce_prefix.size()); 46 memcpy(nonce_prefix_, nonce_prefix.data(), nonce_prefix.size());
47 return true; 47 return true;
48 } 48 }
49 49
50 bool AeadBaseDecrypter::DecryptPacket(QuicPathId path_id, 50 bool AeadBaseDecrypter::DecryptPacket(QuicPathId path_id,
51 QuicPacketNumber packet_number, 51 QuicPacketNumber packet_number,
52 const StringPiece& associated_data, 52 StringPiece associated_data,
53 const StringPiece& ciphertext, 53 StringPiece ciphertext,
54 char* output, 54 char* output,
55 size_t* output_length, 55 size_t* output_length,
56 size_t max_output_length) { 56 size_t max_output_length) {
57 if (ciphertext.length() < auth_tag_size_) { 57 if (ciphertext.length() < auth_tag_size_) {
58 return false; 58 return false;
59 } 59 }
60 60
61 uint8_t nonce[sizeof(nonce_prefix_) + sizeof(packet_number)]; 61 uint8_t nonce[sizeof(nonce_prefix_) + sizeof(packet_number)];
62 const size_t nonce_size = nonce_prefix_size_ + sizeof(packet_number); 62 const size_t nonce_size = nonce_prefix_size_ + sizeof(packet_number);
63 DCHECK_LE(nonce_size, sizeof(nonce)); 63 DCHECK_LE(nonce_size, sizeof(nonce));
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 StringPiece AeadBaseDecrypter::GetNoncePrefix() const { 131 StringPiece AeadBaseDecrypter::GetNoncePrefix() const {
132 if (nonce_prefix_size_ == 0) { 132 if (nonce_prefix_size_ == 0) {
133 return StringPiece(); 133 return StringPiece();
134 } 134 }
135 return StringPiece(reinterpret_cast<const char*>(nonce_prefix_), 135 return StringPiece(reinterpret_cast<const char*>(nonce_prefix_),
136 nonce_prefix_size_); 136 nonce_prefix_size_);
137 } 137 }
138 138
139 } // namespace net 139 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/aead_base_decrypter.h ('k') | net/quic/crypto/aead_base_decrypter_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698