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

Side by Side Diff: nss/lib/util/derdec.c

Issue 1504923011: Update NSS to 3.21 RTM and NSPR to 4.11 RTM (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: Created 5 years 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
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
5 #include "secder.h" 5 #include "secder.h"
6 #include "secerr.h" 6 #include "secerr.h"
7 7
8 static PRUint32 8 static PRUint32
9 der_indefinite_length(unsigned char *buf, unsigned char *end) 9 der_indefinite_length(unsigned char *buf, unsigned char *end)
10 { 10 {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return SECFailure; 168 return SECFailure;
169 } 169 }
170 } 170 }
171 171
172 if ((bp + contents_len) > end) { 172 if ((bp + contents_len) > end) {
173 /* Ran past end of buffer */ 173 /* Ran past end of buffer */
174 PORT_SetError(SEC_ERROR_BAD_DER); 174 PORT_SetError(SEC_ERROR_BAD_DER);
175 return SECFailure; 175 return SECFailure;
176 } 176 }
177 177
178 *header_len_p = bp - buf; 178 *header_len_p = (int)(bp - buf);
179 *contents_len_p = contents_len; 179 *contents_len_p = contents_len;
180 180
181 return SECSuccess; 181 return SECSuccess;
182 } 182 }
183 183
184 SECStatus 184 SECStatus
185 DER_Lengths(SECItem *item, int *header_len_p, PRUint32 *contents_len_p) 185 DER_Lengths(SECItem *item, int *header_len_p, PRUint32 *contents_len_p)
186 { 186 {
187 return(der_capture(item->data, &item->data[item->len], header_len_p, 187 return(der_capture(item->data, &item->data[item->len], header_len_p,
188 contents_len_p)); 188 contents_len_p));
189 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698