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

Side by Side Diff: patches/nss-der-encode-time-choice.patch

Issue 10961060: Update NSS to NSS 3.14 Beta 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Add the NSS snapshot timestamp to README.chromium and nss-checkout.sh Created 8 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 | « nss.gyp ('k') | patches/nss-libpkix-leak.patch » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Index: mozilla/security/nss/lib/util/sectime.c
2 ===================================================================
3 --- mozilla/security/nss/lib/util/sectime.c (revision 152884)
4 +++ mozilla/security/nss/lib/util/sectime.c (working copy)
5 @@ -34,14 +34,11 @@
6 *
7 * ***** END LICENSE BLOCK ***** */
8
9 -#include "prlong.h"
10 #include "prtime.h"
11 #include "secder.h"
12 #include "secitem.h"
13 #include "secerr.h"
14
15 -static const PRTime January1st2050 = LL_INIT(0x0008f81e, 0x1b098000);
16 -
17 static char *DecodeUTCTime2FormattedAscii (SECItem *utcTimeDER, char *format);
18 static char *DecodeGeneralizedTime2FormattedAscii (SECItem *generalizedTimeDER, char *format);
19
20 @@ -186,9 +183,11 @@
21
22 SECStatus DER_EncodeTimeChoice(PRArenaPool* arena, SECItem* output, PRTime inpu t)
23 {
24 - if (LL_CMP(input, >, January1st2050)) {
25 - return DER_TimeToGeneralizedTimeArena(arena, output, input);
26 - } else {
27 - return DER_TimeToUTCTimeArena(arena, output, input);
28 + SECStatus rv;
29 +
30 + rv = DER_TimeToUTCTimeArena(arena, output, input);
31 + if (rv == SECSuccess || PORT_GetError() != SEC_ERROR_INVALID_ARGS) {
32 + return rv;
33 }
34 + return DER_TimeToGeneralizedTimeArena(arena, output, input);
35 }
OLDNEW
« no previous file with comments | « nss.gyp ('k') | patches/nss-libpkix-leak.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698