OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |