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

Side by Side Diff: crypto/encryptor_nss.cc

Issue 25637004: Update the NSS bug number for the invalid read when AES-CBC decrypting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "crypto/encryptor.h" 5 #include "crypto/encryptor.h"
6 6
7 #include <cryptohi.h> 7 #include <cryptohi.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 key_->key(), param_.get())); 94 key_->key(), param_.get()));
95 if (!context.get()) 95 if (!context.get())
96 return false; 96 return false;
97 97
98 if (mode_ == CTR) 98 if (mode_ == CTR)
99 return CryptCTR(context.get(), ciphertext, plaintext); 99 return CryptCTR(context.get(), ciphertext, plaintext);
100 100
101 if (ciphertext.size() % AES_BLOCK_SIZE != 0) { 101 if (ciphertext.size() % AES_BLOCK_SIZE != 0) {
102 // Decryption will fail if the input is not a multiple of the block size. 102 // Decryption will fail if the input is not a multiple of the block size.
103 // PK11_CipherOp has a bug where it will do an invalid memory access before 103 // PK11_CipherOp has a bug where it will do an invalid memory access before
104 // the start of the input, so avoid calling it. (Possibly NSS bug 921687). 104 // the start of the input, so avoid calling it. (NSS bug 922780).
105 plaintext->clear(); 105 plaintext->clear();
106 return false; 106 return false;
107 } 107 }
108 108
109 return Crypt(context.get(), ciphertext, plaintext); 109 return Crypt(context.get(), ciphertext, plaintext);
110 } 110 }
111 111
112 bool Encryptor::Crypt(PK11Context* context, 112 bool Encryptor::Crypt(PK11Context* context,
113 const base::StringPiece& input, 113 const base::StringPiece& input,
114 std::string* output) { 114 std::string* output) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // Use |output_data| to mask |input|. 194 // Use |output_data| to mask |input|.
195 MaskMessage( 195 MaskMessage(
196 reinterpret_cast<uint8*>(const_cast<char*>(input.data())), 196 reinterpret_cast<uint8*>(const_cast<char*>(input.data())),
197 input.length(), output_data, output_data); 197 input.length(), output_data, output_data);
198 output->resize(input.length()); 198 output->resize(input.length());
199 return true; 199 return true;
200 } 200 }
201 201
202 } // namespace crypto 202 } // namespace crypto
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698