--- a/jdk/test/sun/security/util/DerInputBuffer/TimeParsing.java Wed Jun 14 11:55:43 2017 +0800
+++ b/jdk/test/sun/security/util/DerInputBuffer/TimeParsing.java Wed Jun 14 12:32:17 2017 +0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4558835 4915146
+ * @bug 4558835 4915146 8181841
* @summary Verify timezone offset and fractional seconds are correctly parsed
* @modules java.base/sun.security.util
*/
@@ -77,6 +77,10 @@
private final static byte[] GEN_FRACT3_ZULU =
{0x18, 0x13, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x37, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x36, 0x35, 0x5a};
+ // 20010810174351.7654Z
+ private final static byte[] GEN_FRACT4_ZULU =
+ {0x18, 0x14, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x37, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x36, 0x35, 0x34, 0x5a};
+
// 20010810184351.7+0100
private final static byte[] GEN_FRACT1_PLUS1 =
{0x18, 0x15, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x2b, 0x30, 0x31, 0x30, 0x30};
@@ -89,10 +93,17 @@
private final static byte[] GEN_FRACT3_PLUS1 =
{0x18, 0x17, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x36, 0x35, 0x2b, 0x30, 0x31, 0x30, 0x30};
+ // 20010810184351.7654+0100
+ private final static byte[] GEN_FRACT4_PLUS1 =
+ {0x18, 0x18, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2e, 0x37, 0x36, 0x35, 0x34, 0x2b, 0x30, 0x31, 0x30, 0x30};
+
// 20010810184351,765+0100
private final static byte[] GEN_FRACT3_COMMA_PLUS1 =
{0x18, 0x17, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2c, 0x37, 0x36, 0x35, 0x2b, 0x30, 0x31, 0x30, 0x30};
+ // 20010810184351,7654+0100
+ private final static byte[] GEN_FRACT4_COMMA_PLUS1 =
+ {0x18, 0x18, 0x32, 0x30, 0x30, 0x31, 0x30, 0x38, 0x31, 0x30, 0x31, 0x38, 0x34, 0x33, 0x35, 0x31, 0x2c, 0x37, 0x36, 0x35, 0x34, 0x2b, 0x30, 0x31, 0x30, 0x30};
private static Date decodeUTC(byte[] b) throws IOException {
DerInputStream derin = new DerInputStream(b);
@@ -146,6 +157,8 @@
checkGeneralized(d3, GEN_FRACT3_ZULU, "fractional seconds (Zulu)");
checkGeneralized(d3, GEN_FRACT3_PLUS1, "fractional seconds (+0100)");
checkGeneralized(d3, GEN_FRACT3_COMMA_PLUS1, "fractional seconds (+0100)");
+ checkGeneralized(d3, GEN_FRACT4_ZULU, "fractional seconds (Zulu)");
+ checkGeneralized(d3, GEN_FRACT4_PLUS1, "fractional seconds (+0100)");
+ checkGeneralized(d3, GEN_FRACT4_COMMA_PLUS1, "fractional seconds (+0100)");
}
-
}