diff --git a/doc/testing.html b/doc/testing.html
index 862b207a2d5..1c8b98557bb 100644
--- a/doc/testing.html
+++ b/doc/testing.html
@@ -44,6 +44,9 @@
Testing the JDK
Docker Tests
Non-US locale
PKCS11 Tests
+Testing with
+alternative security providers
Client UI Tests
@@ -242,6 +245,18 @@ PKCS11 Tests
$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
JTREG="JAVA_OPTIONS=-Djdk.test.lib.artifacts.nsslib-linux_aarch64=/path/to/NSS-libs"
For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.
+Testing with
+alternative security providers
+Some security tests use a hardcoded provider for
+KeyFactory
, Cipher
,
+KeyPairGenerator
, KeyGenerator
,
+AlgorithmParameterGenerator
, KeyAgreement
,
+Mac
, MessageDigest
, SecureRandom
,
+Signature
, AlgorithmParameters
,
+Configuration
, Policy
, or
+SecretKeyFactory
objects. Specify the
+-Dtest.provider.name=NAME
property to use a different
+provider for the service(s).
Client UI Tests
System key shortcuts
Some Client UI tests use key sequences which may be reserved by the operating system. Usually that causes the test failure. So it is highly recommended to disable system key shortcuts prior testing. The steps to access and disable system key shortcuts for various platforms are provided below.
diff --git a/doc/testing.md b/doc/testing.md
index bddc6ba3ee9..2ac8bcaf12a 100644
--- a/doc/testing.md
+++ b/doc/testing.md
@@ -551,6 +551,15 @@ $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
For more notes about the PKCS11 tests, please refer to
test/jdk/sun/security/pkcs11/README.
+### Testing with alternative security providers
+
+Some security tests use a hardcoded provider for `KeyFactory`, `Cipher`,
+`KeyPairGenerator`, `KeyGenerator`, `AlgorithmParameterGenerator`,
+`KeyAgreement`, `Mac`, `MessageDigest`, `SecureRandom`, `Signature`,
+`AlgorithmParameters`, `Configuration`, `Policy`, or `SecretKeyFactory` objects.
+Specify the `-Dtest.provider.name=NAME` property to use a different provider for
+the service(s).
+
### Client UI Tests
#### System key shortcuts
diff --git a/make/RunTests.gmk b/make/RunTests.gmk
index 08783c84321..fc835158ed7 100644
--- a/make/RunTests.gmk
+++ b/make/RunTests.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2024, 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
@@ -200,9 +200,10 @@ $(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
$(eval $(call ParseKeywordVariable, JTREG, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM RUN_PROBLEM_LISTS \
- RETRY_COUNT REPEAT_COUNT MAX_OUTPUT, \
+ RETRY_COUNT REPEAT_COUNT MAX_OUTPUT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
- EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS, \
+ EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS\
+ $(CUSTOM_JTREG_STRING_KEYWORDS), \
))
ifneq ($(JTREG), )
@@ -738,8 +739,6 @@ define SetupRunJtregTestBody
# we may end up with a lot of JVM's
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')
- JTREG_TIMEOUT_FACTOR ?= 4
-
JTREG_VERBOSE ?= fail,error,summary
JTREG_RETAIN ?= fail,error
JTREG_RUN_PROBLEM_LISTS ?= false
@@ -814,6 +813,24 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$($1_JTREG_PROBLEM_LIST))
endif
+ JTREG_ALL_OPTIONS := $$(JTREG_JAVA_OPTIONS) $$(JTREG_VM_OPTIONS)
+
+ JTREG_AUTO_PROBLEM_LISTS :=
+ JTREG_AUTO_TIMEOUT_FACTOR := 4
+
+ ifneq ($$(findstring -Xcomp, $$(JTREG_ALL_OPTIONS)), )
+ JTREG_AUTO_PROBLEM_LISTS += ProblemList-Xcomp.txt
+ JTREG_AUTO_TIMEOUT_FACTOR := 10
+ endif
+
+ ifneq ($$(findstring -XX:+UseZGC, $$(JTREG_ALL_OPTIONS)), )
+ ifneq ($$(findstring -XX:-ZGenerational, $$(JTREG_ALL_OPTIONS)), )
+ JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt
+ else
+ JTREG_AUTO_PROBLEM_LISTS += ProblemList-generational-zgc.txt
+ endif
+ endif
+
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
@@ -843,6 +860,20 @@ define SetupRunJtregTestBody
endif
endif
+ $$(eval $$(call SetupRunJtregTestCustom, $1))
+
+ # SetupRunJtregTestCustom might also adjust JTREG_AUTO_ variables
+ # so set the final results after setting values from custom setup
+ ifneq ($$(JTREG_AUTO_PROBLEM_LISTS), )
+ # Accept both absolute paths as well as relative to the current test root.
+ $1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
+ $$(JTREG_AUTO_PROBLEM_LISTS) \
+ $$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_AUTO_PROBLEM_LISTS)) \
+ ))
+ endif
+
+ JTREG_TIMEOUT_FACTOR ?= $$(JTREG_AUTO_TIMEOUT_FACTOR)
+
clean-outputdirs-$1:
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
$$(RM) -r $$($1_TEST_RESULTS_DIR)
@@ -945,7 +976,7 @@ define SetupRunSpecialTestBody
$1_EXITCODE := $$($1_TEST_RESULTS_DIR)/exitcode.txt
$1_FULL_TEST_NAME := $$(strip $$(patsubst special:%, %, $$($1_TEST)))
- ifneq ($$(findstring :, $$($1_FULL_TEST_NAME)), )
+ ifneq ($$(findstring:, $$($1_FULL_TEST_NAME)), )
$1_TEST_NAME := $$(firstword $$(subst :, ,$$($1_FULL_TEST_NAME)))
$1_TEST_ARGS := $$(strip $$(patsubst special:$$($1_TEST_NAME):%, %, $$($1_TEST)))
else
diff --git a/make/data/tzdata/VERSION b/make/data/tzdata/VERSION
index b138ed7fa78..740427424a6 100644
--- a/make/data/tzdata/VERSION
+++ b/make/data/tzdata/VERSION
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
-tzdata2024a
+tzdata2024b
diff --git a/make/data/tzdata/africa b/make/data/tzdata/africa
index 72b188f074d..8098f4bea9d 100644
--- a/make/data/tzdata/africa
+++ b/make/data/tzdata/africa
@@ -126,17 +126,16 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 16
# Cape Verde / Cabo Verde
#
-# From Paul Eggert (2018-02-16):
-# Shanks gives 1907 for the transition to +02.
-# For now, ignore that and follow the 1911-05-26 Portuguese decree
-# (see Europe/Lisbon).
+# From Tim Parenti (2024-07-01), per Paul Eggert (2018-02-16):
+# For timestamps before independence, see commentary for Europe/Lisbon.
+# Shanks gives 1907 instead for the transition to -02.
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia
- -2:00 - -02 1942 Sep
- -2:00 1:00 -01 1945 Oct 15
- -2:00 - -02 1975 Nov 25 2:00
- -1:00 - -01
+ -2:00 - %z 1942 Sep
+ -2:00 1:00 %z 1945 Oct 15
+ -2:00 - %z 1975 Nov 25 2:00
+ -1:00 - %z
# Chad
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -368,14 +367,12 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
# Guinea-Bissau
#
-# From Paul Eggert (2018-02-16):
-# Shanks gives 1911-05-26 for the transition to WAT,
-# evidently confusing the date of the Portuguese decree
-# (see Europe/Lisbon) with the date that it took effect.
+# From Tim Parenti (2024-07-01), per Paul Eggert (2018-02-16):
+# For timestamps before independence, see commentary for Europe/Lisbon.
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 1:00u
- -1:00 - -01 1975
+ -1:00 - %z 1975
0:00 - GMT
# Comoros
@@ -440,10 +437,10 @@ Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 1:00u
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Nairobi 2:27:16 - LMT 1908 May
- 2:30 - +0230 1928 Jun 30 24:00
+ 2:30 - %z 1928 Jun 30 24:00
3:00 - EAT 1930 Jan 4 24:00
- 2:30 - +0230 1936 Dec 31 24:00
- 2:45 - +0245 1942 Jul 31 24:00
+ 2:30 - %z 1936 Dec 31 24:00
+ 2:45 - %z 1942 Jul 31 24:00
3:00 - EAT
# Liberia
@@ -614,7 +611,7 @@ Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 -
Rule Mauritius 2009 only - Mar lastSun 2:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
- 4:00 Mauritius +04/+05
+ 4:00 Mauritius %z
# Agalega Is, Rodriguez
# no information; probably like Indian/Mauritius
@@ -1094,10 +1091,10 @@ Rule Morocco 2087 only - May 11 2:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
- 0:00 Morocco +00/+01 1984 Mar 16
- 1:00 - +01 1986
- 0:00 Morocco +00/+01 2018 Oct 28 3:00
- 1:00 Morocco +01/+00
+ 0:00 Morocco %z 1984 Mar 16
+ 1:00 - %z 1986
+ 0:00 Morocco %z 2018 Oct 28 3:00
+ 1:00 Morocco %z
# Western Sahara
#
@@ -1111,9 +1108,9 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
# since most of it was then controlled by Morocco.
Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún
- -1:00 - -01 1976 Apr 14
- 0:00 Morocco +00/+01 2018 Oct 28 3:00
- 1:00 Morocco +01/+00
+ -1:00 - %z 1976 Apr 14
+ 0:00 Morocco %z 2018 Oct 28 3:00
+ 1:00 Morocco %z
# Botswana
# Burundi
@@ -1124,13 +1121,27 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún
# Zambia
# Zimbabwe
#
-# Shanks gives 1903-03-01 for the transition to CAT.
-# Perhaps the 1911-05-26 Portuguese decree
-# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
-# merely made it official?
+# From Tim Parenti (2024-07-01):
+# For timestamps before Mozambique's independence, see commentary for
+# Europe/Lisbon.
+#
+# From Paul Eggert (2024-05-24):
+# The London Gazette, 1903-04-03, page 2245, says that
+# as of 1903-03-03 a time ball at the port of Lourenço Marques
+# (as Maputo was then called) was dropped daily at 13:00:00 LMT,
+# corresponding to 22:49:41.7 GMT, so local time was +02:10:18.3.
+# Conversely, the newspaper South Africa, 1909-02-09, page 321,
+# says the port had just installed an apparatus that communicated
+# "from the controlling clock in the new Observatory at Reuben Point ...
+# exact mean South African time, i.e., 30 deg., or 2 hours East of Greenwich".
+# Although Shanks gives 1903-03-01 for the transition to CAT,
+# evidently the port transitioned to CAT after 1903-03-03 but before
+# the Portuguese legal transition of 1912-01-01 (see Europe/Lisbon commentary).
+# For lack of better info, list 1909 as the transition date.
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Africa/Maputo 2:10:20 - LMT 1903 Mar
+ #STDOFF 2:10:18.3
+Zone Africa/Maputo 2:10:18 - LMT 1909
2:00 - CAT
# Namibia
@@ -1195,7 +1206,7 @@ Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8
- 1:30 - +0130 1903 Mar
+ 1:30 - %z 1903 Mar
2:00 - SAST 1942 Sep 20 2:00
2:00 1:00 SAST 1943 Mar 21 2:00
2:00 - SAST 1990 Mar 21 # independence
@@ -1283,7 +1294,7 @@ Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8
Zone Africa/Lagos 0:13:35 - LMT 1905 Jul 1
0:00 - GMT 1908 Jul 1
0:13:35 - LMT 1914 Jan 1
- 0:30 - +0030 1919 Sep 1
+ 0:30 - %z 1919 Sep 1
1:00 - WAT
# São Tomé and Príncipe
diff --git a/make/data/tzdata/antarctica b/make/data/tzdata/antarctica
index fc7176cd0d5..058d8d6a7a2 100644
--- a/make/data/tzdata/antarctica
+++ b/make/data/tzdata/antarctica
@@ -110,34 +110,34 @@
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Antarctica/Casey 0 - -00 1969
- 8:00 - +08 2009 Oct 18 2:00
- 11:00 - +11 2010 Mar 5 2:00
- 8:00 - +08 2011 Oct 28 2:00
- 11:00 - +11 2012 Feb 21 17:00u
- 8:00 - +08 2016 Oct 22
- 11:00 - +11 2018 Mar 11 4:00
- 8:00 - +08 2018 Oct 7 4:00
- 11:00 - +11 2019 Mar 17 3:00
- 8:00 - +08 2019 Oct 4 3:00
- 11:00 - +11 2020 Mar 8 3:00
- 8:00 - +08 2020 Oct 4 0:01
- 11:00 - +11 2021 Mar 14 0:00
- 8:00 - +08 2021 Oct 3 0:01
- 11:00 - +11 2022 Mar 13 0:00
- 8:00 - +08 2022 Oct 2 0:01
- 11:00 - +11 2023 Mar 9 3:00
- 8:00 - +08
+ 8:00 - %z 2009 Oct 18 2:00
+ 11:00 - %z 2010 Mar 5 2:00
+ 8:00 - %z 2011 Oct 28 2:00
+ 11:00 - %z 2012 Feb 21 17:00u
+ 8:00 - %z 2016 Oct 22
+ 11:00 - %z 2018 Mar 11 4:00
+ 8:00 - %z 2018 Oct 7 4:00
+ 11:00 - %z 2019 Mar 17 3:00
+ 8:00 - %z 2019 Oct 4 3:00
+ 11:00 - %z 2020 Mar 8 3:00
+ 8:00 - %z 2020 Oct 4 0:01
+ 11:00 - %z 2021 Mar 14 0:00
+ 8:00 - %z 2021 Oct 3 0:01
+ 11:00 - %z 2022 Mar 13 0:00
+ 8:00 - %z 2022 Oct 2 0:01
+ 11:00 - %z 2023 Mar 9 3:00
+ 8:00 - %z
Zone Antarctica/Davis 0 - -00 1957 Jan 13
- 7:00 - +07 1964 Nov
+ 7:00 - %z 1964 Nov
0 - -00 1969 Feb
- 7:00 - +07 2009 Oct 18 2:00
- 5:00 - +05 2010 Mar 10 20:00u
- 7:00 - +07 2011 Oct 28 2:00
- 5:00 - +05 2012 Feb 21 20:00u
- 7:00 - +07
+ 7:00 - %z 2009 Oct 18 2:00
+ 5:00 - %z 2010 Mar 10 20:00u
+ 7:00 - %z 2011 Oct 28 2:00
+ 5:00 - %z 2012 Feb 21 20:00u
+ 7:00 - %z
Zone Antarctica/Mawson 0 - -00 1954 Feb 13
- 6:00 - +06 2009 Oct 18 2:00
- 5:00 - +05
+ 6:00 - %z 2009 Oct 18 2:00
+ 5:00 - %z
# References:
# Casey Weather (1998-02-26)
# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html
@@ -313,10 +313,10 @@ Zone Antarctica/Troll 0 - -00 2005 Feb 12
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Antarctica/Vostok 0 - -00 1957 Dec 16
- 7:00 - +07 1994 Feb
+ 7:00 - %z 1994 Feb
0 - -00 1994 Nov
- 7:00 - +07 2023 Dec 18 2:00
- 5:00 - +05
+ 7:00 - %z 2023 Dec 18 2:00
+ 5:00 - %z
# S Africa - year-round bases
# Marion Island, -4653+03752
@@ -349,7 +349,7 @@ Zone Antarctica/Vostok 0 - -00 1957 Dec 16
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Antarctica/Rothera 0 - -00 1976 Dec 1
- -3:00 - -03
+ -3:00 - %z
# Uruguay - year round base
# Artigas, King George Island, -621104-0585107
diff --git a/make/data/tzdata/asia b/make/data/tzdata/asia
index 3a54291919d..5c8568f334a 100644
--- a/make/data/tzdata/asia
+++ b/make/data/tzdata/asia
@@ -106,8 +106,8 @@ Rule RussiaAsia 1996 2010 - Oct lastSun 2:00s 0 -
# Afghanistan
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Kabul 4:36:48 - LMT 1890
- 4:00 - +04 1945
- 4:30 - +0430
+ 4:00 - %z 1945
+ 4:30 - %z
# Armenia
# From Paul Eggert (2006-03-22):
@@ -139,12 +139,12 @@ Rule Armenia 2011 only - Mar lastSun 2:00s 1:00 -
Rule Armenia 2011 only - Oct lastSun 2:00s 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
- 3:00 - +03 1957 Mar
- 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s
- 3:00 RussiaAsia +03/+04 1995 Sep 24 2:00s
- 4:00 - +04 1997
- 4:00 RussiaAsia +04/+05 2011
- 4:00 Armenia +04/+05
+ 3:00 - %z 1957 Mar
+ 4:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 3:00 RussiaAsia %z 1995 Sep 24 2:00s
+ 4:00 - %z 1997
+ 4:00 RussiaAsia %z 2011
+ 4:00 Armenia %z
# Azerbaijan
@@ -165,12 +165,12 @@ Rule Azer 1997 2015 - Mar lastSun 4:00 1:00 -
Rule Azer 1997 2015 - Oct lastSun 5:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Baku 3:19:24 - LMT 1924 May 2
- 3:00 - +03 1957 Mar
- 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s
- 3:00 RussiaAsia +03/+04 1992 Sep lastSun 2:00s
- 4:00 - +04 1996
- 4:00 EUAsia +04/+05 1997
- 4:00 Azer +04/+05
+ 3:00 - %z 1957 Mar
+ 4:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 3:00 RussiaAsia %z 1992 Sep lastSun 2:00s
+ 4:00 - %z 1996
+ 4:00 EUAsia %z 1997
+ 4:00 Azer %z
# Bangladesh
# From Alexander Krivenyshev (2009-05-13):
@@ -251,17 +251,17 @@ Rule Dhaka 2009 only - Dec 31 24:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Dhaka 6:01:40 - LMT 1890
5:53:20 - HMT 1941 Oct # Howrah Mean Time?
- 6:30 - +0630 1942 May 15
- 5:30 - +0530 1942 Sep
- 6:30 - +0630 1951 Sep 30
- 6:00 - +06 2009
- 6:00 Dhaka +06/+07
+ 6:30 - %z 1942 May 15
+ 5:30 - %z 1942 Sep
+ 6:30 - %z 1951 Sep 30
+ 6:00 - %z 2009
+ 6:00 Dhaka %z
# Bhutan
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Thimphu 5:58:36 - LMT 1947 Aug 15 # or Thimbu
- 5:30 - +0530 1987 Oct
- 6:00 - +06
+ 5:30 - %z 1987 Oct
+ 6:00 - %z
# British Indian Ocean Territory
# Whitman and the 1995 CIA time zone map say 5:00, but the
@@ -271,8 +271,8 @@ Zone Asia/Thimphu 5:58:36 - LMT 1947 Aug 15 # or Thimbu
# then contained the Chagos Archipelago).
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Chagos 4:49:40 - LMT 1907
- 5:00 - +05 1996
- 6:00 - +06
+ 5:00 - %z 1996
+ 6:00 - %z
# Cocos (Keeling) Islands
# Myanmar (Burma)
@@ -288,9 +288,9 @@ Zone Indian/Chagos 4:49:40 - LMT 1907
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon
6:24:47 - RMT 1920 # Rangoon local time
- 6:30 - +0630 1942 May
- 9:00 - +09 1945 May 3
- 6:30 - +0630
+ 6:30 - %z 1942 May
+ 9:00 - %z 1945 May 3
+ 6:30 - %z
# China
@@ -679,7 +679,7 @@ Zone Asia/Shanghai 8:05:43 - LMT 1901
# Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
# / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.)
Zone Asia/Urumqi 5:50:20 - LMT 1928
- 6:00 - +06
+ 6:00 - %z
# Hong Kong
@@ -1137,7 +1137,7 @@ Rule Macau 1979 only - Oct Sun>=16 03:30 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Macau 7:34:10 - LMT 1904 Oct 30
8:00 - CST 1941 Dec 21 23:00
- 9:00 Macau +09/+10 1945 Sep 30 24:00
+ 9:00 Macau %z 1945 Sep 30 24:00
8:00 Macau C%sT
@@ -1180,7 +1180,7 @@ Zone Asia/Nicosia 2:13:28 - LMT 1921 Nov 14
Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14
2:00 Cyprus EE%sT 1998 Sep
2:00 EUAsia EE%sT 2016 Sep 8
- 3:00 - +03 2017 Oct 29 1:00u
+ 3:00 - %z 2017 Oct 29 1:00u
2:00 EUAsia EE%sT
# Georgia
@@ -1221,18 +1221,25 @@ Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Tbilisi 2:59:11 - LMT 1880
2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time
- 3:00 - +03 1957 Mar
- 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s
- 3:00 RussiaAsia +03/+04 1992
- 3:00 E-EurAsia +03/+04 1994 Sep lastSun
- 4:00 E-EurAsia +04/+05 1996 Oct lastSun
- 4:00 1:00 +05 1997 Mar lastSun
- 4:00 E-EurAsia +04/+05 2004 Jun 27
- 3:00 RussiaAsia +03/+04 2005 Mar lastSun 2:00
- 4:00 - +04
+ 3:00 - %z 1957 Mar
+ 4:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 3:00 RussiaAsia %z 1992
+ 3:00 E-EurAsia %z 1994 Sep lastSun
+ 4:00 E-EurAsia %z 1996 Oct lastSun
+ 4:00 1:00 %z 1997 Mar lastSun
+ 4:00 E-EurAsia %z 2004 Jun 27
+ 3:00 RussiaAsia %z 2005 Mar lastSun 2:00
+ 4:00 - %z
# East Timor
+# From Tim Parenti (2024-07-01):
+# The 1912-01-01 transition occurred at 00:00 new time, per the 1911-05-24
+# Portuguese decree (see Europe/Lisbon). A provision in article 5(c) of the
+# decree prescribed that Timor "will keep counting time in harmony with
+# neighboring foreign colonies, [for] as long as they do not adopt the time
+# that belongs to them in [the Washington Convention] system."
+
# See Indonesia for the 1945 transition.
# From João Carrascalão, brother of the former governor of East Timor, in
@@ -1256,11 +1263,11 @@ Zone Asia/Tbilisi 2:59:11 - LMT 1880
# midnight on Saturday, September 16.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1
- 8:00 - +08 1942 Feb 21 23:00
- 9:00 - +09 1976 May 3
- 8:00 - +08 2000 Sep 17 0:00
- 9:00 - +09
+Zone Asia/Dili 8:22:20 - LMT 1911 Dec 31 16:00u
+ 8:00 - %z 1942 Feb 21 23:00
+ 9:00 - %z 1976 May 3
+ 8:00 - %z 2000 Sep 17 0:00
+ 9:00 - %z
# India
@@ -1326,9 +1333,9 @@ Zone Asia/Kolkata 5:53:28 - LMT 1854 Jun 28 # Kolkata
5:53:20 - HMT 1870 # Howrah Mean Time?
5:21:10 - MMT 1906 Jan 1 # Madras local time
5:30 - IST 1941 Oct
- 5:30 1:00 +0630 1942 May 15
+ 5:30 1:00 %z 1942 May 15
5:30 - IST 1942 Sep
- 5:30 1:00 +0630 1945 Oct 15
+ 5:30 1:00 %z 1945 Oct 15
5:30 - IST
# Since 1970 the following are like Asia/Kolkata:
# Andaman Is
@@ -1380,33 +1387,33 @@ Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10
# Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
# but this must be a typo.
7:07:12 - BMT 1923 Dec 31 16:40u # Batavia
- 7:20 - +0720 1932 Nov
- 7:30 - +0730 1942 Mar 23
- 9:00 - +09 1945 Sep 23
- 7:30 - +0730 1948 May
- 8:00 - +08 1950 May
- 7:30 - +0730 1964
+ 7:20 - %z 1932 Nov
+ 7:30 - %z 1942 Mar 23
+ 9:00 - %z 1945 Sep 23
+ 7:30 - %z 1948 May
+ 8:00 - %z 1950 May
+ 7:30 - %z 1964
7:00 - WIB
# west and central Borneo
Zone Asia/Pontianak 7:17:20 - LMT 1908 May
7:17:20 - PMT 1932 Nov # Pontianak MT
- 7:30 - +0730 1942 Jan 29
- 9:00 - +09 1945 Sep 23
- 7:30 - +0730 1948 May
- 8:00 - +08 1950 May
- 7:30 - +0730 1964
+ 7:30 - %z 1942 Jan 29
+ 9:00 - %z 1945 Sep 23
+ 7:30 - %z 1948 May
+ 8:00 - %z 1950 May
+ 7:30 - %z 1964
8:00 - WITA 1988 Jan 1
7:00 - WIB
# Sulawesi, Lesser Sundas, east and south Borneo
Zone Asia/Makassar 7:57:36 - LMT 1920
7:57:36 - MMT 1932 Nov # Macassar MT
- 8:00 - +08 1942 Feb 9
- 9:00 - +09 1945 Sep 23
+ 8:00 - %z 1942 Feb 9
+ 9:00 - %z 1945 Sep 23
8:00 - WITA
# Maluku Islands, West Papua, Papua
Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
- 9:00 - +09 1944 Sep 1
- 9:30 - +0930 1964
+ 9:00 - %z 1944 Sep 1
+ 9:30 - %z 1964
9:00 - WIT
# Iran
@@ -1642,9 +1649,9 @@ Rule Iran 2021 2022 - Sep 21 24:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Tehran 3:25:44 - LMT 1916
3:25:44 - TMT 1935 Jun 13 # Tehran Mean Time
- 3:30 Iran +0330/+0430 1977 Oct 20 24:00
- 4:00 Iran +04/+05 1979
- 3:30 Iran +0330/+0430
+ 3:30 Iran %z 1977 Oct 20 24:00
+ 4:00 Iran %z 1979
+ 3:30 Iran %z
# Iraq
@@ -1687,8 +1694,8 @@ Rule Iraq 1991 2007 - Oct 1 3:00s 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Baghdad 2:57:40 - LMT 1890
2:57:36 - BMT 1918 # Baghdad Mean Time?
- 3:00 - +03 1982 May
- 3:00 Iraq +03/+04
+ 3:00 - %z 1982 May
+ 3:00 Iraq %z
###############################################################################
@@ -2285,7 +2292,7 @@ Rule Jordan 2022 only - Feb lastThu 24:00 1:00 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Amman 2:23:44 - LMT 1931
2:00 Jordan EE%sT 2022 Oct 28 0:00s
- 3:00 - +03
+ 3:00 - %z
# Kazakhstan
@@ -2496,88 +2503,88 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# Almaty (formerly Alma-Ata), representing most locations in Kazakhstan
# This includes Abai/Abay (ISO 3166-2 code KZ-10), Aqmola/Akmola (KZ-11),
# Almaty (KZ-19), Almaty city (KZ-75), Astana city (KZ-71),
-# East Kazkhstan (KZ-63), Jambyl/Zhambyl (KZ-31), Jetisu/Zhetysu (KZ-33),
+# East Kazakhstan (KZ-63), Jambyl/Zhambyl (KZ-31), Jetisu/Zhetysu (KZ-33),
# Karaganda (KZ-35), North Kazakhstan (KZ-59), Pavlodar (KZ-55),
-# Shyumkent city (KZ-79), Turkistan (KZ-61), and Ulytau (KZ-62).
+# Shymkent city (KZ-79), Turkistan (KZ-61), and Ulytau (KZ-62).
Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-Ata
- 5:00 - +05 1930 Jun 21
- 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
- 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s
- 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s
- 6:00 - +06 2024 Mar 1 0:00
- 5:00 - +05
+ 5:00 - %z 1930 Jun 21
+ 6:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 5:00 RussiaAsia %z 1992 Jan 19 2:00s
+ 6:00 RussiaAsia %z 2004 Oct 31 2:00s
+ 6:00 - %z 2024 Mar 1 0:00
+ 5:00 - %z
# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-43)
Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2
- 4:00 - +04 1930 Jun 21
- 5:00 - +05 1981 Apr 1
- 5:00 1:00 +06 1981 Oct 1
- 6:00 - +06 1982 Apr 1
- 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
- 4:00 RussiaAsia +04/+05 1991 Sep 29 2:00s
- 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s
- 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s
- 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
- 6:00 - +06 2018 Dec 21 0:00
- 5:00 - +05
+ 4:00 - %z 1930 Jun 21
+ 5:00 - %z 1981 Apr 1
+ 5:00 1:00 %z 1981 Oct 1
+ 6:00 - %z 1982 Apr 1
+ 5:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 4:00 RussiaAsia %z 1991 Sep 29 2:00s
+ 5:00 RussiaAsia %z 1992 Jan 19 2:00s
+ 6:00 RussiaAsia %z 1992 Mar 29 2:00s
+ 5:00 RussiaAsia %z 2004 Oct 31 2:00s
+ 6:00 - %z 2018 Dec 21 0:00
+ 5:00 - %z
# Qostanay (aka Kostanay, Kustanay) (KZ-39)
# The 1991/2 rules are unclear partly because of the 1997 Turgai
# reorganization.
Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2
- 4:00 - +04 1930 Jun 21
- 5:00 - +05 1981 Apr 1
- 5:00 1:00 +06 1981 Oct 1
- 6:00 - +06 1982 Apr 1
- 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
- 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
- 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
- 6:00 - +06 2024 Mar 1 0:00
- 5:00 - +05
+ 4:00 - %z 1930 Jun 21
+ 5:00 - %z 1981 Apr 1
+ 5:00 1:00 %z 1981 Oct 1
+ 6:00 - %z 1982 Apr 1
+ 5:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 4:00 RussiaAsia %z 1992 Jan 19 2:00s
+ 5:00 RussiaAsia %z 2004 Oct 31 2:00s
+ 6:00 - %z 2024 Mar 1 0:00
+ 5:00 - %z
# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-15)
Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2
- 4:00 - +04 1930 Jun 21
- 5:00 - +05 1981 Apr 1
- 5:00 1:00 +06 1981 Oct 1
- 6:00 - +06 1982 Apr 1
- 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
- 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
- 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
- 5:00 - +05
+ 4:00 - %z 1930 Jun 21
+ 5:00 - %z 1981 Apr 1
+ 5:00 1:00 %z 1981 Oct 1
+ 6:00 - %z 1982 Apr 1
+ 5:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 4:00 RussiaAsia %z 1992 Jan 19 2:00s
+ 5:00 RussiaAsia %z 2004 Oct 31 2:00s
+ 5:00 - %z
# Mangghystaū (KZ-47)
# Aqtau was not founded until 1963, but it represents an inhabited region,
# so include timestamps before 1963.
Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2
- 4:00 - +04 1930 Jun 21
- 5:00 - +05 1981 Oct 1
- 6:00 - +06 1982 Apr 1
- 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
- 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
- 5:00 RussiaAsia +05/+06 1994 Sep 25 2:00s
- 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
- 5:00 - +05
+ 4:00 - %z 1930 Jun 21
+ 5:00 - %z 1981 Oct 1
+ 6:00 - %z 1982 Apr 1
+ 5:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 4:00 RussiaAsia %z 1992 Jan 19 2:00s
+ 5:00 RussiaAsia %z 1994 Sep 25 2:00s
+ 4:00 RussiaAsia %z 2004 Oct 31 2:00s
+ 5:00 - %z
# Atyraū (KZ-23) is like Mangghystaū except it switched from
# +04/+05 to +05/+06 in spring 1999, not fall 1994.
Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2
- 3:00 - +03 1930 Jun 21
- 5:00 - +05 1981 Oct 1
- 6:00 - +06 1982 Apr 1
- 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
- 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
- 5:00 RussiaAsia +05/+06 1999 Mar 28 2:00s
- 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
- 5:00 - +05
+ 3:00 - %z 1930 Jun 21
+ 5:00 - %z 1981 Oct 1
+ 6:00 - %z 1982 Apr 1
+ 5:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 4:00 RussiaAsia %z 1992 Jan 19 2:00s
+ 5:00 RussiaAsia %z 1999 Mar 28 2:00s
+ 4:00 RussiaAsia %z 2004 Oct 31 2:00s
+ 5:00 - %z
# West Kazakhstan (KZ-27)
# From Paul Eggert (2016-03-18):
# The 1989 transition is from USSR act No. 227 (1989-03-14).
Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk
- 3:00 - +03 1930 Jun 21
- 5:00 - +05 1981 Apr 1
- 5:00 1:00 +06 1981 Oct 1
- 6:00 - +06 1982 Apr 1
- 5:00 RussiaAsia +05/+06 1989 Mar 26 2:00s
- 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
- 5:00 RussiaAsia +05/+06 1992 Mar 29 2:00s
- 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
- 5:00 - +05
+ 3:00 - %z 1930 Jun 21
+ 5:00 - %z 1981 Apr 1
+ 5:00 1:00 %z 1981 Oct 1
+ 6:00 - %z 1982 Apr 1
+ 5:00 RussiaAsia %z 1989 Mar 26 2:00s
+ 4:00 RussiaAsia %z 1992 Jan 19 2:00s
+ 5:00 RussiaAsia %z 1992 Mar 29 2:00s
+ 4:00 RussiaAsia %z 2004 Oct 31 2:00s
+ 5:00 - %z
# Kyrgyzstan (Kirgizstan)
# Transitions through 1991 are from Shanks & Pottenger.
@@ -2598,11 +2605,11 @@ Rule Kyrgyz 1997 2005 - Mar lastSun 2:30 1:00 -
Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2
- 5:00 - +05 1930 Jun 21
- 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
- 5:00 RussiaAsia +05/+06 1991 Aug 31 2:00
- 5:00 Kyrgyz +05/+06 2005 Aug 12
- 6:00 - +06
+ 5:00 - %z 1930 Jun 21
+ 6:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 5:00 RussiaAsia %z 1991 Aug 31 2:00
+ 5:00 Kyrgyz %z 2005 Aug 12
+ 6:00 - %z
###############################################################################
@@ -2809,16 +2816,16 @@ Rule NBorneo 1935 1941 - Dec 14 0:00 0 -
# and 1982 transition dates are from Mok Ly Yng.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Kuching 7:21:20 - LMT 1926 Mar
- 7:30 - +0730 1933
- 8:00 NBorneo +08/+0820 1942 Feb 16
- 9:00 - +09 1945 Sep 12
- 8:00 - +08
+ 7:30 - %z 1933
+ 8:00 NBorneo %z 1942 Feb 16
+ 9:00 - %z 1945 Sep 12
+ 8:00 - %z
# Maldives
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Maldives 4:54:00 - LMT 1880 # Malé
4:54:00 - MMT 1960 # Malé Mean Time
- 5:00 - +05
+ 5:00 - %z
# Mongolia
@@ -2920,9 +2927,37 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Malé
# From Arthur David Olson (2008-05-19):
# Assume that Choibalsan is indeed offset by 8:00.
-# XXX--in the absence of better information, assume that transition
-# was at the start of 2008-03-31 (the day of Steffen Thorsen's report);
-# this is almost surely wrong.
+
+# From Heitor David Pinto (2024-06-23):
+# Sources about time zones in Mongolia seem to list one of two conflicting
+# configurations. The first configuration, mentioned in a comment to the TZ
+# database in 1999, citing a Mongolian government website, lists the provinces
+# of Bayan-Ölgii, Khovd and Uvs in UTC+7, and the rest of the country in
+# UTC+8. The second configuration, mentioned in a comment to the database in
+# 2001, lists Bayan-Ölgii, Khovd, Uvs, Govi-Altai and Zavkhan in UTC+7, Dornod
+# and Sükhbaatar in UTC+9, and the rest of the country in UTC+8.
+#
+# The first configuration is still mentioned by several Mongolian travel
+# agencies:
+# https://www.adventurerider.mn/en/page/about_mongolia
+# http://www.naturetours.mn/nt/mongolia.php
+# https://www.newjuulchin.mn/web/content/7506?unique=fa24a0f6e96e022a3578ee5195ac879638c734ce
+#
+# It also matches these flight schedules in 2013:
+# http://web.archive.org/web/20130722023600/https://www.hunnuair.com/en/timetabled
+# The flight times imply that the airports of Uliastai (Zavkhan), Choibalsan
+# (Dornod) and Altai (Govi-Altai) are in the same time zone as Ulaanbaatar,
+# and Khovd is one hour behind....
+#
+# The second configuration was mentioned by an official of the Mongolian
+# standards agency in an interview in 2014: https://ikon.mn/n/9v6
+# And it's still listed by the Mongolian aviation agency:
+# https://ais.mn/files/aip/eAIP/2023-12-25/html/eSUP/ZM-eSUP-23-04-en-MN.html
+#
+# ... I believe that the first configuration is what is actually observed in
+# Mongolia and has been so all along, at least since 1999. The second
+# configuration closely matches the ideal time zone boundaries at 97.5° E and
+# 112.5° E but it doesn't seem to be used in practice.
# From Ganbold Tsagaankhuu (2015-03-10):
# It seems like yesterday Mongolian Government meeting has concluded to use
@@ -2961,25 +2996,18 @@ Rule Mongol 2015 2016 - Sep lastSat 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
# Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
Zone Asia/Hovd 6:06:36 - LMT 1905 Aug
- 6:00 - +06 1978
- 7:00 Mongol +07/+08
+ 6:00 - %z 1978
+ 7:00 Mongol %z
# Ulaanbaatar, a.k.a. Ulan Bataar, Ulan Bator, Urga
Zone Asia/Ulaanbaatar 7:07:32 - LMT 1905 Aug
- 7:00 - +07 1978
- 8:00 Mongol +08/+09
-# Choibalsan, a.k.a. Bajan Tümen, Bajan Tumen, Chojbalsan,
-# Choybalsan, Sanbejse, Tchoibalsan
-Zone Asia/Choibalsan 7:38:00 - LMT 1905 Aug
- 7:00 - +07 1978
- 8:00 - +08 1983 Apr
- 9:00 Mongol +09/+10 2008 Mar 31
- 8:00 Mongol +08/+09
+ 7:00 - %z 1978
+ 8:00 Mongol %z
# Nepal
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Kathmandu 5:41:16 - LMT 1920
- 5:30 - +0530 1986
- 5:45 - +0545
+ 5:30 - %z 1986
+ 5:45 - %z
# Pakistan
@@ -3125,10 +3153,10 @@ Rule Pakistan 2009 only - Apr 15 0:00 1:00 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Karachi 4:28:12 - LMT 1907
- 5:30 - +0530 1942 Sep
- 5:30 1:00 +0630 1945 Oct 15
- 5:30 - +0530 1951 Sep 30
- 5:00 - +05 1971 Mar 26
+ 5:30 - %z 1942 Sep
+ 5:30 1:00 %z 1945 Oct 15
+ 5:30 - %z 1951 Sep 30
+ 5:00 - %z 1971 Mar 26
5:00 Pakistan PK%sT # Pakistan Time
# Palestine
@@ -3676,14 +3704,14 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
# Philippine Star 2014-08-05
# http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time
-# From Paul Goyette (2018-06-15):
+# From Paul Goyette (2018-06-15) with URLs updated by Guy Harris (2024-02-15):
# In the Philippines, there is a national law, Republic Act No. 10535
# which declares the official time here as "Philippine Standard Time".
# The act [1] even specifies use of PST as the abbreviation, although
# the FAQ provided by PAGASA [2] uses the "acronym PhST to distinguish
# it from the Pacific Standard Time (PST)."
-# [1] http://www.officialgazette.gov.ph/2013/05/15/republic-act-no-10535/
-# [2] https://www1.pagasa.dost.gov.ph/index.php/astronomy/philippine-standard-time#republic-act-10535
+# [1] https://www.officialgazette.gov.ph/2013/05/15/republic-act-no-10535/
+# [2] https://prsd.pagasa.dost.gov.ph/index.php/28-astronomy/302-philippine-standard-time
#
# From Paul Eggert (2018-06-19):
# I surveyed recent news reports, and my impression is that "PST" is
@@ -3716,8 +3744,8 @@ Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31
# Qatar
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha
- 4:00 - +04 1972 Jun
- 3:00 - +03
+ 4:00 - %z 1972 Jun
+ 3:00 - %z
# Kuwait
# Saudi Arabia
@@ -3767,7 +3795,7 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14
- 3:00 - +03
+ 3:00 - %z
# Singapore
# taken from Mok Ly Yng (2003-10-30)
@@ -3775,13 +3803,13 @@ Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
6:55:25 - SMT 1905 Jun 1 # Singapore M.T.
- 7:00 - +07 1933 Jan 1
- 7:00 0:20 +0720 1936 Jan 1
- 7:20 - +0720 1941 Sep 1
- 7:30 - +0730 1942 Feb 16
- 9:00 - +09 1945 Sep 12
- 7:30 - +0730 1981 Dec 31 16:00u
- 8:00 - +08
+ 7:00 - %z 1933 Jan 1
+ 7:00 0:20 %z 1936 Jan 1
+ 7:20 - %z 1941 Sep 1
+ 7:30 - %z 1942 Feb 16
+ 9:00 - %z 1945 Sep 12
+ 7:30 - %z 1981 Dec 31 16:00u
+ 8:00 - %z
# Spratly Is
# no information
@@ -3839,13 +3867,13 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Colombo 5:19:24 - LMT 1880
5:19:32 - MMT 1906 # Moratuwa Mean Time
- 5:30 - +0530 1942 Jan 5
- 5:30 0:30 +06 1942 Sep
- 5:30 1:00 +0630 1945 Oct 16 2:00
- 5:30 - +0530 1996 May 25 0:00
- 6:30 - +0630 1996 Oct 26 0:30
- 6:00 - +06 2006 Apr 15 0:30
- 5:30 - +0530
+ 5:30 - %z 1942 Jan 5
+ 5:30 0:30 %z 1942 Sep
+ 5:30 1:00 %z 1945 Oct 16 2:00
+ 5:30 - %z 1996 May 25 0:00
+ 6:30 - %z 1996 Oct 26 0:30
+ 6:00 - %z 2006 Apr 15 0:30
+ 5:30 - %z
# Syria
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
@@ -4016,16 +4044,16 @@ Rule Syria 2009 2022 - Oct lastFri 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Damascus 2:25:12 - LMT 1920 # Dimashq
2:00 Syria EE%sT 2022 Oct 28 0:00
- 3:00 - +03
+ 3:00 - %z
# Tajikistan
# From Shanks & Pottenger.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2
- 5:00 - +05 1930 Jun 21
- 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
- 5:00 1:00 +06 1991 Sep 9 2:00s
- 5:00 - +05
+ 5:00 - %z 1930 Jun 21
+ 6:00 RussiaAsia %z 1991 Mar 31 2:00s
+ 5:00 1:00 %z 1991 Sep 9 2:00s
+ 5:00 - %z
# Cambodia
# Christmas I
@@ -4035,16 +4063,16 @@ Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Bangkok 6:42:04 - LMT 1880
6:42:04 - BMT 1920 Apr # Bangkok Mean Time
- 7:00 - +07
+ 7:00 - %z
# Turkmenistan
# From Shanks & Pottenger.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Ashgabat 3:53:32 - LMT 1924 May 2 # or Ashkhabad
- 4:00 - +04 1930 Jun 21
- 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00
- 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00
- 5:00 - +05
+ 4:00 - %z 1930 Jun 21
+ 5:00 RussiaAsia %z 1991 Mar 31 2:00
+ 4:00 RussiaAsia %z 1992 Jan 19 2:00
+ 5:00 - %z
# Oman
# Réunion
@@ -4054,25 +4082,25 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 May 2 # or Ashkhabad
# The Crozet Is also observe Réunion time; see the 'antarctica' file.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Dubai 3:41:12 - LMT 1920
- 4:00 - +04
+ 4:00 - %z
# Uzbekistan
# Byalokoz 1919 says Uzbekistan was 4:27:53.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Samarkand 4:27:53 - LMT 1924 May 2
- 4:00 - +04 1930 Jun 21
- 5:00 - +05 1981 Apr 1
- 5:00 1:00 +06 1981 Oct 1
- 6:00 - +06 1982 Apr 1
- 5:00 RussiaAsia +05/+06 1992
- 5:00 - +05
+ 4:00 - %z 1930 Jun 21
+ 5:00 - %z 1981 Apr 1
+ 5:00 1:00 %z 1981 Oct 1
+ 6:00 - %z 1982 Apr 1
+ 5:00 RussiaAsia %z 1992
+ 5:00 - %z
# Milne says Tashkent was 4:37:10.8.
#STDOFF 4:37:10.8
Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
- 5:00 - +05 1930 Jun 21
- 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00
- 5:00 RussiaAsia +05/+06 1992
- 5:00 - +05
+ 5:00 - %z 1930 Jun 21
+ 6:00 RussiaAsia %z 1991 Mar 31 2:00
+ 5:00 RussiaAsia %z 1992
+ 5:00 - %z
# Vietnam (southern)
@@ -4130,7 +4158,7 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
# Võ Nguyên Giáp, Việt Nam Dân Quốc Công Báo, No. 1 (1945-09-29), page 13
# http://baochi.nlv.gov.vn/baochi/cgi-bin/baochi?a=d&d=JwvzO19450929.2.5&dliv=none
# It says that on 1945-09-01 at 24:00, Vietnam moved back two hours, to +07.
-# It also mentions a 1945-03-29 decree (by a Japanese Goveror-General)
+# It also mentions a 1945-03-29 decree (by a Japanese Governor-General)
# to set the time zone to +09, but does not say whether that decree
# merely legalized an earlier change to +09.
#
@@ -4151,14 +4179,14 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
#STDOFF 7:06:30.13
Zone Asia/Ho_Chi_Minh 7:06:30 - LMT 1906 Jul 1
7:06:30 - PLMT 1911 May 1 # Phù Liễn MT
- 7:00 - +07 1942 Dec 31 23:00
- 8:00 - +08 1945 Mar 14 23:00
- 9:00 - +09 1945 Sep 1 24:00
- 7:00 - +07 1947 Apr 1
- 8:00 - +08 1955 Jul 1 01:00
- 7:00 - +07 1959 Dec 31 23:00
- 8:00 - +08 1975 Jun 13
- 7:00 - +07
+ 7:00 - %z 1942 Dec 31 23:00
+ 8:00 - %z 1945 Mar 14 23:00
+ 9:00 - %z 1945 Sep 1 24:00
+ 7:00 - %z 1947 Apr 1
+ 8:00 - %z 1955 Jul 1 01:00
+ 7:00 - %z 1959 Dec 31 23:00
+ 8:00 - %z 1975 Jun 13
+ 7:00 - %z
# From Paul Eggert (2019-02-19):
#
diff --git a/make/data/tzdata/australasia b/make/data/tzdata/australasia
index 624735be652..09698826a49 100644
--- a/make/data/tzdata/australasia
+++ b/make/data/tzdata/australasia
@@ -66,8 +66,8 @@ Zone Australia/Perth 7:43:24 - LMT 1895 Dec
8:00 Aus AW%sT 1943 Jul
8:00 AW AW%sT
Zone Australia/Eucla 8:35:28 - LMT 1895 Dec
- 8:45 Aus +0845/+0945 1943 Jul
- 8:45 AW +0845/+0945
+ 8:45 Aus %z 1943 Jul
+ 8:45 AW %z
# Queensland
#
@@ -232,8 +232,8 @@ Rule LH 2008 max - Apr Sun>=1 2:00 0 -
Rule LH 2008 max - Oct Sun>=1 2:00 0:30 -
Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb
10:00 - AEST 1981 Mar
- 10:30 LH +1030/+1130 1985 Jul
- 10:30 LH +1030/+11
+ 10:30 LH %z 1985 Jul
+ 10:30 LH %z
# Australian miscellany
#
@@ -439,16 +439,16 @@ Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 -
Rule Fiji 2020 only - Dec 20 2:00 1:00 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
- 12:00 Fiji +12/+13
+ 12:00 Fiji %z
# French Polynesia
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct 1 # Rikitea
- -9:00 - -09
+ -9:00 - %z
Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct 1
- -9:30 - -0930
+ -9:30 - %z
Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct 1 # Papeete
- -10:00 - -10
+ -10:00 - %z
# Clipperton (near North America) is administered from French Polynesia;
# it is uninhabited.
@@ -491,7 +491,7 @@ Rule Guam 1977 only - Aug 28 2:00 0 S
Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31
9:39:00 - LMT 1901 # Agana
10:00 - GST 1941 Dec 10 # Guam
- 9:00 - +09 1944 Jul 31
+ 9:00 - %z 1944 Jul 31
10:00 Guam G%sT 2000 Dec 23
10:00 - ChST # Chamorro Standard Time
@@ -503,30 +503,30 @@ Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31
# Wallis & Futuna
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Tarawa 11:32:04 - LMT 1901 # Bairiki
- 12:00 - +12
+ 12:00 - %z
# Kiribati (except Gilbert Is)
# See Pacific/Tarawa for the Gilbert Is.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Kanton 0 - -00 1937 Aug 31
- -12:00 - -12 1979 Oct
- -11:00 - -11 1994 Dec 31
- 13:00 - +13
+ -12:00 - %z 1979 Oct
+ -11:00 - %z 1994 Dec 31
+ 13:00 - %z
Zone Pacific/Kiritimati -10:29:20 - LMT 1901
- -10:40 - -1040 1979 Oct
- -10:00 - -10 1994 Dec 31
- 14:00 - +14
+ -10:40 - %z 1979 Oct
+ -10:00 - %z 1994 Dec 31
+ 14:00 - %z
# Marshall Is
# See Pacific/Tarawa for most locations.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Kwajalein 11:09:20 - LMT 1901
- 11:00 - +11 1937
- 10:00 - +10 1941 Apr 1
- 9:00 - +09 1944 Feb 6
- 11:00 - +11 1969 Oct
- -12:00 - -12 1993 Aug 20 24:00
- 12:00 - +12
+ 11:00 - %z 1937
+ 10:00 - %z 1941 Apr 1
+ 9:00 - %z 1944 Feb 6
+ 11:00 - %z 1969 Oct
+ -12:00 - %z 1993 Aug 20 24:00
+ 12:00 - %z
# Micronesia
# For Chuuk and Yap see Pacific/Port_Moresby.
@@ -534,22 +534,22 @@ Zone Pacific/Kwajalein 11:09:20 - LMT 1901
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31
10:51:56 - LMT 1901
- 11:00 - +11 1914 Oct
- 9:00 - +09 1919 Feb 1
- 11:00 - +11 1937
- 10:00 - +10 1941 Apr 1
- 9:00 - +09 1945 Aug
- 11:00 - +11 1969 Oct
- 12:00 - +12 1999
- 11:00 - +11
+ 11:00 - %z 1914 Oct
+ 9:00 - %z 1919 Feb 1
+ 11:00 - %z 1937
+ 10:00 - %z 1941 Apr 1
+ 9:00 - %z 1945 Aug
+ 11:00 - %z 1969 Oct
+ 12:00 - %z 1999
+ 11:00 - %z
# Nauru
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe
- 11:30 - +1130 1942 Aug 29
- 9:00 - +09 1945 Sep 8
- 11:30 - +1130 1979 Feb 10 2:00
- 12:00 - +12
+ 11:30 - %z 1942 Aug 29
+ 9:00 - %z 1945 Sep 8
+ 11:30 - %z 1979 Feb 10 2:00
+ 12:00 - %z
# New Caledonia
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
@@ -560,7 +560,7 @@ Rule NC 1996 only - Dec 1 2:00s 1:00 -
Rule NC 1997 only - Mar 2 2:00s 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Noumea 11:05:48 - LMT 1912 Jan 13 # Nouméa
- 11:00 NC +11/+12
+ 11:00 NC %z
###############################################################################
@@ -604,8 +604,8 @@ Zone Pacific/Auckland 11:39:04 - LMT 1868 Nov 2
12:00 NZ NZ%sT
Zone Pacific/Chatham 12:13:48 - LMT 1868 Nov 2
- 12:15 - +1215 1946 Jan 1
- 12:45 Chatham +1245/+1345
+ 12:15 - %z 1946 Jan 1
+ 12:45 Chatham %z
# Auckland Is
# uninhabited; Māori and Moriori, colonial settlers, pastoralists, sealers,
@@ -658,8 +658,8 @@ Rule Cook 1979 1990 - Oct lastSun 0:00 0:30 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Rarotonga 13:20:56 - LMT 1899 Dec 26 # Avarua
-10:39:04 - LMT 1952 Oct 16
- -10:30 - -1030 1978 Nov 12
- -10:00 Cook -10/-0930
+ -10:30 - %z 1978 Nov 12
+ -10:00 Cook %z
###############################################################################
@@ -676,30 +676,30 @@ Zone Pacific/Rarotonga 13:20:56 - LMT 1899 Dec 26 # Avarua
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Niue -11:19:40 - LMT 1952 Oct 16 # Alofi
- -11:20 - -1120 1964 Jul
- -11:00 - -11
+ -11:20 - %z 1964 Jul
+ -11:00 - %z
# Norfolk
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston
- 11:12 - +1112 1951
- 11:30 - +1130 1974 Oct 27 02:00s
- 11:30 1:00 +1230 1975 Mar 2 02:00s
- 11:30 - +1130 2015 Oct 4 02:00s
- 11:00 - +11 2019 Jul
- 11:00 AN +11/+12
+ 11:12 - %z 1951
+ 11:30 - %z 1974 Oct 27 02:00s
+ 11:30 1:00 %z 1975 Mar 2 02:00s
+ 11:30 - %z 2015 Oct 4 02:00s
+ 11:00 - %z 2019 Jul
+ 11:00 AN %z
# Palau (Belau)
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror
8:57:56 - LMT 1901
- 9:00 - +09
+ 9:00 - %z
# Papua New Guinea
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
9:48:32 - PMMT 1895 # Port Moresby Mean Time
- 10:00 - +10
+ 10:00 - %z
#
# From Paul Eggert (2014-10-13):
# Base the Bougainville entry on the Arawa-Kieta region, which appears to have
@@ -720,16 +720,16 @@ Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
#
Zone Pacific/Bougainville 10:22:16 - LMT 1880
9:48:32 - PMMT 1895
- 10:00 - +10 1942 Jul
- 9:00 - +09 1945 Aug 21
- 10:00 - +10 2014 Dec 28 2:00
- 11:00 - +11
+ 10:00 - %z 1942 Jul
+ 9:00 - %z 1945 Aug 21
+ 10:00 - %z 2014 Dec 28 2:00
+ 11:00 - %z
# Pitcairn
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Pitcairn -8:40:20 - LMT 1901 # Adamstown
- -8:30 - -0830 1998 Apr 27 0:00
- -8:00 - -08
+ -8:30 - %z 1998 Apr 27 0:00
+ -8:00 - %z
# American Samoa
# Midway
@@ -818,15 +818,15 @@ Rule WS 2012 2020 - Sep lastSun 3:00 1 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Apia 12:33:04 - LMT 1892 Jul 5
-11:26:56 - LMT 1911
- -11:30 - -1130 1950
- -11:00 WS -11/-10 2011 Dec 29 24:00
- 13:00 WS +13/+14
+ -11:30 - %z 1950
+ -11:00 WS %z 2011 Dec 29 24:00
+ 13:00 WS %z
# Solomon Is
# excludes Bougainville, for which see Papua New Guinea
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct 1 # Honiara
- 11:00 - +11
+ 11:00 - %z
# Tokelau
#
@@ -849,8 +849,8 @@ Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct 1 # Honiara
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Fakaofo -11:24:56 - LMT 1901
- -11:00 - -11 2011 Dec 30
- 13:00 - +13
+ -11:00 - %z 2011 Dec 30
+ 13:00 - %z
# Tonga
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
@@ -862,9 +862,9 @@ Rule Tonga 2016 only - Nov Sun>=1 2:00 1:00 -
Rule Tonga 2017 only - Jan Sun>=15 3:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Tongatapu 12:19:12 - LMT 1945 Sep 10
- 12:20 - +1220 1961
- 13:00 - +13 1999
- 13:00 Tonga +13/+14
+ 12:20 - %z 1961
+ 13:00 - %z 1999
+ 13:00 Tonga %z
# US minor outlying islands
@@ -953,7 +953,7 @@ Rule Vanuatu 1992 1993 - Jan Sat>=22 24:00 0 -
Rule Vanuatu 1992 only - Oct Sat>=22 24:00 1:00 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
- 11:00 Vanuatu +11/+12
+ 11:00 Vanuatu %z
###############################################################################
diff --git a/make/data/tzdata/backward b/make/data/tzdata/backward
index 7ddc6cc3d93..cda2ccc0c66 100644
--- a/make/data/tzdata/backward
+++ b/make/data/tzdata/backward
@@ -21,12 +21,13 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
-# tzdb links for backward compatibility
+# Links and zones for backward compatibility
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# This file provides links from old or merged timezone names to current ones.
+# It also provides a few zone entries for old naming conventions.
# Many names changed in 1993 and in 1995, and many merged names moved here
# in the period from 2013 through 2022. Several of these names are
# also present in the file 'backzone', which has data important only
@@ -67,6 +68,8 @@ Link America/Rio_Branco Brazil/Acre #= America/Porto_Acre
Link America/Noronha Brazil/DeNoronha
Link America/Sao_Paulo Brazil/East
Link America/Manaus Brazil/West
+Link Europe/Brussels CET
+Link America/Chicago CST6CDT
Link America/Halifax Canada/Atlantic
Link America/Winnipeg Canada/Central
# This line is commented out, as the name exceeded the 14-character limit
@@ -81,6 +84,9 @@ Link America/Whitehorse Canada/Yukon
Link America/Santiago Chile/Continental
Link Pacific/Easter Chile/EasterIsland
Link America/Havana Cuba
+Link Europe/Athens EET
+Link America/Panama EST
+Link America/New_York EST5EDT
Link Africa/Cairo Egypt
Link Europe/Dublin Eire
# Vanguard section, for most .zi parsers.
@@ -119,6 +125,9 @@ Link America/Jamaica Jamaica
Link Asia/Tokyo Japan
Link Pacific/Kwajalein Kwajalein
Link Africa/Tripoli Libya
+Link Europe/Brussels MET
+Link America/Phoenix MST
+Link America/Denver MST7MDT
Link America/Tijuana Mexico/BajaNorte
Link America/Mazatlan Mexico/BajaSur
Link America/Mexico_City Mexico/General
@@ -298,6 +307,7 @@ Link America/Denver America/Shiprock
Link America/Toronto America/Thunder_Bay
Link America/Edmonton America/Yellowknife
Link Pacific/Auckland Antarctica/South_Pole
+Link Asia/Ulaanbaatar Asia/Choibalsan
Link Asia/Shanghai Asia/Chongqing
Link Asia/Shanghai Asia/Harbin
Link Asia/Urumqi Asia/Kashgar
@@ -312,6 +322,7 @@ Link Europe/Kyiv Europe/Zaporozhye
Link Pacific/Kanton Pacific/Enderbury
Link Pacific/Honolulu Pacific/Johnston
Link Pacific/Port_Moresby Pacific/Yap
+Link Europe/Lisbon WET
# Alternate names for the same location
@@ -337,5 +348,7 @@ Link Europe/Kyiv Europe/Kiev
# Classically, Cyprus is in Asia; e.g. see Herodotus, Histories, I.72.
# However, for various reasons many users expect to find it under Europe.
Link Asia/Nicosia Europe/Nicosia
+Link Pacific/Honolulu HST
+Link America/Los_Angeles PST8PDT
Link Pacific/Guadalcanal Pacific/Ponape #= Pacific/Pohnpei
Link Pacific/Port_Moresby Pacific/Truk #= Pacific/Chuuk
diff --git a/make/data/tzdata/etcetera b/make/data/tzdata/etcetera
index 27147715ef6..780c835819d 100644
--- a/make/data/tzdata/etcetera
+++ b/make/data/tzdata/etcetera
@@ -28,7 +28,7 @@
# These entries are for uses not otherwise covered by the tz database.
# Their main practical use is for platforms like Android that lack
-# support for POSIX.1-2017-style TZ strings. On such platforms these entries
+# support for POSIX proleptic TZ strings. On such platforms these entries
# can be useful if the timezone database is wrong or if a ship or
# aircraft at sea is not in a timezone.
@@ -74,29 +74,29 @@ Link Etc/GMT GMT
# so we moved the names into the Etc subdirectory.
# Also, the time zone abbreviations are now compatible with %z.
-Zone Etc/GMT-14 14 - +14
-Zone Etc/GMT-13 13 - +13
-Zone Etc/GMT-12 12 - +12
-Zone Etc/GMT-11 11 - +11
-Zone Etc/GMT-10 10 - +10
-Zone Etc/GMT-9 9 - +09
-Zone Etc/GMT-8 8 - +08
-Zone Etc/GMT-7 7 - +07
-Zone Etc/GMT-6 6 - +06
-Zone Etc/GMT-5 5 - +05
-Zone Etc/GMT-4 4 - +04
-Zone Etc/GMT-3 3 - +03
-Zone Etc/GMT-2 2 - +02
-Zone Etc/GMT-1 1 - +01
-Zone Etc/GMT+1 -1 - -01
-Zone Etc/GMT+2 -2 - -02
-Zone Etc/GMT+3 -3 - -03
-Zone Etc/GMT+4 -4 - -04
-Zone Etc/GMT+5 -5 - -05
-Zone Etc/GMT+6 -6 - -06
-Zone Etc/GMT+7 -7 - -07
-Zone Etc/GMT+8 -8 - -08
-Zone Etc/GMT+9 -9 - -09
-Zone Etc/GMT+10 -10 - -10
-Zone Etc/GMT+11 -11 - -11
-Zone Etc/GMT+12 -12 - -12
+Zone Etc/GMT-14 14 - %z
+Zone Etc/GMT-13 13 - %z
+Zone Etc/GMT-12 12 - %z
+Zone Etc/GMT-11 11 - %z
+Zone Etc/GMT-10 10 - %z
+Zone Etc/GMT-9 9 - %z
+Zone Etc/GMT-8 8 - %z
+Zone Etc/GMT-7 7 - %z
+Zone Etc/GMT-6 6 - %z
+Zone Etc/GMT-5 5 - %z
+Zone Etc/GMT-4 4 - %z
+Zone Etc/GMT-3 3 - %z
+Zone Etc/GMT-2 2 - %z
+Zone Etc/GMT-1 1 - %z
+Zone Etc/GMT+1 -1 - %z
+Zone Etc/GMT+2 -2 - %z
+Zone Etc/GMT+3 -3 - %z
+Zone Etc/GMT+4 -4 - %z
+Zone Etc/GMT+5 -5 - %z
+Zone Etc/GMT+6 -6 - %z
+Zone Etc/GMT+7 -7 - %z
+Zone Etc/GMT+8 -8 - %z
+Zone Etc/GMT+9 -9 - %z
+Zone Etc/GMT+10 -10 - %z
+Zone Etc/GMT+11 -11 - %z
+Zone Etc/GMT+12 -12 - %z
diff --git a/make/data/tzdata/europe b/make/data/tzdata/europe
index 18865f33b6c..df203f218d1 100644
--- a/make/data/tzdata/europe
+++ b/make/data/tzdata/europe
@@ -753,14 +753,6 @@ Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
# Take "abolishing daylight saving time" to mean that time is now considered
# to be standard.
-# These are for backward compatibility with older versions.
-
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone WET 0:00 EU WE%sT
-Zone CET 1:00 C-Eur CE%sT
-Zone MET 1:00 C-Eur ME%sT
-Zone EET 2:00 EU EE%sT
-
# Previous editions of this database used abbreviations like MET DST
# for Central European Summer Time, but this didn't agree with common usage.
@@ -894,7 +886,7 @@ Zone Europe/Minsk 1:50:16 - LMT 1880
3:00 Russia MSK/MSD 1990
3:00 - MSK 1991 Mar 31 2:00s
2:00 Russia EE%sT 2011 Mar 27 2:00s
- 3:00 - +03
+ 3:00 - %z
# Belgium
# Luxembourg
@@ -1199,22 +1191,22 @@ Rule Thule 2007 max - Nov Sun>=1 2:00 0 S
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Danmarkshavn -1:14:40 - LMT 1916 Jul 28
- -3:00 - -03 1980 Apr 6 2:00
- -3:00 EU -03/-02 1996
+ -3:00 - %z 1980 Apr 6 2:00
+ -3:00 EU %z 1996
0:00 - GMT
#
# Use the old name Scoresbysund, as the current name Ittoqqortoormiit
# exceeds tzdb's 14-letter limit and has no common English abbreviation.
Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit
- -2:00 - -02 1980 Apr 6 2:00
- -2:00 C-Eur -02/-01 1981 Mar 29
- -1:00 EU -01/+00 2024 Mar 31
- -2:00 EU -02/-01
+ -2:00 - %z 1980 Apr 6 2:00
+ -2:00 C-Eur %z 1981 Mar 29
+ -1:00 EU %z 2024 Mar 31
+ -2:00 EU %z
Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb
- -3:00 - -03 1980 Apr 6 2:00
- -3:00 EU -03/-02 2023 Mar 26 1:00u
- -2:00 - -02 2023 Oct 29 1:00u
- -2:00 EU -02/-01
+ -3:00 - %z 1980 Apr 6 2:00
+ -3:00 EU %z 2023 Mar 26 1:00u
+ -2:00 - %z 2023 Oct 29 1:00u
+ -2:00 EU %z
Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik
-4:00 Thule A%sT
@@ -2086,10 +2078,39 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
# Portugal
-# From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne:
-# According to a Portuguese decree (1911-05-26)
-# https://dre.pt/application/dir/pdf1sdip/1911/05/12500/23132313.pdf
-# Lisbon was at -0:36:44.68, but switched to GMT on 1912-01-01 at 00:00.
+# From Tim Parenti (2024-07-01), per Alois Treindl (2021-02-07) and Michael
+# Deckers (2021-02-10):
+# http://oal.ul.pt/documentos/2018/01/hl1911a2018.pdf/
+# The Astronomical Observatory of Lisbon has published a list detailing the
+# historical transitions in legal time within continental Portugal. It
+# directly references many decrees and ordinances which are, in turn,
+# referenced below. They can be viewed in the public archives of the Diário da
+# República (until 1976-04-09 known as the Diário do Govêrno) at
+# https://dre.pt/ (in Portuguese).
+#
+# Most of the Rules below have been updated simply to match the Observatory's
+# listing for continental (mainland) Portugal. Although there are over 50
+# referenced decrees and ordinances, only the handful with comments below have
+# been verified against the text, typically to provide additional confidence
+# wherever dates provided by Whitman and Shanks & Pottenger had disagreed.
+# See further below for the Azores and Madeira.
+
+# From Tim Parenti (2024-07-01), per Paul Eggert (2014-08-11), after a
+# heads-up from Stephen Colebourne:
+# According to a 1911-05-24 Portuguese decree, Lisbon was at -0:36:44.68, but
+# switched to GMT on 1912-01-01 at 00:00.
+# https://dre.pt/dr/detalhe/decreto/593090
+# https://dre.pt/application/conteudo/593090
+# The decree made legal time throughout Portugal and her possessions
+# "subordinate to the Greenwich meridian, according to the principle adopted at
+# the Washington Convention in 1884" and eliminated the "difference of five
+# minutes between the internal and external clocks of railway stations".
+#
+# The decree was gazetted in the 1911-05-30 issue of Diário do Govêrno, and is
+# considered to be dated 1911-05-24 by that issue's summary; however, the text
+# of the decree itself is dated 1911-05-26. The Diário da República website
+# notes the discrepancy, but later laws and the Observatory all seem to refer
+# to this decree by the 1911-05-24 date.
#
# From Michael Deckers (2018-02-15):
# article 5 [of the 1911 decree; Deckers's translation] ...:
@@ -2097,37 +2118,62 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
# according to the 2nd article, the civil day January 1, 1912 begins,
# all clocks therefore having to be advanced or set back correspondingly ...
-# From Rui Pedro Salgueiro (1992-11-12):
-# Portugal has recently (September, 27) changed timezone
-# (from WET to MET or CET) to harmonize with EEC.
-#
-# Martin Bruckmann (1996-02-29) reports via Peter Ilieve
-# that Portugal is reverting to 0:00 by not moving its clocks this spring.
-# The new Prime Minister was fed up with getting up in the dark in the winter.
-#
-# From Paul Eggert (1996-11-12):
-# IATA SSIM (1991-09) reports several 1991-09 and 1992-09 transitions
-# at 02:00u, not 01:00u. Assume that these are typos.
-# IATA SSIM (1991/1992) reports that the Azores were at -1:00.
-# IATA SSIM (1993-02) says +0:00; later issues (through 1996-09) say -1:00.
-# Guess that the Azores changed to EU rules in 1992 (since that's when Portugal
-# harmonized with EU rules), and that they stayed +0:00 that winter.
-#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-# DSH writes that despite Decree 1,469 (1915), the change to the clocks was not
-# done every year, depending on what Spain did, because of railroad schedules.
-# Go with Shanks & Pottenger.
+# From Tim Parenti (2024-07-01), per Paul Eggert (1999-01-30):
+# DSH writes in their history that Decreto 1469 of 1915-03-30 established
+# summer time and that, "despite" this, the change to the clocks was not done
+# every year, depending on what Spain did, because of railroad schedules.
+# In fact, that decree had nothing to do with DST; rather, it regulated the
+# sending of time signals. But we do see linkage to Spain in the 1920s below.
+# https://dre.pt/dr/detalhe/decreto/1469-1915-285721
+# https://dre.pt/application/conteudo/285721
+#
+# According to the Observatory, standard time was first advanced by Decreto
+# 2433 of 1916-06-09 and restored by Decreto 2712 of 1916-10-28. While Whitman
+# gives 1916-10-31 for the latter transition, Shanks & Pottenger agrees more
+# closely with the decree, which stated that its provision "will start sixty
+# minutes after the end of 31 October, according to the current time," i.e.,
+# 01:00 on 1 November.
+# https://dre.pt/dr/detalhe/decreto/2433-1916-267192
+# https://dre.pt/application/conteudo/267192
+# https://dre.pt/dr/detalhe/decreto/2712-1916-590937
+# https://dre.pt/application/conteudo/590937
Rule Port 1916 only - Jun 17 23:00 1:00 S
-# Whitman gives 1916 Oct 31; go with Shanks & Pottenger.
Rule Port 1916 only - Nov 1 1:00 0 -
-Rule Port 1917 only - Feb 28 23:00s 1:00 S
-Rule Port 1917 1921 - Oct 14 23:00s 0 -
-Rule Port 1918 only - Mar 1 23:00s 1:00 S
-Rule Port 1919 only - Feb 28 23:00s 1:00 S
-Rule Port 1920 only - Feb 29 23:00s 1:00 S
-Rule Port 1921 only - Feb 28 23:00s 1:00 S
+# From Tim Parenti (2024-07-01):
+# Article 7 of Decreto 2922 of 1916-12-30 stated that "the legal time will be
+# advanced by sixty minutes from 1 March to 31 October." Per Article 15, this
+# came into force from 1917-01-01. Just before the first fall back, Decreto
+# 3446 of 1917-10-11 changed the annual end date to 14 October.
+# https://dre.pt/dr/detalhe/decreto/2922-1916-261894
+# https://dre.pt/application/conteudo/261894
+# https://dre.pt/dr/detalhe/decreto/3446-1917-495161
+# https://dre.pt/application/conteudo/495161
+# This annual change was revoked by Decreto 8038 of 1922-02-18.
+# https://dre.pt/dr/detalhe/decreto/8038-1922-569751
+# https://dre.pt/application/conteudo/569751
+Rule Port 1917 1921 - Mar 1 0:00 1:00 S
+Rule Port 1917 1921 - Oct 14 24:00 0 -
+# From Tim Parenti (2024-07-01):
+# Decreto 9592 of 1924-04-14 noted that "France maintains the advance of legal
+# time in the summer and Spain has now adopted it for the first time" and
+# considered "that the absence of similar measures would cause serious
+# difficulties for international rail connections with consequent repercussions
+# on domestic service hours..." along with "inconvenient analogues...for postal
+# and telegraph services." Summer time would be in effect from 17 April to 4
+# October, with the spring change explicitly specified by bringing clocks
+# forward from 16 April 23:00.
+# https://dre.pt/dr/detalhe/decreto/9592-1924-652133
+# https://dre.pt/application/conteudo/652133
+#
+# Decreto 10700, issued 1925-04-16, noted that Spain had not continued summer
+# time, declared that "the current legal hour prior to 17 April remains
+# unchanged from that day forward", and revoked legislation to the contrary,
+# just a day before summer time would have otherwise resumed.
+# https://dre.pt/dr/detalhe/decreto/10700-1925-437826
+# https://dre.pt/application/conteudo/437826
Rule Port 1924 only - Apr 16 23:00s 1:00 S
-Rule Port 1924 only - Oct 14 23:00s 0 -
+Rule Port 1924 only - Oct 4 23:00s 0 -
Rule Port 1926 only - Apr 17 23:00s 1:00 S
Rule Port 1926 1929 - Oct Sat>=1 23:00s 0 -
Rule Port 1927 only - Apr 9 23:00s 1:00 S
@@ -2139,6 +2185,8 @@ Rule Port 1931 1932 - Oct Sat>=1 23:00s 0 -
Rule Port 1932 only - Apr 2 23:00s 1:00 S
Rule Port 1934 only - Apr 7 23:00s 1:00 S
# Whitman gives 1934 Oct 5; go with Shanks & Pottenger.
+# Note: The 1935 law specified 10-06 00:00, not 10-05 24:00, but the following
+# is equivalent and more succinct.
Rule Port 1934 1938 - Oct Sat>=1 23:00s 0 -
# Shanks & Pottenger give 1935 Apr 30; go with Whitman.
Rule Port 1935 only - Mar 30 23:00s 1:00 S
@@ -2149,10 +2197,19 @@ Rule Port 1938 only - Mar 26 23:00s 1:00 S
Rule Port 1939 only - Apr 15 23:00s 1:00 S
# Whitman gives 1939 Oct 7; go with Shanks & Pottenger.
Rule Port 1939 only - Nov 18 23:00s 0 -
+# From Tim Parenti (2024-07-01):
+# Portaria 9465 of 1940-02-17 advanced clocks from Saturday 1940-02-24 23:00.
+# The clocks were restored by Portaria 9658, issued Monday 1940-10-07,
+# effective from 24:00 that very night, which agrees with Shanks & Pottenger;
+# Whitman gives Saturday 1940-10-05 instead.
+# https://dre.pt/dr/detalhe/portaria/9465-1940-189096
+# https://dre.pt/application/conteudo/189096
+# https://dre.pt/dr/detalhe/portaria/9658-1940-196729
+# https://dre.pt/application/conteudo/196729
Rule Port 1940 only - Feb 24 23:00s 1:00 S
-# Shanks & Pottenger give 1940 Oct 7; go with Whitman.
-Rule Port 1940 1941 - Oct 5 23:00s 0 -
+Rule Port 1940 only - Oct 7 23:00s 0 -
Rule Port 1941 only - Apr 5 23:00s 1:00 S
+Rule Port 1941 only - Oct 5 23:00s 0 -
Rule Port 1942 1945 - Mar Sat>=8 23:00s 1:00 S
Rule Port 1942 only - Apr 25 22:00s 2:00 M # Midsummer
Rule Port 1942 only - Aug 15 22:00s 1:00 S
@@ -2162,66 +2219,195 @@ Rule Port 1943 1945 - Aug Sat>=25 22:00s 1:00 S
Rule Port 1944 1945 - Apr Sat>=21 22:00s 2:00 M
Rule Port 1946 only - Apr Sat>=1 23:00s 1:00 S
Rule Port 1946 only - Oct Sat>=1 23:00s 0 -
-# Whitman says DST was not observed in 1950; go with Shanks & Pottenger.
-# Whitman gives Oct lastSun for 1952 on; go with Shanks & Pottenger.
-Rule Port 1947 1965 - Apr Sun>=1 2:00s 1:00 S
+# From Tim Parenti (2024-07-01), per Alois Treindl (2021-02-07):
+# The Astronomical Observatory of Lisbon cites Portaria 11767 of 1947-03-28 for
+# 1947 and Portaria 12286 of 1948-02-19 for 1948.
+# https://dre.pt/dr/detalhe/portaria/11767-1947-414787
+# https://dre.pt/application/conteudo/414787
+# https://dre.pt/dr/detalhe/portaria/12286-1948-152953
+# https://dre.pt/application/conteudo/152953
+#
+# Although the latter ordinance explicitly had the 1948-10-03 transition
+# scheduled for 02:00 rather than 03:00 as had been used in 1947, Decreto-Lei
+# 37048 of 1948-09-07 recognized "that it is advisable to definitely set...the
+# 'summer time' regime", and fixed the fall transition at 03:00 moving forward.
+# https://dre.pt/dr/detalhe/decreto-lei/37048-1948-373810
+# https://dre.pt/application/conteudo/373810
+# While the Observatory only cites this act for 1949-1965 and not for 1948, it
+# does not appear to have had any provision delaying its effect, so assume that
+# it overrode the prior ordinance for 1948-10-03.
+#
+# Whitman says DST was not observed in 1950 and gives Oct lastSun for 1952 on.
+# The Observatory, however, agrees with Shanks & Pottenger that 1950 was not an
+# exception and that Oct Sun>=1 was maintained through 1965.
+Rule Port 1947 1966 - Apr Sun>=1 2:00s 1:00 S
Rule Port 1947 1965 - Oct Sun>=1 2:00s 0 -
-Rule Port 1977 only - Mar 27 0:00s 1:00 S
-Rule Port 1977 only - Sep 25 0:00s 0 -
-Rule Port 1978 1979 - Apr Sun>=1 0:00s 1:00 S
-Rule Port 1978 only - Oct 1 0:00s 0 -
-Rule Port 1979 1982 - Sep lastSun 1:00s 0 -
-Rule Port 1980 only - Mar lastSun 0:00s 1:00 S
-Rule Port 1981 1982 - Mar lastSun 1:00s 1:00 S
-Rule Port 1983 only - Mar lastSun 2:00s 1:00 S
+# From Tim Parenti (2024-07-01):
+# Decreto-Lei 47233 of 1966-10-01 considered that the "duality" in time was
+# "the cause of serious disturbances" and noted that "the countries with which
+# we have the most frequent contacts...have already adopted" a solution
+# coinciding with the extant "summer time". It established that the former
+# "summer time" would apply year-round on the mainland and adjacent islands
+# with immediate effect, as the fall back would have otherwise occurred later
+# that evening.
+# https://dre.pt/dr/detalhe/decreto-lei/47233-1966-293729
+# Model this by changing zones without changing clocks at the
+# previously-appointed fall back time.
+#
+# Decreto-Lei 309/76 of 1976-04-27 acknowledged that those international
+# contacts had returned to adopting seasonal times, and considered that the
+# year-round advancement "entails considerable sacrifices for the vast majority
+# of the working population during the winter months", including morning
+# visibility concerns for schoolchildren. It specified, beginning 1976-09-26
+# 01:00, an annual return to UT+00 on the mainland from 00:00 UT on Sep lastSun
+# to 00:00 UT on Mar lastSun (unless the latter date fell on Easter, in which
+# case it was to be brought forward to the preceding Sunday). It also assigned
+# the Permanent Time Commission to study and propose revisions for the Azores
+# and Madeira, neither of which resumed DST until 1982 (as described further
+# below).
+# https://dre.pt/dr/detalhe/decreto-lei/309-1976-502063
+Rule Port 1976 only - Sep lastSun 1:00 0 -
+Rule Port 1977 only - Mar lastSun 0:00s 1:00 S
+Rule Port 1977 only - Sep lastSun 0:00s 0 -
+# From Tim Parenti (2024-07-01):
+# Beginning in 1978, rather than triggering the Easter rule of the 1976 decree
+# (Easter fell on 1978-03-26), Article 5 was used instead, which allowed DST
+# dates to be changed by order of the Minister of Education and Scientific
+# Research, upon consultation with the Permanent Time Commission, "whenever
+# considered convenient." As such, a series of one-off ordinances were
+# promulgated for the mainland in 1978 through 1980, after which the 1976
+# decree naturally came back into force from 1981.
+Rule Port 1978 1980 - Apr Sun>=1 1:00s 1:00 S
+Rule Port 1978 only - Oct 1 1:00s 0 -
+Rule Port 1979 1980 - Sep lastSun 1:00s 0 -
+Rule Port 1981 1986 - Mar lastSun 0:00s 1:00 S
+Rule Port 1981 1985 - Sep lastSun 0:00s 0 -
+# From Tim Parenti (2024-07-01):
+# Decreto-Lei 44-B/86 of 1986-03-07 switched mainland Portugal's transition
+# times from 0:00s to 1:00u to harmonize with the EEC from 1986-03-30.
+# https://dre.pt/dr/detalhe/decreto-lei/44-b-1986-628280
+# (Transitions of 1:00s as previously reported and used by the W-Eur rules,
+# though equivalent, appear to have been fiction here.) Madeira continued to
+# use 0:00s for spring 1986 before joining with the mainland using 1:00u in the
+# fall; meanwhile, in the Azores the two were equivalent, so the law specifying
+# 0:00s wasn't touched until 1992. (See below for more on the islands.)
+#
+# From Rui Pedro Salgueiro (1992-11-12):
+# Portugal has recently (September, 27) changed timezone
+# (from WET to MET or CET) to harmonize with EEC.
+#
+# Martin Bruckmann (1996-02-29) reports via Peter Ilieve
+# that Portugal is reverting to 0:00 by not moving its clocks this spring.
+# The new Prime Minister was fed up with getting up in the dark in the winter.
+#
+# From Paul Eggert (1996-11-12):
+# IATA SSIM (1991-09) reports several 1991-09 and 1992-09 transitions
+# at 02:00u, not 01:00u. Assume that these are typos.
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
#STDOFF -0:36:44.68
Zone Europe/Lisbon -0:36:45 - LMT 1884
-0:36:45 - LMT 1912 Jan 1 0:00u # Lisbon MT
- 0:00 Port WE%sT 1966 Apr 3 2:00
+ 0:00 Port WE%sT 1966 Oct 2 2:00s
1:00 - CET 1976 Sep 26 1:00
- 0:00 Port WE%sT 1983 Sep 25 1:00s
- 0:00 W-Eur WE%sT 1992 Sep 27 1:00s
+ 0:00 Port WE%sT 1986
+ 0:00 EU WE%sT 1992 Sep 27 1:00u
1:00 EU CE%sT 1996 Mar 31 1:00u
0:00 EU WE%sT
+
+# From Tim Parenti (2024-07-01):
+# For the Azores and Madeira, legislation was followed from the laws currently
+# in force as listed at:
+# https://oal.ul.pt/hora-legal/legislacao/
+# working backward through references of revocation and abrogation to
+# Decreto-Lei 47233 of 1966-10-01, the last time DST was abolished across the
+# mainland and its adjacent islands. Because of that reference, it is
+# therefore assumed that DST rules in the islands prior to 1966 were like that
+# of the mainland, though most legislation of the time didn't explicitly
+# specify DST practices for the islands.
Zone Atlantic/Azores -1:42:40 - LMT 1884 # Ponta Delgada
-1:54:32 - HMT 1912 Jan 1 2:00u # Horta MT
# Vanguard section, for zic and other parsers that support %z.
-# -2:00 Port %z 1966 Apr 3 2:00
-# -1:00 Port %z 1983 Sep 25 1:00s
-# -1:00 W-Eur %z 1992 Sep 27 1:00s
+ -2:00 Port %z 1966 Oct 2 2:00s
+# From Tim Parenti (2024-07-01):
+# While Decreto-Lei 309/76 of 1976-04-27 reintroduced DST on the mainland by
+# falling back on 1976-09-26, it assigned the Permanent Time Commission to
+# study and propose revisions for the Azores and Madeira. Decreto Regional
+# 9/77/A of 1977-05-17 affirmed that "the legal time remained unchanged in the
+# Azores" at UT-1, and would remain there year-round.
+# https://dre.pt/dr/detalhe/decreto-regional/9-1977-252066
+#
+# Decreto Regional 2/82/A, published 1982-03-02, adopted DST in the same
+# fashion as the mainland used at the time.
+# https://dre.pt/dr/detalhe/decreto-regional/2-1982-599965
+# Though transitions in the Azores officially remained at 0:00s through 1992,
+# this was equivalent to the EU-style 1:00u adopted by the mainland in 1986, so
+# model it as such.
+ -1:00 - %z 1982 Mar 28 0:00s
+ -1:00 Port %z 1986
# Rearguard section, for parsers lacking %z; see ziguard.awk.
- -2:00 Port -02/-01 1942 Apr 25 22:00s
- -2:00 Port +00 1942 Aug 15 22:00s
- -2:00 Port -02/-01 1943 Apr 17 22:00s
- -2:00 Port +00 1943 Aug 28 22:00s
- -2:00 Port -02/-01 1944 Apr 22 22:00s
- -2:00 Port +00 1944 Aug 26 22:00s
- -2:00 Port -02/-01 1945 Apr 21 22:00s
- -2:00 Port +00 1945 Aug 25 22:00s
- -2:00 Port -02/-01 1966 Apr 3 2:00
- -1:00 Port -01/+00 1983 Sep 25 1:00s
- -1:00 W-Eur -01/+00 1992 Sep 27 1:00s
+# -2:00 Port -02/-01 1942 Apr 25 22:00s
+# -2:00 Port +00 1942 Aug 15 22:00s
+# -2:00 Port -02/-01 1943 Apr 17 22:00s
+# -2:00 Port +00 1943 Aug 28 22:00s
+# -2:00 Port -02/-01 1944 Apr 22 22:00s
+# -2:00 Port +00 1944 Aug 26 22:00s
+# -2:00 Port -02/-01 1945 Apr 21 22:00s
+# -2:00 Port +00 1945 Aug 25 22:00s
+# -2:00 Port -02/-01 1966 Oct 2 2:00s
+# -1:00 - -01 1982 Mar 28 0:00s
+# -1:00 Port -01/+00 1986
# End of rearguard section.
- 0:00 EU WE%sT 1993 Mar 28 1:00u
- -1:00 EU -01/+00
+#
+# From Paul Eggert (1996-11-12):
+# IATA SSIM (1991/1992) reports that the Azores were at -1:00.
+# IATA SSIM (1993-02) says +0:00; later issues (through 1996-09) say -1:00.
+#
+# From Tim Parenti (2024-07-01):
+# After mainland Portugal had shifted forward an hour from 1992-09-27, Decreto
+# Legislativo Regional 29/92/A of 1992-12-23 sought to "reduce the time
+# difference" by shifting the Azores forward as well from 1992-12-27. Just six
+# months later, this was revoked by Decreto Legislativo Regional 9/93/A, citing
+# "major changes in work habits and way of life." Though the revocation didn't
+# give a transition time, it was signed Wednesday 1993-06-16; assume it took
+# effect later that evening, and that an EU-style spring forward (to +01) was
+# still observed in the interim on 1993-03-28.
+# https://dre.pt/dr/detalhe/decreto-legislativo-regional/29-1992-621553
+# https://dre.pt/dr/detalhe/decreto-legislativo-regional/9-1993-389633
+ -1:00 EU %z 1992 Dec 27 1:00s
+ 0:00 EU WE%sT 1993 Jun 17 1:00u
+ -1:00 EU %z
+
Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal
-1:07:36 - FMT 1912 Jan 1 1:00u # Funchal MT
# Vanguard section, for zic and other parsers that support %z.
-# -1:00 Port %z 1966 Apr 3 2:00
+ -1:00 Port %z 1966 Oct 2 2:00s
# Rearguard section, for parsers lacking %z; see ziguard.awk.
- -1:00 Port -01/+00 1942 Apr 25 22:00s
- -1:00 Port +01 1942 Aug 15 22:00s
- -1:00 Port -01/+00 1943 Apr 17 22:00s
- -1:00 Port +01 1943 Aug 28 22:00s
- -1:00 Port -01/+00 1944 Apr 22 22:00s
- -1:00 Port +01 1944 Aug 26 22:00s
- -1:00 Port -01/+00 1945 Apr 21 22:00s
- -1:00 Port +01 1945 Aug 25 22:00s
- -1:00 Port -01/+00 1966 Apr 3 2:00
+# -1:00 Port -01/+00 1942 Apr 25 22:00s
+# -1:00 Port +01 1942 Aug 15 22:00s
+# -1:00 Port -01/+00 1943 Apr 17 22:00s
+# -1:00 Port +01 1943 Aug 28 22:00s
+# -1:00 Port -01/+00 1944 Apr 22 22:00s
+# -1:00 Port +01 1944 Aug 26 22:00s
+# -1:00 Port -01/+00 1945 Apr 21 22:00s
+# -1:00 Port +01 1945 Aug 25 22:00s
+# -1:00 Port -01/+00 1966 Oct 2 2:00s
# End of rearguard section.
- 0:00 Port WE%sT 1983 Sep 25 1:00s
+#
+# From Tim Parenti (2024-07-01):
+# Decreto Regional 5/82/M, published 1982-04-03, established DST transitions at
+# 0:00u, which for Madeira is equivalent to the mainland's rules (0:00s) at the
+# time. It came into effect the day following its publication, Sunday
+# 1982-04-04, thus resuming Madeira's DST practice about a week later than the
+# mainland and the Azores.
+# https://dre.pt/dr/detalhe/decreto-regional/5-1982-608273
+#
+# Decreto Legislativo Regional 18/86/M, published 1986-10-01, adopted EU-style
+# rules (1:00u) and entered into immediate force after being signed on
+# 1986-07-31.
+# https://dre.pt/dr/detalhe/decreto-legislativo-regional/18-1986-221705
+ 0:00 - WET 1982 Apr 4
+ 0:00 Port WE%sT 1986 Jul 31
0:00 EU WE%sT
# Romania
@@ -2433,7 +2619,7 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
2:00 Poland EE%sT 1946 Apr 7
3:00 Russia MSK/MSD 1989 Mar 26 2:00s
2:00 Russia EE%sT 2011 Mar 27 2:00s
- 3:00 - +03 2014 Oct 26 2:00s
+ 3:00 - %z 2014 Oct 26 2:00s
2:00 - EET
@@ -2683,14 +2869,14 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
# http://publication.pravo.gov.ru/Document/View/0001201602150056
Zone Europe/Astrakhan 3:12:12 - LMT 1924 May
- 3:00 - +03 1930 Jun 21
- 4:00 Russia +04/+05 1989 Mar 26 2:00s
- 3:00 Russia +03/+04 1991 Mar 31 2:00s
- 4:00 - +04 1992 Mar 29 2:00s
- 3:00 Russia +03/+04 2011 Mar 27 2:00s
- 4:00 - +04 2014 Oct 26 2:00s
- 3:00 - +03 2016 Mar 27 2:00s
- 4:00 - +04
+ 3:00 - %z 1930 Jun 21
+ 4:00 Russia %z 1989 Mar 26 2:00s
+ 3:00 Russia %z 1991 Mar 31 2:00s
+ 4:00 - %z 1992 Mar 29 2:00s
+ 3:00 Russia %z 2011 Mar 27 2:00s
+ 4:00 - %z 2014 Oct 26 2:00s
+ 3:00 - %z 2016 Mar 27 2:00s
+ 4:00 - %z
# From Paul Eggert (2016-11-11):
# Europe/Volgograd covers:
@@ -2720,15 +2906,15 @@ Zone Europe/Astrakhan 3:12:12 - LMT 1924 May
# http://publication.pravo.gov.ru/Document/View/0001202012220002
Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3
- 3:00 - +03 1930 Jun 21
- 4:00 - +04 1961 Nov 11
- 4:00 Russia +04/+05 1988 Mar 27 2:00s
+ 3:00 - %z 1930 Jun 21
+ 4:00 - %z 1961 Nov 11
+ 4:00 Russia %z 1988 Mar 27 2:00s
3:00 Russia MSK/MSD 1991 Mar 31 2:00s
- 4:00 - +04 1992 Mar 29 2:00s
+ 4:00 - %z 1992 Mar 29 2:00s
3:00 Russia MSK/MSD 2011 Mar 27 2:00s
4:00 - MSK 2014 Oct 26 2:00s
3:00 - MSK 2018 Oct 28 2:00s
- 4:00 - +04 2020 Dec 27 2:00s
+ 4:00 - %z 2020 Dec 27 2:00s
3:00 - MSK
# From Paul Eggert (2016-11-11):
@@ -2743,14 +2929,14 @@ Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3
# http://publication.pravo.gov.ru/Document/View/0001201611220031
Zone Europe/Saratov 3:04:18 - LMT 1919 Jul 1 0:00u
- 3:00 - +03 1930 Jun 21
- 4:00 Russia +04/+05 1988 Mar 27 2:00s
- 3:00 Russia +03/+04 1991 Mar 31 2:00s
- 4:00 - +04 1992 Mar 29 2:00s
- 3:00 Russia +03/+04 2011 Mar 27 2:00s
- 4:00 - +04 2014 Oct 26 2:00s
- 3:00 - +03 2016 Dec 4 2:00s
- 4:00 - +04
+ 3:00 - %z 1930 Jun 21
+ 4:00 Russia %z 1988 Mar 27 2:00s
+ 3:00 Russia %z 1991 Mar 31 2:00s
+ 4:00 - %z 1992 Mar 29 2:00s
+ 3:00 Russia %z 2011 Mar 27 2:00s
+ 4:00 - %z 2014 Oct 26 2:00s
+ 3:00 - %z 2016 Dec 4 2:00s
+ 4:00 - %z
# From Paul Eggert (2016-03-18):
# Europe/Kirov covers:
@@ -2758,10 +2944,10 @@ Zone Europe/Saratov 3:04:18 - LMT 1919 Jul 1 0:00u
# The 1989 transition is from USSR act No. 227 (1989-03-14).
#
Zone Europe/Kirov 3:18:48 - LMT 1919 Jul 1 0:00u
- 3:00 - +03 1930 Jun 21
- 4:00 Russia +04/+05 1989 Mar 26 2:00s
+ 3:00 - %z 1930 Jun 21
+ 4:00 Russia %z 1989 Mar 26 2:00s
3:00 Russia MSK/MSD 1991 Mar 31 2:00s
- 4:00 - +04 1992 Mar 29 2:00s
+ 4:00 - %z 1992 Mar 29 2:00s
3:00 Russia MSK/MSD 2011 Mar 27 2:00s
4:00 - MSK 2014 Oct 26 2:00s
3:00 - MSK
@@ -2776,15 +2962,15 @@ Zone Europe/Kirov 3:18:48 - LMT 1919 Jul 1 0:00u
# The 1989 transition is from USSR act No. 227 (1989-03-14).
Zone Europe/Samara 3:20:20 - LMT 1919 Jul 1 0:00u
- 3:00 - +03 1930 Jun 21
- 4:00 - +04 1935 Jan 27
- 4:00 Russia +04/+05 1989 Mar 26 2:00s
- 3:00 Russia +03/+04 1991 Mar 31 2:00s
- 2:00 Russia +02/+03 1991 Sep 29 2:00s
- 3:00 - +03 1991 Oct 20 3:00
- 4:00 Russia +04/+05 2010 Mar 28 2:00s
- 3:00 Russia +03/+04 2011 Mar 27 2:00s
- 4:00 - +04
+ 3:00 - %z 1930 Jun 21
+ 4:00 - %z 1935 Jan 27
+ 4:00 Russia %z 1989 Mar 26 2:00s
+ 3:00 Russia %z 1991 Mar 31 2:00s
+ 2:00 Russia %z 1991 Sep 29 2:00s
+ 3:00 - %z 1991 Oct 20 3:00
+ 4:00 Russia %z 2010 Mar 28 2:00s
+ 3:00 Russia %z 2011 Mar 27 2:00s
+ 4:00 - %z
# From Paul Eggert (2016-03-18):
# Europe/Ulyanovsk covers:
@@ -2800,14 +2986,14 @@ Zone Europe/Samara 3:20:20 - LMT 1919 Jul 1 0:00u
# http://publication.pravo.gov.ru/Document/View/0001201603090051
Zone Europe/Ulyanovsk 3:13:36 - LMT 1919 Jul 1 0:00u
- 3:00 - +03 1930 Jun 21
- 4:00 Russia +04/+05 1989 Mar 26 2:00s
- 3:00 Russia +03/+04 1991 Mar 31 2:00s
- 2:00 Russia +02/+03 1992 Jan 19 2:00s
- 3:00 Russia +03/+04 2011 Mar 27 2:00s
- 4:00 - +04 2014 Oct 26 2:00s
- 3:00 - +03 2016 Mar 27 2:00s
- 4:00 - +04
+ 3:00 - %z 1930 Jun 21
+ 4:00 Russia %z 1989 Mar 26 2:00s
+ 3:00 Russia %z 1991 Mar 31 2:00s
+ 2:00 Russia %z 1992 Jan 19 2:00s
+ 3:00 Russia %z 2011 Mar 27 2:00s
+ 4:00 - %z 2014 Oct 26 2:00s
+ 3:00 - %z 2016 Mar 27 2:00s
+ 4:00 - %z
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
# Asia/Yekaterinburg covers...
@@ -2832,12 +3018,12 @@ Zone Europe/Ulyanovsk 3:13:36 - LMT 1919 Jul 1 0:00u
#STDOFF 4:02:32.9
Zone Asia/Yekaterinburg 4:02:33 - LMT 1916 Jul 3
3:45:05 - PMT 1919 Jul 15 4:00
- 4:00 - +04 1930 Jun 21
- 5:00 Russia +05/+06 1991 Mar 31 2:00s
- 4:00 Russia +04/+05 1992 Jan 19 2:00s
- 5:00 Russia +05/+06 2011 Mar 27 2:00s
- 6:00 - +06 2014 Oct 26 2:00s
- 5:00 - +05
+ 4:00 - %z 1930 Jun 21
+ 5:00 Russia %z 1991 Mar 31 2:00s
+ 4:00 Russia %z 1992 Jan 19 2:00s
+ 5:00 Russia %z 2011 Mar 27 2:00s
+ 6:00 - %z 2014 Oct 26 2:00s
+ 5:00 - %z
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
@@ -2847,12 +3033,12 @@ Zone Asia/Yekaterinburg 4:02:33 - LMT 1916 Jul 3
# Byalokoz 1919 says Omsk was 4:53:30.
Zone Asia/Omsk 4:53:30 - LMT 1919 Nov 14
- 5:00 - +05 1930 Jun 21
- 6:00 Russia +06/+07 1991 Mar 31 2:00s
- 5:00 Russia +05/+06 1992 Jan 19 2:00s
- 6:00 Russia +06/+07 2011 Mar 27 2:00s
- 7:00 - +07 2014 Oct 26 2:00s
- 6:00 - +06
+ 5:00 - %z 1930 Jun 21
+ 6:00 Russia %z 1991 Mar 31 2:00s
+ 5:00 Russia %z 1992 Jan 19 2:00s
+ 6:00 Russia %z 2011 Mar 27 2:00s
+ 7:00 - %z 2014 Oct 26 2:00s
+ 6:00 - %z
# From Paul Eggert (2016-02-22):
# Asia/Barnaul covers:
@@ -2885,14 +3071,14 @@ Zone Asia/Omsk 4:53:30 - LMT 1919 Nov 14
# http://publication.pravo.gov.ru/Document/View/0001201603090038
Zone Asia/Barnaul 5:35:00 - LMT 1919 Dec 10
- 6:00 - +06 1930 Jun 21
- 7:00 Russia +07/+08 1991 Mar 31 2:00s
- 6:00 Russia +06/+07 1992 Jan 19 2:00s
- 7:00 Russia +07/+08 1995 May 28
- 6:00 Russia +06/+07 2011 Mar 27 2:00s
- 7:00 - +07 2014 Oct 26 2:00s
- 6:00 - +06 2016 Mar 27 2:00s
- 7:00 - +07
+ 6:00 - %z 1930 Jun 21
+ 7:00 Russia %z 1991 Mar 31 2:00s
+ 6:00 Russia %z 1992 Jan 19 2:00s
+ 7:00 Russia %z 1995 May 28
+ 6:00 Russia %z 2011 Mar 27 2:00s
+ 7:00 - %z 2014 Oct 26 2:00s
+ 6:00 - %z 2016 Mar 27 2:00s
+ 7:00 - %z
# From Paul Eggert (2016-03-18):
# Asia/Novosibirsk covers:
@@ -2906,14 +3092,14 @@ Zone Asia/Barnaul 5:35:00 - LMT 1919 Dec 10
# http://publication.pravo.gov.ru/Document/View/0001201607040064
Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00
- 6:00 - +06 1930 Jun 21
- 7:00 Russia +07/+08 1991 Mar 31 2:00s
- 6:00 Russia +06/+07 1992 Jan 19 2:00s
- 7:00 Russia +07/+08 1993 May 23 # say Shanks & P.
- 6:00 Russia +06/+07 2011 Mar 27 2:00s
- 7:00 - +07 2014 Oct 26 2:00s
- 6:00 - +06 2016 Jul 24 2:00s
- 7:00 - +07
+ 6:00 - %z 1930 Jun 21
+ 7:00 Russia %z 1991 Mar 31 2:00s
+ 6:00 Russia %z 1992 Jan 19 2:00s
+ 7:00 Russia %z 1993 May 23 # say Shanks & P.
+ 6:00 Russia %z 2011 Mar 27 2:00s
+ 7:00 - %z 2014 Oct 26 2:00s
+ 6:00 - %z 2016 Jul 24 2:00s
+ 7:00 - %z
# From Paul Eggert (2016-03-18):
# Asia/Tomsk covers:
@@ -2958,14 +3144,14 @@ Zone Asia/Novosibirsk 5:31:40 - LMT 1919 Dec 14 6:00
# http://publication.pravo.gov.ru/Document/View/0001201604260048
Zone Asia/Tomsk 5:39:51 - LMT 1919 Dec 22
- 6:00 - +06 1930 Jun 21
- 7:00 Russia +07/+08 1991 Mar 31 2:00s
- 6:00 Russia +06/+07 1992 Jan 19 2:00s
- 7:00 Russia +07/+08 2002 May 1 3:00
- 6:00 Russia +06/+07 2011 Mar 27 2:00s
- 7:00 - +07 2014 Oct 26 2:00s
- 6:00 - +06 2016 May 29 2:00s
- 7:00 - +07
+ 6:00 - %z 1930 Jun 21
+ 7:00 Russia %z 1991 Mar 31 2:00s
+ 6:00 Russia %z 1992 Jan 19 2:00s
+ 7:00 Russia %z 2002 May 1 3:00
+ 6:00 Russia %z 2011 Mar 27 2:00s
+ 7:00 - %z 2014 Oct 26 2:00s
+ 6:00 - %z 2016 May 29 2:00s
+ 7:00 - %z
# From Tim Parenti (2014-07-03):
@@ -2996,12 +3182,12 @@ Zone Asia/Tomsk 5:39:51 - LMT 1919 Dec 22
# realigning itself with KRAT.
Zone Asia/Novokuznetsk 5:48:48 - LMT 1924 May 1
- 6:00 - +06 1930 Jun 21
- 7:00 Russia +07/+08 1991 Mar 31 2:00s
- 6:00 Russia +06/+07 1992 Jan 19 2:00s
- 7:00 Russia +07/+08 2010 Mar 28 2:00s
- 6:00 Russia +06/+07 2011 Mar 27 2:00s
- 7:00 - +07
+ 6:00 - %z 1930 Jun 21
+ 7:00 Russia %z 1991 Mar 31 2:00s
+ 6:00 Russia %z 1992 Jan 19 2:00s
+ 7:00 Russia %z 2010 Mar 28 2:00s
+ 6:00 Russia %z 2011 Mar 27 2:00s
+ 7:00 - %z
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
# Asia/Krasnoyarsk covers...
@@ -3015,12 +3201,12 @@ Zone Asia/Novokuznetsk 5:48:48 - LMT 1924 May 1
# Byalokoz 1919 says Krasnoyarsk was 6:11:26.
Zone Asia/Krasnoyarsk 6:11:26 - LMT 1920 Jan 6
- 6:00 - +06 1930 Jun 21
- 7:00 Russia +07/+08 1991 Mar 31 2:00s
- 6:00 Russia +06/+07 1992 Jan 19 2:00s
- 7:00 Russia +07/+08 2011 Mar 27 2:00s
- 8:00 - +08 2014 Oct 26 2:00s
- 7:00 - +07
+ 6:00 - %z 1930 Jun 21
+ 7:00 Russia %z 1991 Mar 31 2:00s
+ 6:00 Russia %z 1992 Jan 19 2:00s
+ 7:00 Russia %z 2011 Mar 27 2:00s
+ 8:00 - %z 2014 Oct 26 2:00s
+ 7:00 - %z
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
@@ -3037,12 +3223,12 @@ Zone Asia/Krasnoyarsk 6:11:26 - LMT 1920 Jan 6
Zone Asia/Irkutsk 6:57:05 - LMT 1880
6:57:05 - IMT 1920 Jan 25 # Irkutsk Mean Time
- 7:00 - +07 1930 Jun 21
- 8:00 Russia +08/+09 1991 Mar 31 2:00s
- 7:00 Russia +07/+08 1992 Jan 19 2:00s
- 8:00 Russia +08/+09 2011 Mar 27 2:00s
- 9:00 - +09 2014 Oct 26 2:00s
- 8:00 - +08
+ 7:00 - %z 1930 Jun 21
+ 8:00 Russia %z 1991 Mar 31 2:00s
+ 7:00 Russia %z 1992 Jan 19 2:00s
+ 8:00 Russia %z 2011 Mar 27 2:00s
+ 9:00 - %z 2014 Oct 26 2:00s
+ 8:00 - %z
# From Tim Parenti (2014-07-06):
@@ -3059,13 +3245,13 @@ Zone Asia/Irkutsk 6:57:05 - LMT 1880
# http://publication.pravo.gov.ru/Document/View/0001201512300107
Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15
- 8:00 - +08 1930 Jun 21
- 9:00 Russia +09/+10 1991 Mar 31 2:00s
- 8:00 Russia +08/+09 1992 Jan 19 2:00s
- 9:00 Russia +09/+10 2011 Mar 27 2:00s
- 10:00 - +10 2014 Oct 26 2:00s
- 8:00 - +08 2016 Mar 27 2:00
- 9:00 - +09
+ 8:00 - %z 1930 Jun 21
+ 9:00 Russia %z 1991 Mar 31 2:00s
+ 8:00 Russia %z 1992 Jan 19 2:00s
+ 9:00 Russia %z 2011 Mar 27 2:00s
+ 10:00 - %z 2014 Oct 26 2:00s
+ 8:00 - %z 2016 Mar 27 2:00
+ 9:00 - %z
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29):
@@ -3105,12 +3291,12 @@ Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15
# Byalokoz 1919 says Yakutsk was 8:38:58.
Zone Asia/Yakutsk 8:38:58 - LMT 1919 Dec 15
- 8:00 - +08 1930 Jun 21
- 9:00 Russia +09/+10 1991 Mar 31 2:00s
- 8:00 Russia +08/+09 1992 Jan 19 2:00s
- 9:00 Russia +09/+10 2011 Mar 27 2:00s
- 10:00 - +10 2014 Oct 26 2:00s
- 9:00 - +09
+ 8:00 - %z 1930 Jun 21
+ 9:00 Russia %z 1991 Mar 31 2:00s
+ 8:00 Russia %z 1992 Jan 19 2:00s
+ 9:00 Russia %z 2011 Mar 27 2:00s
+ 10:00 - %z 2014 Oct 26 2:00s
+ 9:00 - %z
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29):
@@ -3128,12 +3314,12 @@ Zone Asia/Yakutsk 8:38:58 - LMT 1919 Dec 15
# Go with Byalokoz.
Zone Asia/Vladivostok 8:47:31 - LMT 1922 Nov 15
- 9:00 - +09 1930 Jun 21
- 10:00 Russia +10/+11 1991 Mar 31 2:00s
- 9:00 Russia +09/+10 1992 Jan 19 2:00s
- 10:00 Russia +10/+11 2011 Mar 27 2:00s
- 11:00 - +11 2014 Oct 26 2:00s
- 10:00 - +10
+ 9:00 - %z 1930 Jun 21
+ 10:00 Russia %z 1991 Mar 31 2:00s
+ 9:00 Russia %z 1992 Jan 19 2:00s
+ 10:00 Russia %z 2011 Mar 27 2:00s
+ 11:00 - %z 2014 Oct 26 2:00s
+ 10:00 - %z
# From Tim Parenti (2014-07-03):
@@ -3151,14 +3337,14 @@ Zone Asia/Vladivostok 8:47:31 - LMT 1922 Nov 15
# This transition is no doubt wrong, but we have no better info.
Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15
- 8:00 - +08 1930 Jun 21
- 9:00 Russia +09/+10 1991 Mar 31 2:00s
- 8:00 Russia +08/+09 1992 Jan 19 2:00s
- 9:00 Russia +09/+10 2004
- 10:00 Russia +10/+11 2011 Mar 27 2:00s
- 11:00 - +11 2011 Sep 13 0:00s # Decree 725?
- 10:00 - +10 2014 Oct 26 2:00s
- 9:00 - +09
+ 8:00 - %z 1930 Jun 21
+ 9:00 Russia %z 1991 Mar 31 2:00s
+ 8:00 Russia %z 1992 Jan 19 2:00s
+ 9:00 Russia %z 2004
+ 10:00 Russia %z 2011 Mar 27 2:00s
+ 11:00 - %z 2011 Sep 13 0:00s # Decree 725?
+ 10:00 - %z 2014 Oct 26 2:00s
+ 9:00 - %z
# From Tim Parenti (2014-07-03):
@@ -3174,14 +3360,14 @@ Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15
# The Zone name should be Asia/Yuzhno-Sakhalinsk, but that's too long.
Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23
- 9:00 - +09 1945 Aug 25
- 11:00 Russia +11/+12 1991 Mar 31 2:00s # Sakhalin T
- 10:00 Russia +10/+11 1992 Jan 19 2:00s
- 11:00 Russia +11/+12 1997 Mar lastSun 2:00s
- 10:00 Russia +10/+11 2011 Mar 27 2:00s
- 11:00 - +11 2014 Oct 26 2:00s
- 10:00 - +10 2016 Mar 27 2:00s
- 11:00 - +11
+ 9:00 - %z 1945 Aug 25
+ 11:00 Russia %z 1991 Mar 31 2:00s # Sakhalin T
+ 10:00 Russia %z 1992 Jan 19 2:00s
+ 11:00 Russia %z 1997 Mar lastSun 2:00s
+ 10:00 Russia %z 2011 Mar 27 2:00s
+ 11:00 - %z 2014 Oct 26 2:00s
+ 10:00 - %z 2016 Mar 27 2:00s
+ 11:00 - %z
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29):
@@ -3204,13 +3390,13 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23
# http://publication.pravo.gov.ru/Document/View/0001201604050038
Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
- 10:00 - +10 1930 Jun 21 # Magadan Time
- 11:00 Russia +11/+12 1991 Mar 31 2:00s
- 10:00 Russia +10/+11 1992 Jan 19 2:00s
- 11:00 Russia +11/+12 2011 Mar 27 2:00s
- 12:00 - +12 2014 Oct 26 2:00s
- 10:00 - +10 2016 Apr 24 2:00s
- 11:00 - +11
+ 10:00 - %z 1930 Jun 21 # Magadan Time
+ 11:00 Russia %z 1991 Mar 31 2:00s
+ 10:00 Russia %z 1992 Jan 19 2:00s
+ 11:00 Russia %z 2011 Mar 27 2:00s
+ 12:00 - %z 2014 Oct 26 2:00s
+ 10:00 - %z 2016 Apr 24 2:00s
+ 11:00 - %z
# From Tim Parenti (2014-07-06):
@@ -3255,12 +3441,12 @@ Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
# Go with Srednekolymsk.
Zone Asia/Srednekolymsk 10:14:52 - LMT 1924 May 2
- 10:00 - +10 1930 Jun 21
- 11:00 Russia +11/+12 1991 Mar 31 2:00s
- 10:00 Russia +10/+11 1992 Jan 19 2:00s
- 11:00 Russia +11/+12 2011 Mar 27 2:00s
- 12:00 - +12 2014 Oct 26 2:00s
- 11:00 - +11
+ 10:00 - %z 1930 Jun 21
+ 11:00 Russia %z 1991 Mar 31 2:00s
+ 10:00 Russia %z 1992 Jan 19 2:00s
+ 11:00 Russia %z 2011 Mar 27 2:00s
+ 12:00 - %z 2014 Oct 26 2:00s
+ 11:00 - %z
# From Tim Parenti (2014-07-03):
@@ -3278,14 +3464,14 @@ Zone Asia/Srednekolymsk 10:14:52 - LMT 1924 May 2
# UTC+12 since at least then, too.
Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15
- 8:00 - +08 1930 Jun 21
- 9:00 Russia +09/+10 1981 Apr 1
- 11:00 Russia +11/+12 1991 Mar 31 2:00s
- 10:00 Russia +10/+11 1992 Jan 19 2:00s
- 11:00 Russia +11/+12 2011 Mar 27 2:00s
- 12:00 - +12 2011 Sep 13 0:00s # Decree 725?
- 11:00 - +11 2014 Oct 26 2:00s
- 10:00 - +10
+ 8:00 - %z 1930 Jun 21
+ 9:00 Russia %z 1981 Apr 1
+ 11:00 Russia %z 1991 Mar 31 2:00s
+ 10:00 Russia %z 1992 Jan 19 2:00s
+ 11:00 Russia %z 2011 Mar 27 2:00s
+ 12:00 - %z 2011 Sep 13 0:00s # Decree 725?
+ 11:00 - %z 2014 Oct 26 2:00s
+ 10:00 - %z
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
@@ -3298,12 +3484,12 @@ Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15
# The Zone name should be Asia/Petropavlovsk-Kamchatski or perhaps
# Asia/Petropavlovsk-Kamchatsky, but these are too long.
Zone Asia/Kamchatka 10:34:36 - LMT 1922 Nov 10
- 11:00 - +11 1930 Jun 21
- 12:00 Russia +12/+13 1991 Mar 31 2:00s
- 11:00 Russia +11/+12 1992 Jan 19 2:00s
- 12:00 Russia +12/+13 2010 Mar 28 2:00s
- 11:00 Russia +11/+12 2011 Mar 27 2:00s
- 12:00 - +12
+ 11:00 - %z 1930 Jun 21
+ 12:00 Russia %z 1991 Mar 31 2:00s
+ 11:00 Russia %z 1992 Jan 19 2:00s
+ 12:00 Russia %z 2010 Mar 28 2:00s
+ 11:00 Russia %z 2011 Mar 27 2:00s
+ 12:00 - %z
# From Tim Parenti (2014-07-03):
@@ -3311,13 +3497,13 @@ Zone Asia/Kamchatka 10:34:36 - LMT 1922 Nov 10
# 87 RU-CHU Chukotka Autonomous Okrug
Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2
- 12:00 - +12 1930 Jun 21
- 13:00 Russia +13/+14 1982 Apr 1 0:00s
- 12:00 Russia +12/+13 1991 Mar 31 2:00s
- 11:00 Russia +11/+12 1992 Jan 19 2:00s
- 12:00 Russia +12/+13 2010 Mar 28 2:00s
- 11:00 Russia +11/+12 2011 Mar 27 2:00s
- 12:00 - +12
+ 12:00 - %z 1930 Jun 21
+ 13:00 Russia %z 1982 Apr 1 0:00s
+ 12:00 Russia %z 1991 Mar 31 2:00s
+ 11:00 Russia %z 1992 Jan 19 2:00s
+ 12:00 Russia %z 2010 Mar 28 2:00s
+ 11:00 Russia %z 2011 Mar 27 2:00s
+ 12:00 - %z
# Bosnia & Herzegovina
# Croatia
@@ -3436,7 +3622,7 @@ Zone Africa/Ceuta -0:21:16 - LMT 1901 Jan 1 0:00u
1:00 - CET 1986
1:00 EU CE%sT
Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C.
- -1:00 - -01 1946 Sep 30 1:00
+ -1:00 - %z 1946 Sep 30 1:00
0:00 - WET 1980 Apr 6 0:00s
0:00 1:00 WEST 1980 Sep 28 1:00u
0:00 EU WE%sT
@@ -3517,8 +3703,8 @@ Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C.
# but if no one is present after 11 at night, could be postponed until one
# hour before the beginning of service.
-# From Paul Eggert (2013-09-11):
-# Round BMT to the nearest even second, 0:29:46.
+# From Paul Eggert (2024-05-24):
+# Express BMT as 0:29:45.500, approximately the same precision 7° 26' 22.50".
#
# We can find no reliable source for Shanks's assertion that all of Switzerland
# except Geneva switched to Bern Mean Time at 00:00 on 1848-09-12. This book:
@@ -3557,6 +3743,7 @@ Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S
Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
+ #STDOFF 0:29:45.500
0:29:46 - BMT 1894 Jun # Bern Mean Time
1:00 Swiss CE%sT 1981
1:00 EU CE%sT
@@ -3754,7 +3941,7 @@ Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 -
Zone Europe/Istanbul 1:55:52 - LMT 1880
1:56:56 - IMT 1910 Oct # Istanbul Mean Time?
2:00 Turkey EE%sT 1978 Jun 29
- 3:00 Turkey +03/+04 1984 Nov 1 2:00
+ 3:00 Turkey %z 1984 Nov 1 2:00
2:00 Turkey EE%sT 2007
2:00 EU EE%sT 2011 Mar 27 1:00u
2:00 - EET 2011 Mar 28 1:00u
@@ -3763,7 +3950,7 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880
2:00 EU EE%sT 2015 Oct 25 1:00u
2:00 1:00 EEST 2015 Nov 8 1:00u
2:00 EU EE%sT 2016 Sep 7
- 3:00 - +03
+ 3:00 - %z
# Ukraine
#
diff --git a/make/data/tzdata/leapseconds b/make/data/tzdata/leapseconds
index 8e7df3de984..63a76620dbf 100644
--- a/make/data/tzdata/leapseconds
+++ b/make/data/tzdata/leapseconds
@@ -92,11 +92,11 @@ Leap 2016 Dec 31 23:59:60 + S
# Any additional leap seconds will come after this.
# This Expires line is commented out for now,
# so that pre-2020a zic implementations do not reject this file.
-#Expires 2024 Dec 28 00:00:00
+#Expires 2025 Jun 28 00:00:00
# POSIX timestamps for the data in this file:
-#updated 1704708379 (2024-01-08 10:06:19 UTC)
-#expires 1735344000 (2024-12-28 00:00:00 UTC)
+#updated 1720104763 (2024-07-04 14:52:43 UTC)
+#expires 1751068800 (2025-06-28 00:00:00 UTC)
# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat)
-# File expires on 28 December 2024
+# File expires on 28 June 2025
diff --git a/make/data/tzdata/northamerica b/make/data/tzdata/northamerica
index a8b2ef3f7fa..c95e7d0e643 100644
--- a/make/data/tzdata/northamerica
+++ b/make/data/tzdata/northamerica
@@ -208,26 +208,6 @@ Rule US 1987 2006 - Apr Sun>=1 2:00 1:00 D
Rule US 2007 max - Mar Sun>=8 2:00 1:00 D
Rule US 2007 max - Nov Sun>=1 2:00 0 S
-# From Arthur David Olson, 2005-12-19
-# We generate the files specified below to guard against old files with
-# obsolete information being left in the time zone binary directory.
-# We limit the list to names that have appeared in previous versions of
-# this time zone package.
-# We do these as separate Zones rather than as Links to avoid problems if
-# a particular place changes whether it observes DST.
-# We put these specifications here in the northamerica file both to
-# increase the chances that they'll actually get compiled and to
-# avoid the need to duplicate the US rules in another file.
-
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone EST -5:00 - EST
-Zone MST -7:00 - MST
-Zone HST -10:00 - HST
-Zone EST5EDT -5:00 US E%sT
-Zone CST6CDT -6:00 US C%sT
-Zone MST7MDT -7:00 US M%sT
-Zone PST8PDT -8:00 US P%sT
-
# From U. S. Naval Observatory (1989-01-19):
# USA EASTERN 5 H BEHIND UTC NEW YORK, WASHINGTON
# USA EASTERN 4 H BEHIND UTC APR 3 - OCT 30
@@ -2396,6 +2376,81 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# the researchers who prepared the Decrees page failed to find some of
# the relevant documents.
+# From Heitor David Pinto (2024-08-04):
+# In 1931, the decree implementing DST specified that it would take
+# effect on 30 April....
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=192270&pagina=2&seccion=1
+#
+# In 1981, the decree changing Campeche, Yucatán and Quintana Roo to UTC-5
+# specified that it would enter into force on 26 December 1981 at 2:00....
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4705667&fecha=23/12/1981&cod_diario=202796
+#
+# In 1982, the decree returning Campeche and Yucatán to UTC-6 specified that
+# it would enter into force on 2 November 1982 at 2:00....
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=205689&pagina=3&seccion=0
+#
+# Quintana Roo changed to UTC-6 on 4 January 1983 at 0:00, and again
+# to UTC-5 on 26 October 1997 at 2:00....
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4787355&fecha=28/12/1982&cod_diario=206112
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=209559&pagina=15&seccion=0
+#
+# Durango, Coahuila, Nuevo León and Tamaulipas were set to UTC-7 on 1 January
+# 1922, and changed to UTC-6 on 10 June 1927. Then Durango, Coahuila and
+# Nuevo León (but not Tamaulipas) returned to UTC-7 on 15 November 1930,
+# observed DST in 1931, and changed again to UTC-6 on 1 April 1932....
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4441846&fecha=29/12/1921&cod_diario=187468
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4541520&fecha=09/06/1927&cod_diario=193920
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4491963&fecha=15/11/1930&cod_diario=190835
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4418437&fecha=21/01/1932&cod_diario=185588
+#
+# ... the ... 10 June 1927 ... decree only said 10 June 1927, without
+# specifying a time, so I suppose that it should be considered at 0:00.
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4541520&fecha=09/06/1927&cod_diario=193920
+#
+# In 1942, the decree changing Baja California, Baja California Sur, Sonora,
+# Sinaloa and Nayarit to UTC-7 was published on 24 April, but it said that it
+# would apply from 1 April, so it's unclear when the change actually
+# occurred. The database currently shows 24 April 1942.
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=192203&pagina=2&seccion=1
+#
+# Baja California Sur, Sonora, Sinaloa and Nayarit never used UTC-8. The ...
+# 14 January 1949 ... change [to UTC-8] only occurred in Baja California.
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4515613&fecha=13/01/1949&cod_diario=192309
+#
+# In 1945, the decree changing Baja California to UTC-8 specified that it
+# would take effect on the third day from its publication.
+# It was published on 12 November, so it would take effect on 15 November....
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4555049&fecha=12/11/1945&cod_diario=194763
+#
+# In 1948, the decree changing Baja California to UTC-7 specified that it
+# would take effect on "this date". The decree was made on 13 March,
+# but published on 5 April, so it's unclear when the change actually occurred.
+# The database currently shows 5 April 1948.
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?cod_diario=188624&pagina=2&seccion=0
+#
+# In 1949, the decree changing Baja California to UTC-8 was published on 13
+# January, but it said that it would apply from 1 January, so it's unclear when
+# the change actually occurred. The database currently shows 14 January 1949.
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4515613&fecha=13/01/1949&cod_diario=192309
+#
+# Baja California also observed UTC-7 from 1 May to 24 September 1950,
+# from 29 April to 30 September 1951 at 2:00,
+# and from 27 April to 28 September 1952 at 2:00....
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4600403&fecha=29/04/1950&cod_diario=197505
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4623553&fecha=23/09/1950&cod_diario=198805
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4469444&fecha=27/04/1951&cod_diario=189317
+# https://www.dof.gob.mx/nota_to_imagen_fs.php?codnota=4533868&fecha=10/03/1952&cod_diario=193465
+#
+# All changes in Baja California from 1948 to 1952 match those in California,
+# on the same dates or with a difference of one day.
+# So it may be easier to implement these changes as DST with rule CA
+# during this whole period.
+#
+# From Paul Eggert (2024-08-18):
+# For now, maintain the slightly-different history for Baja California,
+# as we have no information on whether 1948/1952 clocks in Tijuana followed
+# the decrees or followed San Diego.
+
# From Alan Perry (1996-02-15):
# A guy from our Mexico subsidiary finally found the Presidential Decree
# outlining the timezone changes in Mexico.
@@ -2599,7 +2654,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Mexico 1931 only - May 1 23:00 1:00 D
+Rule Mexico 1931 only - April 30 0:00 1:00 D
Rule Mexico 1931 only - Oct 1 0:00 0 S
Rule Mexico 1939 only - Feb 5 0:00 1:00 D
Rule Mexico 1939 only - Jun 25 0:00 0 S
@@ -2618,14 +2673,16 @@ Rule Mexico 2002 2022 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
# Quintana Roo; represented by Cancún
Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 6:00u
- -6:00 - CST 1981 Dec 23
+ -6:00 - CST 1981 Dec 26 2:00
+ -5:00 - EST 1983 Jan 4 0:00
+ -6:00 Mexico C%sT 1997 Oct 26 2:00
-5:00 Mexico E%sT 1998 Aug 2 2:00
-6:00 Mexico C%sT 2015 Feb 1 2:00
-5:00 - EST
# Campeche, Yucatán; represented by Mérida
Zone America/Merida -5:58:28 - LMT 1922 Jan 1 6:00u
- -6:00 - CST 1981 Dec 23
- -5:00 - EST 1982 Dec 2
+ -6:00 - CST 1981 Dec 26 2:00
+ -5:00 - EST 1982 Nov 2 2:00
-6:00 Mexico C%sT
# Coahuila, Nuevo León, Tamaulipas (near US border)
# This includes the following municipios:
@@ -2642,12 +2699,15 @@ Zone America/Matamoros -6:30:00 - LMT 1922 Jan 1 6:00u
-6:00 US C%sT
# Durango; Coahuila, Nuevo León, Tamaulipas (away from US border)
Zone America/Monterrey -6:41:16 - LMT 1922 Jan 1 6:00u
+ -7:00 - MST 1927 Jun 10
+ -6:00 - CST 1930 Nov 15
+ -7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1988
-6:00 US C%sT 1989
-6:00 Mexico C%sT
# Central Mexico
Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u
- -7:00 - MST 1927 Jun 10 23:00
+ -7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
-7:00 Mexico M%sT 1932 Apr 1
-6:00 Mexico C%sT 2001 Sep 30 2:00
@@ -2658,7 +2718,7 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u
# Práxedis G Guerrero.
# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
- -7:00 - MST 1927 Jun 10 23:00
+ -7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
-7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1996
@@ -2673,7 +2733,7 @@ Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
# Benavides.
# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u
- -7:00 - MST 1927 Jun 10 23:00
+ -7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
-7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1996
@@ -2685,7 +2745,7 @@ Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u
-6:00 US C%sT
# Chihuahua (away from US border)
Zone America/Chihuahua -7:04:20 - LMT 1922 Jan 1 7:00u
- -7:00 - MST 1927 Jun 10 23:00
+ -7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
-7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1996
@@ -2695,23 +2755,21 @@ Zone America/Chihuahua -7:04:20 - LMT 1922 Jan 1 7:00u
-6:00 - CST
# Sonora
Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u
- -7:00 - MST 1927 Jun 10 23:00
+ -7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
-7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1942 Apr 24
- -7:00 - MST 1949 Jan 14
- -8:00 - PST 1970
+ -7:00 - MST 1996
-7:00 Mexico M%sT 1999
-7:00 - MST
# Baja California Sur, Nayarit (except Bahía de Banderas), Sinaloa
Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u
- -7:00 - MST 1927 Jun 10 23:00
+ -7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
-7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1942 Apr 24
- -7:00 - MST 1949 Jan 14
- -8:00 - PST 1970
+ -7:00 - MST 1970
-7:00 Mexico M%sT
# Bahía de Banderas
@@ -2744,27 +2802,32 @@ Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u
# Use "Bahia_Banderas" to keep the name to fourteen characters.
Zone America/Bahia_Banderas -7:01:00 - LMT 1922 Jan 1 7:00u
- -7:00 - MST 1927 Jun 10 23:00
+ -7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
-7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1942 Apr 24
- -7:00 - MST 1949 Jan 14
- -8:00 - PST 1970
+ -7:00 - MST 1970
-7:00 Mexico M%sT 2010 Apr 4 2:00
-6:00 Mexico C%sT
# Baja California
Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1924
- -8:00 - PST 1927 Jun 10 23:00
+ -8:00 - PST 1927 Jun 10
-7:00 - MST 1930 Nov 15
-8:00 - PST 1931 Apr 1
-8:00 1:00 PDT 1931 Sep 30
-8:00 - PST 1942 Apr 24
-8:00 1:00 PWT 1945 Aug 14 23:00u
- -8:00 1:00 PPT 1945 Nov 12 # Peace
+ -8:00 1:00 PPT 1945 Nov 15 # Peace
-8:00 - PST 1948 Apr 5
-8:00 1:00 PDT 1949 Jan 14
+ -8:00 - PST 1950 May 1
+ -8:00 1:00 PDT 1950 Sep 24
+ -8:00 - PST 1951 Apr 29 2:00
+ -8:00 1:00 PDT 1951 Sep 30 2:00
+ -8:00 - PST 1952 Apr 27 2:00
+ -8:00 1:00 PDT 1952 Sep 28 2:00
-8:00 - PST 1954
-8:00 CA P%sT 1961
-8:00 - PST 1976
@@ -3573,8 +3636,8 @@ Zone America/Puerto_Rico -4:24:25 - LMT 1899 Mar 28 12:00 # San Juan
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Miquelon -3:44:40 - LMT 1911 Jun 15 # St Pierre
-4:00 - AST 1980 May
- -3:00 - -03 1987
- -3:00 Canada -03/-02
+ -3:00 - %z 1987
+ -3:00 Canada %z
# Turks and Caicos
#
diff --git a/make/data/tzdata/southamerica b/make/data/tzdata/southamerica
index d77acc08857..3824202546a 100644
--- a/make/data/tzdata/southamerica
+++ b/make/data/tzdata/southamerica
@@ -425,11 +425,11 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 -
Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May # Córdoba Mean Time
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 Arg -03/-02
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 Arg %z
#
# Córdoba (CB), Santa Fe (SF), Entre Ríos (ER), Corrientes (CN), Misiones (MN),
# Chaco (CC), Formosa (FM), Santiago del Estero (SE)
@@ -444,120 +444,120 @@ Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
Zone America/Argentina/Cordoba -4:16:48 - LMT 1894 Oct 31
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1991 Mar 3
- -4:00 - -04 1991 Oct 20
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 Arg -03/-02
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1991 Mar 3
+ -4:00 - %z 1991 Oct 20
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 Arg %z
#
# Salta (SA), La Pampa (LP), Neuquén (NQ), Rio Negro (RN)
Zone America/Argentina/Salta -4:21:40 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1991 Mar 3
- -4:00 - -04 1991 Oct 20
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 Arg -03/-02 2008 Oct 18
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1991 Mar 3
+ -4:00 - %z 1991 Oct 20
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 Arg %z 2008 Oct 18
+ -3:00 - %z
#
# Tucumán (TM)
Zone America/Argentina/Tucuman -4:20:52 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1991 Mar 3
- -4:00 - -04 1991 Oct 20
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 - -03 2004 Jun 1
- -4:00 - -04 2004 Jun 13
- -3:00 Arg -03/-02
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1991 Mar 3
+ -4:00 - %z 1991 Oct 20
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 - %z 2004 Jun 1
+ -4:00 - %z 2004 Jun 13
+ -3:00 Arg %z
#
# La Rioja (LR)
Zone America/Argentina/La_Rioja -4:27:24 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1991 Mar 1
- -4:00 - -04 1991 May 7
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 - -03 2004 Jun 1
- -4:00 - -04 2004 Jun 20
- -3:00 Arg -03/-02 2008 Oct 18
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1991 Mar 1
+ -4:00 - %z 1991 May 7
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 - %z 2004 Jun 1
+ -4:00 - %z 2004 Jun 20
+ -3:00 Arg %z 2008 Oct 18
+ -3:00 - %z
#
# San Juan (SJ)
Zone America/Argentina/San_Juan -4:34:04 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1991 Mar 1
- -4:00 - -04 1991 May 7
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 - -03 2004 May 31
- -4:00 - -04 2004 Jul 25
- -3:00 Arg -03/-02 2008 Oct 18
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1991 Mar 1
+ -4:00 - %z 1991 May 7
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 - %z 2004 May 31
+ -4:00 - %z 2004 Jul 25
+ -3:00 Arg %z 2008 Oct 18
+ -3:00 - %z
#
# Jujuy (JY)
Zone America/Argentina/Jujuy -4:21:12 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1990 Mar 4
- -4:00 - -04 1990 Oct 28
- -4:00 1:00 -03 1991 Mar 17
- -4:00 - -04 1991 Oct 6
- -3:00 1:00 -02 1992
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 Arg -03/-02 2008 Oct 18
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1990 Mar 4
+ -4:00 - %z 1990 Oct 28
+ -4:00 1:00 %z 1991 Mar 17
+ -4:00 - %z 1991 Oct 6
+ -3:00 1:00 %z 1992
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 Arg %z 2008 Oct 18
+ -3:00 - %z
#
# Catamarca (CT), Chubut (CH)
Zone America/Argentina/Catamarca -4:23:08 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1991 Mar 3
- -4:00 - -04 1991 Oct 20
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 - -03 2004 Jun 1
- -4:00 - -04 2004 Jun 20
- -3:00 Arg -03/-02 2008 Oct 18
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1991 Mar 3
+ -4:00 - %z 1991 Oct 20
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 - %z 2004 Jun 1
+ -4:00 - %z 2004 Jun 20
+ -3:00 Arg %z 2008 Oct 18
+ -3:00 - %z
#
# Mendoza (MZ)
Zone America/Argentina/Mendoza -4:35:16 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1990 Mar 4
- -4:00 - -04 1990 Oct 15
- -4:00 1:00 -03 1991 Mar 1
- -4:00 - -04 1991 Oct 15
- -4:00 1:00 -03 1992 Mar 1
- -4:00 - -04 1992 Oct 18
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 - -03 2004 May 23
- -4:00 - -04 2004 Sep 26
- -3:00 Arg -03/-02 2008 Oct 18
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1990 Mar 4
+ -4:00 - %z 1990 Oct 15
+ -4:00 1:00 %z 1991 Mar 1
+ -4:00 - %z 1991 Oct 15
+ -4:00 1:00 %z 1992 Mar 1
+ -4:00 - %z 1992 Oct 18
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 - %z 2004 May 23
+ -4:00 - %z 2004 Sep 26
+ -3:00 Arg %z 2008 Oct 18
+ -3:00 - %z
#
# San Luis (SL)
@@ -567,53 +567,53 @@ Rule SanLuis 2007 2008 - Oct Sun>=8 0:00 1:00 -
Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1990
- -3:00 1:00 -02 1990 Mar 14
- -4:00 - -04 1990 Oct 15
- -4:00 1:00 -03 1991 Mar 1
- -4:00 - -04 1991 Jun 1
- -3:00 - -03 1999 Oct 3
- -4:00 1:00 -03 2000 Mar 3
- -3:00 - -03 2004 May 31
- -4:00 - -04 2004 Jul 25
- -3:00 Arg -03/-02 2008 Jan 21
- -4:00 SanLuis -04/-03 2009 Oct 11
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1990
+ -3:00 1:00 %z 1990 Mar 14
+ -4:00 - %z 1990 Oct 15
+ -4:00 1:00 %z 1991 Mar 1
+ -4:00 - %z 1991 Jun 1
+ -3:00 - %z 1999 Oct 3
+ -4:00 1:00 %z 2000 Mar 3
+ -3:00 - %z 2004 May 31
+ -4:00 - %z 2004 Jul 25
+ -3:00 Arg %z 2008 Jan 21
+ -4:00 SanLuis %z 2009 Oct 11
+ -3:00 - %z
#
# Santa Cruz (SC)
Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 - -03 2004 Jun 1
- -4:00 - -04 2004 Jun 20
- -3:00 Arg -03/-02 2008 Oct 18
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 - %z 2004 Jun 1
+ -4:00 - %z 2004 Jun 20
+ -3:00 Arg %z 2008 Oct 18
+ -3:00 - %z
#
# Tierra del Fuego, Antártida e Islas del Atlántico Sur (TF)
Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
#STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
- -4:00 - -04 1930 Dec
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1999 Oct 3
- -4:00 Arg -04/-03 2000 Mar 3
- -3:00 - -03 2004 May 30
- -4:00 - -04 2004 Jun 20
- -3:00 Arg -03/-02 2008 Oct 18
- -3:00 - -03
+ -4:00 - %z 1930 Dec
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1999 Oct 3
+ -4:00 Arg %z 2000 Mar 3
+ -3:00 - %z 2004 May 30
+ -4:00 - %z 2004 Jun 20
+ -3:00 Arg %z 2008 Oct 18
+ -3:00 - %z
# Bolivia
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/La_Paz -4:32:36 - LMT 1890
-4:32:36 - CMT 1931 Oct 15 # Calamarca MT
-4:32:36 1:00 BST 1932 Mar 21 # Bolivia ST
- -4:00 - -04
+ -4:00 - %z
# Brazil
@@ -984,12 +984,12 @@ Rule Brazil 2018 only - Nov Sun>=1 0:00 1:00 -
#
# Fernando de Noronha (administratively part of PE)
Zone America/Noronha -2:09:40 - LMT 1914
- -2:00 Brazil -02/-01 1990 Sep 17
- -2:00 - -02 1999 Sep 30
- -2:00 Brazil -02/-01 2000 Oct 15
- -2:00 - -02 2001 Sep 13
- -2:00 Brazil -02/-01 2002 Oct 1
- -2:00 - -02
+ -2:00 Brazil %z 1990 Sep 17
+ -2:00 - %z 1999 Sep 30
+ -2:00 Brazil %z 2000 Oct 15
+ -2:00 - %z 2001 Sep 13
+ -2:00 Brazil %z 2002 Oct 1
+ -2:00 - %z
# Other Atlantic islands have no permanent settlement.
# These include Trindade and Martim Vaz (administratively part of ES),
# Rocas Atoll (RN), and the St Peter and St Paul Archipelago (PE).
@@ -1002,119 +1002,119 @@ Zone America/Noronha -2:09:40 - LMT 1914
# In the north a very small part from the river Javary (now Jari I guess,
# the border with Amapá) to the Amazon, then to the Xingu.
Zone America/Belem -3:13:56 - LMT 1914
- -3:00 Brazil -03/-02 1988 Sep 12
- -3:00 - -03
+ -3:00 Brazil %z 1988 Sep 12
+ -3:00 - %z
#
# west Pará (PA)
# West Pará includes Altamira, Óbidos, Prainha, Oriximiná, and Santarém.
Zone America/Santarem -3:38:48 - LMT 1914
- -4:00 Brazil -04/-03 1988 Sep 12
- -4:00 - -04 2008 Jun 24 0:00
- -3:00 - -03
+ -4:00 Brazil %z 1988 Sep 12
+ -4:00 - %z 2008 Jun 24 0:00
+ -3:00 - %z
#
# Maranhão (MA), Piauí (PI), Ceará (CE), Rio Grande do Norte (RN),
# Paraíba (PB)
Zone America/Fortaleza -2:34:00 - LMT 1914
- -3:00 Brazil -03/-02 1990 Sep 17
- -3:00 - -03 1999 Sep 30
- -3:00 Brazil -03/-02 2000 Oct 22
- -3:00 - -03 2001 Sep 13
- -3:00 Brazil -03/-02 2002 Oct 1
- -3:00 - -03
+ -3:00 Brazil %z 1990 Sep 17
+ -3:00 - %z 1999 Sep 30
+ -3:00 Brazil %z 2000 Oct 22
+ -3:00 - %z 2001 Sep 13
+ -3:00 Brazil %z 2002 Oct 1
+ -3:00 - %z
#
# Pernambuco (PE) (except Atlantic islands)
Zone America/Recife -2:19:36 - LMT 1914
- -3:00 Brazil -03/-02 1990 Sep 17
- -3:00 - -03 1999 Sep 30
- -3:00 Brazil -03/-02 2000 Oct 15
- -3:00 - -03 2001 Sep 13
- -3:00 Brazil -03/-02 2002 Oct 1
- -3:00 - -03
+ -3:00 Brazil %z 1990 Sep 17
+ -3:00 - %z 1999 Sep 30
+ -3:00 Brazil %z 2000 Oct 15
+ -3:00 - %z 2001 Sep 13
+ -3:00 Brazil %z 2002 Oct 1
+ -3:00 - %z
#
# Tocantins (TO)
Zone America/Araguaina -3:12:48 - LMT 1914
- -3:00 Brazil -03/-02 1990 Sep 17
- -3:00 - -03 1995 Sep 14
- -3:00 Brazil -03/-02 2003 Sep 24
- -3:00 - -03 2012 Oct 21
- -3:00 Brazil -03/-02 2013 Sep
- -3:00 - -03
+ -3:00 Brazil %z 1990 Sep 17
+ -3:00 - %z 1995 Sep 14
+ -3:00 Brazil %z 2003 Sep 24
+ -3:00 - %z 2012 Oct 21
+ -3:00 Brazil %z 2013 Sep
+ -3:00 - %z
#
# Alagoas (AL), Sergipe (SE)
Zone America/Maceio -2:22:52 - LMT 1914
- -3:00 Brazil -03/-02 1990 Sep 17
- -3:00 - -03 1995 Oct 13
- -3:00 Brazil -03/-02 1996 Sep 4
- -3:00 - -03 1999 Sep 30
- -3:00 Brazil -03/-02 2000 Oct 22
- -3:00 - -03 2001 Sep 13
- -3:00 Brazil -03/-02 2002 Oct 1
- -3:00 - -03
+ -3:00 Brazil %z 1990 Sep 17
+ -3:00 - %z 1995 Oct 13
+ -3:00 Brazil %z 1996 Sep 4
+ -3:00 - %z 1999 Sep 30
+ -3:00 Brazil %z 2000 Oct 22
+ -3:00 - %z 2001 Sep 13
+ -3:00 Brazil %z 2002 Oct 1
+ -3:00 - %z
#
# Bahia (BA)
# There are too many Salvadors elsewhere, so use America/Bahia instead
# of America/Salvador.
Zone America/Bahia -2:34:04 - LMT 1914
- -3:00 Brazil -03/-02 2003 Sep 24
- -3:00 - -03 2011 Oct 16
- -3:00 Brazil -03/-02 2012 Oct 21
- -3:00 - -03
+ -3:00 Brazil %z 2003 Sep 24
+ -3:00 - %z 2011 Oct 16
+ -3:00 Brazil %z 2012 Oct 21
+ -3:00 - %z
#
# Goiás (GO), Distrito Federal (DF), Minas Gerais (MG),
# Espírito Santo (ES), Rio de Janeiro (RJ), São Paulo (SP), Paraná (PR),
# Santa Catarina (SC), Rio Grande do Sul (RS)
Zone America/Sao_Paulo -3:06:28 - LMT 1914
- -3:00 Brazil -03/-02 1963 Oct 23 0:00
- -3:00 1:00 -02 1964
- -3:00 Brazil -03/-02
+ -3:00 Brazil %z 1963 Oct 23 0:00
+ -3:00 1:00 %z 1964
+ -3:00 Brazil %z
#
# Mato Grosso do Sul (MS)
Zone America/Campo_Grande -3:38:28 - LMT 1914
- -4:00 Brazil -04/-03
+ -4:00 Brazil %z
#
# Mato Grosso (MT)
Zone America/Cuiaba -3:44:20 - LMT 1914
- -4:00 Brazil -04/-03 2003 Sep 24
- -4:00 - -04 2004 Oct 1
- -4:00 Brazil -04/-03
+ -4:00 Brazil %z 2003 Sep 24
+ -4:00 - %z 2004 Oct 1
+ -4:00 Brazil %z
#
# Rondônia (RO)
Zone America/Porto_Velho -4:15:36 - LMT 1914
- -4:00 Brazil -04/-03 1988 Sep 12
- -4:00 - -04
+ -4:00 Brazil %z 1988 Sep 12
+ -4:00 - %z
#
# Roraima (RR)
Zone America/Boa_Vista -4:02:40 - LMT 1914
- -4:00 Brazil -04/-03 1988 Sep 12
- -4:00 - -04 1999 Sep 30
- -4:00 Brazil -04/-03 2000 Oct 15
- -4:00 - -04
+ -4:00 Brazil %z 1988 Sep 12
+ -4:00 - %z 1999 Sep 30
+ -4:00 Brazil %z 2000 Oct 15
+ -4:00 - %z
#
# east Amazonas (AM): Boca do Acre, Jutaí, Manaus, Floriano Peixoto
# The great circle line from Tabatinga to Porto Acre divides
# east from west Amazonas.
Zone America/Manaus -4:00:04 - LMT 1914
- -4:00 Brazil -04/-03 1988 Sep 12
- -4:00 - -04 1993 Sep 28
- -4:00 Brazil -04/-03 1994 Sep 22
- -4:00 - -04
+ -4:00 Brazil %z 1988 Sep 12
+ -4:00 - %z 1993 Sep 28
+ -4:00 Brazil %z 1994 Sep 22
+ -4:00 - %z
#
# west Amazonas (AM): Atalaia do Norte, Boca do Maoco, Benjamin Constant,
# Eirunepé, Envira, Ipixuna
Zone America/Eirunepe -4:39:28 - LMT 1914
- -5:00 Brazil -05/-04 1988 Sep 12
- -5:00 - -05 1993 Sep 28
- -5:00 Brazil -05/-04 1994 Sep 22
- -5:00 - -05 2008 Jun 24 0:00
- -4:00 - -04 2013 Nov 10
- -5:00 - -05
+ -5:00 Brazil %z 1988 Sep 12
+ -5:00 - %z 1993 Sep 28
+ -5:00 Brazil %z 1994 Sep 22
+ -5:00 - %z 2008 Jun 24 0:00
+ -4:00 - %z 2013 Nov 10
+ -5:00 - %z
#
# Acre (AC)
Zone America/Rio_Branco -4:31:12 - LMT 1914
- -5:00 Brazil -05/-04 1988 Sep 12
- -5:00 - -05 2008 Jun 24 0:00
- -4:00 - -04 2013 Nov 10
- -5:00 - -05
+ -5:00 Brazil %z 1988 Sep 12
+ -5:00 - %z 2008 Jun 24 0:00
+ -4:00 - %z 2013 Nov 10
+ -5:00 - %z
# Chile
@@ -1382,36 +1382,36 @@ Rule Chile 2023 max - Sep Sun>=2 4:00u 1:00 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Santiago -4:42:45 - LMT 1890
-4:42:45 - SMT 1910 Jan 10 # Santiago Mean Time
- -5:00 - -05 1916 Jul 1
+ -5:00 - %z 1916 Jul 1
-4:42:45 - SMT 1918 Sep 10
- -4:00 - -04 1919 Jul 1
+ -4:00 - %z 1919 Jul 1
-4:42:45 - SMT 1927 Sep 1
- -5:00 Chile -05/-04 1932 Sep 1
- -4:00 - -04 1942 Jun 1
- -5:00 - -05 1942 Aug 1
- -4:00 - -04 1946 Jul 14 24:00
- -4:00 1:00 -03 1946 Aug 28 24:00 # central CL
- -5:00 1:00 -04 1947 Mar 31 24:00
- -5:00 - -05 1947 May 21 23:00
- -4:00 Chile -04/-03
+ -5:00 Chile %z 1932 Sep 1
+ -4:00 - %z 1942 Jun 1
+ -5:00 - %z 1942 Aug 1
+ -4:00 - %z 1946 Jul 14 24:00
+ -4:00 1:00 %z 1946 Aug 28 24:00 # central CL
+ -5:00 1:00 %z 1947 Mar 31 24:00
+ -5:00 - %z 1947 May 21 23:00
+ -4:00 Chile %z
Zone America/Punta_Arenas -4:43:40 - LMT 1890
-4:42:45 - SMT 1910 Jan 10
- -5:00 - -05 1916 Jul 1
+ -5:00 - %z 1916 Jul 1
-4:42:45 - SMT 1918 Sep 10
- -4:00 - -04 1919 Jul 1
+ -4:00 - %z 1919 Jul 1
-4:42:45 - SMT 1927 Sep 1
- -5:00 Chile -05/-04 1932 Sep 1
- -4:00 - -04 1942 Jun 1
- -5:00 - -05 1942 Aug 1
- -4:00 - -04 1946 Aug 28 24:00
- -5:00 1:00 -04 1947 Mar 31 24:00
- -5:00 - -05 1947 May 21 23:00
- -4:00 Chile -04/-03 2016 Dec 4
- -3:00 - -03
+ -5:00 Chile %z 1932 Sep 1
+ -4:00 - %z 1942 Jun 1
+ -5:00 - %z 1942 Aug 1
+ -4:00 - %z 1946 Aug 28 24:00
+ -5:00 1:00 %z 1947 Mar 31 24:00
+ -5:00 - %z 1947 May 21 23:00
+ -4:00 Chile %z 2016 Dec 4
+ -3:00 - %z
Zone Pacific/Easter -7:17:28 - LMT 1890
-7:17:28 - EMT 1932 Sep # Easter Mean Time
- -7:00 Chile -07/-06 1982 Mar 14 3:00u # Easter Time
- -6:00 Chile -06/-05
+ -7:00 Chile %z 1982 Mar 14 3:00u # Easter Time
+ -6:00 Chile %z
#
# Salas y Gómez Island is uninhabited.
# Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
@@ -1431,10 +1431,10 @@ Zone Pacific/Easter -7:17:28 - LMT 1890
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Antarctica/Palmer 0 - -00 1965
- -4:00 Arg -04/-03 1969 Oct 5
- -3:00 Arg -03/-02 1982 May
- -4:00 Chile -04/-03 2016 Dec 4
- -3:00 - -03
+ -4:00 Arg %z 1969 Oct 5
+ -3:00 Arg %z 1982 May
+ -4:00 Chile %z 2016 Dec 4
+ -3:00 - %z
# Colombia
@@ -1453,7 +1453,7 @@ Rule CO 1993 only - Feb 6 24:00 0 -
#STDOFF -4:56:16.4
Zone America/Bogota -4:56:16 - LMT 1884 Mar 13
-4:56:16 - BMT 1914 Nov 23 # Bogotá Mean Time
- -5:00 CO -05/-04
+ -5:00 CO %z
# Malpelo, Providencia, San Andres
# no information; probably like America/Bogota
@@ -1484,10 +1484,10 @@ Rule Ecuador 1993 only - Feb 5 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Guayaquil -5:19:20 - LMT 1890
-5:14:00 - QMT 1931 # Quito Mean Time
- -5:00 Ecuador -05/-04
+ -5:00 Ecuador %z
Zone Pacific/Galapagos -5:58:24 - LMT 1931 # Puerto Baquerizo Moreno
- -5:00 - -05 1986
- -6:00 Ecuador -06/-05
+ -5:00 - %z 1986
+ -6:00 Ecuador %z
# Falklands
@@ -1587,10 +1587,10 @@ Rule Falk 2001 2010 - Sep Sun>=1 2:00 1:00 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Atlantic/Stanley -3:51:24 - LMT 1890
-3:51:24 - SMT 1912 Mar 12 # Stanley Mean Time
- -4:00 Falk -04/-03 1983 May
- -3:00 Falk -03/-02 1985 Sep 15
- -4:00 Falk -04/-03 2010 Sep 5 2:00
- -3:00 - -03
+ -4:00 Falk %z 1983 May
+ -3:00 Falk %z 1985 Sep 15
+ -4:00 Falk %z 2010 Sep 5 2:00
+ -3:00 - %z
# French Guiana
# For the 1911/1912 establishment of standard time in French possessions, see:
@@ -1598,8 +1598,8 @@ Zone Atlantic/Stanley -3:51:24 - LMT 1890
# page 752, 18b.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Cayenne -3:29:20 - LMT 1911 Jul 1
- -4:00 - -04 1967 Oct
- -3:00 - -03
+ -4:00 - %z 1967 Oct
+ -3:00 - %z
# Guyana
@@ -1633,10 +1633,10 @@ Zone America/Cayenne -3:29:20 - LMT 1911 Jul 1
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Guyana -3:52:39 - LMT 1911 Aug 1 # Georgetown
- -4:00 - -04 1915 Mar 1
- -3:45 - -0345 1975 Aug 1
- -3:00 - -03 1992 Mar 29 1:00
- -4:00 - -04
+ -4:00 - %z 1915 Mar 1
+ -3:45 - %z 1975 Aug 1
+ -3:00 - %z 1992 Mar 29 1:00
+ -4:00 - %z
# Paraguay
#
@@ -1734,9 +1734,9 @@ Rule Para 2013 max - Mar Sun>=22 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Asuncion -3:50:40 - LMT 1890
-3:50:40 - AMT 1931 Oct 10 # Asunción Mean Time
- -4:00 - -04 1972 Oct
- -3:00 - -03 1974 Apr
- -4:00 Para -04/-03
+ -4:00 - %z 1972 Oct
+ -3:00 - %z 1974 Apr
+ -4:00 Para %z
# Peru
#
@@ -1763,12 +1763,12 @@ Rule Peru 1994 only - Apr 1 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Lima -5:08:12 - LMT 1890
-5:08:36 - LMT 1908 Jul 28 # Lima Mean Time?
- -5:00 Peru -05/-04
+ -5:00 Peru %z
# South Georgia
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Atlantic/South_Georgia -2:26:08 - LMT 1890 # Grytviken
- -2:00 - -02
+ -2:00 - %z
# South Sandwich Is
# uninhabited; scientific personnel have wintered
@@ -1778,8 +1778,8 @@ Zone Atlantic/South_Georgia -2:26:08 - LMT 1890 # Grytviken
Zone America/Paramaribo -3:40:40 - LMT 1911
-3:40:52 - PMT 1935 # Paramaribo Mean Time
-3:40:36 - PMT 1945 Oct # The capital moved?
- -3:30 - -0330 1984 Oct
- -3:00 - -03
+ -3:30 - %z 1984 Oct
+ -3:00 - %z
# Uruguay
# From Paul Eggert (1993-11-18):
@@ -1994,15 +1994,15 @@ Rule Uruguay 2006 2014 - Oct Sun>=1 2:00 1:00 -
# This Zone can be simplified once we assume zic %z.
Zone America/Montevideo -3:44:51 - LMT 1908 Jun 10
-3:44:51 - MMT 1920 May 1 # Montevideo MT
- -4:00 - -04 1923 Oct 1
- -3:30 Uruguay -0330/-03 1942 Dec 14
- -3:00 Uruguay -03/-0230 1960
- -3:00 Uruguay -03/-02 1968
- -3:00 Uruguay -03/-0230 1970
- -3:00 Uruguay -03/-02 1974
- -3:00 Uruguay -03/-0130 1974 Mar 10
- -3:00 Uruguay -03/-0230 1974 Dec 22
- -3:00 Uruguay -03/-02
+ -4:00 - %z 1923 Oct 1
+ -3:30 Uruguay %z 1942 Dec 14
+ -3:00 Uruguay %z 1960
+ -3:00 Uruguay %z 1968
+ -3:00 Uruguay %z 1970
+ -3:00 Uruguay %z 1974
+ -3:00 Uruguay %z 1974 Mar 10
+ -3:00 Uruguay %z 1974 Dec 22
+ -3:00 Uruguay %z
# Venezuela
#
@@ -2036,7 +2036,7 @@ Zone America/Montevideo -3:44:51 - LMT 1908 Jun 10
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Caracas -4:27:44 - LMT 1890
-4:27:40 - CMT 1912 Feb 12 # Caracas Mean Time?
- -4:30 - -0430 1965 Jan 1 0:00
- -4:00 - -04 2007 Dec 9 3:00
- -4:30 - -0430 2016 May 1 2:30
- -4:00 - -04
+ -4:30 - %z 1965 Jan 1 0:00
+ -4:00 - %z 2007 Dec 9 3:00
+ -4:30 - %z 2016 May 1 2:30
+ -4:00 - %z
diff --git a/make/data/tzdata/zone.tab b/make/data/tzdata/zone.tab
index 0a01e8777dd..b90ab4e4b25 100644
--- a/make/data/tzdata/zone.tab
+++ b/make/data/tzdata/zone.tab
@@ -287,8 +287,7 @@ MK +4159+02126 Europe/Skopje
ML +1239-00800 Africa/Bamako
MM +1647+09610 Asia/Yangon
MN +4755+10653 Asia/Ulaanbaatar most of Mongolia
-MN +4801+09139 Asia/Hovd Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan
-MN +4804+11430 Asia/Choibalsan Dornod, Sukhbaatar
+MN +4801+09139 Asia/Hovd Bayan-Olgii, Hovd, Uvs
MO +221150+1133230 Asia/Macau
MP +1512+14545 Pacific/Saipan
MQ +1436-06105 America/Martinique
diff --git a/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java b/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java
index be685a5c195..30a4a68074c 100644
--- a/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java
+++ b/src/java.base/share/classes/com/sun/crypto/provider/KeyWrapCipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2023, 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
@@ -123,6 +123,25 @@ public AES256_KWP_NoPadding() {
}
}
+ // validate the key algorithm/encoding and then returns the key bytes
+ // which callers should erase after use
+ private static byte[] checkKey(Key key, int fixedKeySize)
+ throws InvalidKeyException {
+
+ byte[] keyBytes = key.getEncoded();
+ if (keyBytes == null) {
+ throw new InvalidKeyException("Null key");
+ }
+ int keyLen = keyBytes.length;
+ if (!key.getAlgorithm().equalsIgnoreCase("AES") ||
+ !AESCrypt.isKeySizeValid(keyLen) ||
+ (fixedKeySize != -1 && fixedKeySize != keyLen)) {
+ throw new InvalidKeyException("Invalid key length: " +
+ keyLen + " bytes");
+ }
+ return keyBytes;
+ }
+
// store the specified bytes, e.g. in[inOfs...(inOfs+inLen-1)] into
// 'dataBuf' starting at 'dataIdx'.
// NOTE: if 'in' is null, this method will ensure that 'dataBuf' has enough
@@ -294,10 +313,8 @@ protected byte[] engineGetIV() {
// actual impl for various engineInit(...) methods
private void implInit(int opmode, Key key, byte[] iv, SecureRandom random)
throws InvalidKeyException, InvalidAlgorithmParameterException {
- byte[] keyBytes = key.getEncoded();
- if (keyBytes == null) {
- throw new InvalidKeyException("Null key");
- }
+ byte[] keyBytes = checkKey(key, fixedKeySize);
+
this.opmode = opmode;
boolean decrypting = (opmode == Cipher.DECRYPT_MODE ||
opmode == Cipher.UNWRAP_MODE);
@@ -658,21 +675,11 @@ protected AlgorithmParameters engineGetParameters() {
* @exception InvalidKeyException if key
is invalid.
*/
protected int engineGetKeySize(Key key) throws InvalidKeyException {
- byte[] encoded = key.getEncoded();
- if (encoded == null) {
- throw new InvalidKeyException("Cannot decide key length");
- }
+ byte[] keyBytes = checkKey(key, fixedKeySize);
+ // only need length; erase immediately
+ Arrays.fill(keyBytes, (byte) 0);
+ return Math.multiplyExact(keyBytes.length, 8);
- // only need length
- Arrays.fill(encoded, (byte) 0);
- int keyLen = encoded.length;
- if (!key.getAlgorithm().equalsIgnoreCase("AES") ||
- !AESCrypt.isKeySizeValid(keyLen) ||
- (fixedKeySize != -1 && fixedKeySize != keyLen)) {
- throw new InvalidKeyException("Invalid key length: " +
- keyLen + " bytes");
- }
- return Math.multiplyExact(keyLen, 8);
}
/**
diff --git a/src/java.base/share/classes/java/lang/ThreadLocal.java b/src/java.base/share/classes/java/lang/ThreadLocal.java
index ae696768395..848e3721dcf 100644
--- a/src/java.base/share/classes/java/lang/ThreadLocal.java
+++ b/src/java.base/share/classes/java/lang/ThreadLocal.java
@@ -90,7 +90,7 @@ public class ThreadLocal {
* The next hash code to be given out. Updated atomically. Starts at
* zero.
*/
- private static AtomicInteger nextHashCode =
+ private static final AtomicInteger nextHashCode =
new AtomicInteger();
/**
diff --git a/src/java.base/share/classes/java/time/format/DateTimeFormatter.java b/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
index c94b123b26c..c8e865db2b4 100644
--- a/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
+++ b/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
@@ -2240,29 +2240,23 @@ public Object parseObject(String text, ParsePosition pos) {
DateTimeParseContext context;
try {
context = formatter.parseUnresolved0(text, pos);
- } catch (IndexOutOfBoundsException ex) {
- if (pos.getErrorIndex() < 0) {
- pos.setErrorIndex(0);
- }
- return null;
- }
- if (context == null) {
- if (pos.getErrorIndex() < 0) {
- pos.setErrorIndex(0);
+ if (context == null) {
+ if (pos.getErrorIndex() < 0) {
+ pos.setErrorIndex(0);
+ }
+ return null;
}
- return null;
- }
- try {
TemporalAccessor resolved = context.toResolved(formatter.resolverStyle, formatter.resolverFields);
if (parseType == null) {
return resolved;
}
return resolved.query(parseType);
} catch (RuntimeException ex) {
- pos.setErrorIndex(0);
+ if (pos.getErrorIndex() < 0) {
+ pos.setErrorIndex(0);
+ }
return null;
}
}
}
-
}
diff --git a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java
index dc1afa7b7c0..08bdaf44bb4 100644
--- a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java
+++ b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java
@@ -67,7 +67,7 @@ public static void runTest() throws Throwable {
"-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "CodeCacheFullCountTest", "WasteCodeCache");
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
// Ignore adapter creation failures
- if (oa.getExitValue() != 0 && !oa.getOutput().contains("Out of space in CodeCache for adapters")) {
+ if (oa.getExitValue() != 0 && !oa.getOutput().contains("Out of space in CodeCache")) {
oa.reportDiagnosticSummary();
throw new RuntimeException("VM finished with exit code " + oa.getExitValue());
}
diff --git a/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java b/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java
index 4877a3433a7..a9149a2e6c2 100644
--- a/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java
+++ b/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2023, 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
@@ -40,13 +40,14 @@ public static void main(String args[]) throws Exception {
ProcessBuilder pb = ProcessTools.createNativeTestProcessBuilder("invoke",
"test_java_overflow");
pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH);
- new OutputAnalyzer(pb.start())
- .shouldHaveExitValue(0);
+ OutputAnalyzer output = ProcessTools.executeProcess(pb);
+ output.shouldHaveExitValue(0);
- pb = ProcessTools.createNativeTestProcessBuilder("invoke", "test_native_overflow");
+ pb = ProcessTools.createNativeTestProcessBuilder("invoke",
+ "test_java_overflow_initial");
pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH);
- new OutputAnalyzer(pb.start())
- .shouldHaveExitValue(0);
+ output = ProcessTools.executeProcess(pb);
+ output.shouldHaveExitValue(0);
}
}
diff --git a/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPagesNative.java b/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPagesNative.java
new file mode 100644
index 00000000000..d3a132f4b62
--- /dev/null
+++ b/test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPagesNative.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2023, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Stack guard pages should be installed correctly and removed when thread is detached for native threads
+ * @modules java.base/jdk.internal.misc
+ * @library /test/lib
+ * @requires os.family == "linux"
+ * @compile DoOverflow.java
+ * @run main/native TestStackGuardPagesNative
+ */
+import jdk.test.lib.Utils;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+
+
+public class TestStackGuardPagesNative {
+ public static void main(String args[]) throws Exception {
+
+ ProcessBuilder pb = ProcessTools.createNativeTestProcessBuilder("invoke", "test_native_overflow");
+ pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH);
+ OutputAnalyzer output = ProcessTools.executeProcess(pb);
+ output.shouldHaveExitValue(0);
+
+ pb = ProcessTools.createNativeTestProcessBuilder("invoke", "test_native_overflow_initial");
+ pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH);
+ output = ProcessTools.executeProcess(pb);
+ output.shouldHaveExitValue(0);
+
+ }
+}
diff --git a/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c b/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
index 50a37001fbf..abef2ea050a 100644
--- a/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+++ b/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2023, 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
@@ -53,10 +53,11 @@ JavaVM* _jvm;
static jmp_buf context;
-static int _last_si_code = -1;
-static int _failures = 0;
-static int _rec_count = 0;
-static int _kp_rec_count = 0;
+static volatile int _last_si_code = -1;
+static volatile int _failures = 0;
+static volatile int _rec_count = 0; // Number of allocations to hit stack guard page
+static volatile int _kp_rec_count = 0; // Kept record of rec_count, for retrying
+static int _peek_value = 0; // Used for accessing memory to cause SIGSEGV
pid_t gettid() {
return (pid_t) syscall(SYS_gettid);
@@ -73,7 +74,7 @@ static char* altstack = NULL;
void set_signal_handler() {
if (altstack == NULL) {
// Dynamically allocated in case SIGSTKSZ is not constant
- altstack = malloc(SIGSTKSZ);
+ altstack = (char*)malloc(SIGSTKSZ);
if (altstack == NULL) {
fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n");
exit(7);
@@ -116,31 +117,37 @@ size_t get_java_stacksize () {
return jdk_args.javaStackSize;
}
-void *run_java_overflow (void *p) {
+// Call DoOverflow::`method` on JVM
+void call_method_on_jvm(const char* method) {
JNIEnv *env;
jclass class_id;
jmethodID method_id;
int res;
- res = (*_jvm)->AttachCurrentThread(_jvm, (void**)&env, NULL);
+ res = (*_jvm)->AttachCurrentThread(_jvm, (void **)&env, NULL);
if (res != JNI_OK) {
fprintf(stderr, "Test ERROR. Can't attach to current thread\n");
exit(7);
}
- class_id = (*env)->FindClass (env, "DoOverflow");
+ class_id = (*env)->FindClass(env, "DoOverflow");
if (class_id == NULL) {
fprintf(stderr, "Test ERROR. Can't load class DoOverflow\n");
exit(7);
}
- method_id = (*env)->GetStaticMethodID(env, class_id, "printIt", "()V");
+ method_id = (*env)->GetStaticMethodID(env, class_id, method, "()V");
if (method_id == NULL) {
- fprintf(stderr, "Test ERROR. Can't find method DoOverflow.printIt\n");
+ fprintf(stderr, "Test ERROR. Can't find method DoOverflow.%s\n", method);
exit(7);
}
(*env)->CallStaticVoidMethod(env, class_id, method_id, NULL);
+}
+
+void *run_java_overflow (void *p) {
+ volatile int res;
+ call_method_on_jvm("printIt");
res = (*_jvm)->DetachCurrentThread(_jvm);
if (res != JNI_OK) {
@@ -151,42 +158,22 @@ void *run_java_overflow (void *p) {
}
void do_overflow(){
- int *p = alloca(sizeof(int));
+ volatile int *p = NULL;
if (_kp_rec_count == 0 || _rec_count < _kp_rec_count) {
- _rec_count ++;
- do_overflow();
+ for(;;) {
+ _rec_count++;
+ p = (int*)alloca(128);
+ _peek_value = p[0]; // Peek
+ }
}
}
void *run_native_overflow(void *p) {
// Test that stack guard page is correctly set for initial and non initial thread
// and correctly removed for the initial thread
- JNIEnv *env;
- jclass class_id;
- jmethodID method_id;
- int res;
-
+ volatile int res;
printf("run_native_overflow %ld\n", (long) gettid());
-
- res = (*_jvm)->AttachCurrentThread(_jvm, (void **)&env, NULL);
- if (res != JNI_OK) {
- fprintf(stderr, "Test ERROR. Can't attach to current thread\n");
- exit(7);
- }
-
- class_id = (*env)->FindClass (env, "DoOverflow");
- if (class_id == NULL) {
- fprintf(stderr, "Test ERROR. Can't load class DoOverflow\n");
- exit(7);
- }
-
- method_id = (*env)->GetStaticMethodID (env, class_id, "printAlive", "()V");
- if (method_id == NULL) {
- fprintf(stderr, "Test ERROR. Can't find method DoOverflow.printAlive\n");
- exit(7);
- }
-
- (*env)->CallStaticVoidMethod (env, class_id, method_id, NULL);
+ call_method_on_jvm("printAlive");
// Initialize statics used in do_overflow
_kp_rec_count = 0;
@@ -240,7 +227,18 @@ void *run_native_overflow(void *p) {
void usage() {
fprintf(stderr, "Usage: invoke test_java_overflow\n");
+ fprintf(stderr, " invoke test_java_overflow_initial\n");
fprintf(stderr, " invoke test_native_overflow\n");
+ fprintf(stderr, " invoke test_native_overflow_initial\n");
+}
+
+void init_thread_or_die(pthread_t *thr, pthread_attr_t *thread_attr) {
+ size_t stack_size = get_java_stacksize();
+ if (pthread_attr_init(thread_attr) != 0 ||
+ pthread_attr_setstacksize(thread_attr, stack_size) != 0) {
+ printf("Failed to set stacksize. Exiting test.\n");
+ exit(0);
+ }
}
@@ -283,37 +281,53 @@ int main (int argc, const char** argv) {
exit(7);
}
- size_t stack_size = get_java_stacksize();
pthread_t thr;
pthread_attr_t thread_attr;
- pthread_attr_init(&thread_attr);
- pthread_attr_setstacksize(&thread_attr, stack_size);
+ if (argc < 2) {
+ fprintf(stderr, "No test selected");
+ usage();
+ exit(7);
+ }
- if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
+ if (strcmp(argv[1], "test_java_overflow_initial") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
+ printf("Testing stack guard page behaviour for initial thread\n");
+ run_java_overflow(NULL);
+ // This test crash on error
+ exit(0);
+ }
+
+ if (strcmp(argv[1], "test_java_overflow") == 0) {
+ init_thread_or_die(&thr, &thread_attr);
+ printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
pthread_create(&thr, &thread_attr, run_java_overflow, NULL);
pthread_join(thr, NULL);
- printf("Testing stack guard page behaviour for initial thread\n");
- run_java_overflow(NULL);
// This test crash on error
exit(0);
}
- if (argc > 1 && strcmp(argv[1], "test_native_overflow") == 0) {
+ if (strcmp(argv[1], "test_native_overflow_initial") == 0) {
printf("\nTesting NATIVE_OVERFLOW\n");
+ printf("Testing stack guard page behaviour for initial thread\n");
+ run_native_overflow(NULL);
+
+ exit((_failures > 0) ? 1 : 0);
+ }
+
+ if (strcmp(argv[1], "test_native_overflow") == 0) {
+ init_thread_or_die(&thr, &thread_attr);
+ printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
+
pthread_create(&thr, &thread_attr, run_native_overflow, NULL);
pthread_join(thr, NULL);
- printf("Testing stack guard page behaviour for initial thread\n");
- run_native_overflow(NULL);
-
exit((_failures > 0) ? 1 : 0);
}
diff --git a/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java b/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java
index 3164294ecca..440914826bc 100644
--- a/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java
+++ b/test/jdk/com/sun/crypto/provider/CICO/CICODESFuncTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -66,7 +66,8 @@ public class CICODESFuncTest {
private static final int IV_LENGTH = 8;
public static void main(String[] args) throws Exception {
- Provider provider = Security.getProvider("SunJCE");
+ Provider provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
if (provider == null) {
throw new RuntimeException("SunJCE provider does not exist.");
}
diff --git a/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java b/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java
index 0641845d7f9..d0af93ff646 100644
--- a/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java
+++ b/test/jdk/com/sun/crypto/provider/CICO/CICOSkipTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -75,7 +75,7 @@ public class CICOSkipTest {
"OFB", "OFB64", "PCBC"};
private static final String[] PADDINGS = {"NoPadding", "Pkcs5Padding"};
private static final String[] PBE_ALGOS = {"PBEWithMD5AndDES",
- "PBEWithMD5AndDES/CBC/PKCS5Padding"};
+ "PBEWithMD5AndDES/CBC/PKCS5Padding", "PBEWithSHA1AndDESede"};
public static void main(String[] args) throws Exception {
// how many kinds of padding mode such as PKCS5padding and NoPadding
@@ -204,9 +204,10 @@ private void initCiphers(String algo, SecretKey key,
AlgorithmParameterSpec aps) throws NoSuchAlgorithmException,
NoSuchPaddingException, InvalidKeyException,
InvalidAlgorithmParameterException {
- Provider provider = Security.getProvider("SunJCE");
+ String providerName = System.getProperty("test.provider.name", "SunJCE");
+ Provider provider = Security.getProvider(providerName);
if (provider == null) {
- throw new RuntimeException("SunJCE provider does not exist.");
+ throw new RuntimeException(providerName + " provider does not exist.");
}
Cipher ci1 = Cipher.getInstance(algo, provider);
ci1.init(Cipher.ENCRYPT_MODE, key, aps);
diff --git a/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java b/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java
index e6e5c2faa01..3dd15d50058 100644
--- a/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java
+++ b/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/AESPBEWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -69,9 +69,10 @@ public AESPBEWrapper(PBEAlgorithm algo, String passwd)
*/
@Override
protected Cipher initCipher(int mode) throws GeneralSecurityException {
- Provider provider = Security.getProvider("SunJCE");
+ String providerName = System.getProperty("test.provider.name", "SunJCE");
+ Provider provider = Security.getProvider(providerName);
if (provider == null) {
- throw new RuntimeException("SunJCE provider does not exist.");
+ throw new RuntimeException(providerName + ": provider does not exist.");
}
// get Cipher instance
Cipher ci = Cipher.getInstance(transformation, provider);
diff --git a/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java b/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java
index f68fd85146b..cde094e1f90 100644
--- a/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java
+++ b/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/DefaultPBEWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -58,9 +58,10 @@ public DefaultPBEWrapper(PBEAlgorithm algo, String passwd) {
*/
@Override
protected Cipher initCipher(int mode) throws GeneralSecurityException {
- Provider provider = Security.getProvider("SunJCE");
+ String providerName = System.getProperty("test.provider.name", "SunJCE");
+ Provider provider = Security.getProvider(providerName);
if (provider == null) {
- throw new RuntimeException("SunJCE provider does not exist.");
+ throw new RuntimeException(providerName + ": provider does not exist.");
}
SecretKey key = SecretKeyFactory.getInstance(baseAlgo)
.generateSecret(new PBEKeySpec(password.toCharArray()));
diff --git a/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java b/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java
index fb2d0ac901f..ac7580990f0 100644
--- a/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java
+++ b/test/jdk/com/sun/crypto/provider/CICO/PBEFunc/PBKDF2Wrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -89,9 +89,10 @@ public PBKDF2Wrapper(PBEAlgorithm algo, String passwd)
*/
@Override
protected Cipher initCipher(int mode) throws GeneralSecurityException {
- Provider provider = Security.getProvider("SunJCE");
+ String providerName = System.getProperty("test.provider.name", "SunJCE");
+ Provider provider = Security.getProvider(providerName);
if (provider == null) {
- throw new RuntimeException("SunJCE provider does not exist.");
+ throw new RuntimeException(providerName + ": provider does not exist.");
}
// Generate secret key
PBEKeySpec pbeKeySpec = new PBEKeySpec(password.toCharArray(),
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java
index 58267c2ffba..78b69c2ea95 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/Encrypt.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -122,7 +122,8 @@ public Encrypt(Provider provider, String algorithm, String mode,
}
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
for (String alg : ALGORITHMS) {
for (int keyStrength : KEY_STRENGTHS) {
if (keyStrength > Cipher.getMaxAllowedKeyLength(alg)) {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java
index 11efb2d0611..885b5998aa4 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMLargeDataKAT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, 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
@@ -102,7 +102,8 @@ public class GCMLargeDataKAT {
byte[] encrypt(int inLen) {
try {
- cipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ cipher = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
cipher.init(Cipher.ENCRYPT_MODE, key, spec);
return cipher.doFinal(plaintext, 0, inLen);
} catch (Exception e) {
@@ -125,7 +126,8 @@ boolean decrypt(byte[] data) {
return false;
}
try {
- cipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ cipher = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
cipher.init(Cipher.DECRYPT_MODE, key, spec);
result = cipher.doFinal(data);
} catch (Exception e) {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java
index eea64ee77dc..06fe8fa5496 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMParameterSpecTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -101,7 +101,8 @@ public GCMParameterSpecTest(int keyLength, int tagLength, int IVlength,
AAD = Helper.generateBytes(AADLength);
// init a secret key
- KeyGenerator kg = KeyGenerator.getInstance("AES", "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance("AES",
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(keyLength);
key = kg.generateKey();
}
@@ -225,7 +226,8 @@ private byte[] recoverCipherText(byte[] cipherText, GCMParameterSpec spec)
private Cipher createCipher(int mode, GCMParameterSpec spec)
throws Exception {
- Cipher cipher = Cipher.getInstance(TRANSFORMATION, "SunJCE");
+ Cipher cipher = Cipher.getInstance(TRANSFORMATION,
+ System.getProperty("test.provider.name", "SunJCE"));
cipher.init(mode, key, spec);
return cipher;
}
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java
index 21f1deec45b..c1a0ae2dfd0 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/KeyWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -37,7 +37,7 @@ public class KeyWrapper {
static final String AES = "AES";
static final String TRANSFORMATION = "AES/GCM/NoPadding";
- static final String PROVIDER = "SunJCE";
+ static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE");
static final int KEY_LENGTH = 128;
public static void main(String argv[]) throws Exception {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java
index f6bd3805ae4..fd7df41c91a 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/ReadWriteSkip.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -50,7 +50,7 @@ static enum BufferType {
static final int BLOCK = 50;
static final int SAVE = 45;
static final int DISCARD = BLOCK - SAVE;
- static final String PROVIDER = "SunJCE";
+ static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE");
static final String AES = "AES";
static final String GCM = "GCM";
static final String PADDING = "NoPadding";
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java
index 756fd624223..3e3fa3d77b1 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SameBuffer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -41,7 +41,7 @@
*/
public class SameBuffer {
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE");
private static final String AES = "AES";
private static final String GCM = "GCM";
private static final String PADDING = "NoPadding";
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java
index 6f5e8200e10..accf38f98b5 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/SealedObjectTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -37,7 +37,7 @@ public class SealedObjectTest {
private static final String AES = "AES";
private static final String TRANSFORMATION = "AES/GCM/NoPadding";
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE");
private static final int KEY_LENGTH = 128;
public static void main(String[] args) throws Exception {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java
index 157a8bb329d..6a35b3f2ce8 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/WrongAAD.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, 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
@@ -44,7 +44,7 @@
*/
public class WrongAAD {
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE");
private static final String TRANSFORMATION = "AES/GCM/NoPadding";
private static final int TEXT_SIZE = 800;
private static final int KEY_SIZE = 128;
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java
index 1bb9f0d061f..5d6da523f2a 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/CICO.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2024, 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
@@ -52,7 +52,7 @@ public class CICO {
"cFB24", "cFB32", "Cfb40", "CFB72", "OfB", "OfB20", "OfB48",
"OfB56", "OFB64", "OFB112", "CFB112", "pCbC" };
private static final String[] PADDING = { "noPadding", "pkcs5padding" };
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE");
private static final int NREADS = 3;
private static final int KEY_LENGTH = 128;
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java
index d569965bca1..e610e98a27b 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/CTR.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2024, 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
@@ -50,7 +50,8 @@ public class CTR {
private static final String ALGORITHM = "AES";
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunJCE");
private static final String[] MODES = {"CTR","CFB24","OFB32","GCM"};
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java
index 9598e1743c2..a494d230381 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/Padding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2024, 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
@@ -47,7 +47,8 @@
public class Padding {
private static final String ALGORITHM = "AES";
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunJCE");
private static final String[] MODES_PKCS5PAD = {
"ECb", "CbC", "PCBC", "OFB",
"OFB150", "cFB", "CFB7", "cFB8", "cFB16", "cFB24", "cFB32",
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java
index ef538f63f90..e8b8c3edf30 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4511676.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -41,10 +41,12 @@ public class Test4511676 {
public boolean execute() throws Exception {
- Cipher ci = Cipher.getInstance(ALGO, "SunJCE");
+ Cipher ci = Cipher.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
// TEST FIX 4511676
- KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(KEYSIZE*8);
SecretKey key = kg.generateKey();
try {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java
index b743d6bcefd..c1428fdc033 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512524.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -45,10 +45,12 @@ public class Test4512524 {
public void execute(String mode) throws Exception {
String transformation = ALGO+"/"+mode+"/"+PADDING;
- Cipher ci = Cipher.getInstance(transformation, "SunJCE");
+ Cipher ci = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
// TEST FIX 4512524
- KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(KEYSIZE*8);
SecretKey key = kg.generateKey();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java
index bf004314392..a33727075d7 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4512704.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -45,9 +45,11 @@ public void execute(String mode) throws Exception {
AlgorithmParameterSpec aps = null;
String transformation = ALGO + "/" + mode + "/"+PADDING;
- Cipher ci = Cipher.getInstance(transformation, "SunJCE");
+ Cipher ci = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
- KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(KEYSIZE*8);
SecretKey key = kg.generateKey();
// TEST FIX 4512704
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java
index 856c55a6fbe..80d58dc19c5 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4513830.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -52,10 +52,12 @@ public boolean execute() throws Exception {
byte[] plainText=new byte[125];
rdm.nextBytes(plainText);
- Cipher ci = Cipher.getInstance(ALGO+"/"+MODE+"/"+PADDING, "SunJCE");
+ Cipher ci = Cipher.getInstance(ALGO+"/"+MODE+"/"+PADDING,
+ System.getProperty("test.provider.name", "SunJCE"));
// TEST FIX 4513830
- KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(KEYSIZE*8);
SecretKey key = kg.generateKey();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java
index ccab72bf69a..1eed3831f53 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4517355.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -48,8 +48,10 @@ public class Test4517355 {
public void execute(String mode, String padding) throws Exception {
String transformation = ALGO + "/" + mode + "/" + padding;
- Cipher ci = Cipher.getInstance(transformation, "SunJCE");
- KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE");
+ Cipher ci = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
+ KeyGenerator kg = KeyGenerator.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(KEYSIZE*8);
SecretKey key = kg.generateKey();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java
index 86409d3e4cd..e49ef86b384 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/Test4626070.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -38,8 +38,10 @@ public class Test4626070 {
public void execute(String mode, String padding) throws Exception {
String transformation = ALGO + "/" + mode + "/" + padding;
- Cipher ci = Cipher.getInstance(transformation, "SunJCE");
- KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE");
+ Cipher ci = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
+ KeyGenerator kg = KeyGenerator.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(KEYSIZE*8);
SecretKey key = kg.generateKey();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java
index dd0d97101c1..9e2342c7be6 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2024, 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
@@ -48,7 +48,7 @@
public class TestAESCipher {
private static final String ALGORITHM = "AES";
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE");
private static final String[] MODES = { "ECb", "CbC", "CTR", "PCBC", "OFB",
"OFB150", "cFB", "CFB7", "cFB8", "cFB16", "cFB24", "cFB32",
"Cfb40", "cfB48", "cfB56", "cfB64", "cfB72", "cfB80", "cfB88",
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java
index 91d7426b7f1..65b34507835 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/Dynamic.java
@@ -46,7 +46,7 @@ public class Dynamic {
static final String[] PADDING = {
"NoPadding", "PKCS5Padding", "ISO10126Padding"
};
- static final String SUNJCE = "SunJCE";
+ static final String PROVIDER = System.getProperty("test.provider.name", "SunJCE");
Cipher ci = null;
byte[] iv = null;
@@ -128,8 +128,8 @@ protected boolean runTest(String algo, String mo, String pad)
new Random().nextBytes(plainText);
String transformation = algo + "/" + mo + "/" + pad;
- ci = Cipher.getInstance(transformation, SUNJCE);
- KeyGenerator kg = KeyGenerator.getInstance(algo, SUNJCE);
+ ci = Cipher.getInstance(transformation, PROVIDER);
+ KeyGenerator kg = KeyGenerator.getInstance(algo, PROVIDER);
if (keyStrength > Cipher.getMaxAllowedKeyLength(transformation)) {
// skip if this key length is larger than what's
// configured in the jce jurisdiction policy files
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java
index d29a0aa0904..bb9538c70a1 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithProviderChange.java
@@ -33,7 +33,7 @@
public class TestAESWithProviderChange extends Dynamic {
public static void main(String argv[]) throws Exception {
- Security.removeProvider(SUNJCE);
+ Security.removeProvider(PROVIDER);
Security.addProvider(new com.sun.crypto.provider.SunJCE());
new TestAESWithProviderChange().run(argv);
}
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java
index 81761a7ea4b..677f9aa913a 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/TestAESWithRemoveAddProvider.java
@@ -34,8 +34,8 @@
public class TestAESWithRemoveAddProvider extends Dynamic {
public static void main(String argv[]) throws Exception {
- Provider pJCE = Security.getProvider(SUNJCE);
- Security.removeProvider(SUNJCE);
+ Provider pJCE = Security.getProvider(PROVIDER);
+ Security.removeProvider(PROVIDER);
Security.addProvider(pJCE);
new TestAESWithRemoveAddProvider().run(argv);
}
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy
index 175e9cb86e5..5c6a06beb02 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestAESCiphers/testAES.policy
@@ -1,6 +1,7 @@
grant codeBase "file:${test.classes}/*" {
- permission java.security.SecurityPermission "removeProvider.SunJCE";
- permission java.security.SecurityPermission "insertProvider.SunJCE";
+ permission java.security.SecurityPermission "removeProvider.*";
+ permission java.security.SecurityPermission "insertProvider.*";
permission java.lang.RuntimePermission
"accessClassInPackage.com.sun.crypto.provider";
+ permission java.util.PropertyPermission "test.provider.name", "read";
};
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java
index c6c7a66c5e4..87d08b2c4a7 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -43,7 +43,8 @@
public class TestCICOWithGCM {
public static void main(String[] args) throws Exception {
//init Secret Key
- KeyGenerator kg = KeyGenerator.getInstance("AES", "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance("AES",
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(128);
SecretKey key = kg.generateKey();
@@ -53,9 +54,11 @@ public static void main(String[] args) throws Exception {
rdm.nextBytes(plainText);
//init ciphers
- Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
encCipher.init(Cipher.ENCRYPT_MODE, key);
- Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
decCipher.init(Cipher.DECRYPT_MODE, key, encCipher.getParameters());
//init cipher streams
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java
index 80732762297..960dd66567a 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCMAndAAD.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -39,7 +39,8 @@
public class TestCICOWithGCMAndAAD {
public static void main(String[] args) throws Exception {
//init Secret Key
- KeyGenerator kg = KeyGenerator.getInstance("AES", "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance("AES",
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(128);
SecretKey key = kg.generateKey();
@@ -53,10 +54,12 @@ public static void main(String[] args) throws Exception {
byte[] aad2 = aad.clone();
aad2[50]++;
- Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
encCipher.init(Cipher.ENCRYPT_MODE, key);
encCipher.updateAAD(aad);
- Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
decCipher.init(Cipher.DECRYPT_MODE, key, encCipher.getParameters());
decCipher.updateAAD(aad);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java
index 697da6750ad..70a9dd5998f 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestCopySafe.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -57,7 +57,8 @@ public class TestCopySafe {
public static void main(String[] argv) throws Exception {
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
AlgorithmParameterSpec params = null;
boolean result = true;
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java
index 0777508b36f..d94753e941e 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -68,7 +68,8 @@ private static void checkISE(Cipher c) throws Exception {
}
public void test() throws Exception {
- Cipher c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ Cipher c = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
SecretKey key = new SecretKeySpec(new byte[16], "AES");
// First try parameter-less init.
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java
index 9b91e612c35..26b160eaae1 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -45,7 +45,8 @@ public class TestISO10126Padding {
private TestISO10126Padding() throws Exception {
// setup
- KeyGenerator kg = KeyGenerator.getInstance(ALGO, "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(KEYSIZE*8);
key = kg.generateKey();
}
@@ -59,7 +60,8 @@ private void runTest(int dataLength) throws Exception {
// TEST#1 --
// generate the cipher text using manually-supplied
// XML Encryption padding
- Cipher ci = Cipher.getInstance(TRANS + "/NoPadding", "SunJCE");
+ Cipher ci = Cipher.getInstance(TRANS + "/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
ci.init(Cipher.ENCRYPT_MODE, key);
byte[] paddedData = new byte[ci.getBlockSize()];
System.arraycopy(data, 0, paddedData, 0, data.length);
@@ -68,7 +70,8 @@ private void runTest(int dataLength) throws Exception {
byte[] cipherText = ci.doFinal(paddedData);
// decrypt using ISO10126Padding
- ci = Cipher.getInstance(TRANS + "/ISO10126Padding", "SunJCE");
+ ci = Cipher.getInstance(TRANS + "/ISO10126Padding",
+ System.getProperty("test.provider.name", "SunJCE"));
ci.init(Cipher.DECRYPT_MODE, key);
byte[] recovered = ci.doFinal(cipherText);
if (!Arrays.equals(data, recovered)) {
@@ -76,7 +79,8 @@ private void runTest(int dataLength) throws Exception {
}
// TEST#2 --
// generate the cipher text using ISO10126Padding
- ci = Cipher.getInstance(TRANS + "/ISO10126Padding", "SunJCE");
+ ci = Cipher.getInstance(TRANS + "/ISO10126Padding",
+ System.getProperty("test.provider.name", "SunJCE"));
ci.init(Cipher.ENCRYPT_MODE, key);
cipherText = ci.doFinal(data);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java
index a9576e7f3eb..71f07d61b13 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -83,7 +83,8 @@ private static byte[] constructByteArray(String s) {
public boolean execute() throws Exception {
String transformation = ALGO+"/"+MODE+"/"+PADDING;
- Cipher c = Cipher.getInstance(transformation, "SunJCE");
+ Cipher c = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
for (int i=0; i
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java
index 098232b8c4c..623f5f5d281 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VK.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -707,7 +707,8 @@ private static byte[] constructByteArray(String s) {
public boolean execute() throws Exception {
String transformation = ALGO+"/"+MODE+"/"+PADDING;
- Cipher c = Cipher.getInstance(transformation, "SunJCE");
+ Cipher c = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
for (int i=0; i
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java
index b8f83bd7b05..6265ca10281 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForECB_VT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -513,7 +513,8 @@ private static byte[] constructByteArray(String s) {
public boolean execute() throws Exception {
String transformation = ALGO+"/"+MODE+"/"+PADDING;
- Cipher c = Cipher.getInstance(transformation, "SunJCE");
+ Cipher c = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
for (int i=0; i
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java
index bdcf465f854..70db7b166e8 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -278,7 +278,8 @@ public String toString() {
};
void executeArray(TestVector tv) throws Exception {
- Cipher c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ Cipher c = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
try {
System.out.println("Test #" + tv.id + ": byte[].");
@@ -320,7 +321,8 @@ void executeArray(TestVector tv) throws Exception {
}
void executeByteBuffer(TestVector tv, boolean direct, int offset) throws Exception {
- Cipher c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ Cipher c = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
ByteBuffer src;
ByteBuffer ctdst;
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java
index 9747f3bced2..a32f787a72a 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNoPaddingModes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, 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
@@ -42,7 +42,8 @@ public class TestNoPaddingModes {
};
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
String transformation;
for (String mode : MODES) {
for (String padding : PADDINGS) {
@@ -50,7 +51,8 @@ public static void main(String[] args) throws Exception {
System.out.println("Test using " + transformation);
try {
- Cipher c = Cipher.getInstance(transformation, "SunJCE");
+ Cipher c = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
throw new RuntimeException("=> Fail, no exception thrown");
} catch (NoSuchAlgorithmException | NoSuchPaddingException ex) {
System.out.println("=> Expected ex: " + ex);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java
index 3ed865f5a98..140f24d51d1 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestNonexpanding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2024, 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
@@ -45,7 +45,8 @@
public class TestNonexpanding {
private static final String ALGORITHM = "AES";
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunJCE");
private static final String[] MODES = { "ECb", "CbC", "OFB", "OFB150",
"cFB", "CFB7", "cFB8", "cFB16", "cFB24", "cFB32", "Cfb40", "cfB48",
"cfB56", "cfB64", "cfB72", "cfB80", "cfB88", "cfB96", "cfb104",
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java
index e158bc54652..cc8c050396e 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestSameBuffer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2024, 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
@@ -47,7 +47,8 @@
public class TestSameBuffer {
private static final String ALGORITHM = "AES";
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunJCE");
private static final String[] MODES = { "ECb", "CbC", "OFB", "CFB150",
"cFB", "CFB7", " cFB8", "cFB16", "cFB24", "cFB32", "Cfb40",
"cfB48", " cfB56", "cfB64", "cfB72", "cfB80", "cfB88", "cfB96",
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java
index 52d6c43bdb1..fe1f76c0a04 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2024, 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
@@ -71,7 +71,7 @@ private static void runTest() throws Exception {
for (int i = 0; i < MODES.length; i++) {
System.out.println("===== TESTING MODE " + MODES[i] + " =====");
Cipher ci = Cipher.getInstance(ALGO+"/"+MODES[i]+"/PKCS5Padding",
- "SunJCE");
+ System.getProperty("test.provider.name", "SunJCE"));
TestShortBuffer test = null;
int stored = 0;
AlgorithmParameters params = null;
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java b/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java
index 6d985312b6b..1073985c18c 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/CTR/CounterMode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -162,7 +162,8 @@ public static void main(String[] args) throws Exception {
continue;
}
System.out.println("Running test " + i + " (" + alg + ")");
- Cipher cipher = Cipher.getInstance(alg + "/CTR/NoPadding", "SunJCE");
+ Cipher cipher = Cipher.getInstance(alg + "/CTR/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
SecretKeySpec key = new SecretKeySpec(KEYS[i], alg);
IvParameterSpec iv = new IvParameterSpec(IVS[i]);
byte[] plainText = PLAIN[i];
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java b/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java
index 6dba280899f..6d34fd3d50b 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/CTS/CTSMode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -156,7 +156,7 @@ private static void test1() throws Exception {
}
System.out.println("Running test1_" + i + " (" + algo + ")");
Cipher cipher = Cipher.getInstance(algo+ "/CTS/NoPadding",
- "SunJCE");
+ System.getProperty("test.provider.name", "SunJCE"));
byte[] plainText = PLAIN1[i];
byte[] cipherText = CIPHER1[i];
cipher.init(Cipher.ENCRYPT_MODE, KEY1, IV1);
@@ -194,7 +194,8 @@ private static void test2() throws Exception {
continue;
}
Cipher cipher =
- Cipher.getInstance(algo+"/CTS/NoPadding", "SunJCE");
+ Cipher.getInstance(algo+"/CTS/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
int blockSize = cipher.getBlockSize();
SecretKeySpec key = new SecretKeySpec(new byte[keySize], algo);
// Make sure encryption works for inputs with valid length
@@ -226,7 +227,8 @@ private static void test2() throws Exception {
IvParameterSpec iv2 = new IvParameterSpec(IV2_SRC, 0, blockSize);
cipher.init(Cipher.ENCRYPT_MODE, key, iv2);
Cipher cipher2 =
- Cipher.getInstance(algo+"/CBC/NoPadding", "SunJCE");
+ Cipher.getInstance(algo+"/CBC/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
cipher2.init(Cipher.ENCRYPT_MODE, key, iv2);
byte[] eout = cipher.doFinal(IV2_SRC, 0, blockSize);
@@ -294,7 +296,8 @@ private static void test3() throws Exception {
continue;
}
Cipher cipher =
- Cipher.getInstance(algo+ "/CTS/NoPadding", "SunJCE");
+ Cipher.getInstance(algo+ "/CTS/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
byte[] plainText = PLAIN1[i];
byte[] cipherText = CIPHER1[i];
byte[] enc = new byte[plainText.length];
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java b/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java
index c1447eb3e51..a71390b504e 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/DES/KeyWrapping.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2024, 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
@@ -24,16 +24,19 @@
/*
* @test
* @bug 0000000
+ * @library /test/lib
* @summary KeyWrapping
* @author Jan Luehe
*/
import javax.crypto.*;
import java.security.*;
+import jdk.test.lib.security.SecurityUtils;
public class KeyWrapping {
public static void main(String[] args) throws Exception {
- Cipher c1 = Cipher.getInstance("DES", "SunJCE");
+ Cipher c1 = Cipher.getInstance("DES",
+ System.getProperty("test.provider.name", "SunJCE"));
Cipher c2 = Cipher.getInstance("DES");
KeyGenerator keyGen = KeyGenerator.getInstance("DES");
@@ -70,8 +73,9 @@ public static void main(String[] args) throws Exception {
if (!msg.equals(new String(clearText)))
throw new Exception("The unwrapped session key is corrupted.");
- KeyPairGenerator kpairGen = KeyPairGenerator.getInstance("DSA");
- kpairGen.initialize(1024);
+ String kpgAlgorithm = "DSA";
+ KeyPairGenerator kpairGen = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpairGen.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kpair = kpairGen.genKeyPair();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/DES/Sealtest.java b/test/jdk/com/sun/crypto/provider/Cipher/DES/Sealtest.java
index abc536f14e2..d4b2173358c 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/DES/Sealtest.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/DES/Sealtest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -24,20 +24,23 @@
/*
* @test
* @bug 0000000 7055362
+ * @library /test/lib
* @summary Sealtest
* @author Jan Luehe
*/
import java.io.*;
import java.security.*;
import javax.crypto.*;
+import jdk.test.lib.security.SecurityUtils;
public class Sealtest {
public static void main(String[] args) throws Exception {
// create DSA keypair
- KeyPairGenerator kpgen = KeyPairGenerator.getInstance("DSA");
- kpgen.initialize(512);
+ String kpgAlgorithm = "DSA";
+ KeyPairGenerator kpgen = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpgen.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpgen.generateKeyPair();
// create DES key
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/NISTWrapKAT.java b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/NISTWrapKAT.java
index 3da7c7072f0..a79f48196d1 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/NISTWrapKAT.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/NISTWrapKAT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2024, 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
@@ -259,9 +259,12 @@ public void testKeyWrap(String algo, String key, int keyLen,
System.out.println("=> skip, exceeds max allowed size " + allowed);
return;
}
- Cipher c1 = Cipher.getInstance(algo, "SunJCE");
- Cipher c2 = Cipher.getInstance(algo, "SunJCE");
- Cipher c3 = Cipher.getInstance(algo, "SunJCE");
+ Cipher c1 = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
+ Cipher c2 = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
+ Cipher c3 = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
byte[] keyVal = toBytes(key, keyLen << 1);
byte[] dataVal = toBytes(data, dataLen << 1);
@@ -318,9 +321,12 @@ public void testEnc(String algo, String key, int keyLen, String data, int dataLe
System.out.println("=> skip, exceeds max allowed size " + allowed);
return;
}
- Cipher c1 = Cipher.getInstance(algo, "SunJCE");
- Cipher c2 = Cipher.getInstance(algo, "SunJCE");
- Cipher c3 = Cipher.getInstance(algo, "SunJCE");
+ Cipher c1 = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
+ Cipher c2 = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
+ Cipher c3 = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
byte[] keyVal = toBytes(key, keyLen << 1);
byte[] dataVal = toBytes(data, dataLen << 1);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java
index 2da8c3c86f0..aa073dc2290 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -50,15 +50,18 @@
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
+import jdk.test.lib.security.SecurityUtils;
/*
* @test
* @bug 8048599 8248268
+ * @library /test/lib
* @summary Tests for key wrap and unwrap operations
*/
public class TestCipherKeyWrapperTest {
- private static final String SUN_JCE = "SunJCE";
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunJCE");
// Blowfish Variable key length: 32 bits to 448 bits
private static final int BLOWFISH_MIN_KEYSIZE = 32;
private static final int BLOWFISH_MAX_KEYSIZE = 448;
@@ -152,14 +155,15 @@ public static void main(String[] args) throws Exception {
// PBE and public wrapper test.
String[] publicPrivateAlgos = new String[] { "DiffieHellman", "DSA",
"RSA" };
- Provider provider = Security.getProvider(SUN_JCE);
+ Provider provider = Security.getProvider(PROVIDER_NAME);
if (provider == null) {
- throw new RuntimeException("SUN_JCE provider not exist");
+ throw new RuntimeException(PROVIDER_NAME + " provider not exist");
}
test.wrapperPBEKeyTest(provider);
// Public and private key wrap test
- test.wrapperPublicPriviteKeyTest(provider, publicPrivateAlgos);
+ test.wrapperPublicPriviteKeyTest(provider, publicPrivateAlgos, "DES");
+ test.wrapperPublicPriviteKeyTest(provider, publicPrivateAlgos, "AES");
}
private void wrapperAesDESedeKeyTest(String algo, String wrapAlgo,
@@ -253,7 +257,7 @@ private void wrapperPBEKeyTest(Provider p) throws InvalidKeySpecException,
}
}
- private void wrapperPublicPriviteKeyTest(Provider p, String[] algorithms)
+ private void wrapperPublicPriviteKeyTest(Provider p, String[] algorithms, String algoWrap)
throws NoSuchAlgorithmException, InvalidKeyException,
NoSuchPaddingException, IllegalBlockSizeException,
InvalidAlgorithmParameterException {
@@ -262,10 +266,9 @@ private void wrapperPublicPriviteKeyTest(Provider p, String[] algorithms)
System.out.println("Generate key pair (algorithm: " + algo
+ ", provider: " + p.getName() + ")");
KeyPairGenerator kpg = KeyPairGenerator.getInstance(algo);
- kpg.initialize(512);
+ kpg.initialize(SecurityUtils.getTestKeySize(algo));
KeyPair kp = kpg.genKeyPair();
// key generated
- String algoWrap = "DES";
KeyGenerator kg = KeyGenerator.getInstance(algoWrap, p);
Key key = kg.generateKey();
wrapTest(algo, algoWrap, key, kp.getPrivate(), Cipher.PRIVATE_KEY,
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java
index 33046c558c1..68545f9e36c 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestGeneral.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2024, 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
@@ -176,7 +176,8 @@ public static void main(String[] argv) throws Exception {
String ALGO = "AES/KW/PKCS5Padding";
System.out.println("Testing " + ALGO);
- Cipher c = Cipher.getInstance(ALGO, "SunJCE");
+ Cipher c = Cipher.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
// test all possible pad lengths, i.e. 1 - 16
for (int i = 1; i <= MAX_KW_PKCS5PAD_LEN; i++) {
@@ -187,7 +188,8 @@ public static void main(String[] argv) throws Exception {
ALGO = "AES/KW/NoPadding";
System.out.println("Testing " + ALGO);
- c = Cipher.getInstance(ALGO, "SunJCE");
+ c = Cipher.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
testEnc(c, data, data.length, KW_IV_LEN, 0);
testEnc(c, data, data.length >> 1, KW_IV_LEN, 0);
testWrap(c, data, data.length, KW_IV_LEN, 0);
@@ -196,7 +198,8 @@ public static void main(String[] argv) throws Exception {
ALGO = "AES/KWP/NoPadding";
System.out.println("Testing " + ALGO);
- c = Cipher.getInstance(ALGO, "SunJCE");
+ c = Cipher.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
// test all possible pad lengths, i.e. 0 - 7
for (int i = 0; i <= MAX_KWP_PAD_LEN; i++) {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java
index f1b686707e2..ea8ac397ebb 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/TestKeySizeCheck.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2024, 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 8248268
+ * @bug 8248268 8302225
* @summary Verify cipher key size restriction is enforced properly with IKE
* @run main TestKeySizeCheck
*/
@@ -43,6 +43,8 @@ public class TestKeySizeCheck {
}
}
+ private static final int[] AES_KEYSIZES = { 128, 192, 256 };
+
private static SecretKey getKey(int sizeInBytes) {
if (sizeInBytes <= BYTES_32.length) {
return new SecretKeySpec(BYTES_32, 0, sizeInBytes, "AES");
@@ -59,12 +61,13 @@ public static void test(String algo, int[] invalidKeySizes)
throws Exception {
System.out.println("Testing " + algo);
- Cipher c = Cipher.getInstance(algo, "SunJCE");
+ Cipher c = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
int[] modes = { Cipher.ENCRYPT_MODE, Cipher.WRAP_MODE };
for (int ks : invalidKeySizes) {
System.out.println("keysize: " + ks);
- SecretKey key = getKey(ks);
+ SecretKey key = getKey(ks >> 3);
for (int m : modes) {
try {
@@ -72,11 +75,25 @@ public static void test(String algo, int[] invalidKeySizes)
throw new RuntimeException("Expected IKE not thrown for "
+ getModeStr(m));
} catch (InvalidKeyException ike) {
- System.out.println(" => expected IKE thrown for "
- + getModeStr(m));
+ System.out.println(getModeStr(m) + " => got expected IKE");
}
}
}
+
+ // now test against the valid key size(s) and make sure they work
+ int underscoreIdx = algo.indexOf("_");
+ int[] validKeySizes = (algo.indexOf("_") == -1 ?
+ AES_KEYSIZES : new int[] { Integer.parseInt(algo.substring
+ (underscoreIdx + 1, underscoreIdx + 4)) });
+ for (int ks : validKeySizes) {
+ System.out.println("keysize: " + ks);
+ SecretKey key = getKey(ks >> 3);
+
+ for (int m : modes) {
+ c.init(m, key);
+ System.out.println(getModeStr(m) + " => ok");
+ }
+ }
}
public static void main(String[] argv) throws Exception {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java
index 90cfacf36fd..e9d9038ada9 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/KeyWrap/XMLEncKAT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2024, 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
@@ -111,7 +111,8 @@ public static void testKeyWrap(String cAlg, byte[] cKeyVal,
String cKeyAlg, String[] base64Wrapped) throws Exception {
System.out.println("Testing " + cAlg + " Cipher with " +
8*cKeyVal.length + "-bit key");
- Cipher c = Cipher.getInstance(cAlg, "SunJCE");
+ Cipher c = Cipher.getInstance(cAlg,
+ System.getProperty("test.provider.name", "SunJCE"));
SecretKey cKey = new SecretKeySpec(cKeyVal, cKeyAlg);
c.init(Cipher.UNWRAP_MODE, cKey);
Key[] key = new SecretKey[base64Wrapped.length];
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java
index 9ec85c8eea0..c385a6ab4cf 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/DecryptWithoutParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -40,7 +40,8 @@ public class DecryptWithoutParameters {
public static void main(String argv[]) throws Exception {
String algo = "PBEWithMD5AndDES";
- Cipher cipher = Cipher.getInstance(algo, "SunJCE");
+ Cipher cipher = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
SecretKey key = new SecretKeySpec(new byte[5], algo);
try {
cipher.init(Cipher.DECRYPT_MODE, key);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java
index 9c4cc3663c1..736e0a9fe64 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/NegativeLength.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -38,7 +38,9 @@ public class NegativeLength {
public static void main(String[] args) throws Exception {
SecretKeyFactory skf = SecretKeyFactory.getInstance(
- "PBKDF2WithHmacSHA1", "SunJCE");
+ "PBKDF2WithHmacSHA1",
+ System.getProperty("test.provider.name", "SunJCE"));
+
// Create a valid PBEKeySpec
PBEKeySpec pbeks = new PBEKeySpec(
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java
index 3be7ecd8893..20642f6ca58 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEInvalidParamsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -65,7 +65,8 @@ public static void main(String[] args) throws Exception {
System.out.println("=>testing " + algo);
SecretKeyFactory skf = SecretKeyFactory.getInstance(algo);
SecretKey key = skf.generateSecret(ks);
- Cipher c = Cipher.getInstance(algo, "SunJCE");
+ Cipher c = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
try {
c.init(Cipher.ENCRYPT_MODE, key, INVALID_PARAMS);
throw new Exception("Test Failed: expected IAPE is " +
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java
index 03da1d9c9a9..77cf745fb3b 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeyCleanupTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2024, 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,6 +23,7 @@
/*
* @test
+ * @library /test/lib
* @modules java.base/com.sun.crypto.provider:+open
* @run main/othervm PBEKeyCleanupTest
* @summary Verify that key storage is cleared
@@ -38,6 +39,7 @@
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
+import jdk.test.lib.security.SecurityUtils;
/**
* Test that the array holding the key bytes is cleared when it is
@@ -45,7 +47,8 @@
*/
public class PBEKeyCleanupTest {
- private final static String SunJCEProvider = "SunJCE";
+ private final static String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunJCE");
private static final String PASS_PHRASE = "some hidden string";
private static final int ITERATION_COUNT = 1000;
@@ -60,19 +63,19 @@ private static void testPBESecret(String algorithm) throws Exception {
char[] password = new char[] {'f', 'o', 'o'};
PBEKeySpec pbeKeySpec = new PBEKeySpec(password);
SecretKeyFactory keyFac =
- SecretKeyFactory.getInstance(algorithm, SunJCEProvider);
+ SecretKeyFactory.getInstance(algorithm, PROVIDER_NAME);
testCleanupSecret(algorithm, keyFac.generateSecret(pbeKeySpec));
}
private static void testPBKSecret(String algorithm) throws Exception {
- byte[] salt = new byte[8];
+ byte[] salt = new byte[SecurityUtils.getTestSaltSize()];
new Random().nextBytes(salt);
char[] password = new char[] {'f', 'o', 'o'};
PBEKeySpec pbeKeySpec = new PBEKeySpec(PASS_PHRASE.toCharArray(), salt,
ITERATION_COUNT, KEY_SIZE);
SecretKeyFactory keyFac =
- SecretKeyFactory.getInstance(algorithm, SunJCEProvider);
+ SecretKeyFactory.getInstance(algorithm, PROVIDER_NAME);
testCleanupSecret(algorithm, keyFac.generateSecret(pbeKeySpec));
}
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java
index 35221709350..296eca5ac4a 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEKeysAlgorithmNames.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -57,7 +57,8 @@ public static void main(String[] argv) throws Exception {
for (String s : algs) {
System.out.println("Testing " + s);
- SecretKeyFactory skf = SecretKeyFactory.getInstance(s, "SunJCE");
+ SecretKeyFactory skf = SecretKeyFactory.getInstance(s,
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println(" Checking skf.getAlgorithm()");
if (!skf.getAlgorithm().equalsIgnoreCase(s)) {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java
index 7afc354cea6..79e32de4306 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBEParametersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -59,7 +59,8 @@ public static void main(String[] args) throws Exception {
String algo = PBE_ALGOS[i];
SecretKeyFactory skf = SecretKeyFactory.getInstance(algo);
SecretKey key = skf.generateSecret(ks);
- Cipher c = Cipher.getInstance(algo, "SunJCE");
+ Cipher c = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
c.init(Cipher.ENCRYPT_MODE, key);
c.doFinal(new byte[10]); // force the generation of parameters
AlgorithmParameters params = c.getParameters();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java
index 4fe20f8cbac..cba73f325c6 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESameBuffer/PBESameBuffer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -81,7 +81,7 @@ public static void main(String[] args) {
public boolean test(String[] args, PrintStream out) {
boolean result = true;
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
for (int loop : OFFSETS) {
OUTPUT_OFFSET = loop;
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java
index f97acd547a8..6a4bc0692d0 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PBESealedObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -76,9 +76,12 @@ public class PBESealedObject {
"PBEWithHmacSHA512AndAES_256"
};
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunJCE");
+
public static void main(String[] args) {
PBESealedObject test = new PBESealedObject();
- Provider sunjce = Security.getProvider("SunJCE");
+ Provider sunjce = Security.getProvider(PROVIDER_NAME);
if (!test.runAll(sunjce, System.out)) {
throw new RuntimeException("One or more tests have failed....");
@@ -158,7 +161,7 @@ public boolean runTest(Provider p, String algo, PrintStream out)
return false;
}
- unsealedKey = (SecretKey) so.getObject(key, "SunJCE");
+ unsealedKey = (SecretKey) so.getObject(key, PROVIDER_NAME);
return Arrays.equals(unsealedKey.getEncoded(), key.getEncoded());
} catch (InvalidKeyException ex) {
if (baseAlgo.endsWith("TRIPLEDES") || baseAlgo.endsWith("AES_256")) {
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java
index 9f80b0ae152..d19da00b638 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12Cipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -84,7 +84,8 @@ public static void main(String[] argv) throws Exception {
new SecureRandom().nextBytes(input);
char[] PASSWD = { 'p','a','s','s','w','o','r','d' };
long start = System.currentTimeMillis();
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + p.getName() + "...");
runTest("PBEWithSHA1AndDESede", input, PASSWD, p);
runTest("PBEWithSHA1AndRC2_40", input, PASSWD, p);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java
index 7943e8d228f..a5911a91ebf 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/PKCS12CipherKAT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -179,7 +179,8 @@ private static Test t(String alg, String plaintext, char[] password,
static void runTests(Test[] tests) throws Exception {
long start = System.currentTimeMillis();
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + p.getName() + "...");
Cipher.getInstance("PBEWithSHA1AndRC2_40", p);
Cipher.getInstance("PBEWithSHA1AndDESede", p);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java
index 437b8ff26d5..4aa83133840 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherKeyWrapperPBEKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -79,7 +79,8 @@ public class TestCipherKeyWrapperPBEKey {
public static void main(String[] args) {
TestCipherKeyWrapperPBEKey test = new TestCipherKeyWrapperPBEKey();
- Provider sunjce = Security.getProvider("SunJCE");
+ Provider sunjce = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
if (!test.runAll(sunjce, System.out)) {
throw new RuntimeException("One or more tests have failed....");
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java b/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java
index e3167068029..a3432c1ba93 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/PBE/TestCipherPBECons.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -40,14 +40,15 @@
public class TestCipherPBECons {
private static final String[] PBEAlgorithms = {"pbeWithMD5ANDdes",
- "PBEWithMD5AndTripleDES"};
+ "PBEWithMD5AndTripleDES", "PBEWithSHA1AndDESede"};
private static final String[] cipherModes = {"ECb", "cbC", "cFB", "Cfb32",
"OfB", "oFb64", "pCbC"};
private static final String[] cipherPaddings = {"Pkcs5Padding", "NoPaDDing"};
public static void main(String[] args) {
TestCipherPBECons test = new TestCipherPBECons();
- Provider sunjce = Security.getProvider("SunJCE");
+ Provider sunjce = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
if (!test.runAll(sunjce, System.out)) {
throw new RuntimeException("One or more tests have failed....");
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java
index 28d22e22f75..0775336ca26 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -47,9 +47,10 @@ public class TestOAEP {
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- cp = Security.getProvider("SunJCE");
+ cp = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + cp.getName() + "...");
- Provider kfp = Security.getProvider("SunRsaSign");
+ Provider kfp = Security.getProvider(
+ System.getProperty("test.provider.name", "SunRsaSign"));
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", kfp);
kpg.initialize(768);
KeyPair kp = kpg.generateKeyPair();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java
index fe1ca35fcc4..3bacff7617d 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPPadding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 8020081 8022669
+ * @library /test/lib
* @summary encryption/decryption test for using OAEPPadding with
* OAEPParameterSpec specified and not specified during a Cipher.init().
* @author Anthony Scarpino
@@ -43,7 +44,7 @@
import javax.crypto.spec.OAEPParameterSpec;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.spec.PSource;
-
+import jdk.test.lib.security.SecurityUtils;
public class TestOAEPPadding {
private static RSAPrivateKey privateKey;
@@ -52,11 +53,14 @@ public class TestOAEPPadding {
static boolean failed = false;
public static void main(String args[]) throws Exception {
- cp = Security.getProvider("SunJCE");
+ cp = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + cp.getName() + "...");
- Provider kfp = Security.getProvider("SunRsaSign");
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", kfp);
- kpg.initialize(2048);
+ Provider kfp = Security.getProvider(
+ System.getProperty("test.provider.name", "SunRsaSign"));
+ String kpgAlgorithm = "RSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, kfp);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpg.generateKeyPair();
privateKey = (RSAPrivateKey)kp.getPrivate();
publicKey = (RSAPublicKey)kp.getPublic();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java
index 9f17da2a711..8578930dbc1 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -44,7 +44,8 @@ private static boolean runTest(String mdName, MGF1ParameterSpec mgfSpec,
byte[] p) throws Exception {
OAEPParameterSpec spec = new OAEPParameterSpec(mdName, "MGF1",
mgfSpec, new PSource.PSpecified(p));
- cp = Security.getProvider("SunJCE");
+ cp = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + cp.getName() + "...");
AlgorithmParameters ap = AlgorithmParameters.getInstance("OAEP", cp);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java
index 308171d766e..6cf66178da7 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPWithParams.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 4923484 8146293
+ * @library /test/lib
* @summary encryption/decryption test for using OAEPParameterSpec.
* @author Valerie Peng
*/
@@ -35,6 +36,7 @@
import javax.crypto.*;
import javax.crypto.spec.PSource;
import javax.crypto.spec.OAEPParameterSpec;
+import jdk.test.lib.security.SecurityUtils;
public class TestOAEPWithParams {
@@ -54,11 +56,14 @@ public class TestOAEPWithParams {
};
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- cp = Security.getProvider("SunJCE");
+ cp = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + cp.getName() + "...");
- Provider kfp = Security.getProvider("SunRsaSign");
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", kfp);
- kpg.initialize(768);
+ Provider kfp = Security.getProvider(
+ System.getProperty("test.provider.name", "SunRsaSign"));
+ String kpgAlgorithm = "RSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, kfp);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpg.generateKeyPair();
privateKey = kp.getPrivate();
publicKey = kp.getPublic();
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java
index 6d43ce1a715..3cbbfc3ba3f 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -57,8 +57,10 @@ public class TestOAEP_KAT {
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- Provider provider = Security.getProvider("SunJCE");
- Provider kfProvider = Security.getProvider("SunRsaSign");
+ Provider provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
+ Provider kfProvider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunRsaSign"));
System.out.println("Testing provider " + provider.getName() + "...");
Cipher c = Cipher.getInstance("RSA/ECB/OAEPwithSHA1andMGF1Padding", provider);
KeyFactory kf = KeyFactory.getInstance("RSA", kfProvider);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java
index 1e4c6ed10b1..610890a5247 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/RSA/TestRSA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -101,20 +101,28 @@ private static int nextNibble(StringReader r) throws IOException {
}
private final static BigInteger N = new BigInteger
- ("116231208661367609700141079576488663663527180869991078124978203037949869"
- +"312762870627991319537001781149083155962615105864954367253799351549459177"
- +"839995715202060014346744789001273681801687605044315560723525700773069112"
- +"214443196787519930666193675297582113726306864236010438506452172563580739"
- +"994193451997175316921");
+ ("188266606413163647033284152746165049309898453322378171182320013745371408"
+ +"184225151227340555539225381200565037956400694325061098310480360339435446"
+ +"755336872372614880713694669514510970895097323213784523223711244354375506"
+ +"545371740274561954822416119304686041493350049135717091225288845575963270"
+ +"990119098295690603875646206002898855577388327774594330896529948536446408"
+ +"529165060686851725546480612209956477350581924733034990053737541249952501"
+ +"521769091148873248215142518797910690254486909784694829645856181407041627"
+ +"170373444275842961547787746324163594572697634605250977434548015081503826"
+ +"85269006571608614747965903308253511034583");
private final static BigInteger E = BigInteger.valueOf(65537);
private final static BigInteger D = new BigInteger
- ("528278531576995741358027120152717979850387435582102361125581844437708890"
- +"736418759997555187916546691958396015481089485084669078137376029510618510"
- +"203389286674134146181629472813419906337170366867244770096128371742241254"
- +"843638089774095747779777512895029847721754360216404183209801002443859648"
- +"26168432372077852785");
+ ("559658959270449023652159986632594861346314765962941829914811303419116045"
+ +"486272857832294696380057096672262714220410818939360476461317579410769250"
+ +"330981320689411092912185059149606517928125605236733543203155054153225543"
+ +"370812803235323701309554652228655108862291812277980776744407549833834128"
+ +"186640306349843950814414209051640048163781518404082259622597528271617305"
+ +"214590875955949331568915021275293633454662841999317653268823194135508673"
+ +"577887397954709453731172900970199673444683653554380810128925964066225098"
+ +"009484055412274405773246950554037029408478181447349886871279557912030178"
+ +"079306593910311097342934485929224862873");
private final static Random RANDOM = new Random();
@@ -154,21 +162,22 @@ public static void testKat(String alg, int mode, Key key, String in, String out,
}
private final static String in2 = "0f:7d:6c:20:75:99:a5:bc:c1:53:b0:4e:8d:ef:98:fb:cf:2d:e5:1d:d4:bf:71:56:12:b7:a3:c3:e4:53:1b:07:d3:bb:94:a7:a7:28:75:1e:83:46:c9:80:4e:3f:ac:b2:47:06:9f:1b:68:38:73:b8:69:9e:6b:8b:8b:23:60:31:ae:ea:36:24:6f:85:af:de:a5:2a:88:7d:6a:9f:8a:9f:61:f6:59:3f:a8:ce:91:75:49:e9:34:b8:9f:b6:21:8c";
- private final static String out2 = "7d:84:d1:3a:dc:ac:46:09:3a:0c:e5:4b:85:5d:fa:bb:52:f1:0f:de:d9:87:ef:b3:f7:c8:e3:9a:29:be:e9:b5:51:57:fd:07:5b:3c:1c:1c:56:aa:0c:a6:3f:79:40:16:ee:2c:2c:2e:fe:b8:3e:fd:45:90:1c:e7:87:1d:0a:0a:c5:de:9d:2b:a9:dd:77:d2:89:ba:98:fe:78:5b:a3:91:b4:ac:b5:ae:ce:45:21:f7:74:97:3e:a9:58:59:bc:14:13:02:3f:09:7b:97:90:b3:bd:53:cb:15:c0:6e:36:ea:d4:a3:3e:fc:94:85:a9:66:7f:57:b4:2a:ae:70:2e:fb";
+ private final static String out2 = "4d:17:15:23:d9:f6:97:4d:4b:5b:9b:37:bd:a7:c5:33:b9:40:1f:c4:63:fa:7c:2a:fb:19:0b:d8:c4:3a:bd:e7:46:6b:1b:09:20:93:39:7c:e5:5f:7b:83:a7:a6:f6:f5:42:20:e7:7f:d3:14:9a:14:25:f9:31:9e:3c:c9:04:20:be:31:ac:77:45:37:4d:76:1b:10:3a:aa:42:c7:df:4c:61:a4:35:4d:28:41:c2:f9:b7:ce:00:94:42:06:c7:35:06:ca:f2:9e:96:c3:89:54:10:82:d8:de:f3:6c:23:8c:47:41:5a:13:fa:33:e0:a5:7f:ec:43:5d:b0:ea:c9:43:17:72:73:ce:11:48:fb:19:ee:13:6a:92:13:06:5c:55:dc:9e:86:b9:fb:44:62:44:9e:a9:e8:bd:6a:c0:c1:64:4b:fd:a9:5d:ef:59:1e:16:fe:64:c1:07:31:9e:9f:4d:4e:28:34:ea:39:e0:65:68:d4:8b:02:0b:8b:ed:bb:a6:a6:4a:29:b9:b5:08:f3:7a:a8:fd:03:3e:0d:d0:9e:25:47:2c:45:f2:40:39:58:e8:95:64:04:2b:50:1e:a5:ff:00:a4:cf:a9:13:4b:17:3a:e8:d1:2c:c1:4a:ab:1c:07:b4:b5:f6:c9:3f:38:48:89:55:59:00:c1:25:c9:d7:68";
private final static String in1 = "17:a3:a7:b1:86:29:06:c5:81:33:cd:2f:da:32:7c:0e:26:a8:18:aa:37:9b:dd:4a:b0:b0:a7:1c:14:82:6c:d9:c9:14:9f:55:19:91:02:0d:d9:d7:95:c2:2b:a6:fa:ba:a3:51:00:83:6b:ec:97:27:40:a3:8f:ba:b1:09:15:11:44:33:c6:3c:47:95:50:71:50:5a:f4:aa:00:4e:b9:48:6a:b1:34:e9:d0:c8:b8:92:bf:95:f3:3d:91:66:93:2b";
- private final static String out1 = "28:b7:b4:73:f2:16:11:c0:67:70:96:ee:dc:3e:23:87:9f:30:a7:e5:f0:db:aa:67:33:27:0e:75:79:af:29:f5:88:3d:93:22:14:d2:59:b4:eb:ce:95:7f:24:74:df:f2:aa:4d:e6:65:5a:63:6d:64:30:ef:31:f1:a6:df:17:42:b6:d1:ed:22:1f:b0:96:69:9d:f8:ce:ff:3a:47:96:51:ba:d9:8d:57:39:40:dc:fc:d3:03:92:39:f4:dd:4b:1b:07:8b:33:60:27:2d:5f:c6:cf:17:92:c6:12:69:a3:54:2e:b8:0f:ca:d9:46:0f:da:95:34:d0:84:35:9c:f6:44";
+ private final static String out1 = "18:6d:d2:89:43:cb:ec:5c:ff:3d:fd:d5:23:2d:aa:fc:db:a7:63:5f:c7:2d:6f:81:c2:9f:aa:47:ed:fc:79:39:8a:6d:8f:c3:d0:f9:64:c3:e1:5f:1a:b3:20:03:1e:8a:3a:c5:58:ef:78:6b:fc:50:98:0a:11:d3:30:d9:68:44:9b:93:a6:b3:92:8f:09:0c:7a:d0:64:ac:e2:c7:b5:6a:37:35:00:3b:4e:d7:64:fb:54:c2:54:90:b9:71:6a:48:c4:6c:1e:e4:e6:4c:3f:fc:34:69:16:b9:53:8c:9f:30:4e:2e:7e:9c:fb:5f:26:18:c0:6e:69:32:18:30:40:59:8c:d1:c2:7a:41:75:06:9d:1c:0f:14:74:a9:f0:47:3a:97:0d:c4:c6:3f:24:ee:ed:c5:f8:2c:b6:ae:1d:e5:64:33:cd:e1:e0:21:d6:10:c0:8b:59:06:59:81:73:28:b4:f4:ef:fa:e8:67:a8:65:a5:e4:3c:c3:7e:99:f8:55:7a:e9:0d:41:3a:bf:c1:8c:41:f3:71:32:b6:c0:05:8b:91:8a:90:35:60:95:52:78:8e:a7:e5:a9:a1:bf:a3:de:55:c6:02:03:d5:98:01:59:fb:91:da:37:9e:3f:39:85:e1:3f:79:23:6c:0e:68:25:4c:13:3a:52:a2:f8:d9:4c:ce";
- private final static String rin1 = "09:01:06:53:a7:96:09:63:ef:e1:3f:e9:8d:95:22:d1:0e:1b:87:c1:a2:41:b2:09:97:a3:5e:e0:a4:1d:59:91:21:e4:ca:87:bf:77:4a:7e:a2:22:ff:59:1e:bd:a4:80:aa:93:4a:41:56:95:5b:f4:57:df:fc:52:2f:46:9b:45:d7:03:ae:22:8e:67:9e:6c:b9:95:4f:bd:8e:e8:67:90:5b:fe:de:2f:11:22:2e:9d:30:93:6d:c0:48:00:cb:08:b9:c4:36:e9:03:7c:08:2d:68:42:cb:71:d0:7d:47:22:c1:58:c5:b8:2f:28:3e:98:78:11:6d:71:5b:3b:36:3c";
- private final static String rout1 = "4a:21:64:20:56:5f:27:0c:90:1d:f3:1b:64:8e:16:d3:af:79:ca:c6:65:56:19:77:8f:25:35:70:be:f3:15:b3:e3:d8:8f:04:ec:c3:60:59:d0:9a:66:be:1c:ad:f7:09:46:a9:09:46:12:5f:28:b6:28:b1:53:fb:fe:07:73:b8:8b:f8:83:64:8e:2d:45:ca:1a:fd:85:4a:2c:fa:fc:e6:58:f7:e4:83:68:8c:38:49:2b:f3:5c:c1:2d:24:6a:cd:22:6d:cb:f4:f1:8c:9e:1a:94:a7:4b:6f:d1:b4:b4:ab:56:8b:a3:a9:89:88:c3:5d:a8:47:2a:67:50:32:71:19";
+ private final static String rin1 = "09:01:06:53:a7:96:09:63:ef:e1:3f:e9:8d:95:22:d1:0e:1b:87:c1:a2:41:b2:09:97:a3:5e:e0:a4:1d:59:91:21:e4:ca:87:bf:77:4a:7e:a2:22:ff:59:1e:bd:a4:80:aa:93:4a:41:56:95:5b:f4:57:df:fc:52:2f:46:9b:45:d7:03:ae:22:8e:67:9e:6c:b9:95:4f:bd:8e:e8:67:90:5b:fe:de:2f:11:22:2e:9d:30:93:6d:c0:48:00:cb:08:b9:c4:36:e9:03:7c:08:2d:68:42:cb:71:d0:7d:47:22:c1:58:c5:b8:2f:28:3e:98:78:11:6d:71:5b:3b:36:3c:09:01:06:53:a7:96:09:63:ef:e1:3f:e9:8d:95:22:d1:0e:1b:87:c1:a2:41:b2:09:97:a3:5e:e0:a4:1d:59:91:21:e4:ca:87:bf:77:4a:7e:a2:22:ff:59:1e:bd:a4:80:aa:93:4a:41:56:95:5b:f4:57:df:fc:52:2f:46:9b:45:d7:03:ae:22:8e:67:9e:6c:b9:95:4f:bd:8e:e8:67:90:5b:fe:de:2f:11:22:2e:9d:30:93:6d:c0:48:00:cb:08:b9:c4:36:e9:03:7c:08:2d:68:42:cb:71:d0:7d:47:22:c1:58:c5:b8:2f:28:3e:98:78:11:6d:71:5b:3b:36:3c";
+ private final static String rout1 = "19:dd:a2:f9:57:d4:6b:60:85:ec:2d:5d:f9:64:f8:a0:c0:33:36:a2:8c:59:0f:74:9b:62:a8:ad:42:ed:be:34:0e:dc:13:db:d5:b9:aa:64:38:35:18:d7:6c:1d:da:5b:ff:f2:98:f5:fc:67:36:fb:9f:84:df:84:a3:af:ce:02:e5:05:ca:a7:e4:29:c0:5c:55:6a:8d:dc:8f:f7:6e:d4:ee:2e:6c:5b:ea:f8:bf:4c:7d:5f:af:6a:c3:77:02:80:33:be:13:4c:98:cf:dc:aa:e8:7d:73:69:6e:30:2c:35:c5:90:83:45:0d:64:04:af:b6:94:c3:a8:e2:d4:08:98:1d:b1:73:e3:fc:10:1f:71:0f:d0:13:f3:58:80:c4:a3:a9:02:52:cf:aa:41:b6:9b:69:33:9d:2a:d6:f6:02:07:ec:ce:19:01:f1:2f:90:27:fe:00:a5:d7:8d:01:97:36:fd:88:34:2f:f3:ab:38:ed:9d:69:91:af:b2:0d:ca:92:ca:9e:e7:24:37:d6:e3:c7:02:30:69:5b:ea:b4:b2:68:5f:4e:8c:cc:fd:bb:2e:96:2f:a3:c6:f7:71:93:24:5c:ca:8f:bc:f9:d8:bd:d3:b9:d1:16:ba:5a:ac:62:41:b4:d8:56:45:74:55:c2:a5:ef:23:f5:e3:27:ce:99:97:e9";
- private final static String rin2 = "1b:49:a6:7a:83:1c:b6:28:47:16:2f:be:6a:d3:28:a6:83:07:4f:50:be:5c:99:26:2a:15:b8:21:a8:cc:8a:45:93:07:ff:32:67:3c:a4:92:d2:cd:43:eb:f5:2e:09:79:c8:32:3a:9d:00:4c:f5:6e:65:b2:ca:9c:c2:d5:35:8e:fe:6c:ba:1a:7b:65:c1:4f:e9:6c:cb:5d:9f:13:5d:5f:be:32:cd:91:ed:8b:d7:d7:e9:d6:5c:cc:11:7b:d9:ff:7a:93:de:e4:81:92:56:0c:52:47:75:56:a8:e0:9a:55:16:0c:43:df:ae:be:a1:6a:9d:5a:be:fc:51:ea:52:0c";
- private final static String rout2 = "65:28:b9:48:8d:68:3f:5e:9a:85:e7:09:78:4c:0c:0e:60:6c:89:43:3c:d3:72:b9:2f:5a:eb:4f:15:77:93:9d:47:05:a6:52:48:72:ee:ce:e8:5a:6d:28:b0:06:5a:a1:93:58:a1:61:3f:9b:42:0d:c1:ec:32:0a:7a:1e:38:45:47:87:52:16:62:c9:44:c6:04:4d:82:64:01:f4:b1:26:dc:7f:61:82:52:7a:f6:6b:ab:22:98:87:93:63:4c:3f:92:c7:5b:cc:e5:2b:15:db:f7:d3:c7:b5:38:6f:15:3b:1e:88:3d:31:0c:b4:f9:6d:66:41:b7:1b:a0:4a:b8:16";
+ private final static String rin2 = "1b:49:a6:7a:83:1c:b6:28:47:16:2f:be:6a:d3:28:a6:83:07:4f:50:be:5c:99:26:2a:15:b8:21:a8:cc:8a:45:93:07:ff:32:67:3c:a4:92:d2:cd:43:eb:f5:2e:09:79:c8:32:3a:9d:00:4c:f5:6e:65:b2:ca:9c:c2:d5:35:8e:fe:6c:ba:1a:7b:65:c1:4f:e9:6c:cb:5d:9f:13:5d:5f:be:32:cd:91:ed:8b:d7:d7:e9:d6:5c:cc:11:7b:d9:ff:7a:93:de:e4:81:92:56:0c:52:47:75:56:a8:e0:9a:55:16:0c:43:df:ae:be:a1:6a:9d:5a:be:fc:51:ea:52:0c:1b:49:a6:7a:83:1c:b6:28:47:16:2f:be:6a:d3:28:a6:83:07:4f:50:be:5c:99:26:2a:15:b8:21:a8:cc:8a:45:93:07:ff:32:67:3c:a4:92:d2:cd:43:eb:f5:2e:09:79:c8:32:3a:9d:00:4c:f5:6e:65:b2:ca:9c:c2:d5:35:8e:fe:6c:ba:1a:7b:65:c1:4f:e9:6c:cb:5d:9f:13:5d:5f:be:32:cd:91:ed:8b:d7:d7:e9:d6:5c:cc:11:7b:d9:ff:7a:93:de:e4:81:92:56:0c:52:47:75:56:a8:e0:9a:55:16:0c:43:df:ae:be:a1:6a:9d:5a:be:fc:51:ea:52:0c";
+ private final static String rout2 = "7a:11:19:cf:76:97:4b:29:48:66:69:e7:f0:db:18:53:d4:50:71:a4:9d:90:47:9f:e6:8a:f3:ba:2e:96:fd:c8:4b:02:7e:06:a9:2b:47:0d:68:3c:6a:f9:21:62:77:0d:4e:e1:1b:82:97:66:13:01:c2:3b:b2:d3:f8:9e:cc:c9:2a:1a:76:05:3f:d4:f7:fb:9d:9b:bf:a8:2d:fd:81:e5:f4:bb:ca:3b:5f:93:ea:ef:88:1c:c1:18:52:38:be:50:42:29:08:d9:65:43:5f:01:7d:50:22:7a:2f:f1:29:14:95:30:c1:b8:fd:eb:da:c1:4e:8a:ef:97:84:f9:cf:34:ab:89:a6:3c:4a:ff:a4:98:a8:7c:c6:2c:c3:e3:10:a9:8b:67:32:47:35:37:15:03:3b:d0:f3:23:fc:bb:42:64:a2:ba:63:3e:94:6e:7a:e6:94:05:79:29:28:d5:99:5b:f9:67:fd:ea:d3:5f:b5:7b:f4:10:9b:0a:1c:20:6b:0c:59:56:76:45:07:56:cb:d0:ab:08:fc:19:8e:f1:27:03:22:f1:e9:23:d3:01:b1:4d:cf:96:f7:a6:44:59:de:2a:52:fd:bb:14:ae:39:c4:e4:0f:4e:10:f7:c6:61:79:0a:a6:4c:ed:ee:d7:40:fe:ef:f3:85:ae:3e:f3:bb:6e:de";
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- p = Security.getProvider("SunJCE");
+ p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + p.getName() + "...");
KeyFactory kf;
@@ -189,8 +198,8 @@ public static void main(String[] args) throws Exception {
// blocktype 1
testEncDec("RSA/ECB/PKCS1Padding", 96, privateKey, publicKey);
- testEncDec("RSA/ECB/NoPadding", 128, publicKey, privateKey);
- testEncDec("RSA/ECB/NoPadding", 128, privateKey, publicKey);
+ testEncDec("RSA/ECB/NoPadding", 256, publicKey, privateKey);
+ testEncDec("RSA/ECB/NoPadding", 256, privateKey, publicKey);
// expected failure, blocktype 2 random padding bytes are different
testKat("RSA/ECB/PKCS1Padding", Cipher.ENCRYPT_MODE, publicKey, in2, out2, false);
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java b/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java
index b5e50c842a0..dd3568f2e19 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/TestCipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -44,7 +44,7 @@
*/
public abstract class TestCipher {
- private final String SUNJCE = "SunJCE";
+ private final String PROVIDER_NAME = System.getProperty("test.provider.name", "SunJCE");
private final String ALGORITHM;
private final String[] MODES;
private final String[] PADDINGS;
@@ -138,8 +138,8 @@ private void runTest(String mo, String pad, int keySize)
out.println("Testing: " + TRANSFORMATION);
// Initialization
- Cipher ci = Cipher.getInstance(TRANSFORMATION, SUNJCE);
- KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM, SUNJCE);
+ Cipher ci = Cipher.getInstance(TRANSFORMATION, PROVIDER_NAME);
+ KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM, PROVIDER_NAME);
if (keySize != 0) {
kg.init(keySize);
}
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java b/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java
index d110c05a339..22da35e7e6b 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/TextLength/SameBufferOverwrite.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -44,9 +44,11 @@ public class SameBufferOverwrite {
SameBufferOverwrite(String algo, String transformation)
throws Exception {
- KeyGenerator kg = KeyGenerator.getInstance(algo, "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
skey = kg.generateKey();
- c = Cipher.getInstance(transformation, "SunJCE");
+ c = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
}
/*
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java b/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java
index 70908a23746..5c806df25bd 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/UTIL/StrongOrUnlimited.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2024, 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
@@ -38,7 +38,8 @@ public static void main(String[] args) throws Exception {
// decide if the installed jurisdiction policy file is the
// unlimited version
boolean isUnlimited = true;
- Cipher c = Cipher.getInstance("AES", "SunJCE");
+ Cipher c = Cipher.getInstance("AES",
+ System.getProperty("test.provider.name", "SunJCE"));
try {
c.init(Cipher.ENCRYPT_MODE,
diff --git a/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java b/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java
index d9bf59b63f0..6ba7f9a0d69 100644
--- a/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java
+++ b/test/jdk/com/sun/crypto/provider/Cipher/UTIL/SunJCEGetInstance.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -40,9 +40,10 @@ public static void main(String[] args) throws Exception {
Cipher jce;
try{
+ String providerName = System.getProperty("test.provider.name", "SunJCE");
// Remove SunJCE from Provider list
- Provider prov = Security.getProvider("SunJCE");
- Security.removeProvider("SunJCE");
+ Provider prov = Security.getProvider(providerName);
+ Security.removeProvider(providerName);
// Create our own instance of SunJCE provider. Purposefully not
// using SunJCE.getInstance() so we can have our own instance
// for the test.
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java
index 34e87030636..9fe96d967dc 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHGenSharedSecret.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 0000000
+ * @library /test/lib
* @summary DHGenSharedSecret
* @author Jan Luehe
*/
@@ -33,40 +34,11 @@
import javax.crypto.*;
import javax.crypto.spec.*;
import java.math.BigInteger;
+import jdk.test.lib.security.DiffieHellmanGroup;
+import jdk.test.lib.security.SecurityUtils;
public class DHGenSharedSecret {
- static byte[] DHPrime = {
-(byte)0x00, (byte)0x8D, (byte)0x8A, (byte)0x6C, (byte)0x7F, (byte)0xCC,
-(byte)0xA5, (byte)0xBF, (byte)0x9C, (byte)0xE1, (byte)0xFA, (byte)0x3C,
-(byte)0xCA, (byte)0x98, (byte)0xB7, (byte)0x99, (byte)0xD1, (byte)0xE5,
-(byte)0x2C, (byte)0xC0, (byte)0x26, (byte)0x97, (byte)0x12, (byte)0x80,
-(byte)0x12, (byte)0xEF, (byte)0x0B, (byte)0xDE, (byte)0x71, (byte)0x76,
-(byte)0xAA, (byte)0x2D, (byte)0x86, (byte)0x41, (byte)0x0E, (byte)0x6A,
-(byte)0xC2, (byte)0x12, (byte)0xAA, (byte)0xAA, (byte)0xE4, (byte)0x84,
-(byte)0x80, (byte)0x13, (byte)0x95, (byte)0x06, (byte)0xC4, (byte)0x83,
-(byte)0xB9, (byte)0xD3, (byte)0x72, (byte)0xC5, (byte)0xC8, (byte)0x85,
-(byte)0x96, (byte)0x59, (byte)0x08, (byte)0xFA, (byte)0x9E, (byte)0x3C,
-(byte)0xDC, (byte)0x92, (byte)0x28, (byte)0xC3, (byte)0x1D, (byte)0x6F,
-(byte)0x44, (byte)0x36, (byte)0x70, (byte)0x40, (byte)0x80, (byte)0xF1,
-(byte)0x35
- };
-
- static byte[] DHBase = {
-(byte)0x72, (byte)0x21, (byte)0xB3, (byte)0xA8, (byte)0x83, (byte)0xDD,
-(byte)0x76, (byte)0xF5, (byte)0x0D, (byte)0x9B, (byte)0x81, (byte)0x11,
-(byte)0x15, (byte)0x03, (byte)0x6D, (byte)0x4D, (byte)0x46, (byte)0x65,
-(byte)0x30, (byte)0xB0, (byte)0xFA, (byte)0xFE, (byte)0xBE, (byte)0xA8,
-(byte)0xD9, (byte)0x83, (byte)0x33, (byte)0x54, (byte)0xC7, (byte)0xF6,
-(byte)0x81, (byte)0xAC, (byte)0xCC, (byte)0xA3, (byte)0xAE, (byte)0xAA,
-(byte)0xC8, (byte)0x11, (byte)0x38, (byte)0xD4, (byte)0x4F, (byte)0xC4,
-(byte)0x89, (byte)0xD3, (byte)0x72, (byte)0xEE, (byte)0x22, (byte)0x5A,
-(byte)0x68, (byte)0xF7, (byte)0xAC, (byte)0x24, (byte)0x01, (byte)0x9B,
-(byte)0xE9, (byte)0x08, (byte)0xFE, (byte)0x58, (byte)0x0A, (byte)0xCF,
-(byte)0xB9, (byte)0x52, (byte)0xB4, (byte)0x02, (byte)0x73, (byte)0xA4,
-(byte)0xA6, (byte)0xB9, (byte)0x0C, (byte)0x8D, (byte)0xA7, (byte)0xFB,
- };
-
public static void main(String[] args) throws Exception {
DHGenSharedSecret test = new DHGenSharedSecret();
test.run();
@@ -75,8 +47,9 @@ public static void main(String[] args) throws Exception {
public void run() throws Exception {
long start, end;
- BigInteger p = new BigInteger(1, DHPrime);
- BigInteger g = new BigInteger(1, DHBase);
+ DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup();
+ BigInteger p = dhGroup.getPrime();
+ BigInteger g = new BigInteger(1, dhGroup.getBase().toByteArray());
int l = 512;
DHParameterSpec spec =
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java
index c7a0c4aeb33..da583c9dc29 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 7146728
+ * @library /test/lib
* @summary DHKeyAgreement2
* @author Jan Luehe
* @run main/othervm -Djdk.crypto.KeyAgreement.legacyKDF=true DHKeyAgreement2
@@ -38,13 +39,14 @@
import javax.crypto.*;
import javax.crypto.spec.*;
import javax.crypto.interfaces.*;
+import jdk.test.lib.security.DiffieHellmanGroup;
+import jdk.test.lib.security.SecurityUtils;
/**
* This test utility executes the Diffie-Hellman key agreement protocol
* between 2 parties: Alice and Bob.
*
- * By default, preconfigured parameters (1024 bit prime modulus and base
- * generator used by SKIP) are used.
+ * By default, preconfigured parameters are used.
* If this program is called with the "-gen" option, a new set of parameters
* are created.
*/
@@ -59,7 +61,7 @@ public class DHKeyAgreement2 {
private DHKeyAgreement2() {}
public static void main(String argv[]) throws Exception {
- String mode = "USE_SKIP_DH_PARAMS";
+ String mode = "USE_PRECONFIGURED_DH_PARAMS";
DHKeyAgreement2 keyAgree = new DHKeyAgreement2();
@@ -80,22 +82,25 @@ public static void main(String argv[]) throws Exception {
private void run(String mode) throws Exception {
- DHParameterSpec dhSkipParamSpec;
+ DHParameterSpec dhParameterSpec;
+ String algorithm = "DH";
+ int primeSize = SecurityUtils.getTestKeySize(algorithm);
if (mode.equals("GENERATE_DH_PARAMS")) {
// Some central authority creates new DH parameters
System.err.println("Creating Diffie-Hellman parameters ...");
AlgorithmParameterGenerator paramGen
= AlgorithmParameterGenerator.getInstance("DH", SUNJCE);
- paramGen.init(512);
+ paramGen.init(primeSize);
AlgorithmParameters params = paramGen.generateParameters();
- dhSkipParamSpec = (DHParameterSpec)params.getParameterSpec
+ dhParameterSpec = (DHParameterSpec)params.getParameterSpec
(DHParameterSpec.class);
} else {
- // use some pre-generated, default DH parameters
- System.err.println("Using SKIP Diffie-Hellman parameters");
- dhSkipParamSpec = new DHParameterSpec(skip1024Modulus,
- skip1024Base);
+ // use some pre-generated, test default DH parameters
+ DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(primeSize);
+ System.err.println("Using " + dhGroup.name() + " Diffie-Hellman parameters");
+ dhParameterSpec = new DHParameterSpec(dhGroup.getPrime(),
+ dhGroup.getBase());
}
/*
@@ -104,7 +109,7 @@ private void run(String mode) throws Exception {
*/
System.err.println("ALICE: Generate DH keypair ...");
KeyPairGenerator aliceKpairGen = KeyPairGenerator.getInstance("DH", SUNJCE);
- aliceKpairGen.initialize(dhSkipParamSpec);
+ aliceKpairGen.initialize(dhParameterSpec);
KeyPair aliceKpair = aliceKpairGen.generateKeyPair();
System.out.println("Alice DH public key:\n" +
aliceKpair.getPublic().toString());
@@ -227,20 +232,26 @@ private void run(String mode) throws Exception {
}
System.err.println("Shared secrets are the same");
+ testSecretKey(bobKeyAgree, alicePubKey, "DES");
+ testSecretKey(bobKeyAgree, alicePubKey, "AES");
+ }
+
+ private static void testSecretKey(KeyAgreement bobKeyAgree, PublicKey alicePubKey, String algo)
+ throws Exception {
// Now let's return the shared secret as a SecretKey object
// and use it for encryption
- System.out.println("Return shared secret as SecretKey object ...");
+ System.out.println("Return shared secret as SecretKey object with algorithm: " + algo);
bobKeyAgree.doPhase(alicePubKey, true);
- SecretKey desKey = bobKeyAgree.generateSecret("DES");
+ SecretKey key = bobKeyAgree.generateSecret(algo);
- Cipher desCipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
- desCipher.init(Cipher.ENCRYPT_MODE, desKey);
+ Cipher cipher = Cipher.getInstance(algo + "/ECB/PKCS5Padding");
+ cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] cleartext = "This is just an example".getBytes();
- byte[] ciphertext = desCipher.doFinal(cleartext);
+ byte[] ciphertext = cipher.doFinal(cleartext);
- desCipher.init(Cipher.DECRYPT_MODE, desKey);
- byte[] cleartext1 = desCipher.doFinal(ciphertext);
+ cipher.init(Cipher.DECRYPT_MODE, key);
+ byte[] cleartext1 = cipher.doFinal(ciphertext);
int clearLen = cleartext.length;
int clear1Len = cleartext1.length;
@@ -274,47 +285,4 @@ private void usage() {
System.err.print("DHKeyAgreement usage: ");
System.err.println("[-gen]");
}
-
- // The 1024 bit Diffie-Hellman modulus values used by SKIP
- private static final byte skip1024ModulusBytes[] = {
- (byte)0xF4, (byte)0x88, (byte)0xFD, (byte)0x58,
- (byte)0x4E, (byte)0x49, (byte)0xDB, (byte)0xCD,
- (byte)0x20, (byte)0xB4, (byte)0x9D, (byte)0xE4,
- (byte)0x91, (byte)0x07, (byte)0x36, (byte)0x6B,
- (byte)0x33, (byte)0x6C, (byte)0x38, (byte)0x0D,
- (byte)0x45, (byte)0x1D, (byte)0x0F, (byte)0x7C,
- (byte)0x88, (byte)0xB3, (byte)0x1C, (byte)0x7C,
- (byte)0x5B, (byte)0x2D, (byte)0x8E, (byte)0xF6,
- (byte)0xF3, (byte)0xC9, (byte)0x23, (byte)0xC0,
- (byte)0x43, (byte)0xF0, (byte)0xA5, (byte)0x5B,
- (byte)0x18, (byte)0x8D, (byte)0x8E, (byte)0xBB,
- (byte)0x55, (byte)0x8C, (byte)0xB8, (byte)0x5D,
- (byte)0x38, (byte)0xD3, (byte)0x34, (byte)0xFD,
- (byte)0x7C, (byte)0x17, (byte)0x57, (byte)0x43,
- (byte)0xA3, (byte)0x1D, (byte)0x18, (byte)0x6C,
- (byte)0xDE, (byte)0x33, (byte)0x21, (byte)0x2C,
- (byte)0xB5, (byte)0x2A, (byte)0xFF, (byte)0x3C,
- (byte)0xE1, (byte)0xB1, (byte)0x29, (byte)0x40,
- (byte)0x18, (byte)0x11, (byte)0x8D, (byte)0x7C,
- (byte)0x84, (byte)0xA7, (byte)0x0A, (byte)0x72,
- (byte)0xD6, (byte)0x86, (byte)0xC4, (byte)0x03,
- (byte)0x19, (byte)0xC8, (byte)0x07, (byte)0x29,
- (byte)0x7A, (byte)0xCA, (byte)0x95, (byte)0x0C,
- (byte)0xD9, (byte)0x96, (byte)0x9F, (byte)0xAB,
- (byte)0xD0, (byte)0x0A, (byte)0x50, (byte)0x9B,
- (byte)0x02, (byte)0x46, (byte)0xD3, (byte)0x08,
- (byte)0x3D, (byte)0x66, (byte)0xA4, (byte)0x5D,
- (byte)0x41, (byte)0x9F, (byte)0x9C, (byte)0x7C,
- (byte)0xBD, (byte)0x89, (byte)0x4B, (byte)0x22,
- (byte)0x19, (byte)0x26, (byte)0xBA, (byte)0xAB,
- (byte)0xA2, (byte)0x5E, (byte)0xC3, (byte)0x55,
- (byte)0xE9, (byte)0x2F, (byte)0x78, (byte)0xC7
- };
-
- // The SKIP 1024 bit modulus
- private static final BigInteger skip1024Modulus
- = new BigInteger(1, skip1024ModulusBytes);
-
- // The base used with the SKIP 1024 bit modulus
- private static final BigInteger skip1024Base = BigInteger.valueOf(2);
}
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java
index 6cdcf1dad2e..d4f70ea2563 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement3.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 0000000
+ * @library /test/lib
* @summary DHKeyAgreement3
* @author Jan Luehe
*/
@@ -37,13 +38,14 @@
import javax.crypto.*;
import javax.crypto.spec.*;
import javax.crypto.interfaces.*;
+import jdk.test.lib.security.DiffieHellmanGroup;
+import jdk.test.lib.security.SecurityUtils;
/**
* This test utility executes the Diffie-Hellman key agreement protocol
* between 3 parties: Alice, Bob, and Carol.
*
- * We use the same 1024 bit prime modulus and base generator that are used by
- * SKIP.
+ * By default, preconfigured parameters are used.
*/
public class DHKeyAgreement3 {
@@ -61,27 +63,27 @@ public static void main(String argv[]) throws Exception {
private void run() throws Exception {
- DHParameterSpec dhSkipParamSpec;
-
- System.err.println("Using SKIP Diffie-Hellman parameters");
- dhSkipParamSpec = new DHParameterSpec(skip1024Modulus, skip1024Base);
+ DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup();
+ DHParameterSpec dhParamSpec;
+ System.err.println("Using " + dhGroup.name() + " Diffie-Hellman parameters");
+ dhParamSpec = new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase());
// Alice creates her own DH key pair
System.err.println("ALICE: Generate DH keypair ...");
KeyPairGenerator aliceKpairGen = KeyPairGenerator.getInstance("DH", "SunJCE");
- aliceKpairGen.initialize(dhSkipParamSpec);
+ aliceKpairGen.initialize(dhParamSpec);
KeyPair aliceKpair = aliceKpairGen.generateKeyPair();
// Bob creates his own DH key pair
System.err.println("BOB: Generate DH keypair ...");
KeyPairGenerator bobKpairGen = KeyPairGenerator.getInstance("DH", "SunJCE");
- bobKpairGen.initialize(dhSkipParamSpec);
+ bobKpairGen.initialize(dhParamSpec);
KeyPair bobKpair = bobKpairGen.generateKeyPair();
// Carol creates her own DH key pair
System.err.println("CAROL: Generate DH keypair ...");
KeyPairGenerator carolKpairGen = KeyPairGenerator.getInstance("DH", "SunJCE");
- carolKpairGen.initialize(dhSkipParamSpec);
+ carolKpairGen.initialize(dhParamSpec);
KeyPair carolKpair = carolKpairGen.generateKeyPair();
@@ -178,47 +180,4 @@ private void usage() {
System.err.print("DHKeyAgreement usage: ");
System.err.println("[-gen]");
}
-
- // The 1024 bit Diffie-Hellman modulus values used by SKIP
- private static final byte skip1024ModulusBytes[] = {
- (byte)0xF4, (byte)0x88, (byte)0xFD, (byte)0x58,
- (byte)0x4E, (byte)0x49, (byte)0xDB, (byte)0xCD,
- (byte)0x20, (byte)0xB4, (byte)0x9D, (byte)0xE4,
- (byte)0x91, (byte)0x07, (byte)0x36, (byte)0x6B,
- (byte)0x33, (byte)0x6C, (byte)0x38, (byte)0x0D,
- (byte)0x45, (byte)0x1D, (byte)0x0F, (byte)0x7C,
- (byte)0x88, (byte)0xB3, (byte)0x1C, (byte)0x7C,
- (byte)0x5B, (byte)0x2D, (byte)0x8E, (byte)0xF6,
- (byte)0xF3, (byte)0xC9, (byte)0x23, (byte)0xC0,
- (byte)0x43, (byte)0xF0, (byte)0xA5, (byte)0x5B,
- (byte)0x18, (byte)0x8D, (byte)0x8E, (byte)0xBB,
- (byte)0x55, (byte)0x8C, (byte)0xB8, (byte)0x5D,
- (byte)0x38, (byte)0xD3, (byte)0x34, (byte)0xFD,
- (byte)0x7C, (byte)0x17, (byte)0x57, (byte)0x43,
- (byte)0xA3, (byte)0x1D, (byte)0x18, (byte)0x6C,
- (byte)0xDE, (byte)0x33, (byte)0x21, (byte)0x2C,
- (byte)0xB5, (byte)0x2A, (byte)0xFF, (byte)0x3C,
- (byte)0xE1, (byte)0xB1, (byte)0x29, (byte)0x40,
- (byte)0x18, (byte)0x11, (byte)0x8D, (byte)0x7C,
- (byte)0x84, (byte)0xA7, (byte)0x0A, (byte)0x72,
- (byte)0xD6, (byte)0x86, (byte)0xC4, (byte)0x03,
- (byte)0x19, (byte)0xC8, (byte)0x07, (byte)0x29,
- (byte)0x7A, (byte)0xCA, (byte)0x95, (byte)0x0C,
- (byte)0xD9, (byte)0x96, (byte)0x9F, (byte)0xAB,
- (byte)0xD0, (byte)0x0A, (byte)0x50, (byte)0x9B,
- (byte)0x02, (byte)0x46, (byte)0xD3, (byte)0x08,
- (byte)0x3D, (byte)0x66, (byte)0xA4, (byte)0x5D,
- (byte)0x41, (byte)0x9F, (byte)0x9C, (byte)0x7C,
- (byte)0xBD, (byte)0x89, (byte)0x4B, (byte)0x22,
- (byte)0x19, (byte)0x26, (byte)0xBA, (byte)0xAB,
- (byte)0xA2, (byte)0x5E, (byte)0xC3, (byte)0x55,
- (byte)0xE9, (byte)0x2F, (byte)0x78, (byte)0xC7
- };
-
- // The SKIP 1024 bit modulus
- private static final BigInteger skip1024Modulus
- = new BigInteger(1, skip1024ModulusBytes);
-
- // The base used with the SKIP 1024 bit modulus
- private static final BigInteger skip1024Base = BigInteger.valueOf(2);
}
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java
index dc963bf6267..c863da6b4b4 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyAgreementPadding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2024, 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
@@ -34,21 +34,22 @@
import java.security.KeyPairGenerator;
import java.util.Arrays;
import java.util.HexFormat;
+import jdk.test.lib.security.SecurityUtils;
public class DHKeyAgreementPadding {
public static void main(String[] args) throws Exception {
-
- byte[] aliceSecret = new byte[80];
- byte[] bobSecret = new byte[80];
-
- KeyAgreement alice = KeyAgreement.getInstance("DiffieHellman");
- KeyAgreement bob = KeyAgreement.getInstance("DiffieHellman");
+ String kpgAlgorithm = "DiffieHellman";
+ KeyAgreement alice = KeyAgreement.getInstance(kpgAlgorithm);
+ KeyAgreement bob = KeyAgreement.getInstance(kpgAlgorithm);
+ int keySizeBits = SecurityUtils.getTestKeySize(kpgAlgorithm);
+ byte[] aliceSecret = new byte[keySizeBits / 8];
+ byte[] bobSecret = new byte[keySizeBits / 8];
// The probability of an error is 0.2% or 1/500. Try more times.
for (int i = 0; i < 5000; i++) {
- KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("DiffieHellman");
- keyPairGen.initialize(512);
+ KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(kpgAlgorithm);
+ keyPairGen.initialize(keySizeBits);
KeyPair aliceKeyPair = keyPairGen.generateKeyPair();
KeyPair bobKeyPair = keyPairGen.generateKeyPair();
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java
index e12f3871ec2..356cfc4b20a 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 0000000
+ * @library /test/lib
* @summary DHKeyFactory
* @author Jan Luehe
*/
@@ -36,6 +37,8 @@
import javax.crypto.*;
import javax.crypto.spec.*;
import javax.crypto.interfaces.*;
+import jdk.test.lib.security.DiffieHellmanGroup;
+import jdk.test.lib.security.SecurityUtils;
/**
* This test creates a DH keypair, retrieves the encodings of the DH public and
@@ -55,15 +58,13 @@ public static void main(String argv[]) throws Exception {
private void run() throws Exception {
- DHParameterSpec dhSkipParamSpec;
+ DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup();
+ DHParameterSpec dhParamSpec = new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase());
+ System.out.println("Using " + dhGroup.name() + " Diffie-Hellman parameters");
- // use some pre-generated, default DH parameters
- System.err.println("Using SKIP Diffie-Hellman parameters");
- dhSkipParamSpec = new DHParameterSpec(skip1024Modulus,
- skip1024Base);
-
- KeyPairGenerator kpgen = KeyPairGenerator.getInstance("DH", "SunJCE");
- kpgen.initialize(dhSkipParamSpec);
+ KeyPairGenerator kpgen = KeyPairGenerator.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
+ kpgen.initialize(dhParamSpec);
KeyPair kp = kpgen.generateKeyPair();
// get the public key encoding
@@ -72,7 +73,8 @@ private void run() throws Exception {
// get the private key encoding
byte[] privKeyEnc = kp.getPrivate().getEncoded();
- KeyFactory kfac = KeyFactory.getInstance("DH", "SunJCE");
+ KeyFactory kfac = KeyFactory.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKeyEnc);
PublicKey pubKey = kfac.generatePublic(x509KeySpec);
@@ -80,47 +82,4 @@ private void run() throws Exception {
PKCS8EncodedKeySpec pkcsKeySpec = new PKCS8EncodedKeySpec(privKeyEnc);
PrivateKey privKey = kfac.generatePrivate(pkcsKeySpec);
}
-
- // The 1024 bit Diffie-Hellman modulus values used by SKIP
- private static final byte skip1024ModulusBytes[] = {
- (byte)0xF4, (byte)0x88, (byte)0xFD, (byte)0x58,
- (byte)0x4E, (byte)0x49, (byte)0xDB, (byte)0xCD,
- (byte)0x20, (byte)0xB4, (byte)0x9D, (byte)0xE4,
- (byte)0x91, (byte)0x07, (byte)0x36, (byte)0x6B,
- (byte)0x33, (byte)0x6C, (byte)0x38, (byte)0x0D,
- (byte)0x45, (byte)0x1D, (byte)0x0F, (byte)0x7C,
- (byte)0x88, (byte)0xB3, (byte)0x1C, (byte)0x7C,
- (byte)0x5B, (byte)0x2D, (byte)0x8E, (byte)0xF6,
- (byte)0xF3, (byte)0xC9, (byte)0x23, (byte)0xC0,
- (byte)0x43, (byte)0xF0, (byte)0xA5, (byte)0x5B,
- (byte)0x18, (byte)0x8D, (byte)0x8E, (byte)0xBB,
- (byte)0x55, (byte)0x8C, (byte)0xB8, (byte)0x5D,
- (byte)0x38, (byte)0xD3, (byte)0x34, (byte)0xFD,
- (byte)0x7C, (byte)0x17, (byte)0x57, (byte)0x43,
- (byte)0xA3, (byte)0x1D, (byte)0x18, (byte)0x6C,
- (byte)0xDE, (byte)0x33, (byte)0x21, (byte)0x2C,
- (byte)0xB5, (byte)0x2A, (byte)0xFF, (byte)0x3C,
- (byte)0xE1, (byte)0xB1, (byte)0x29, (byte)0x40,
- (byte)0x18, (byte)0x11, (byte)0x8D, (byte)0x7C,
- (byte)0x84, (byte)0xA7, (byte)0x0A, (byte)0x72,
- (byte)0xD6, (byte)0x86, (byte)0xC4, (byte)0x03,
- (byte)0x19, (byte)0xC8, (byte)0x07, (byte)0x29,
- (byte)0x7A, (byte)0xCA, (byte)0x95, (byte)0x0C,
- (byte)0xD9, (byte)0x96, (byte)0x9F, (byte)0xAB,
- (byte)0xD0, (byte)0x0A, (byte)0x50, (byte)0x9B,
- (byte)0x02, (byte)0x46, (byte)0xD3, (byte)0x08,
- (byte)0x3D, (byte)0x66, (byte)0xA4, (byte)0x5D,
- (byte)0x41, (byte)0x9F, (byte)0x9C, (byte)0x7C,
- (byte)0xBD, (byte)0x89, (byte)0x4B, (byte)0x22,
- (byte)0x19, (byte)0x26, (byte)0xBA, (byte)0xAB,
- (byte)0xA2, (byte)0x5E, (byte)0xC3, (byte)0x55,
- (byte)0xE9, (byte)0x2F, (byte)0x78, (byte)0xC7
- };
-
- // The SKIP 1024 bit modulus
- private static final BigInteger skip1024Modulus
- = new BigInteger(1, skip1024ModulusBytes);
-
- // The base used with the SKIP 1024 bit modulus
- private static final BigInteger skip1024Base = BigInteger.valueOf(2);
}
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java
index b24f0a66fb9..723ce11760b 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/DHKeyGenSpeed.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 0000000
+ * @library /test/lib
* @summary DHKeyGenSpeed
* @author Jan Luehe
*/
@@ -33,42 +34,11 @@
import javax.crypto.*;
import javax.crypto.spec.*;
import java.math.*;
+import jdk.test.lib.security.DiffieHellmanGroup;
+import jdk.test.lib.security.SecurityUtils;
public class DHKeyGenSpeed {
- static byte[] DHPrime = {
-(byte)0x00, (byte)0x91, (byte)0x18, (byte)0x26, (byte)0x9A, (byte)0x26,
-(byte)0x43, (byte)0xA6, (byte)0x1E, (byte)0x11, (byte)0x02, (byte)0xA0,
-(byte)0x88, (byte)0xFE, (byte)0x12, (byte)0xEA, (byte)0x63, (byte)0x20,
-(byte)0x6D, (byte)0x4F, (byte)0x40, (byte)0x3C, (byte)0x4F, (byte)0x13,
-(byte)0x10, (byte)0x97, (byte)0xEC, (byte)0x3A, (byte)0x38, (byte)0x87,
-(byte)0x9B, (byte)0x08, (byte)0x66, (byte)0x0C, (byte)0x82, (byte)0xD0,
-(byte)0x57, (byte)0xE0, (byte)0x37, (byte)0x16, (byte)0x8E, (byte)0xB4,
-(byte)0xEA, (byte)0xB7, (byte)0xE6, (byte)0xAF, (byte)0x4C, (byte)0xE0,
-(byte)0x40, (byte)0x07, (byte)0xF4, (byte)0x81, (byte)0xDD, (byte)0x36,
-(byte)0x33, (byte)0xAD, (byte)0x92, (byte)0xC6, (byte)0x0F, (byte)0xB5,
-(byte)0xE4, (byte)0x0F, (byte)0x0E, (byte)0xEA, (byte)0x91, (byte)0x35,
-(byte)0xFB, (byte)0x55, (byte)0x7A, (byte)0x39, (byte)0xD1, (byte)0xF0,
-(byte)0x6B, (byte)0x9A, (byte)0xB9, (byte)0xFA, (byte)0x19, (byte)0xBE,
-(byte)0x1B, (byte)0xFD, (byte)0x77
- };
- static byte[] DHBase = {
-(byte)0x29, (byte)0xF2, (byte)0x29, (byte)0xC8, (byte)0x42, (byte)0x25,
-(byte)0x29, (byte)0xC3, (byte)0xF2, (byte)0xAA, (byte)0xF2, (byte)0x6A,
-(byte)0x3C, (byte)0xD2, (byte)0xD2, (byte)0xDE, (byte)0xD3, (byte)0x6B,
-(byte)0x85, (byte)0xA5, (byte)0xE1, (byte)0x43, (byte)0x90, (byte)0xA2,
-(byte)0xB6, (byte)0xA5, (byte)0x0C, (byte)0xBA, (byte)0xB9, (byte)0x4C,
-(byte)0x25, (byte)0xE0, (byte)0xC8, (byte)0xEA, (byte)0xA1, (byte)0x7B,
-(byte)0xB9, (byte)0xF8, (byte)0xFF, (byte)0x15, (byte)0x66, (byte)0x5B,
-(byte)0xB0, (byte)0x00, (byte)0x18, (byte)0xE2, (byte)0xF4, (byte)0xF1,
-(byte)0xB4, (byte)0x7A, (byte)0xC2, (byte)0xCF, (byte)0x9C, (byte)0x61,
-(byte)0x36, (byte)0xED, (byte)0x14, (byte)0x72, (byte)0xD7, (byte)0xD4,
-(byte)0x94, (byte)0x20, (byte)0x5E, (byte)0x1E, (byte)0xE4, (byte)0xB1,
-(byte)0x60, (byte)0xC8, (byte)0x10, (byte)0x85, (byte)0xBD, (byte)0x74,
-(byte)0x34, (byte)0x8C, (byte)0x3C, (byte)0x2A, (byte)0xBD, (byte)0x3C,
-(byte)0xFF, (byte)0x14
- };
-
public static void main(String[] args) throws Exception {
DHKeyGenSpeed test = new DHKeyGenSpeed();
test.run();
@@ -78,8 +48,9 @@ public static void main(String[] args) throws Exception {
public void run() throws Exception {
long start, end;
- BigInteger p = new BigInteger(1, DHPrime);
- BigInteger g = new BigInteger(1, DHBase);
+ DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup();
+ BigInteger p = dhGroup.getPrime();
+ BigInteger g = new BigInteger(1, dhGroup.getBase().toByteArray());
int l = 576;
DHParameterSpec spec =
@@ -87,14 +58,15 @@ public void run() throws Exception {
// generate keyPairs using parameters
KeyPairGenerator keyGen =
- KeyPairGenerator.getInstance("DH", "SunJCE");
+ KeyPairGenerator.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
start = System.currentTimeMillis();
keyGen.initialize(spec);
KeyPair keys = keyGen.generateKeyPair();
end = System.currentTimeMillis();
System.out.println("PrimeBits\tExponentBits");
- System.out.println(DHPrime.length*8 + "\t\t" + l);
+ System.out.println(dhGroup.getPrime().bitLength() + "\t\t" + l);
System.out.println("keyGen(millisecond): " + (end - start));
System.out.println("Test Passed!");
}
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java
index 910104b98c5..9b7eec95d6d 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/SameDHKeyStressTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2024, 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
@@ -78,7 +78,8 @@ public static boolean runTest(String algo, int numParties, String secretAlgo) {
Key[] keyArchives = new Key[numParties];
try {
// generate AlogirhtmParameterSpec
- AlgorithmParameterGenerator apg = AlgorithmParameterGenerator.getInstance("DH","SunJCE");
+ AlgorithmParameterGenerator apg = AlgorithmParameterGenerator.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
AlgorithmParameterSpec aps = new DHGenParameterSpec(512, 64);
apg.init(aps);
DHParameterSpec spec = apg.generateParameters().
@@ -139,8 +140,10 @@ class KAParticipant {
public KAParticipant(String pName, String algo) throws NoSuchAlgorithmException, NoSuchProviderException {
name = pName;
algorithm = algo;
- keyGen = KeyPairGenerator.getInstance(algo,"SunJCE");
- ka = KeyAgreement.getInstance(algo,"SunJCE");
+ keyGen = KeyPairGenerator.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
+ ka = KeyAgreement.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
}
public void initialize(AlgorithmParameterSpec spec) throws InvalidAlgorithmParameterException, InvalidKeyException {
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java
index 1faaa6783b4..71f383079e0 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHKeys.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, 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
@@ -55,7 +55,8 @@ private enum SupportedKeySize {
public static void main(String[] args) throws Exception {
for (SupportedKeySize keySize : SupportedKeySize.values()) {
System.out.println("Checking " + keySize.primeSize + " ...");
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", "SunJCE");
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
kpg.initialize(keySize.primeSize);
KeyPair kp = kpg.generateKeyPair();
checkKeyPair(kp, keySize.primeSize);
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java
index 27f010dd141..efc85999b3e 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, 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
@@ -24,6 +24,7 @@
/**
* @test
* @bug 8072452 8163498
+ * @library /test/lib
* @summary Support DHE sizes up to 8192-bits and DSA sizes up to 3072-bits
* This test has been split based on lower/higher key sizes in order to
* reduce individual execution times and run in parallel
@@ -33,14 +34,16 @@
* @run main/timeout=300 SupportedDHParamGens 832
* @run main/timeout=300 SupportedDHParamGens 1024
* @run main/timeout=600 SupportedDHParamGens 2048
+ * @run main/timeout=600 SupportedDHParamGens 3072
+ * @run main/timeout=600 SupportedDHParamGens 4096
*/
-
import java.math.BigInteger;
import java.security.*;
-import javax.crypto.*;
import javax.crypto.interfaces.*;
import javax.crypto.spec.*;
+import jdk.test.lib.security.DiffieHellmanGroup;
+import jdk.test.lib.security.SecurityUtils;
public class SupportedDHParamGens {
@@ -48,18 +51,31 @@ public static void main(String[] args) throws Exception {
int primeSize = Integer.valueOf(args[0]).intValue();
System.out.println("Checking " + primeSize + " ...");
- AlgorithmParameterGenerator apg =
- AlgorithmParameterGenerator.getInstance("DH", "SunJCE");
- apg.init(primeSize);
- AlgorithmParameters ap = apg.generateParameters();
- DHParameterSpec spec = ap.getParameterSpec(DHParameterSpec.class);
+ DHParameterSpec spec = null;
+ switch (primeSize) {
+ case 2048, 3072, 4096 -> spec = getDHParameterSpec(primeSize);
+ default -> {
+ AlgorithmParameterGenerator apg =
+ AlgorithmParameterGenerator.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
+ apg.init(primeSize);
+ AlgorithmParameters ap = apg.generateParameters();
+ spec = ap.getParameterSpec(DHParameterSpec.class);
+ }
+ }
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", "SunJCE");
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
kpg.initialize(spec);
KeyPair kp = kpg.generateKeyPair();
checkKeyPair(kp, primeSize);
}
+ private static DHParameterSpec getDHParameterSpec(int primeSize) {
+ DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup(primeSize);
+ return new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase());
+ }
+
private static void checkKeyPair(KeyPair kp, int pSize) throws Exception {
DHPrivateKey privateKey = (DHPrivateKey)kp.getPrivate();
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java
index 740486e06cf..7d2570991d5 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGensLongKey.java
@@ -24,6 +24,7 @@
/**
* @test
* @bug 8072452 8163498
+ * @library /test/lib
* @summary Support DHE sizes up to 8192-bits and DSA sizes up to 3072-bits
* This test has been split based on lower/higher key sizes in order to
* reduce individual execution times and run in parallel
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java
index b304121fa0c..adb59d9caef 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/TestExponentSize.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -81,7 +81,8 @@ BigInteger getBigIntValue() {
public static void main(String[] args) throws Exception {
KeyPair kp;
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", "SunJCE");
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
// Sun's default uses a default psize of 2048 and
// lsize of (pSize / 2) but at least 384 bits
diff --git a/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java b/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java
index d2ef5fab807..dff10c3d21a 100644
--- a/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java
+++ b/test/jdk/com/sun/crypto/provider/KeyAgreement/UnsupportedDHKeys.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, 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
@@ -61,7 +61,8 @@ public static void main(String[] args) throws Exception {
try {
System.out.println("Checking " + keySize.primeSize + " ...");
KeyPairGenerator kpg =
- KeyPairGenerator.getInstance("DH", "SunJCE");
+ KeyPairGenerator.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
kpg.initialize(keySize.primeSize);
throw new Exception("Should not support " + keySize.primeSize);
diff --git a/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java b/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java
index 1f2fa128db8..e5c8bb63aa7 100644
--- a/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java
+++ b/test/jdk/com/sun/crypto/provider/KeyFactory/PBKDF2HmacSHA1FactoryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -69,7 +69,8 @@ public class PBKDF2HmacSHA1FactoryTest {
};
private static void test() throws Exception {
- SecretKeyFactory skf = SecretKeyFactory.getInstance(ALGO, "SunJCE");
+ SecretKeyFactory skf = SecretKeyFactory.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
for (int i = 0; i < TEST_VECTORS.length; i++) {
System.out.println("=>Testing vector#" + (i+1));
diff --git a/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java b/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java
index 650e743baa9..b2122d5691b 100644
--- a/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java
+++ b/test/jdk/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 6578538 8027624
+ * @library /test/lib
* @summary com.sun.crypto.provider.SunJCE instance leak using KRB5 and
* LoginContext
* @author Brad Wetmore
@@ -45,6 +46,7 @@
import java.util.*;
import java.util.concurrent.*;
+import jdk.test.lib.security.SecurityUtils;
public class TestProviderLeak {
private static final int MB = 1024 * 1024;
@@ -106,9 +108,10 @@ private static void dumpMemoryStats(String s) throws Exception {
public static void main(String [] args) throws Exception {
// Prepare the test
final SecretKeyFactory skf =
- SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1", "SunJCE");
+ SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1",
+ System.getProperty("test.provider.name", "SunJCE"));
final PBEKeySpec pbeKS = new PBEKeySpec(
- "passPhrase".toCharArray(), new byte [] { 0 }, 5, 512);
+ "passPhrase".toCharArray(), new byte [SecurityUtils.getTestSaltSize()], 1000, 512);
ExecutorService executor = Executors.newSingleThreadExecutor();
Callable task = new Callable() {
diff --git a/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java b/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java
index 3e93874a88a..1238d9ecd55 100644
--- a/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java
+++ b/test/jdk/com/sun/crypto/provider/KeyGenerator/Test4628062.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -41,7 +41,8 @@ public class Test4628062 {
private static final int[] HMACSHA512_SIZES = { 64 };
public boolean execute(String algo, int[] keySizes) throws Exception {
- KeyGenerator kg = KeyGenerator.getInstance(algo, "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
// TEST FIX 4628062
Key keyWithDefaultSize = kg.generateKey();
diff --git a/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java b/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java
index fd53497a4b4..a1226b89d34 100644
--- a/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java
+++ b/test/jdk/com/sun/crypto/provider/KeyGenerator/TestExplicitKeyLength.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -35,13 +35,14 @@
public class TestExplicitKeyLength {
- private static final String ALGOS[] = { "RC2", "ARCFOUR" };
+ private static final String ALGOS[] = { "RC2", "ARCFOUR", "AES", "AES", "AES" };
private static final int KEY_SIZES[] =
- { 64, 80 }; // in bits
+ { 64, 80, 128, 192, 256 }; // in bits
public static void runTest(String algo, int keysize) throws Exception {
- KeyGenerator kg = KeyGenerator.getInstance(algo, "SunJCE");
+ KeyGenerator kg = KeyGenerator.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
kg.init(keysize);
Key generatedKey = kg.generateKey();
int actualSizeInBits = generatedKey.getEncoded().length*8;
diff --git a/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java b/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java
index 2c54237fac5..5fac9ffc72d 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/DigestCloneabilityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -40,7 +40,8 @@ public static void main(String[] args) throws Exception {
// make SampleProvider the most preferred, so its digest impl is picked
int status = Security.insertProviderAt(p, 1);
try {
- Mac mac = Mac.getInstance(ALGO, "SunJCE");
+ Mac mac = Mac.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunJCE"));
// do a complete mac generation and check if the supplied
// digest is used
mac.init(new SecretKeySpec(new byte[512>>3], ALGO));
@@ -72,7 +73,8 @@ public static class CloneableDigest extends MessageDigestSpi
public CloneableDigest() throws NoSuchAlgorithmException {
try {
- md = MessageDigest.getInstance("SHA-512", "SUN");
+ md = MessageDigest.getInstance("SHA-512",
+ System.getProperty("test.provider.name", "SUN"));
} catch (NoSuchProviderException nspe) {
// should never happen
}
diff --git a/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java b/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java
index 9b1dd1cb373..dafc6023a79 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/EmptyByteBufferTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -51,7 +51,8 @@ public void doTest(String alg) throws NoSuchAlgorithmException,
SecretKey key = Utils.getSecretKeySpec();
// instantiate Mac object and init it with a SecretKey
- Mac mac = Mac.getInstance(alg, "SunJCE");
+ Mac mac = Mac.getInstance(alg,
+ System.getProperty("test.provider.name", "SunJCE"));
mac.init(key);
// prepare buffer
diff --git a/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java b/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java
index 374775f1b3f..5e5e3457354 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/HmacPBESHA1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -46,7 +46,8 @@ public class HmacPBESHA1 {
};
private static final int[] MAC_LENGTHS = { 20, 20, 28, 32, 48, 64 };
private static final String KEY_ALGO = "PBE";
- private static final String PROVIDER = "SunJCE";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunJCE");
private static SecretKey key = null;
diff --git a/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java b/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java
index 38d4da44a4a..7d662563e4b 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/HmacSaltLengths.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -41,6 +41,10 @@ public class HmacSaltLengths {
private static final String[] ALGOS = {
"HmacPBESHA1",
+ "HmacPBESHA224",
+ "HmacPBESHA256",
+ "HmacPBESHA384",
+ "HmacPBESHA512",
"PBEWithHmacSHA1",
"PBEWithHmacSHA224",
"PBEWithHmacSHA256",
@@ -89,7 +93,8 @@ public static void main(String[] argv) throws Exception {
new SecureRandom().nextBytes(input);
char[] PASSWD = { 'p','a','s','s','w','o','r','d' };
long start = System.currentTimeMillis();
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + p.getName() + "...");
for (String algo : ALGOS) {
runTest(algo, input, PASSWD, p);
diff --git a/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java b/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java
index f294b67743b..4b2f8d8abc7 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/LargeByteBufferTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -53,7 +53,8 @@ public void doTest(String alg) throws NoSuchAlgorithmException,
SecretKey key = Utils.getSecretKeySpec();
// instantiate Mac object and init it with a SecretKey
- Mac mac = Mac.getInstance(alg, "SunJCE");
+ Mac mac = Mac.getInstance(alg,
+ System.getProperty("test.provider.name", "SunJCE"));
mac.init(key);
// prepare buffer
diff --git a/test/jdk/com/sun/crypto/provider/Mac/MacClone.java b/test/jdk/com/sun/crypto/provider/Mac/MacClone.java
index 4edc2436716..08f2b39be56 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/MacClone.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/MacClone.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -26,6 +26,8 @@
* @bug 7087021 8013069
* @summary Clone tests for all MAC algorithms.
* @author Jan Luehe
+ * @run main MacClone DES
+ * @run main MacClone AES
*/
import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.*;
@@ -37,7 +39,8 @@ public static void main(String[] args) throws Exception {
String[] algos = { "HmacMD5", "HmacSHA1", "HmacSHA224", "HmacSHA256",
"HmacSHA384", "HmacSHA512" };
- KeyGenerator kgen = KeyGenerator.getInstance("DES");
+ String keyAlgo = args[0];
+ KeyGenerator kgen = KeyGenerator.getInstance(keyAlgo);
SecretKey skey = kgen.generateKey();
for (String algo : algos) {
doTest(algo, skey, null);
@@ -60,7 +63,8 @@ private static void doTest(String algo, SecretKey skey,
//
// Clone an uninitialized Mac object
//
- Mac mac = Mac.getInstance(algo, "SunJCE");
+ Mac mac = Mac.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
Mac macClone = (Mac)mac.clone();
System.out.println(macClone.getProvider().toString());
System.out.println(macClone.getAlgorithm());
@@ -77,7 +81,8 @@ private static void doTest(String algo, SecretKey skey,
//
// Clone an initialized Mac object
//
- mac = Mac.getInstance(algo, "SunJCE");
+ mac = Mac.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
mac.init(skey, params);
macClone = (Mac)mac.clone();
System.out.println(macClone.getProvider().toString());
diff --git a/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java b/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java
index b75359e2ddf..9721668ea91 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/MacKAT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -333,7 +333,8 @@ private static Test t(String alg, byte[] input, String macvalue, byte[] key) {
static void runTests(Test[] tests) throws Exception {
long start = System.currentTimeMillis();
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + p.getName() + "...");
for (int i = 0; i < tests.length; i++) {
Test test = tests[i];
diff --git a/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java b/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java
index 598ea6a910c..e8b8351c974 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/MacSameTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -63,7 +63,8 @@ public void doTest(String algo) throws NoSuchAlgorithmException,
NoSuchProviderException, InvalidKeyException {
Mac mac;
try {
- mac = Mac.getInstance(algo, "SunJCE");
+ mac = Mac.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
} catch (NoSuchAlgorithmException nsae) {
// depending on Solaris configuration,
// it can support HMAC or not with Mac
diff --git a/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java b/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java
index d71d4f96317..a4f3e441cb3 100644
--- a/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java
+++ b/test/jdk/com/sun/crypto/provider/Mac/NullByteBufferTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -51,7 +51,8 @@ public void doTest(String alg) throws NoSuchAlgorithmException,
SecretKey key = Utils.getSecretKeySpec();
// instantiate Mac object and init it with a SecretKey
- Mac mac = Mac.getInstance(alg, "SunJCE");
+ Mac mac = Mac.getInstance(alg,
+ System.getProperty("test.provider.name", "SunJCE"));
mac.init(key);
try {
diff --git a/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java b/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java
index 062c34ceda3..445ccf8c739 100644
--- a/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java
+++ b/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESOids.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -51,7 +51,8 @@
*/
public class TestAESOids {
- private static final String PROVIDER_NAME = "SunJCE";
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunJCE");
private static final byte[] INPUT = "1234567890123456".getBytes();
private static final List DATA = Arrays.asList(
diff --git a/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java b/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java
index a75694be832..9b99ece8bda 100644
--- a/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java
+++ b/test/jdk/com/sun/crypto/provider/NSASuiteB/TestAESWrapOids.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -46,7 +46,8 @@
*/
public class TestAESWrapOids {
- private static final String PROVIDER_NAME = "SunJCE";
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunJCE");
private static final List DATA = Arrays.asList(
new DataTuple("2.16.840.1.101.3.4.1.5", "AESWrap_128"),
diff --git a/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java b/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java
index 15110d78d85..726b7d7063b 100644
--- a/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java
+++ b/test/jdk/com/sun/crypto/provider/NSASuiteB/TestHmacSHAOids.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -41,7 +41,8 @@
*/
public class TestHmacSHAOids {
- private static final String PROVIDER_NAME = "SunJCE";
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunJCE");
private static final byte[] INPUT = "1234567890".getBytes();
private static final List DATA = Arrays.asList(
diff --git a/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java b/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java
index 983e8acb4c3..b23390f0e50 100644
--- a/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java
+++ b/test/jdk/com/sun/crypto/provider/TLS/TestKeyMaterial.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -47,7 +47,8 @@ public class TestKeyMaterial extends Utils {
private static int PREFIX_LENGTH = "km-master: ".length();
public static void main(String[] args) throws Exception {
- Provider provider = Security.getProvider("SunJCE");
+ Provider provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
InputStream in = new FileInputStream(new File(BASE, "keymatdata.txt"));
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
diff --git a/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java b/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java
index bf47477b135..9dc22c77fd0 100644
--- a/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java
+++ b/test/jdk/com/sun/crypto/provider/TLS/TestLeadingZeroes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -47,7 +47,8 @@
public class TestLeadingZeroes {
- private static final String SUNJCE = "SunJCE";
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunJCE");
// Hex formatter to upper case with ":" delimiter
private static final HexFormat HEX_FORMATTER = HexFormat.ofDelimiter(":").withUpperCase();
@@ -73,14 +74,14 @@ private void run() throws Exception {
kfac.generatePrivate(new PKCS8EncodedKeySpec(bobPrivKeyEnc));
// generate normal shared secret
- KeyAgreement aliceKeyAgree = KeyAgreement.getInstance("DH", SUNJCE);
+ KeyAgreement aliceKeyAgree = KeyAgreement.getInstance("DH", PROVIDER_NAME);
aliceKeyAgree.init(alicePrivKey);
aliceKeyAgree.doPhase(bobPubKey, true);
byte[] sharedSecret = aliceKeyAgree.generateSecret();
System.out.println("shared secret:\n" + HEX_FORMATTER.formatHex(sharedSecret));
// verify that leading zero is present
- if (sharedSecret.length != 128) {
+ if (sharedSecret.length != 256) {
throw new Exception("Unexpected shared secret length");
}
if (sharedSecret[0] != 0) {
@@ -96,7 +97,7 @@ private void run() throws Exception {
"tls premaster secret:\n" + HEX_FORMATTER.formatHex(tlsPremasterSecret));
// check that leading zero has been stripped
- if (tlsPremasterSecret.length != 127) {
+ if (tlsPremasterSecret.length != 255) {
throw new Exception("Unexpected TLS premaster secret length");
}
if (tlsPremasterSecret[0] == 0) {
@@ -111,279 +112,455 @@ private void run() throws Exception {
}
private static final byte alicePubKeyEnc[] = {
- (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x24,
- (byte)0x30, (byte)0x81, (byte)0x99, (byte)0x06,
- (byte)0x09, (byte)0x2A, (byte)0x86, (byte)0x48,
- (byte)0x86, (byte)0xF7, (byte)0x0D, (byte)0x01,
- (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x81,
- (byte)0x8B, (byte)0x02, (byte)0x81, (byte)0x81,
- (byte)0x00, (byte)0xF4, (byte)0x88, (byte)0xFD,
- (byte)0x58, (byte)0x4E, (byte)0x49, (byte)0xDB,
- (byte)0xCD, (byte)0x20, (byte)0xB4, (byte)0x9D,
- (byte)0xE4, (byte)0x91, (byte)0x07, (byte)0x36,
- (byte)0x6B, (byte)0x33, (byte)0x6C, (byte)0x38,
- (byte)0x0D, (byte)0x45, (byte)0x1D, (byte)0x0F,
- (byte)0x7C, (byte)0x88, (byte)0xB3, (byte)0x1C,
- (byte)0x7C, (byte)0x5B, (byte)0x2D, (byte)0x8E,
- (byte)0xF6, (byte)0xF3, (byte)0xC9, (byte)0x23,
- (byte)0xC0, (byte)0x43, (byte)0xF0, (byte)0xA5,
- (byte)0x5B, (byte)0x18, (byte)0x8D, (byte)0x8E,
- (byte)0xBB, (byte)0x55, (byte)0x8C, (byte)0xB8,
- (byte)0x5D, (byte)0x38, (byte)0xD3, (byte)0x34,
- (byte)0xFD, (byte)0x7C, (byte)0x17, (byte)0x57,
- (byte)0x43, (byte)0xA3, (byte)0x1D, (byte)0x18,
- (byte)0x6C, (byte)0xDE, (byte)0x33, (byte)0x21,
- (byte)0x2C, (byte)0xB5, (byte)0x2A, (byte)0xFF,
- (byte)0x3C, (byte)0xE1, (byte)0xB1, (byte)0x29,
- (byte)0x40, (byte)0x18, (byte)0x11, (byte)0x8D,
- (byte)0x7C, (byte)0x84, (byte)0xA7, (byte)0x0A,
- (byte)0x72, (byte)0xD6, (byte)0x86, (byte)0xC4,
- (byte)0x03, (byte)0x19, (byte)0xC8, (byte)0x07,
- (byte)0x29, (byte)0x7A, (byte)0xCA, (byte)0x95,
- (byte)0x0C, (byte)0xD9, (byte)0x96, (byte)0x9F,
- (byte)0xAB, (byte)0xD0, (byte)0x0A, (byte)0x50,
- (byte)0x9B, (byte)0x02, (byte)0x46, (byte)0xD3,
- (byte)0x08, (byte)0x3D, (byte)0x66, (byte)0xA4,
- (byte)0x5D, (byte)0x41, (byte)0x9F, (byte)0x9C,
- (byte)0x7C, (byte)0xBD, (byte)0x89, (byte)0x4B,
- (byte)0x22, (byte)0x19, (byte)0x26, (byte)0xBA,
- (byte)0xAB, (byte)0xA2, (byte)0x5E, (byte)0xC3,
- (byte)0x55, (byte)0xE9, (byte)0x2F, (byte)0x78,
- (byte)0xC7, (byte)0x02, (byte)0x01, (byte)0x02,
- (byte)0x02, (byte)0x02, (byte)0x02, (byte)0x00,
- (byte)0x03, (byte)0x81, (byte)0x85, (byte)0x00,
- (byte)0x02, (byte)0x81, (byte)0x81, (byte)0x00,
- (byte)0xEE, (byte)0xD6, (byte)0xB1, (byte)0xA3,
- (byte)0xB4, (byte)0x78, (byte)0x2B, (byte)0x35,
- (byte)0xEF, (byte)0xCD, (byte)0x17, (byte)0x86,
- (byte)0x63, (byte)0x2B, (byte)0x97, (byte)0x0E,
- (byte)0x7A, (byte)0xD1, (byte)0xFF, (byte)0x7A,
- (byte)0xEB, (byte)0x57, (byte)0x61, (byte)0xA1,
- (byte)0xF7, (byte)0x90, (byte)0x11, (byte)0xA7,
- (byte)0x79, (byte)0x28, (byte)0x69, (byte)0xBA,
- (byte)0xA7, (byte)0xB2, (byte)0x37, (byte)0x17,
- (byte)0xAE, (byte)0x3C, (byte)0x92, (byte)0x89,
- (byte)0x88, (byte)0xE5, (byte)0x7E, (byte)0x8E,
- (byte)0xF0, (byte)0x24, (byte)0xD0, (byte)0xE1,
- (byte)0xC4, (byte)0xB0, (byte)0x26, (byte)0x5A,
- (byte)0x1E, (byte)0xBD, (byte)0xA0, (byte)0xCF,
- (byte)0x3E, (byte)0x97, (byte)0x2A, (byte)0x13,
- (byte)0x92, (byte)0x3B, (byte)0x39, (byte)0xD0,
- (byte)0x1D, (byte)0xA3, (byte)0x6B, (byte)0x3E,
- (byte)0xC2, (byte)0xBB, (byte)0x14, (byte)0xB6,
- (byte)0xE2, (byte)0x4C, (byte)0x0E, (byte)0x5B,
- (byte)0x4B, (byte)0xA4, (byte)0x9D, (byte)0xA6,
- (byte)0x21, (byte)0xB0, (byte)0xF9, (byte)0xDE,
- (byte)0x55, (byte)0xAE, (byte)0x5C, (byte)0x29,
- (byte)0x0E, (byte)0xC1, (byte)0xFC, (byte)0xBA,
- (byte)0x51, (byte)0xD3, (byte)0xB6, (byte)0x6D,
- (byte)0x75, (byte)0x72, (byte)0xDF, (byte)0x43,
- (byte)0xAB, (byte)0x94, (byte)0x21, (byte)0x6E,
- (byte)0x0C, (byte)0xD1, (byte)0x93, (byte)0x54,
- (byte)0x56, (byte)0x7D, (byte)0x4B, (byte)0x90,
- (byte)0xF1, (byte)0x94, (byte)0x45, (byte)0xD4,
- (byte)0x2A, (byte)0x71, (byte)0xA1, (byte)0xB8,
- (byte)0xDD, (byte)0xAA, (byte)0x05, (byte)0xF0,
- (byte)0x27, (byte)0x37, (byte)0xBD, (byte)0x44
+ (byte)0x30, (byte)0x82, (byte)0x02, (byte)0x25,
+ (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x17,
+ (byte)0x06, (byte)0x09, (byte)0x2a, (byte)0x86,
+ (byte)0x48, (byte)0x86, (byte)0xf7, (byte)0x0d,
+ (byte)0x01, (byte)0x03, (byte)0x01, (byte)0x30,
+ (byte)0x82, (byte)0x01, (byte)0x08, (byte)0x02,
+ (byte)0x82, (byte)0x01, (byte)0x01, (byte)0x00,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xad, (byte)0xf8, (byte)0x54, (byte)0x58,
+ (byte)0xa2, (byte)0xbb, (byte)0x4a, (byte)0x9a,
+ (byte)0xaf, (byte)0xdc, (byte)0x56, (byte)0x20,
+ (byte)0x27, (byte)0x3d, (byte)0x3c, (byte)0xf1,
+ (byte)0xd8, (byte)0xb9, (byte)0xc5, (byte)0x83,
+ (byte)0xce, (byte)0x2d, (byte)0x36, (byte)0x95,
+ (byte)0xa9, (byte)0xe1, (byte)0x36, (byte)0x41,
+ (byte)0x14, (byte)0x64, (byte)0x33, (byte)0xfb,
+ (byte)0xcc, (byte)0x93, (byte)0x9d, (byte)0xce,
+ (byte)0x24, (byte)0x9b, (byte)0x3e, (byte)0xf9,
+ (byte)0x7d, (byte)0x2f, (byte)0xe3, (byte)0x63,
+ (byte)0x63, (byte)0x0c, (byte)0x75, (byte)0xd8,
+ (byte)0xf6, (byte)0x81, (byte)0xb2, (byte)0x02,
+ (byte)0xae, (byte)0xc4, (byte)0x61, (byte)0x7a,
+ (byte)0xd3, (byte)0xdf, (byte)0x1e, (byte)0xd5,
+ (byte)0xd5, (byte)0xfd, (byte)0x65, (byte)0x61,
+ (byte)0x24, (byte)0x33, (byte)0xf5, (byte)0x1f,
+ (byte)0x5f, (byte)0x06, (byte)0x6e, (byte)0xd0,
+ (byte)0x85, (byte)0x63, (byte)0x65, (byte)0x55,
+ (byte)0x3d, (byte)0xed, (byte)0x1a, (byte)0xf3,
+ (byte)0xb5, (byte)0x57, (byte)0x13, (byte)0x5e,
+ (byte)0x7f, (byte)0x57, (byte)0xc9, (byte)0x35,
+ (byte)0x98, (byte)0x4f, (byte)0x0c, (byte)0x70,
+ (byte)0xe0, (byte)0xe6, (byte)0x8b, (byte)0x77,
+ (byte)0xe2, (byte)0xa6, (byte)0x89, (byte)0xda,
+ (byte)0xf3, (byte)0xef, (byte)0xe8, (byte)0x72,
+ (byte)0x1d, (byte)0xf1, (byte)0x58, (byte)0xa1,
+ (byte)0x36, (byte)0xad, (byte)0xe7, (byte)0x35,
+ (byte)0x30, (byte)0xac, (byte)0xca, (byte)0x4f,
+ (byte)0x48, (byte)0x3a, (byte)0x79, (byte)0x7a,
+ (byte)0xbc, (byte)0x0a, (byte)0xb1, (byte)0x82,
+ (byte)0xb3, (byte)0x24, (byte)0xfb, (byte)0x61,
+ (byte)0xd1, (byte)0x08, (byte)0xa9, (byte)0x4b,
+ (byte)0xb2, (byte)0xc8, (byte)0xe3, (byte)0xfb,
+ (byte)0xb9, (byte)0x6a, (byte)0xda, (byte)0xb7,
+ (byte)0x60, (byte)0xd7, (byte)0xf4, (byte)0x68,
+ (byte)0x1d, (byte)0x4f, (byte)0x42, (byte)0xa3,
+ (byte)0xde, (byte)0x39, (byte)0x4d, (byte)0xf4,
+ (byte)0xae, (byte)0x56, (byte)0xed, (byte)0xe7,
+ (byte)0x63, (byte)0x72, (byte)0xbb, (byte)0x19,
+ (byte)0x0b, (byte)0x07, (byte)0xa7, (byte)0xc8,
+ (byte)0xee, (byte)0x0a, (byte)0x6d, (byte)0x70,
+ (byte)0x9e, (byte)0x02, (byte)0xfc, (byte)0xe1,
+ (byte)0xcd, (byte)0xf7, (byte)0xe2, (byte)0xec,
+ (byte)0xc0, (byte)0x34, (byte)0x04, (byte)0xcd,
+ (byte)0x28, (byte)0x34, (byte)0x2f, (byte)0x61,
+ (byte)0x91, (byte)0x72, (byte)0xfe, (byte)0x9c,
+ (byte)0xe9, (byte)0x85, (byte)0x83, (byte)0xff,
+ (byte)0x8e, (byte)0x4f, (byte)0x12, (byte)0x32,
+ (byte)0xee, (byte)0xf2, (byte)0x81, (byte)0x83,
+ (byte)0xc3, (byte)0xfe, (byte)0x3b, (byte)0x1b,
+ (byte)0x4c, (byte)0x6f, (byte)0xad, (byte)0x73,
+ (byte)0x3b, (byte)0xb5, (byte)0xfc, (byte)0xbc,
+ (byte)0x2e, (byte)0xc2, (byte)0x20, (byte)0x05,
+ (byte)0xc5, (byte)0x8e, (byte)0xf1, (byte)0x83,
+ (byte)0x7d, (byte)0x16, (byte)0x83, (byte)0xb2,
+ (byte)0xc6, (byte)0xf3, (byte)0x4a, (byte)0x26,
+ (byte)0xc1, (byte)0xb2, (byte)0xef, (byte)0xfa,
+ (byte)0x88, (byte)0x6b, (byte)0x42, (byte)0x38,
+ (byte)0x61, (byte)0x28, (byte)0x5c, (byte)0x97,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0x02, (byte)0x01, (byte)0x02, (byte)0x03,
+ (byte)0x82, (byte)0x01, (byte)0x06, (byte)0x00,
+ (byte)0x02, (byte)0x82, (byte)0x01, (byte)0x01,
+ (byte)0x00, (byte)0xb0, (byte)0x6e, (byte)0x76,
+ (byte)0x73, (byte)0x32, (byte)0xd4, (byte)0xcf,
+ (byte)0xb8, (byte)0x16, (byte)0x46, (byte)0x76,
+ (byte)0x8b, (byte)0x2b, (byte)0x2b, (byte)0xda,
+ (byte)0x6e, (byte)0x25, (byte)0x52, (byte)0x87,
+ (byte)0x9e, (byte)0x0c, (byte)0x97, (byte)0xc7,
+ (byte)0x16, (byte)0x42, (byte)0xb6, (byte)0x30,
+ (byte)0xc6, (byte)0x30, (byte)0xce, (byte)0xc5,
+ (byte)0xf4, (byte)0x8e, (byte)0x28, (byte)0xe0,
+ (byte)0x8d, (byte)0x5b, (byte)0x44, (byte)0x59,
+ (byte)0xae, (byte)0x5e, (byte)0xb6, (byte)0x5f,
+ (byte)0x48, (byte)0x8e, (byte)0x13, (byte)0x91,
+ (byte)0x00, (byte)0x72, (byte)0x9b, (byte)0x1b,
+ (byte)0xd8, (byte)0x69, (byte)0xe4, (byte)0xdf,
+ (byte)0x10, (byte)0x50, (byte)0x53, (byte)0x0f,
+ (byte)0x3d, (byte)0xba, (byte)0x82, (byte)0x02,
+ (byte)0x1c, (byte)0x78, (byte)0xf3, (byte)0xf3,
+ (byte)0x9a, (byte)0x01, (byte)0x3d, (byte)0xb6,
+ (byte)0x65, (byte)0xc2, (byte)0x6f, (byte)0x70,
+ (byte)0xec, (byte)0x67, (byte)0x14, (byte)0x56,
+ (byte)0xa0, (byte)0x98, (byte)0xef, (byte)0xc8,
+ (byte)0x63, (byte)0xbe, (byte)0x14, (byte)0x78,
+ (byte)0x1d, (byte)0xff, (byte)0xf8, (byte)0xf9,
+ (byte)0xd9, (byte)0x53, (byte)0xb2, (byte)0xc4,
+ (byte)0x40, (byte)0x3e, (byte)0x90, (byte)0x5c,
+ (byte)0x10, (byte)0xf8, (byte)0xa4, (byte)0xd3,
+ (byte)0xa2, (byte)0x39, (byte)0xc6, (byte)0xeb,
+ (byte)0xcd, (byte)0x3d, (byte)0xd1, (byte)0x27,
+ (byte)0x51, (byte)0xc8, (byte)0x4f, (byte)0x9b,
+ (byte)0x86, (byte)0xce, (byte)0xcf, (byte)0x80,
+ (byte)0x96, (byte)0x3d, (byte)0xb9, (byte)0x25,
+ (byte)0x05, (byte)0x54, (byte)0x15, (byte)0x8d,
+ (byte)0x02, (byte)0xd2, (byte)0x6f, (byte)0xed,
+ (byte)0xaf, (byte)0x49, (byte)0x0d, (byte)0x3e,
+ (byte)0xda, (byte)0xe6, (byte)0x3d, (byte)0x1a,
+ (byte)0x91, (byte)0x8f, (byte)0xca, (byte)0x6d,
+ (byte)0x88, (byte)0xff, (byte)0x0f, (byte)0x75,
+ (byte)0xf5, (byte)0x4e, (byte)0x08, (byte)0x42,
+ (byte)0xf0, (byte)0xa3, (byte)0x4a, (byte)0x95,
+ (byte)0xca, (byte)0x18, (byte)0xc1, (byte)0x3d,
+ (byte)0x9a, (byte)0x12, (byte)0x3e, (byte)0x09,
+ (byte)0x29, (byte)0x82, (byte)0x8e, (byte)0xe5,
+ (byte)0x3a, (byte)0x4c, (byte)0xcc, (byte)0x8f,
+ (byte)0x94, (byte)0x14, (byte)0xe3, (byte)0xc7,
+ (byte)0x63, (byte)0x8a, (byte)0x23, (byte)0x11,
+ (byte)0x03, (byte)0x77, (byte)0x7d, (byte)0xe8,
+ (byte)0x03, (byte)0x15, (byte)0x37, (byte)0xa9,
+ (byte)0xe5, (byte)0xd7, (byte)0x38, (byte)0x8f,
+ (byte)0xa8, (byte)0x49, (byte)0x5d, (byte)0xe4,
+ (byte)0x0d, (byte)0xed, (byte)0xb9, (byte)0x92,
+ (byte)0xc4, (byte)0xd7, (byte)0x72, (byte)0xf2,
+ (byte)0x29, (byte)0x26, (byte)0x99, (byte)0x11,
+ (byte)0xac, (byte)0xa8, (byte)0x45, (byte)0xb1,
+ (byte)0x6b, (byte)0x5a, (byte)0x01, (byte)0xc4,
+ (byte)0xe0, (byte)0x08, (byte)0xbf, (byte)0xa1,
+ (byte)0x49, (byte)0x2a, (byte)0x9c, (byte)0x8c,
+ (byte)0x89, (byte)0x31, (byte)0x07, (byte)0x36,
+ (byte)0x7d, (byte)0xec, (byte)0xa3, (byte)0x9a,
+ (byte)0x1e, (byte)0xd6, (byte)0xc6, (byte)0x01,
+ (byte)0x0e, (byte)0xc8, (byte)0x85, (byte)0x55,
+ (byte)0x42, (byte)0xa4, (byte)0x87, (byte)0x58,
+ (byte)0xfa, (byte)0xec, (byte)0x71, (byte)0x2e,
+ (byte)0x4c, (byte)0x46, (byte)0xd2, (byte)0x19,
+ (byte)0x23, (byte)0x0a, (byte)0x59, (byte)0x1a,
+ (byte)0x56
};
private static final byte alicePrivKeyEnc[] = {
- (byte)0x30, (byte)0x81, (byte)0xE3, (byte)0x02,
- (byte)0x01, (byte)0x00, (byte)0x30, (byte)0x81,
- (byte)0x99, (byte)0x06, (byte)0x09, (byte)0x2A,
- (byte)0x86, (byte)0x48, (byte)0x86, (byte)0xF7,
- (byte)0x0D, (byte)0x01, (byte)0x03, (byte)0x01,
- (byte)0x30, (byte)0x81, (byte)0x8B, (byte)0x02,
- (byte)0x81, (byte)0x81, (byte)0x00, (byte)0xF4,
- (byte)0x88, (byte)0xFD, (byte)0x58, (byte)0x4E,
- (byte)0x49, (byte)0xDB, (byte)0xCD, (byte)0x20,
- (byte)0xB4, (byte)0x9D, (byte)0xE4, (byte)0x91,
- (byte)0x07, (byte)0x36, (byte)0x6B, (byte)0x33,
- (byte)0x6C, (byte)0x38, (byte)0x0D, (byte)0x45,
- (byte)0x1D, (byte)0x0F, (byte)0x7C, (byte)0x88,
- (byte)0xB3, (byte)0x1C, (byte)0x7C, (byte)0x5B,
- (byte)0x2D, (byte)0x8E, (byte)0xF6, (byte)0xF3,
- (byte)0xC9, (byte)0x23, (byte)0xC0, (byte)0x43,
- (byte)0xF0, (byte)0xA5, (byte)0x5B, (byte)0x18,
- (byte)0x8D, (byte)0x8E, (byte)0xBB, (byte)0x55,
- (byte)0x8C, (byte)0xB8, (byte)0x5D, (byte)0x38,
- (byte)0xD3, (byte)0x34, (byte)0xFD, (byte)0x7C,
- (byte)0x17, (byte)0x57, (byte)0x43, (byte)0xA3,
- (byte)0x1D, (byte)0x18, (byte)0x6C, (byte)0xDE,
- (byte)0x33, (byte)0x21, (byte)0x2C, (byte)0xB5,
- (byte)0x2A, (byte)0xFF, (byte)0x3C, (byte)0xE1,
- (byte)0xB1, (byte)0x29, (byte)0x40, (byte)0x18,
- (byte)0x11, (byte)0x8D, (byte)0x7C, (byte)0x84,
- (byte)0xA7, (byte)0x0A, (byte)0x72, (byte)0xD6,
- (byte)0x86, (byte)0xC4, (byte)0x03, (byte)0x19,
- (byte)0xC8, (byte)0x07, (byte)0x29, (byte)0x7A,
- (byte)0xCA, (byte)0x95, (byte)0x0C, (byte)0xD9,
- (byte)0x96, (byte)0x9F, (byte)0xAB, (byte)0xD0,
- (byte)0x0A, (byte)0x50, (byte)0x9B, (byte)0x02,
- (byte)0x46, (byte)0xD3, (byte)0x08, (byte)0x3D,
- (byte)0x66, (byte)0xA4, (byte)0x5D, (byte)0x41,
- (byte)0x9F, (byte)0x9C, (byte)0x7C, (byte)0xBD,
- (byte)0x89, (byte)0x4B, (byte)0x22, (byte)0x19,
- (byte)0x26, (byte)0xBA, (byte)0xAB, (byte)0xA2,
- (byte)0x5E, (byte)0xC3, (byte)0x55, (byte)0xE9,
- (byte)0x2F, (byte)0x78, (byte)0xC7, (byte)0x02,
- (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x02,
- (byte)0x02, (byte)0x00, (byte)0x04, (byte)0x42,
- (byte)0x02, (byte)0x40, (byte)0x36, (byte)0x4D,
- (byte)0xD0, (byte)0x58, (byte)0x64, (byte)0x91,
- (byte)0x78, (byte)0xA2, (byte)0x4B, (byte)0x79,
- (byte)0x46, (byte)0xFE, (byte)0xC9, (byte)0xD9,
- (byte)0xCA, (byte)0x5C, (byte)0xF9, (byte)0xFD,
- (byte)0x6C, (byte)0x5D, (byte)0x76, (byte)0x3A,
- (byte)0x41, (byte)0x6D, (byte)0x44, (byte)0x62,
- (byte)0x75, (byte)0x93, (byte)0x81, (byte)0x93,
- (byte)0x00, (byte)0x4C, (byte)0xB1, (byte)0xD8,
- (byte)0x7D, (byte)0x9D, (byte)0xF3, (byte)0x16,
- (byte)0x2C, (byte)0x6C, (byte)0x9F, (byte)0x7A,
- (byte)0x84, (byte)0xA3, (byte)0x7A, (byte)0xC1,
- (byte)0x4F, (byte)0x60, (byte)0xE3, (byte)0xB5,
- (byte)0x86, (byte)0x28, (byte)0x08, (byte)0x4D,
- (byte)0x94, (byte)0xB6, (byte)0x04, (byte)0x0D,
- (byte)0xAC, (byte)0xBD, (byte)0x1F, (byte)0x42,
- (byte)0x8F, (byte)0x1B
+ (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x3f,
+ (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x30,
+ (byte)0x82, (byte)0x01, (byte)0x17, (byte)0x06,
+ (byte)0x09, (byte)0x2a, (byte)0x86, (byte)0x48,
+ (byte)0x86, (byte)0xf7, (byte)0x0d, (byte)0x01,
+ (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x82,
+ (byte)0x01, (byte)0x08, (byte)0x02, (byte)0x82,
+ (byte)0x01, (byte)0x01, (byte)0x00, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xad,
+ (byte)0xf8, (byte)0x54, (byte)0x58, (byte)0xa2,
+ (byte)0xbb, (byte)0x4a, (byte)0x9a, (byte)0xaf,
+ (byte)0xdc, (byte)0x56, (byte)0x20, (byte)0x27,
+ (byte)0x3d, (byte)0x3c, (byte)0xf1, (byte)0xd8,
+ (byte)0xb9, (byte)0xc5, (byte)0x83, (byte)0xce,
+ (byte)0x2d, (byte)0x36, (byte)0x95, (byte)0xa9,
+ (byte)0xe1, (byte)0x36, (byte)0x41, (byte)0x14,
+ (byte)0x64, (byte)0x33, (byte)0xfb, (byte)0xcc,
+ (byte)0x93, (byte)0x9d, (byte)0xce, (byte)0x24,
+ (byte)0x9b, (byte)0x3e, (byte)0xf9, (byte)0x7d,
+ (byte)0x2f, (byte)0xe3, (byte)0x63, (byte)0x63,
+ (byte)0x0c, (byte)0x75, (byte)0xd8, (byte)0xf6,
+ (byte)0x81, (byte)0xb2, (byte)0x02, (byte)0xae,
+ (byte)0xc4, (byte)0x61, (byte)0x7a, (byte)0xd3,
+ (byte)0xdf, (byte)0x1e, (byte)0xd5, (byte)0xd5,
+ (byte)0xfd, (byte)0x65, (byte)0x61, (byte)0x24,
+ (byte)0x33, (byte)0xf5, (byte)0x1f, (byte)0x5f,
+ (byte)0x06, (byte)0x6e, (byte)0xd0, (byte)0x85,
+ (byte)0x63, (byte)0x65, (byte)0x55, (byte)0x3d,
+ (byte)0xed, (byte)0x1a, (byte)0xf3, (byte)0xb5,
+ (byte)0x57, (byte)0x13, (byte)0x5e, (byte)0x7f,
+ (byte)0x57, (byte)0xc9, (byte)0x35, (byte)0x98,
+ (byte)0x4f, (byte)0x0c, (byte)0x70, (byte)0xe0,
+ (byte)0xe6, (byte)0x8b, (byte)0x77, (byte)0xe2,
+ (byte)0xa6, (byte)0x89, (byte)0xda, (byte)0xf3,
+ (byte)0xef, (byte)0xe8, (byte)0x72, (byte)0x1d,
+ (byte)0xf1, (byte)0x58, (byte)0xa1, (byte)0x36,
+ (byte)0xad, (byte)0xe7, (byte)0x35, (byte)0x30,
+ (byte)0xac, (byte)0xca, (byte)0x4f, (byte)0x48,
+ (byte)0x3a, (byte)0x79, (byte)0x7a, (byte)0xbc,
+ (byte)0x0a, (byte)0xb1, (byte)0x82, (byte)0xb3,
+ (byte)0x24, (byte)0xfb, (byte)0x61, (byte)0xd1,
+ (byte)0x08, (byte)0xa9, (byte)0x4b, (byte)0xb2,
+ (byte)0xc8, (byte)0xe3, (byte)0xfb, (byte)0xb9,
+ (byte)0x6a, (byte)0xda, (byte)0xb7, (byte)0x60,
+ (byte)0xd7, (byte)0xf4, (byte)0x68, (byte)0x1d,
+ (byte)0x4f, (byte)0x42, (byte)0xa3, (byte)0xde,
+ (byte)0x39, (byte)0x4d, (byte)0xf4, (byte)0xae,
+ (byte)0x56, (byte)0xed, (byte)0xe7, (byte)0x63,
+ (byte)0x72, (byte)0xbb, (byte)0x19, (byte)0x0b,
+ (byte)0x07, (byte)0xa7, (byte)0xc8, (byte)0xee,
+ (byte)0x0a, (byte)0x6d, (byte)0x70, (byte)0x9e,
+ (byte)0x02, (byte)0xfc, (byte)0xe1, (byte)0xcd,
+ (byte)0xf7, (byte)0xe2, (byte)0xec, (byte)0xc0,
+ (byte)0x34, (byte)0x04, (byte)0xcd, (byte)0x28,
+ (byte)0x34, (byte)0x2f, (byte)0x61, (byte)0x91,
+ (byte)0x72, (byte)0xfe, (byte)0x9c, (byte)0xe9,
+ (byte)0x85, (byte)0x83, (byte)0xff, (byte)0x8e,
+ (byte)0x4f, (byte)0x12, (byte)0x32, (byte)0xee,
+ (byte)0xf2, (byte)0x81, (byte)0x83, (byte)0xc3,
+ (byte)0xfe, (byte)0x3b, (byte)0x1b, (byte)0x4c,
+ (byte)0x6f, (byte)0xad, (byte)0x73, (byte)0x3b,
+ (byte)0xb5, (byte)0xfc, (byte)0xbc, (byte)0x2e,
+ (byte)0xc2, (byte)0x20, (byte)0x05, (byte)0xc5,
+ (byte)0x8e, (byte)0xf1, (byte)0x83, (byte)0x7d,
+ (byte)0x16, (byte)0x83, (byte)0xb2, (byte)0xc6,
+ (byte)0xf3, (byte)0x4a, (byte)0x26, (byte)0xc1,
+ (byte)0xb2, (byte)0xef, (byte)0xfa, (byte)0x88,
+ (byte)0x6b, (byte)0x42, (byte)0x38, (byte)0x61,
+ (byte)0x28, (byte)0x5c, (byte)0x97, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x02,
+ (byte)0x01, (byte)0x02, (byte)0x04, (byte)0x1f,
+ (byte)0x02, (byte)0x1d, (byte)0x00, (byte)0xc7,
+ (byte)0x06, (byte)0xe9, (byte)0x24, (byte)0xf8,
+ (byte)0xb1, (byte)0xdf, (byte)0x98, (byte)0x61,
+ (byte)0x34, (byte)0x7f, (byte)0xcf, (byte)0xf1,
+ (byte)0xcc, (byte)0xcd, (byte)0xc8, (byte)0xcc,
+ (byte)0xd9, (byte)0x6a, (byte)0xb8, (byte)0x7d,
+ (byte)0x72, (byte)0x4c, (byte)0x58, (byte)0x5a,
+ (byte)0x97, (byte)0x39, (byte)0x69
};
private static final byte bobPubKeyEnc[] = {
- (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x23,
- (byte)0x30, (byte)0x81, (byte)0x99, (byte)0x06,
- (byte)0x09, (byte)0x2A, (byte)0x86, (byte)0x48,
- (byte)0x86, (byte)0xF7, (byte)0x0D, (byte)0x01,
- (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x81,
- (byte)0x8B, (byte)0x02, (byte)0x81, (byte)0x81,
- (byte)0x00, (byte)0xF4, (byte)0x88, (byte)0xFD,
- (byte)0x58, (byte)0x4E, (byte)0x49, (byte)0xDB,
- (byte)0xCD, (byte)0x20, (byte)0xB4, (byte)0x9D,
- (byte)0xE4, (byte)0x91, (byte)0x07, (byte)0x36,
- (byte)0x6B, (byte)0x33, (byte)0x6C, (byte)0x38,
- (byte)0x0D, (byte)0x45, (byte)0x1D, (byte)0x0F,
- (byte)0x7C, (byte)0x88, (byte)0xB3, (byte)0x1C,
- (byte)0x7C, (byte)0x5B, (byte)0x2D, (byte)0x8E,
- (byte)0xF6, (byte)0xF3, (byte)0xC9, (byte)0x23,
- (byte)0xC0, (byte)0x43, (byte)0xF0, (byte)0xA5,
- (byte)0x5B, (byte)0x18, (byte)0x8D, (byte)0x8E,
- (byte)0xBB, (byte)0x55, (byte)0x8C, (byte)0xB8,
- (byte)0x5D, (byte)0x38, (byte)0xD3, (byte)0x34,
- (byte)0xFD, (byte)0x7C, (byte)0x17, (byte)0x57,
- (byte)0x43, (byte)0xA3, (byte)0x1D, (byte)0x18,
- (byte)0x6C, (byte)0xDE, (byte)0x33, (byte)0x21,
- (byte)0x2C, (byte)0xB5, (byte)0x2A, (byte)0xFF,
- (byte)0x3C, (byte)0xE1, (byte)0xB1, (byte)0x29,
- (byte)0x40, (byte)0x18, (byte)0x11, (byte)0x8D,
- (byte)0x7C, (byte)0x84, (byte)0xA7, (byte)0x0A,
- (byte)0x72, (byte)0xD6, (byte)0x86, (byte)0xC4,
- (byte)0x03, (byte)0x19, (byte)0xC8, (byte)0x07,
- (byte)0x29, (byte)0x7A, (byte)0xCA, (byte)0x95,
- (byte)0x0C, (byte)0xD9, (byte)0x96, (byte)0x9F,
- (byte)0xAB, (byte)0xD0, (byte)0x0A, (byte)0x50,
- (byte)0x9B, (byte)0x02, (byte)0x46, (byte)0xD3,
- (byte)0x08, (byte)0x3D, (byte)0x66, (byte)0xA4,
- (byte)0x5D, (byte)0x41, (byte)0x9F, (byte)0x9C,
- (byte)0x7C, (byte)0xBD, (byte)0x89, (byte)0x4B,
- (byte)0x22, (byte)0x19, (byte)0x26, (byte)0xBA,
- (byte)0xAB, (byte)0xA2, (byte)0x5E, (byte)0xC3,
- (byte)0x55, (byte)0xE9, (byte)0x2F, (byte)0x78,
- (byte)0xC7, (byte)0x02, (byte)0x01, (byte)0x02,
- (byte)0x02, (byte)0x02, (byte)0x02, (byte)0x00,
- (byte)0x03, (byte)0x81, (byte)0x84, (byte)0x00,
- (byte)0x02, (byte)0x81, (byte)0x80, (byte)0x2C,
- (byte)0x40, (byte)0xFA, (byte)0xF6, (byte)0xA6,
- (byte)0xF8, (byte)0xAC, (byte)0xC2, (byte)0x4F,
- (byte)0xCD, (byte)0xC7, (byte)0x37, (byte)0x93,
- (byte)0xE5, (byte)0xE4, (byte)0x5E, (byte)0x18,
- (byte)0x14, (byte)0xE6, (byte)0x50, (byte)0xDA,
- (byte)0x55, (byte)0x38, (byte)0x5D, (byte)0x24,
- (byte)0xF5, (byte)0x42, (byte)0x68, (byte)0x5F,
- (byte)0xF5, (byte)0x15, (byte)0xC8, (byte)0x9B,
- (byte)0x5D, (byte)0x06, (byte)0x3D, (byte)0xE1,
- (byte)0x52, (byte)0x2F, (byte)0x98, (byte)0xFF,
- (byte)0x37, (byte)0xBB, (byte)0x75, (byte)0x48,
- (byte)0x48, (byte)0xE9, (byte)0x65, (byte)0x84,
- (byte)0x37, (byte)0xBB, (byte)0xB3, (byte)0xE9,
- (byte)0x36, (byte)0x01, (byte)0xB4, (byte)0x6A,
- (byte)0x1C, (byte)0xB2, (byte)0x11, (byte)0x82,
- (byte)0xCE, (byte)0x3D, (byte)0x65, (byte)0xE5,
- (byte)0x3C, (byte)0x89, (byte)0xE9, (byte)0x52,
- (byte)0x19, (byte)0xBD, (byte)0x58, (byte)0xF6,
- (byte)0xA2, (byte)0x03, (byte)0xA8, (byte)0xB2,
- (byte)0xA5, (byte)0xDB, (byte)0xEB, (byte)0xF5,
- (byte)0x94, (byte)0xF9, (byte)0x46, (byte)0xBE,
- (byte)0x45, (byte)0x4C, (byte)0x65, (byte)0xD2,
- (byte)0xD1, (byte)0xCF, (byte)0xFF, (byte)0xFF,
- (byte)0xFA, (byte)0x38, (byte)0xF1, (byte)0x72,
- (byte)0xAB, (byte)0xB9, (byte)0x14, (byte)0x4E,
- (byte)0xF5, (byte)0xF0, (byte)0x7A, (byte)0x8E,
- (byte)0x45, (byte)0xFD, (byte)0x5B, (byte)0xF9,
- (byte)0xA2, (byte)0x97, (byte)0x1B, (byte)0xAE,
- (byte)0x2C, (byte)0x7B, (byte)0x6B, (byte)0x7C,
- (byte)0x98, (byte)0xFE, (byte)0x58, (byte)0xDD,
- (byte)0xBE, (byte)0xF6, (byte)0x1C, (byte)0x8E,
- (byte)0xD0, (byte)0xA1, (byte)0x72
+ (byte)0x30, (byte)0x82, (byte)0x02, (byte)0x25,
+ (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x17,
+ (byte)0x06, (byte)0x09, (byte)0x2a, (byte)0x86,
+ (byte)0x48, (byte)0x86, (byte)0xf7, (byte)0x0d,
+ (byte)0x01, (byte)0x03, (byte)0x01, (byte)0x30,
+ (byte)0x82, (byte)0x01, (byte)0x08, (byte)0x02,
+ (byte)0x82, (byte)0x01, (byte)0x01, (byte)0x00,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xad, (byte)0xf8, (byte)0x54, (byte)0x58,
+ (byte)0xa2, (byte)0xbb, (byte)0x4a, (byte)0x9a,
+ (byte)0xaf, (byte)0xdc, (byte)0x56, (byte)0x20,
+ (byte)0x27, (byte)0x3d, (byte)0x3c, (byte)0xf1,
+ (byte)0xd8, (byte)0xb9, (byte)0xc5, (byte)0x83,
+ (byte)0xce, (byte)0x2d, (byte)0x36, (byte)0x95,
+ (byte)0xa9, (byte)0xe1, (byte)0x36, (byte)0x41,
+ (byte)0x14, (byte)0x64, (byte)0x33, (byte)0xfb,
+ (byte)0xcc, (byte)0x93, (byte)0x9d, (byte)0xce,
+ (byte)0x24, (byte)0x9b, (byte)0x3e, (byte)0xf9,
+ (byte)0x7d, (byte)0x2f, (byte)0xe3, (byte)0x63,
+ (byte)0x63, (byte)0x0c, (byte)0x75, (byte)0xd8,
+ (byte)0xf6, (byte)0x81, (byte)0xb2, (byte)0x02,
+ (byte)0xae, (byte)0xc4, (byte)0x61, (byte)0x7a,
+ (byte)0xd3, (byte)0xdf, (byte)0x1e, (byte)0xd5,
+ (byte)0xd5, (byte)0xfd, (byte)0x65, (byte)0x61,
+ (byte)0x24, (byte)0x33, (byte)0xf5, (byte)0x1f,
+ (byte)0x5f, (byte)0x06, (byte)0x6e, (byte)0xd0,
+ (byte)0x85, (byte)0x63, (byte)0x65, (byte)0x55,
+ (byte)0x3d, (byte)0xed, (byte)0x1a, (byte)0xf3,
+ (byte)0xb5, (byte)0x57, (byte)0x13, (byte)0x5e,
+ (byte)0x7f, (byte)0x57, (byte)0xc9, (byte)0x35,
+ (byte)0x98, (byte)0x4f, (byte)0x0c, (byte)0x70,
+ (byte)0xe0, (byte)0xe6, (byte)0x8b, (byte)0x77,
+ (byte)0xe2, (byte)0xa6, (byte)0x89, (byte)0xda,
+ (byte)0xf3, (byte)0xef, (byte)0xe8, (byte)0x72,
+ (byte)0x1d, (byte)0xf1, (byte)0x58, (byte)0xa1,
+ (byte)0x36, (byte)0xad, (byte)0xe7, (byte)0x35,
+ (byte)0x30, (byte)0xac, (byte)0xca, (byte)0x4f,
+ (byte)0x48, (byte)0x3a, (byte)0x79, (byte)0x7a,
+ (byte)0xbc, (byte)0x0a, (byte)0xb1, (byte)0x82,
+ (byte)0xb3, (byte)0x24, (byte)0xfb, (byte)0x61,
+ (byte)0xd1, (byte)0x08, (byte)0xa9, (byte)0x4b,
+ (byte)0xb2, (byte)0xc8, (byte)0xe3, (byte)0xfb,
+ (byte)0xb9, (byte)0x6a, (byte)0xda, (byte)0xb7,
+ (byte)0x60, (byte)0xd7, (byte)0xf4, (byte)0x68,
+ (byte)0x1d, (byte)0x4f, (byte)0x42, (byte)0xa3,
+ (byte)0xde, (byte)0x39, (byte)0x4d, (byte)0xf4,
+ (byte)0xae, (byte)0x56, (byte)0xed, (byte)0xe7,
+ (byte)0x63, (byte)0x72, (byte)0xbb, (byte)0x19,
+ (byte)0x0b, (byte)0x07, (byte)0xa7, (byte)0xc8,
+ (byte)0xee, (byte)0x0a, (byte)0x6d, (byte)0x70,
+ (byte)0x9e, (byte)0x02, (byte)0xfc, (byte)0xe1,
+ (byte)0xcd, (byte)0xf7, (byte)0xe2, (byte)0xec,
+ (byte)0xc0, (byte)0x34, (byte)0x04, (byte)0xcd,
+ (byte)0x28, (byte)0x34, (byte)0x2f, (byte)0x61,
+ (byte)0x91, (byte)0x72, (byte)0xfe, (byte)0x9c,
+ (byte)0xe9, (byte)0x85, (byte)0x83, (byte)0xff,
+ (byte)0x8e, (byte)0x4f, (byte)0x12, (byte)0x32,
+ (byte)0xee, (byte)0xf2, (byte)0x81, (byte)0x83,
+ (byte)0xc3, (byte)0xfe, (byte)0x3b, (byte)0x1b,
+ (byte)0x4c, (byte)0x6f, (byte)0xad, (byte)0x73,
+ (byte)0x3b, (byte)0xb5, (byte)0xfc, (byte)0xbc,
+ (byte)0x2e, (byte)0xc2, (byte)0x20, (byte)0x05,
+ (byte)0xc5, (byte)0x8e, (byte)0xf1, (byte)0x83,
+ (byte)0x7d, (byte)0x16, (byte)0x83, (byte)0xb2,
+ (byte)0xc6, (byte)0xf3, (byte)0x4a, (byte)0x26,
+ (byte)0xc1, (byte)0xb2, (byte)0xef, (byte)0xfa,
+ (byte)0x88, (byte)0x6b, (byte)0x42, (byte)0x38,
+ (byte)0x61, (byte)0x28, (byte)0x5c, (byte)0x97,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0x02, (byte)0x01, (byte)0x02, (byte)0x03,
+ (byte)0x82, (byte)0x01, (byte)0x06, (byte)0x00,
+ (byte)0x02, (byte)0x82, (byte)0x01, (byte)0x01,
+ (byte)0x00, (byte)0x8d, (byte)0xb4, (byte)0x1c,
+ (byte)0xfc, (byte)0xc0, (byte)0x5f, (byte)0x38,
+ (byte)0x4c, (byte)0x7f, (byte)0x31, (byte)0xaa,
+ (byte)0x03, (byte)0x06, (byte)0xf0, (byte)0xec,
+ (byte)0xfd, (byte)0x45, (byte)0x8d, (byte)0x69,
+ (byte)0x8a, (byte)0xb6, (byte)0x60, (byte)0x2f,
+ (byte)0xa2, (byte)0xb4, (byte)0xda, (byte)0xc0,
+ (byte)0x2e, (byte)0xe1, (byte)0x31, (byte)0x12,
+ (byte)0x5a, (byte)0x49, (byte)0xef, (byte)0xf7,
+ (byte)0x17, (byte)0x77, (byte)0x26, (byte)0xa8,
+ (byte)0x91, (byte)0x0b, (byte)0xbc, (byte)0x84,
+ (byte)0x5c, (byte)0x20, (byte)0x84, (byte)0xd3,
+ (byte)0x38, (byte)0xc9, (byte)0xa1, (byte)0x5b,
+ (byte)0xad, (byte)0x84, (byte)0x83, (byte)0xb9,
+ (byte)0xe1, (byte)0x59, (byte)0x87, (byte)0xd9,
+ (byte)0x9b, (byte)0x36, (byte)0x6b, (byte)0x3c,
+ (byte)0xb6, (byte)0x3c, (byte)0x3a, (byte)0x0c,
+ (byte)0xf4, (byte)0x0b, (byte)0xad, (byte)0x23,
+ (byte)0x8d, (byte)0x5f, (byte)0x80, (byte)0x16,
+ (byte)0xa3, (byte)0x96, (byte)0xbd, (byte)0x28,
+ (byte)0x2f, (byte)0x9f, (byte)0xd1, (byte)0x7e,
+ (byte)0x13, (byte)0x86, (byte)0x6a, (byte)0x22,
+ (byte)0x26, (byte)0xdb, (byte)0x3b, (byte)0x42,
+ (byte)0xf0, (byte)0x21, (byte)0x7a, (byte)0x6c,
+ (byte)0xe3, (byte)0xb0, (byte)0x8d, (byte)0x9c,
+ (byte)0x3b, (byte)0xfb, (byte)0x17, (byte)0x27,
+ (byte)0xde, (byte)0xe4, (byte)0x82, (byte)0x2e,
+ (byte)0x6d, (byte)0x08, (byte)0xeb, (byte)0x2b,
+ (byte)0xb9, (byte)0xb0, (byte)0x94, (byte)0x0e,
+ (byte)0x56, (byte)0xc1, (byte)0xf2, (byte)0x54,
+ (byte)0xd8, (byte)0x94, (byte)0x21, (byte)0xc2,
+ (byte)0x2d, (byte)0x4d, (byte)0x28, (byte)0xf2,
+ (byte)0xc3, (byte)0x96, (byte)0x5b, (byte)0x24,
+ (byte)0xb6, (byte)0xee, (byte)0xa4, (byte)0xbf,
+ (byte)0x20, (byte)0x19, (byte)0x29, (byte)0x1a,
+ (byte)0x55, (byte)0x46, (byte)0x7a, (byte)0x2a,
+ (byte)0x14, (byte)0x12, (byte)0x4d, (byte)0xf4,
+ (byte)0xee, (byte)0xf5, (byte)0x6f, (byte)0x4f,
+ (byte)0xf7, (byte)0x99, (byte)0x1c, (byte)0xa3,
+ (byte)0x72, (byte)0x33, (byte)0x7d, (byte)0xfe,
+ (byte)0xae, (byte)0x0b, (byte)0xda, (byte)0x2c,
+ (byte)0xc7, (byte)0xf3, (byte)0xba, (byte)0xb7,
+ (byte)0x83, (byte)0x58, (byte)0x4c, (byte)0x93,
+ (byte)0x5d, (byte)0x90, (byte)0x65, (byte)0xc9,
+ (byte)0xb8, (byte)0x6d, (byte)0x2d, (byte)0xda,
+ (byte)0x10, (byte)0x55, (byte)0xe6, (byte)0x27,
+ (byte)0xb9, (byte)0x4b, (byte)0x75, (byte)0x30,
+ (byte)0xfa, (byte)0xe4, (byte)0xa3, (byte)0xff,
+ (byte)0xae, (byte)0xf9, (byte)0xfb, (byte)0xe4,
+ (byte)0x62, (byte)0x89, (byte)0x7c, (byte)0x7d,
+ (byte)0x20, (byte)0x50, (byte)0xf9, (byte)0xd1,
+ (byte)0xe2, (byte)0x0e, (byte)0x56, (byte)0xf6,
+ (byte)0x3c, (byte)0x8b, (byte)0x24, (byte)0x8a,
+ (byte)0x6d, (byte)0x92, (byte)0x3f, (byte)0x85,
+ (byte)0x7b, (byte)0x3b, (byte)0x49, (byte)0x21,
+ (byte)0x9d, (byte)0x26, (byte)0x1b, (byte)0x58,
+ (byte)0x08, (byte)0x9e, (byte)0x5f, (byte)0xea,
+ (byte)0x23, (byte)0x20, (byte)0xc2, (byte)0x3d,
+ (byte)0x87, (byte)0xbe, (byte)0x1a, (byte)0x17,
+ (byte)0x34, (byte)0xd8, (byte)0x10, (byte)0x0f,
+ (byte)0x81, (byte)0xb6, (byte)0xc7, (byte)0xa5,
+ (byte)0xe9, (byte)0x8b, (byte)0x21, (byte)0xab,
+ (byte)0x09, (byte)0x88, (byte)0x5e, (byte)0xbd,
+ (byte)0xa2, (byte)0x8a, (byte)0xc4, (byte)0xa8,
+ (byte)0x83
};
private static final byte bobPrivKeyEnc[] = {
- (byte)0x30, (byte)0x81, (byte)0xE4, (byte)0x02,
- (byte)0x01, (byte)0x00, (byte)0x30, (byte)0x81,
- (byte)0x99, (byte)0x06, (byte)0x09, (byte)0x2A,
- (byte)0x86, (byte)0x48, (byte)0x86, (byte)0xF7,
- (byte)0x0D, (byte)0x01, (byte)0x03, (byte)0x01,
- (byte)0x30, (byte)0x81, (byte)0x8B, (byte)0x02,
- (byte)0x81, (byte)0x81, (byte)0x00, (byte)0xF4,
- (byte)0x88, (byte)0xFD, (byte)0x58, (byte)0x4E,
- (byte)0x49, (byte)0xDB, (byte)0xCD, (byte)0x20,
- (byte)0xB4, (byte)0x9D, (byte)0xE4, (byte)0x91,
- (byte)0x07, (byte)0x36, (byte)0x6B, (byte)0x33,
- (byte)0x6C, (byte)0x38, (byte)0x0D, (byte)0x45,
- (byte)0x1D, (byte)0x0F, (byte)0x7C, (byte)0x88,
- (byte)0xB3, (byte)0x1C, (byte)0x7C, (byte)0x5B,
- (byte)0x2D, (byte)0x8E, (byte)0xF6, (byte)0xF3,
- (byte)0xC9, (byte)0x23, (byte)0xC0, (byte)0x43,
- (byte)0xF0, (byte)0xA5, (byte)0x5B, (byte)0x18,
- (byte)0x8D, (byte)0x8E, (byte)0xBB, (byte)0x55,
- (byte)0x8C, (byte)0xB8, (byte)0x5D, (byte)0x38,
- (byte)0xD3, (byte)0x34, (byte)0xFD, (byte)0x7C,
- (byte)0x17, (byte)0x57, (byte)0x43, (byte)0xA3,
- (byte)0x1D, (byte)0x18, (byte)0x6C, (byte)0xDE,
- (byte)0x33, (byte)0x21, (byte)0x2C, (byte)0xB5,
- (byte)0x2A, (byte)0xFF, (byte)0x3C, (byte)0xE1,
- (byte)0xB1, (byte)0x29, (byte)0x40, (byte)0x18,
- (byte)0x11, (byte)0x8D, (byte)0x7C, (byte)0x84,
- (byte)0xA7, (byte)0x0A, (byte)0x72, (byte)0xD6,
- (byte)0x86, (byte)0xC4, (byte)0x03, (byte)0x19,
- (byte)0xC8, (byte)0x07, (byte)0x29, (byte)0x7A,
- (byte)0xCA, (byte)0x95, (byte)0x0C, (byte)0xD9,
- (byte)0x96, (byte)0x9F, (byte)0xAB, (byte)0xD0,
- (byte)0x0A, (byte)0x50, (byte)0x9B, (byte)0x02,
- (byte)0x46, (byte)0xD3, (byte)0x08, (byte)0x3D,
- (byte)0x66, (byte)0xA4, (byte)0x5D, (byte)0x41,
- (byte)0x9F, (byte)0x9C, (byte)0x7C, (byte)0xBD,
- (byte)0x89, (byte)0x4B, (byte)0x22, (byte)0x19,
- (byte)0x26, (byte)0xBA, (byte)0xAB, (byte)0xA2,
- (byte)0x5E, (byte)0xC3, (byte)0x55, (byte)0xE9,
- (byte)0x2F, (byte)0x78, (byte)0xC7, (byte)0x02,
- (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x02,
- (byte)0x02, (byte)0x00, (byte)0x04, (byte)0x43,
- (byte)0x02, (byte)0x41, (byte)0x00, (byte)0xE0,
- (byte)0x31, (byte)0xE7, (byte)0x77, (byte)0xB8,
- (byte)0xD0, (byte)0x7E, (byte)0x0A, (byte)0x9B,
- (byte)0x94, (byte)0xD5, (byte)0x3D, (byte)0x33,
- (byte)0x62, (byte)0x32, (byte)0x51, (byte)0xCE,
- (byte)0x74, (byte)0x5C, (byte)0xA5, (byte)0x72,
- (byte)0xD9, (byte)0x36, (byte)0xF3, (byte)0x8A,
- (byte)0x3F, (byte)0x8B, (byte)0xC6, (byte)0xFE,
- (byte)0xEF, (byte)0x94, (byte)0x8B, (byte)0x50,
- (byte)0x41, (byte)0x9B, (byte)0x14, (byte)0xC8,
- (byte)0xE9, (byte)0x1F, (byte)0x24, (byte)0x1F,
- (byte)0x65, (byte)0x8E, (byte)0xD3, (byte)0x85,
- (byte)0xD0, (byte)0x68, (byte)0x6C, (byte)0xF1,
- (byte)0x79, (byte)0x45, (byte)0xD0, (byte)0x06,
- (byte)0xA4, (byte)0xB8, (byte)0xE0, (byte)0x64,
- (byte)0xF5, (byte)0x38, (byte)0x72, (byte)0x97,
- (byte)0x00, (byte)0x23, (byte)0x5F
+ (byte)0x30, (byte)0x82, (byte)0x01, (byte)0x3f,
+ (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x30,
+ (byte)0x82, (byte)0x01, (byte)0x17, (byte)0x06,
+ (byte)0x09, (byte)0x2a, (byte)0x86, (byte)0x48,
+ (byte)0x86, (byte)0xf7, (byte)0x0d, (byte)0x01,
+ (byte)0x03, (byte)0x01, (byte)0x30, (byte)0x82,
+ (byte)0x01, (byte)0x08, (byte)0x02, (byte)0x82,
+ (byte)0x01, (byte)0x01, (byte)0x00, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xad,
+ (byte)0xf8, (byte)0x54, (byte)0x58, (byte)0xa2,
+ (byte)0xbb, (byte)0x4a, (byte)0x9a, (byte)0xaf,
+ (byte)0xdc, (byte)0x56, (byte)0x20, (byte)0x27,
+ (byte)0x3d, (byte)0x3c, (byte)0xf1, (byte)0xd8,
+ (byte)0xb9, (byte)0xc5, (byte)0x83, (byte)0xce,
+ (byte)0x2d, (byte)0x36, (byte)0x95, (byte)0xa9,
+ (byte)0xe1, (byte)0x36, (byte)0x41, (byte)0x14,
+ (byte)0x64, (byte)0x33, (byte)0xfb, (byte)0xcc,
+ (byte)0x93, (byte)0x9d, (byte)0xce, (byte)0x24,
+ (byte)0x9b, (byte)0x3e, (byte)0xf9, (byte)0x7d,
+ (byte)0x2f, (byte)0xe3, (byte)0x63, (byte)0x63,
+ (byte)0x0c, (byte)0x75, (byte)0xd8, (byte)0xf6,
+ (byte)0x81, (byte)0xb2, (byte)0x02, (byte)0xae,
+ (byte)0xc4, (byte)0x61, (byte)0x7a, (byte)0xd3,
+ (byte)0xdf, (byte)0x1e, (byte)0xd5, (byte)0xd5,
+ (byte)0xfd, (byte)0x65, (byte)0x61, (byte)0x24,
+ (byte)0x33, (byte)0xf5, (byte)0x1f, (byte)0x5f,
+ (byte)0x06, (byte)0x6e, (byte)0xd0, (byte)0x85,
+ (byte)0x63, (byte)0x65, (byte)0x55, (byte)0x3d,
+ (byte)0xed, (byte)0x1a, (byte)0xf3, (byte)0xb5,
+ (byte)0x57, (byte)0x13, (byte)0x5e, (byte)0x7f,
+ (byte)0x57, (byte)0xc9, (byte)0x35, (byte)0x98,
+ (byte)0x4f, (byte)0x0c, (byte)0x70, (byte)0xe0,
+ (byte)0xe6, (byte)0x8b, (byte)0x77, (byte)0xe2,
+ (byte)0xa6, (byte)0x89, (byte)0xda, (byte)0xf3,
+ (byte)0xef, (byte)0xe8, (byte)0x72, (byte)0x1d,
+ (byte)0xf1, (byte)0x58, (byte)0xa1, (byte)0x36,
+ (byte)0xad, (byte)0xe7, (byte)0x35, (byte)0x30,
+ (byte)0xac, (byte)0xca, (byte)0x4f, (byte)0x48,
+ (byte)0x3a, (byte)0x79, (byte)0x7a, (byte)0xbc,
+ (byte)0x0a, (byte)0xb1, (byte)0x82, (byte)0xb3,
+ (byte)0x24, (byte)0xfb, (byte)0x61, (byte)0xd1,
+ (byte)0x08, (byte)0xa9, (byte)0x4b, (byte)0xb2,
+ (byte)0xc8, (byte)0xe3, (byte)0xfb, (byte)0xb9,
+ (byte)0x6a, (byte)0xda, (byte)0xb7, (byte)0x60,
+ (byte)0xd7, (byte)0xf4, (byte)0x68, (byte)0x1d,
+ (byte)0x4f, (byte)0x42, (byte)0xa3, (byte)0xde,
+ (byte)0x39, (byte)0x4d, (byte)0xf4, (byte)0xae,
+ (byte)0x56, (byte)0xed, (byte)0xe7, (byte)0x63,
+ (byte)0x72, (byte)0xbb, (byte)0x19, (byte)0x0b,
+ (byte)0x07, (byte)0xa7, (byte)0xc8, (byte)0xee,
+ (byte)0x0a, (byte)0x6d, (byte)0x70, (byte)0x9e,
+ (byte)0x02, (byte)0xfc, (byte)0xe1, (byte)0xcd,
+ (byte)0xf7, (byte)0xe2, (byte)0xec, (byte)0xc0,
+ (byte)0x34, (byte)0x04, (byte)0xcd, (byte)0x28,
+ (byte)0x34, (byte)0x2f, (byte)0x61, (byte)0x91,
+ (byte)0x72, (byte)0xfe, (byte)0x9c, (byte)0xe9,
+ (byte)0x85, (byte)0x83, (byte)0xff, (byte)0x8e,
+ (byte)0x4f, (byte)0x12, (byte)0x32, (byte)0xee,
+ (byte)0xf2, (byte)0x81, (byte)0x83, (byte)0xc3,
+ (byte)0xfe, (byte)0x3b, (byte)0x1b, (byte)0x4c,
+ (byte)0x6f, (byte)0xad, (byte)0x73, (byte)0x3b,
+ (byte)0xb5, (byte)0xfc, (byte)0xbc, (byte)0x2e,
+ (byte)0xc2, (byte)0x20, (byte)0x05, (byte)0xc5,
+ (byte)0x8e, (byte)0xf1, (byte)0x83, (byte)0x7d,
+ (byte)0x16, (byte)0x83, (byte)0xb2, (byte)0xc6,
+ (byte)0xf3, (byte)0x4a, (byte)0x26, (byte)0xc1,
+ (byte)0xb2, (byte)0xef, (byte)0xfa, (byte)0x88,
+ (byte)0x6b, (byte)0x42, (byte)0x38, (byte)0x61,
+ (byte)0x28, (byte)0x5c, (byte)0x97, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x02,
+ (byte)0x01, (byte)0x02, (byte)0x04, (byte)0x1f,
+ (byte)0x02, (byte)0x1d, (byte)0x01, (byte)0x62,
+ (byte)0x8e, (byte)0xfc, (byte)0xf3, (byte)0x25,
+ (byte)0xf3, (byte)0x2a, (byte)0xf4, (byte)0x49,
+ (byte)0x20, (byte)0x83, (byte)0x61, (byte)0x7f,
+ (byte)0x97, (byte)0x8f, (byte)0x48, (byte)0xac,
+ (byte)0xf9, (byte)0xc3, (byte)0xad, (byte)0x3c,
+ (byte)0x56, (byte)0x95, (byte)0x1c, (byte)0x85,
+ (byte)0xd3, (byte)0x85, (byte)0xd6
};
}
diff --git a/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java b/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java
index 10f6ddc4019..f34bdff2ef7 100644
--- a/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java
+++ b/test/jdk/com/sun/crypto/provider/TLS/TestMasterSecret.java
@@ -49,7 +49,8 @@ public class TestMasterSecret extends Utils {
private static int PREFIX_LENGTH = "m-premaster: ".length();
public static void main(String[] args) throws Exception {
- Provider provider = Security.getProvider("SunJCE");
+ Provider provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
InputStream in = new FileInputStream(new File(BASE, "masterdata.txt"));
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
diff --git a/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java b/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java
index 577927ea883..d35232431bf 100644
--- a/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java
+++ b/test/jdk/com/sun/crypto/provider/TLS/TestPRF.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -47,7 +47,8 @@ public class TestPRF extends Utils {
private static int PREFIX_LENGTH = "prf-output: ".length();
public static void main(String[] args) throws Exception {
- Provider provider = Security.getProvider("SunJCE");
+ Provider provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
InputStream in = new FileInputStream(new File(BASE, "prfdata.txt"));
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
diff --git a/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java b/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java
index dffda070e47..692fc630f9b 100644
--- a/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java
+++ b/test/jdk/com/sun/crypto/provider/TLS/TestPRF12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2024, 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
@@ -50,7 +50,8 @@ public class TestPRF12 extends Utils {
private static int PREFIX_LENGTH = "prf-output: ".length();
public static void main(String[] args) throws Exception {
- Provider provider = Security.getProvider("SunJCE");
+ Provider provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
InputStream in = new FileInputStream(new File(BASE, "prf12data.txt"));
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
diff --git a/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java b/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java
index b95b0855dd0..096af76cfe4 100644
--- a/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java
+++ b/test/jdk/com/sun/crypto/provider/TLS/TestPremaster.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -41,7 +41,8 @@
public class TestPremaster {
public static void main(String[] args) throws Exception {
- Provider provider = Security.getProvider("SunJCE");
+ Provider provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
KeyGenerator kg;
diff --git a/test/jdk/com/sun/jdi/ClassesByName2Test.java b/test/jdk/com/sun/jdi/ClassesByName2Test.java
index c6407edcb28..56066268bc0 100644
--- a/test/jdk/com/sun/jdi/ClassesByName2Test.java
+++ b/test/jdk/com/sun/jdi/ClassesByName2Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2024, 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
@@ -62,7 +62,8 @@ public void run () {
public void run () {
try {
java.security.KeyPairGenerator keyGen =
- java.security.KeyPairGenerator.getInstance("DSA", "SUN");
+ java.security.KeyPairGenerator.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java b/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java
index d1de2030c24..793232654b6 100644
--- a/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java
+++ b/test/jdk/com/sun/org/apache/xml/internal/security/SignatureKeyInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2024, 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
@@ -62,6 +62,7 @@
import java.io.File;
import java.math.BigInteger;
import java.security.*;
+import jdk.test.lib.security.SecurityUtils;
import static jdk.test.lib.Asserts.assertEquals;
@@ -160,7 +161,7 @@ private static void addKeyInfoData(KeyInfo keyInfo, String algorithm) throws Exc
private static KeyPair getKeyPair(String algorithm) throws NoSuchAlgorithmException {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance(algorithm);
- keyGen.initialize(2048);
+ keyGen.initialize(SecurityUtils.getTestKeySize(algorithm));
return keyGen.genKeyPair();
}
diff --git a/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java b/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java
index b1429d92e9e..baf70c16e6e 100644
--- a/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java
+++ b/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2024, 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
@@ -21,19 +21,6 @@
* questions.
*/
-/*
- @test
- @key headful
- @bug 6380743 8158380 8198624
- @summary Submenu should be shown by mnemonic key press.
- @author anton.tarasov@...: area=awt.focus
- @library ../../../regtesthelpers
- @library /test/lib
- @build Util
- @build jdk.test.lib.Platform
- @run main SubMenuShowTest
-*/
-
import java.awt.Robot;
import java.awt.BorderLayout;
import java.awt.event.KeyEvent;
@@ -48,6 +35,17 @@
import jdk.test.lib.Platform;
import test.java.awt.regtesthelpers.Util;
+/*
+ @test
+ @key headful
+ @bug 6380743 8158380 8198624
+ @summary Submenu should be shown by mnemonic key press.
+ @library /java/awt/regtesthelpers
+ @library /test/lib
+ @build Util
+ @build jdk.test.lib.Platform
+ @run main SubMenuShowTest
+*/
public class SubMenuShowTest {
private static Robot robot;
private static JFrame frame;
@@ -116,6 +114,8 @@ public void actionPerformed(ActionEvent e) {
}
public static void doTest() {
+ robot.waitForIdle();
+ robot.delay(1000);
boolean isMacOSX = Platform.isOSX();
if (isMacOSX) {
robot.keyPress(KeyEvent.VK_CONTROL);
diff --git a/test/jdk/java/awt/dnd/DragSourceSerializationTest.java b/test/jdk/java/awt/dnd/DragSourceSerializationTest.java
new file mode 100644
index 00000000000..b80ccd64831
--- /dev/null
+++ b/test/jdk/java/awt/dnd/DragSourceSerializationTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2001, 2023, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.dnd.DragSource;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/*
+ @test
+ @bug 4407057
+ @summary tests that deserialized DragSource has a non-null flavor map
+ @key headful
+ @run main DragSourceSerializationTest
+*/
+
+public class DragSourceSerializationTest {
+
+ public static void main(String[] args) throws Exception {
+ try {
+ final DragSource dragSource = DragSource.getDefaultDragSource();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(dragSource);
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+
+ final DragSource copy = (DragSource)ois.readObject();
+ if (copy.getFlavorMap() == null) {
+ throw new RuntimeException("getFlavorMap() returns null");
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/test/jdk/java/awt/dnd/DragTriggerEventTest.java b/test/jdk/java/awt/dnd/DragTriggerEventTest.java
new file mode 100644
index 00000000000..3e51b611de6
--- /dev/null
+++ b/test/jdk/java/awt/dnd/DragTriggerEventTest.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2013, 2023, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.EventQueue;
+import java.awt.GridLayout;
+import java.awt.Robot;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Dimension;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JList;
+
+/*
+ @test
+ @bug 4388802
+ @summary tests that a drag can be initiated with MOUSE_MOVED event
+ @key headful
+ @run main DragTriggerEventTest
+*/
+
+public class DragTriggerEventTest {
+
+ volatile JFrame frame;
+ volatile JList list;
+ volatile DropTargetPanel panel;
+ volatile Point srcPoint;
+ volatile Rectangle cellBounds;
+ volatile Point dstPoint;
+ volatile Dimension d;
+ static final int FRAME_ACTIVATION_TIMEOUT = 3000;
+ volatile boolean mouse1Pressed = false;
+ volatile boolean ctrlPressed = false;
+
+ public static void main(String[] args) throws Exception {
+ DragTriggerEventTest test = new DragTriggerEventTest();
+ EventQueue.invokeAndWait(test::init);
+ try {
+ test.start();
+ } finally {
+ EventQueue.invokeAndWait(() -> {
+ if (test.frame != null) {
+ test.frame.dispose();
+ }
+ });
+ }
+ }
+
+ public void init() {
+ list = new JList(new String[] {"one", "two", "three", "four"});
+ list.setDragEnabled(true);
+ panel = new DropTargetPanel();
+
+ frame = new JFrame();
+ frame.setTitle("DragTriggerEventTest");
+ frame.setLocation(200, 200);
+ frame.getContentPane().setLayout(new GridLayout(2, 1));
+ frame.getContentPane().add(list);
+ frame.getContentPane().add(panel);
+
+ frame.pack();
+ frame.setVisible(true);
+ }
+
+ public void start() throws Exception {
+ Robot robot;
+ robot = new Robot();
+
+ EventQueue.invokeAndWait(() -> {
+ srcPoint = list.getLocationOnScreen();
+ cellBounds = list.getCellBounds(0, 0);
+ });
+
+ srcPoint.translate(cellBounds.x + cellBounds.width / 2,
+ cellBounds.y + cellBounds.height / 2);
+
+ EventQueue.invokeAndWait(() -> {
+ dstPoint = panel.getLocationOnScreen();
+ d = panel.getSize();
+ });
+ dstPoint.translate(d.width / 2, d.height / 2);
+
+ for (int delay = 32; delay < 10000 && !panel.getResult(); delay *= 2) {
+ System.err.println("attempt to drag with delay " + delay);
+ robot.mouseMove(srcPoint.x, srcPoint.y);
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ mouse1Pressed = true;
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ mouse1Pressed = false;
+
+ robot.keyPress(KeyEvent.VK_CONTROL);
+ ctrlPressed = true;
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ mouse1Pressed = true;
+
+ Point p = new Point(srcPoint);
+ while (!p.equals(dstPoint)) {
+ p.translate(sign(dstPoint.x - p.x),
+ sign(dstPoint.y - p.y));
+ robot.mouseMove(p.x, p.y);
+ robot.delay(delay);
+ }
+ }
+ if (mouse1Pressed) {
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ }
+ if (ctrlPressed) {
+ robot.keyRelease(KeyEvent.VK_CONTROL);
+ }
+
+ EventQueue.invokeAndWait(() -> {
+ if (!panel.getResult()) {
+ throw new RuntimeException("The test failed.");
+ }
+ });
+ }
+
+ public static int sign(int n) {
+ return n < 0 ? -1 : n == 0 ? 0 : 1;
+ }
+}
+
+class DropTargetPanel extends JPanel implements DropTargetListener {
+
+ private boolean passed = false;
+ final Dimension preferredDimension = new Dimension(200, 100);
+
+ public DropTargetPanel() {
+ setDropTarget(new DropTarget(this, this));
+ }
+
+ public Dimension getPreferredSize() {
+ return preferredDimension;
+ }
+
+ public void dragEnter(DropTargetDragEvent dtde) {
+ passed = true;
+ }
+
+ public void dragExit(DropTargetEvent dte) {
+ passed = true;
+ }
+
+ public void dragOver(DropTargetDragEvent dtde) {
+ passed = true;
+ }
+
+ public void dropActionChanged(DropTargetDragEvent dtde) {
+ passed = true;
+ }
+
+ public void drop(DropTargetDropEvent dtde) {
+ passed = true;
+ dtde.rejectDrop();
+ }
+
+ public boolean getResult() {
+ return passed;
+ }
+}
diff --git a/test/jdk/java/awt/dnd/DropActionChangeTest.java b/test/jdk/java/awt/dnd/DropActionChangeTest.java
new file mode 100644
index 00000000000..7cb1019a44d
--- /dev/null
+++ b/test/jdk/java/awt/dnd/DropActionChangeTest.java
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2003, 2023, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.JFrame;
+import java.awt.AWTEvent;
+import java.awt.Component;
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.datatransfer.StringSelection;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceAdapter;
+import java.awt.dnd.DragSourceDropEvent;
+import java.awt.dnd.DragSourceListener;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetAdapter;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.AWTEventListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+
+/*
+ @test
+ @bug 4896462
+ @summary tests that drop action is computed correctly
+ @key headful
+ @run main DropActionChangeTest
+*/
+
+public class DropActionChangeTest extends JFrame implements AWTEventListener {
+ Robot robot;
+ Frame frame;
+ Panel panel;
+ private volatile boolean failed;
+ private volatile boolean dropEnd;
+ private volatile Component clickedComponent;
+ private final Object LOCK = new Object();
+ static final int FRAME_ACTIVATION_TIMEOUT = 3000;
+ static final int DROP_COMPLETION_TIMEOUT = 5000;
+ static final int MOUSE_RELEASE_TIMEOUT = 2000;
+
+ public static void main(String[] args) throws Exception {
+ DropActionChangeTest test = new DropActionChangeTest();
+ EventQueue.invokeAndWait(test::init);
+ try {
+ test.start();
+ } finally {
+ EventQueue.invokeAndWait(() -> {
+ if (test.frame != null) {
+ test.frame.dispose();
+ }
+ });
+ }
+ }
+
+ public void init() {
+ getToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK);
+
+ setSize (200,200);
+ setTitle("DropActionChangeTest");
+ setVisible(true);
+ validate();
+
+ frame = new Frame("Empty Frame with Panel");
+ panel = new Panel();
+ frame.add(panel);
+ frame.setBounds(300, 300, 300, 300);
+ failed = false;
+
+ final DragSourceListener dsl = new DragSourceAdapter() {
+ public void dragDropEnd(DragSourceDropEvent e) {
+ System.err.println("DragSourseListener.dragDropEnd(): " +
+ "drop action=" + e.getDropAction());
+ if (e.getDropAction() != DnDConstants.ACTION_MOVE) {
+ System.err.println("FAILURE: wrong drop action:" + e.getDropAction());
+ failed = true;
+ }
+ synchronized (LOCK) {
+ dropEnd = true;
+ LOCK.notifyAll();
+ }
+ }
+ };
+
+ DragGestureListener dgl = new DragGestureListener() {
+ public void dragGestureRecognized(DragGestureEvent dge) {
+ dge.startDrag(null, new StringSelection("test"), dsl);
+ }
+ };
+
+ new DragSource().createDefaultDragGestureRecognizer(panel,
+ DnDConstants.ACTION_COPY_OR_MOVE, dgl);
+
+ DropTargetListener dtl = new DropTargetAdapter() {
+ public void dragEnter(DropTargetDragEvent e) {
+ System.err.println("DropTargetListener.dragEnter(): " +
+ "user drop action=" + e.getDropAction());
+ e.acceptDrag(e.getDropAction());
+ }
+
+ public void dragOver(DropTargetDragEvent e) {
+ e.acceptDrag(e.getDropAction());
+ }
+ public void drop(DropTargetDropEvent e) {
+ System.err.println("DropTargetListener.drop(): " +
+ "user drop action=" + e.getDropAction());
+ e.acceptDrop(e.getDropAction());
+ e.dropComplete(true);
+ }
+ };
+
+ new DropTarget(panel, dtl);
+
+ frame.setVisible(true);
+ }
+
+ public void start() {
+ try {
+ robot = new Robot();
+
+ Point startPoint = panel.getLocationOnScreen();
+ startPoint.translate(50, 50);
+
+ if (!pointInComponent(robot, startPoint, panel)) {
+ System.err.println("WARNING: Couldn't locate source panel");
+ return;
+ }
+
+
+ Point medPoint = new Point(startPoint.x + (DragSource.getDragThreshold()+10)*2,
+ startPoint.y);
+ Point endPoint = new Point(startPoint.x + (DragSource.getDragThreshold()+10)*4,
+ startPoint.y);
+
+ synchronized (LOCK) {
+ robot.keyPress(KeyEvent.VK_CONTROL);
+ robot.mouseMove(startPoint.x, startPoint.y);
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ Util.doDrag(robot, startPoint, medPoint);
+ robot.keyRelease(KeyEvent.VK_CONTROL);
+ Util.doDrag(robot, medPoint, endPoint);
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ LOCK.wait(DROP_COMPLETION_TIMEOUT);
+ }
+ if (!dropEnd) {
+ System.err.println("DragSourseListener.dragDropEnd() was not called, returning");
+ return;
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+
+ if (failed) {
+ throw new RuntimeException("wrong drop action!");
+ }
+
+ System.err.println("test passed!");
+ }
+
+ public void reset() {
+ clickedComponent = null;
+ }
+
+ public void eventDispatched(AWTEvent e) {
+ if (e.getID() == MouseEvent.MOUSE_RELEASED) {
+ clickedComponent = (Component)e.getSource();
+ synchronized (LOCK) {
+ LOCK.notifyAll();
+ }
+ }
+ }
+
+ boolean pointInComponent(Robot robot, Point p, Component comp)
+ throws InterruptedException {
+ robot.waitForIdle();
+ reset();
+ robot.mouseMove(p.x, p.y);
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ synchronized (LOCK) {
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ LOCK.wait(MOUSE_RELEASE_TIMEOUT);
+ }
+
+ Component c = clickedComponent;
+
+ while (c != null && c != comp) {
+ c = c.getParent();
+ }
+
+ return c == comp;
+ }
+}
+
+
+class Util {
+
+ public static int sign(int n) {
+ return n < 0 ? -1 : n == 0 ? 0 : 1;
+ }
+
+ public static void doDrag(Robot robot, Point startPoint, Point endPoint) {
+ for (Point p = new Point(startPoint); !p.equals(endPoint);
+ p.translate(Util.sign(endPoint.x - p.x),
+ Util.sign(endPoint.y - p.y))) {
+ robot.mouseMove(p.x, p.y);
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/test/jdk/java/awt/dnd/DropActionChangedTest.java b/test/jdk/java/awt/dnd/DropActionChangedTest.java
new file mode 100644
index 00000000000..b515561bb68
--- /dev/null
+++ b/test/jdk/java/awt/dnd/DropActionChangedTest.java
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 2000, 2023, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Button;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.Panel;
+import java.awt.Robot;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceDragEvent;
+import java.awt.dnd.DragSourceDropEvent;
+import java.awt.dnd.DragSourceEvent;
+import java.awt.dnd.DragSourceListener;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetContext;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.InputEvent;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+/*
+ @test
+ @bug 4357930
+ @summary tests that dropActionChanged() is not invoked if the drop gesture
+ is not modified.
+ @key headful
+ @run main DropActionChangedTest
+*/
+
+public class DropActionChangedTest {
+
+ volatile Frame frame;
+ volatile DragSourcePanel dragSourcePanel;
+ volatile DropTargetPanel dropTargetPanel;
+
+ public static void main(String[] args) throws Exception {
+ DropActionChangedTest test = new DropActionChangedTest();
+ EventQueue.invokeAndWait(test::init);
+ try {
+ test.start();
+ } finally {
+ EventQueue.invokeAndWait(() -> {
+ if (test.frame != null) {
+ test.frame.dispose();
+ }
+ });
+ }
+ }
+
+ public void init() {
+ dragSourcePanel = new DragSourcePanel();
+ dropTargetPanel = new DropTargetPanel();
+
+ frame = new Frame();
+ frame.setTitle("DropTargetAddNotifyNPETest");
+ frame.setLocation(200, 200);
+ frame.setLayout(new GridLayout(2, 1));
+ frame.add(dragSourcePanel);
+ frame.add(dropTargetPanel);
+
+ frame.pack();
+ frame.setVisible(true);
+ }
+
+ public void start() throws Exception {
+ Robot robot = new Robot();
+ robot.delay(2000);
+ robot.mouseMove(250, 250);
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ robot.delay(1000);
+ for (int y = 250; y < 350; y+=5) {
+ robot.mouseMove(250, y);
+ robot.delay(100);
+ }
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ if (dropTargetPanel.isDropActionChangedTriggered()) {
+ throw new RuntimeException("The test failed.");
+ }
+ }
+}
+
+class DragSourceButton extends Button implements Serializable,
+ Transferable,
+ DragGestureListener,
+ DragSourceListener {
+ private final DataFlavor dataflavor =
+ new DataFlavor(Button.class, "DragSourceButton");
+
+ public DragSourceButton() {
+ this("DragSourceButton");
+ }
+
+ public DragSourceButton(String str) {
+ super(str);
+
+ DragSource ds = DragSource.getDefaultDragSource();
+ ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY,
+ this);
+ }
+
+ public void dragGestureRecognized(DragGestureEvent dge) {
+ dge.startDrag(null, this, this);
+ }
+
+ public void dragEnter(DragSourceDragEvent dsde) {}
+
+ public void dragExit(DragSourceEvent dse) {}
+
+ public void dragOver(DragSourceDragEvent dsde) {}
+
+ public void dragDropEnd(DragSourceDropEvent dsde) {}
+
+ public void dropActionChanged(DragSourceDragEvent dsde) {}
+
+ public Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException, IOException {
+
+ if (!isDataFlavorSupported(flavor)) {
+ throw new UnsupportedFlavorException(flavor);
+ }
+
+ Object retObj = null;
+
+ ByteArrayOutputStream baoStream = new ByteArrayOutputStream();
+ ObjectOutputStream ooStream = new ObjectOutputStream(baoStream);
+ ooStream.writeObject(this);
+
+ ByteArrayInputStream baiStream = new ByteArrayInputStream(baoStream.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(baiStream);
+ try {
+ retObj = ois.readObject();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e.toString());
+ }
+
+ return retObj;
+ }
+
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] { dataflavor };
+ }
+
+ public boolean isDataFlavorSupported(DataFlavor dflavor) {
+ return dataflavor.equals(dflavor);
+ }
+}
+
+class DragSourcePanel extends Panel {
+
+ final Dimension preferredDimension = new Dimension(200, 100);
+
+ public DragSourcePanel() {
+ setLayout(new GridLayout(1, 1));
+ add(new DragSourceButton());
+ }
+
+ public Dimension getPreferredSize() {
+ return preferredDimension;
+ }
+}
+
+class DropTargetPanel extends Panel implements DropTargetListener {
+
+ final Dimension preferredDimension = new Dimension(200, 100);
+ private boolean dropActionChangedTriggered = false;
+
+ public DropTargetPanel() {
+ setDropTarget(new DropTarget(this, this));
+ }
+
+ public Dimension getPreferredSize() {
+ return preferredDimension;
+ }
+
+ public void dragEnter(DropTargetDragEvent dtde) {}
+
+ public void dragExit(DropTargetEvent dte) {}
+
+ public void dragOver(DropTargetDragEvent dtde) {}
+
+ public void drop(DropTargetDropEvent dtde) {
+ DropTargetContext dtc = dtde.getDropTargetContext();
+
+ if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY) != 0) {
+ dtde.acceptDrop(DnDConstants.ACTION_COPY);
+ } else {
+ dtde.rejectDrop();
+ }
+
+ DataFlavor[] dfs = dtde.getCurrentDataFlavors();
+ Component comp = null;
+
+ if (dfs != null && dfs.length >= 1) {
+ Transferable transfer = dtde.getTransferable();
+
+ try {
+ comp = (Component)transfer.getTransferData(dfs[0]);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ dtc.dropComplete(false);
+ }
+ }
+ dtc.dropComplete(true);
+
+ add(comp);
+ }
+
+ public void dropActionChanged(DropTargetDragEvent dtde) {
+ dropActionChangedTriggered = true;
+ throw new RuntimeException("dropActionChanged triggered");
+ }
+
+ public boolean isDropActionChangedTriggered() {
+ return dropActionChangedTriggered;
+ }
+}
diff --git a/test/jdk/java/awt/dnd/DropPerformanceTest.java b/test/jdk/java/awt/dnd/DropPerformanceTest.java
new file mode 100644
index 00000000000..2ebfd2d085c
--- /dev/null
+++ b/test/jdk/java/awt/dnd/DropPerformanceTest.java
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2001, 2023, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.JButton;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceDragEvent;
+import java.awt.dnd.DragSourceDropEvent;
+import java.awt.dnd.DragSourceEvent;
+import java.awt.dnd.DragSourceListener;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetContext;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.InputEvent;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+/*
+ @test
+ @bug 4484996
+ @summary Tests that drop doesn't take too much time on Win 95/98.
+ @key headful
+ @run main DropPerformanceTest
+*/
+
+public class DropPerformanceTest {
+
+ public static final int CODE_NOT_RETURNED = -1;
+ public static final int CODE_OK = 0;
+ public static final int CODE_FAILURE = 1;
+ public static final int FRAME_ACTIVATION_TIMEOUT = 2000;
+ public static final int DROP_COMPLETION_TIMEOUT = 4000;
+ public static final int TIME_THRESHOLD = 40000;
+
+ private int returnCode = CODE_NOT_RETURNED;
+
+ final Frame frame = new Frame();
+ Robot robot = null;
+ DropTargetPanel dtpanel = null;
+ DragSourcePanel dspanel = null;
+
+ public static void main(String[] args) throws Exception {
+ DropPerformanceTest test = new DropPerformanceTest();
+ if (args.length > 0) {
+ test.run(args);
+ } else {
+ EventQueue.invokeAndWait(test::init);
+ try {
+ test.start();
+ } finally {
+ EventQueue.invokeAndWait(() -> {
+ if (test.frame != null) {
+ test.frame.dispose();
+ }
+ });
+ }
+ }
+ }
+
+ public void run(String[] args) {
+ try {
+ if (args.length != 4) {
+ throw new RuntimeException("Incorrect command line arguments.");
+ }
+
+ int x = Integer.parseInt(args[0]);
+ int y = Integer.parseInt(args[1]);
+ int w = Integer.parseInt(args[2]);
+ int h = Integer.parseInt(args[3]);
+
+ dspanel = new DragSourcePanel();
+
+ frame.setTitle("DropPerformanceTest Drop Source Frame");
+ frame.setLocation(100, 200);
+ frame.add(dspanel);
+ frame.pack();
+ frame.setVisible(true);
+
+ Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
+
+ Point sourcePoint = dspanel.getLocationOnScreen();
+ Dimension d = dspanel.getSize();
+ sourcePoint.translate(d.width / 2, d.height / 2);
+
+ Point targetPoint = new Point(x + w / 2, y + h / 2);
+
+ robot = new Robot();
+ robot.mouseMove(sourcePoint.x, sourcePoint.y);
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ for (; !sourcePoint.equals(targetPoint);
+ sourcePoint.translate(sign(targetPoint.x - sourcePoint.x),
+ sign(targetPoint.y - sourcePoint.y))) {
+ robot.mouseMove(sourcePoint.x, sourcePoint.y);
+ Thread.sleep(10);
+ }
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+ Thread.sleep(DROP_COMPLETION_TIMEOUT);
+
+ } catch (Throwable e) {
+ e.printStackTrace();
+ System.exit(DropPerformanceTest.CODE_FAILURE);
+ }
+
+ System.exit(DropPerformanceTest.CODE_OK);
+ } // run()
+
+ public static int sign(int n) {
+ return n < 0 ? -1 : n == 0 ? 0 : 1;
+ }
+
+ public void init() {
+ dtpanel = new DropTargetPanel();
+
+ frame.setTitle("Drop Target Frame");
+ frame.setLocation(250, 200);
+ frame.add(dtpanel);
+
+ frame.pack();
+ frame.setVisible(true);
+ }
+
+ private void launchChildVM() {
+ try {
+ Thread.sleep(FRAME_ACTIVATION_TIMEOUT);
+
+ Point p = dtpanel.getLocationOnScreen();
+ Dimension d = dtpanel.getSize();
+
+ String javaPath = System.getProperty("java.home", "");
+ String command = javaPath + File.separator + "bin" +
+ File.separator + "java -cp " + System.getProperty("test.classes", ".") +
+ " DropPerformanceTest " +
+ p.x + " " + p.y + " " + d.width + " " + d.height;
+ Process process = Runtime.getRuntime().exec(command);
+ returnCode = process.waitFor();
+ InputStream errorStream = process.getErrorStream();
+ int count = errorStream.available();
+ if (count > 0) {
+ byte[] b = new byte[count];
+ errorStream.read(b);
+ System.err.println("========= Child VM System.err ========");
+ System.err.print(new String(b));
+ System.err.println("======================================");
+ }
+
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ switch (returnCode) {
+ case CODE_NOT_RETURNED:
+ System.err.println("Child VM: failed to start");
+ break;
+ case CODE_OK:
+ System.err.println("Child VM: normal termination");
+ break;
+ case CODE_FAILURE:
+ System.err.println("Child VM: abnormal termination");
+ break;
+ }
+ if (returnCode != CODE_OK) {
+ throw new RuntimeException("The test failed.");
+ }
+ }
+
+ public void start() {
+ launchChildVM();
+ System.err.println("Drop consumed " + dtpanel.getDropTime() + " milliseconds");
+ if (dtpanel.getDropTime() > TIME_THRESHOLD) {
+ throw new RuntimeException("The test failed: drop took too much time");
+ }
+ }
+}
+
+class DragSourceButton extends JButton
+ implements Transferable, Serializable,
+ DragGestureListener, DragSourceListener {
+
+ public DataFlavor dataflavor = new DataFlavor(DragSourceButton.class, "Source");
+
+ DragSourceButton(String str) {
+ super(str);
+ DragSource ds = DragSource.getDefaultDragSource();
+ ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this);
+ }
+
+ public void dragGestureRecognized(DragGestureEvent dge) {
+ dge.startDrag(null, this, this);
+ }
+
+ public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
+ Object ret = null;
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(this);
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ try {
+ ret = (DragSourceButton)ois.readObject();
+ } catch (ClassNotFoundException cannotHappen) {
+ return null;
+ }
+ return ret;
+ }
+
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] { dataflavor };
+ }
+
+ public boolean isDataFlavorSupported(DataFlavor dflavor) {
+ return dataflavor.equals(dflavor);
+ }
+
+ public void dragEnter(DragSourceDragEvent dsde) {}
+
+ public void dragExit(DragSourceEvent dse) {}
+
+ public void dragOver(DragSourceDragEvent dsde) {}
+
+ public void dragDropEnd(DragSourceDropEvent dsde) {}
+
+ public void dropActionChanged(DragSourceDragEvent dsde) {}
+}
+
+class DragSourcePanel extends Panel {
+
+ final Dimension preferredDimension = new Dimension(100, 50);
+
+ public DragSourcePanel() {
+ setLayout(new GridLayout(1, 1));
+ add(new DragSourceButton("Drag me"));
+ }
+
+ public Dimension getPreferredSize() {
+ return preferredDimension;
+ }
+}
+
+class DropTargetPanel extends Panel implements DropTargetListener {
+
+ final Dimension preferredDimension = new Dimension(100, 50);
+ private long dropTime = 0;
+
+ public DropTargetPanel() {
+ setBackground(Color.green);
+ setDropTarget(new DropTarget(this, this));
+ }
+
+ public long getDropTime() {
+ return dropTime;
+ }
+
+ public Dimension getPreferredSize() {
+ return preferredDimension;
+ }
+
+ public void dragEnter(DropTargetDragEvent dtde) {
+ dtde.acceptDrag(DnDConstants.ACTION_COPY);
+ }
+
+ public void dragExit(DropTargetEvent dte) {}
+
+ public void dragOver(DropTargetDragEvent dtde) {
+ dtde.acceptDrag(DnDConstants.ACTION_COPY);
+ }
+
+ public void drop(DropTargetDropEvent dtde) {
+ DropTargetContext dtc = dtde.getDropTargetContext();
+
+ if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY) != 0) {
+ dtde.acceptDrop(DnDConstants.ACTION_COPY);
+ } else {
+ dtde.rejectDrop();
+ return;
+ }
+
+ Transferable t = dtde.getTransferable();
+ DataFlavor[] dfs = t.getTransferDataFlavors();
+
+ long before = System.currentTimeMillis();
+
+ if (dfs != null && dfs.length >= 1) {
+ Object obj = null;
+ try {
+ obj = t.getTransferData(dfs[0]);
+ } catch (IOException ioe) {
+ dtc.dropComplete(false);
+ return;
+ } catch (UnsupportedFlavorException ufe) {
+ dtc.dropComplete(false);
+ return;
+ }
+
+ if (obj != null) {
+ Component comp = (Component)obj;
+ add(comp);
+ }
+ }
+
+ long after = System.currentTimeMillis();
+ dropTime = after - before;
+
+ synchronized (this) {
+ notifyAll();
+ }
+
+ dtc.dropComplete(true);
+ validate();
+ }
+
+ public void dropActionChanged(DropTargetDragEvent dtde) {}
+
+}
diff --git a/test/jdk/java/awt/dnd/DropTargetAddNotifyNPETest.java b/test/jdk/java/awt/dnd/DropTargetAddNotifyNPETest.java
new file mode 100644
index 00000000000..3ccab1250e3
--- /dev/null
+++ b/test/jdk/java/awt/dnd/DropTargetAddNotifyNPETest.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2001, 2023, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Component;
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetAdapter;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetListener;
+
+/*
+ @test
+ @bug 4462285
+ @summary tests that DropTarget.addNotify doesn't throw NPE if peer hierarchy
+ is incomplete
+ @key headful
+ @run main DropTargetAddNotifyNPETest
+*/
+
+public class DropTargetAddNotifyNPETest {
+
+ volatile Component component1;
+ volatile Component component2;
+ volatile Frame frame;
+ volatile DropTargetListener dtListener;
+ volatile DropTarget dropTarget1;
+ volatile DropTarget dropTarget2;
+
+ public static void main(String[] args) throws Exception {
+ DropTargetAddNotifyNPETest test = new DropTargetAddNotifyNPETest();
+ EventQueue.invokeAndWait(() -> {
+ test.init();
+ if (test.frame != null) {
+ test.frame.dispose();
+ }
+ });
+ }
+
+ public void init() {
+ component1 = new LWComponent();
+ component2 = new LWComponent();
+ frame = new Frame("DropTargetAddNotifyNPETest");
+ dtListener = new DropTargetAdapter() {
+ public void drop(DropTargetDropEvent dtde) {
+ dtde.rejectDrop();
+ }
+ };
+ dropTarget1 = new DropTarget(component1, dtListener);
+ dropTarget2 = new DropTarget(component2, dtListener);
+
+ frame.add(component2);
+ component1.addNotify();
+ component2.addNotify();
+ }
+}
+
+class LWComponent extends Component {}
diff --git a/test/jdk/java/awt/dnd/DropTargetNullFlavorMapTest.java b/test/jdk/java/awt/dnd/DropTargetNullFlavorMapTest.java
new file mode 100644
index 00000000000..b2fa07cce2f
--- /dev/null
+++ b/test/jdk/java/awt/dnd/DropTargetNullFlavorMapTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2002, 2023, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.datatransfer.SystemFlavorMap;
+import java.awt.dnd.DropTarget;
+
+/*
+ @test
+ @bug 4785476
+ @summary tests that DropTarget.setFlavorMap(null) works properly
+ @key headful
+ @run main DropTargetNullFlavorMapTest
+*/
+public class DropTargetNullFlavorMapTest {
+
+ public static void main(String[] args) {
+ DropTargetNullFlavorMapTest test = new DropTargetNullFlavorMapTest();
+ test.init();
+ }
+
+ public void init() {
+ final DropTarget dropTarget = new DropTarget();
+
+ if (!SystemFlavorMap.getDefaultFlavorMap().equals(dropTarget.getFlavorMap())) {
+ System.err.println("Default flavor map: " + SystemFlavorMap.getDefaultFlavorMap());
+ System.err.println("DropTarget's flavor map: " + dropTarget.getFlavorMap());
+ throw new RuntimeException("Incorrect flavor map.");
+ }
+
+ Thread.currentThread().setContextClassLoader(new ClassLoader() {});
+
+ dropTarget.setFlavorMap(null);
+
+ if (!SystemFlavorMap.getDefaultFlavorMap().equals(dropTarget.getFlavorMap())) {
+ System.err.println("Default flavor map: " + SystemFlavorMap.getDefaultFlavorMap());
+ System.err.println("DropTarget's flavor map: " + dropTarget.getFlavorMap());
+ throw new RuntimeException("Incorrect flavor map.");
+ }
+ }
+}
diff --git a/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java b/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java
index 421d8fe2faf..58a72aa8767 100644
--- a/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java
+++ b/test/jdk/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -21,20 +21,6 @@
* questions.
*/
-/*
- @test
- @key headful
- @bug 7154072 7161320
- @summary Tests that key events with modifiers are not swallowed.
- @author anton.tarasov: area=awt.focus
- @library ../../../regtesthelpers
- @library /test/lib
- @modules java.desktop/sun.awt
- @build jdk.test.lib.Platform
- @build Util
- @run main SwallowKeyEvents
-*/
-
import jdk.test.lib.Platform;
import java.awt.AWTException;
import java.awt.Frame;
@@ -44,6 +30,20 @@
import java.awt.event.KeyEvent;
import test.java.awt.regtesthelpers.Util;
+/*
+ @test
+ @key headful
+ @bug 7154072 7161320
+ @summary Tests that key events with modifiers are not swallowed.
+ @requires (os.family != "windows")
+ @library /java/awt/regtesthelpers
+ @library /test/lib
+ @modules java.desktop/sun.awt
+ @build jdk.test.lib.Platform
+ @build Util
+ @run main SwallowKeyEvents
+*/
+
public class SwallowKeyEvents {
static final int PRESS_COUNT = 10;
@@ -83,6 +83,8 @@ public void keyPressed(KeyEvent ke) {
});
test();
+ r.waitForIdle();
+ r.delay(500);
System.out.println("key_pressed count: " + keyPressedCount);
diff --git a/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java b/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
index 12cab1f5d0f..374e9c355b4 100644
--- a/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
+++ b/test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2023, 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
@@ -24,8 +24,9 @@
import java.io.FilePermission;
import java.io.IOException;
import java.io.UncheckedIOException;
+import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.AccessibleObject;
+import java.lang.module.ModuleReference;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.lang.reflect.InaccessibleObjectException;
@@ -43,22 +44,25 @@
import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
+import java.util.Deque;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.PropertyPermission;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
-import java.util.stream.Stream;
import jdk.internal.module.Modules;
/**
* @test
- * @bug 8065552
+ * @bug 8065552 8309532
* @summary test that all public fields returned by getDeclaredFields() can
* be set accessible if the right permission is granted; this test
* loads all classes and get their declared fields
@@ -283,18 +287,64 @@ public Iterator iterator() {
}
/*
- * Filter deployment modules
+ * Filter JVMCI module and its transitive dependences
*/
static Set systemModules() {
- Set mods = Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws",
- // All JVMCI packages other than jdk.vm.ci.services are dynamically
- // exported to jdk.internal.vm.compiler
- "jdk.internal.vm.compiler"
+ // Build module graph and inverse dependences
+ Set modules = new HashSet<>();
+ Map> moduleToDeps = new HashMap<>();
+ Map> inverseDeps = new HashMap<>();
+ for (ModuleReference mref : ModuleFinder.ofSystem().findAll()) {
+ var md = mref.descriptor();
+ modules.add(md.name());
+ Set deps = md.requires().stream().map(ModuleDescriptor.Requires::name)
+ .collect(Collectors.toSet());
+ moduleToDeps.put(md.name(), deps);
+ inverseDeps.put(md.name(), new HashSet<>());
+ }
+
+ // reverse edges
+ moduleToDeps.keySet().forEach(u -> {
+ moduleToDeps.get(u)
+ .forEach(v -> inverseDeps.get(v)
+ .add(u));
+ });
+
+ Set mods = Set.of(
+ // All JVMCI packages other than jdk.vm.ci.services are dynamically
+ // exported to jdk.internal.vm.compiler
+ "jdk.internal.vm.compiler", "jdk.internal.vm.compiler.management"
);
- return ModuleFinder.ofSystem().findAll().stream()
- .map(mref -> mref.descriptor().name())
- .filter(mn -> !mods.contains(mn))
- .collect(Collectors.toSet());
+ // Filters all modules that directly or indirectly require jdk.internal.vm.compiler
+ // and jdk.internal.vm.compiler.management, as these are upgradeable and
+ // also provide APIs to add qualified exports dynamically
+ Set filters = mods.stream().flatMap(mn -> findDeps(mn, inverseDeps).stream())
+ .collect(Collectors.toSet());
+ System.out.println("Filtered modules: " + filters);
+ return modules.stream()
+ .filter(mn -> !filters.contains(mn))
+ .collect(Collectors.toSet());
+ }
+
+ /*
+ * Traverse the graph to find all the dependences from the given name.
+ */
+ static Set findDeps(String name, Map> graph) {
+ Set visited = new HashSet<>();
+ Deque deque = new LinkedList<>();
+ deque.add(name);
+ String node;
+ while (!deque.isEmpty()) {
+ node = deque.pop();
+ if (visited.contains(node))
+ continue;
+
+ visited.add(node);
+ Set deps = graph.get(node);
+ if (deps != null)
+ deque.addAll(deps);
+ }
+ return visited;
}
}
diff --git a/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java b/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java
index f2082fcf374..812541c9daa 100644
--- a/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java
+++ b/test/jdk/java/net/Socket/asyncClose/Socket_getInputStream_read.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2024, 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
@@ -60,7 +60,7 @@ public void run() {
}
latch.countDown();
int n = in.read();
- failed("Socket.getInputStream().read() returned unexpectedly!!");
+ failed("Socket.getInputStream().read() returned unexpectedly, n=" + n);
} catch (SocketException se) {
if (latch.getCount() != 1) {
closed();
@@ -77,20 +77,22 @@ public void run() {
public AsyncCloseTest go() {
try {
InetAddress lh = InetAddress.getLocalHost();
- ServerSocket ss = new ServerSocket(0, 0, lh);
- s.connect( new InetSocketAddress(lh, ss.getLocalPort()) );
- Socket s2 = ss.accept();
- Thread thr = new Thread(this);
- thr.start();
- latch.await();
- Thread.sleep(5000); //sleep, so Socket.getInputStream().read() can block
- s.close();
- thr.join();
+ try (ServerSocket ss = new ServerSocket(0, 0, lh)) {
+ s.connect(new InetSocketAddress(lh, ss.getLocalPort()));
+ try (Socket s2 = ss.accept()) {
+ Thread thr = new Thread(this);
+ thr.start();
+ latch.await();
+ Thread.sleep(5000); //sleep, so Socket.getInputStream().read() can block
+ s.close();
+ thr.join();
+ }
- if (isClosed()) {
- return passed();
- } else {
- return failed("Socket.getInputStream().read() wasn't preempted");
+ if (isClosed()) {
+ return passed();
+ } else {
+ return failed("Socket.getInputStream().read() wasn't preempted");
+ }
}
} catch (Exception x) {
failed(x.getMessage());
diff --git a/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java b/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java
index dc5eda06078..6a967ebcf8d 100644
--- a/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java
+++ b/test/jdk/java/net/Socket/asyncClose/Socket_getOutputStream_write.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2024, 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
@@ -66,20 +66,22 @@ public void run() {
public AsyncCloseTest go() {
try {
InetAddress lh = InetAddress.getLocalHost();
- ServerSocket ss = new ServerSocket(0, 0, lh);
- s.connect( new InetSocketAddress(lh, ss.getLocalPort()) );
- Socket s2 = ss.accept();
- Thread thr = new Thread(this);
- thr.start();
- latch.await();
- Thread.sleep(1000);
- s.close();
- thr.join();
+ try (ServerSocket ss = new ServerSocket(0, 0, lh)) {
+ s.connect(new InetSocketAddress(lh, ss.getLocalPort()));
+ try (Socket s2 = ss.accept()) {
+ Thread thr = new Thread(this);
+ thr.start();
+ latch.await();
+ Thread.sleep(1000);
+ s.close();
+ thr.join();
+ }
- if (isClosed()) {
- return passed();
- } else {
- return failed("Socket.getOutputStream().write() wasn't preempted");
+ if (isClosed()) {
+ return passed();
+ } else {
+ return failed("Socket.getOutputStream().write() wasn't preempted");
+ }
}
} catch (Exception x) {
failed(x.getMessage());
diff --git a/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java b/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java
index 1e16c157fed..1e5eb968030 100644
--- a/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java
+++ b/test/jdk/java/security/KeyAgreement/KeyAgreementTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
String kpgAlgo = args[1];
- String provider = args[2];
+ String provider = System.getProperty("test.provider.name", args[2]);
System.out.println("Testing " + kaAlgo);
AlgoSpec aSpec = AlgoSpec.valueOf(AlgoSpec.class, kaAlgo);
List specs = aSpec.getAlgorithmParameterSpecs();
diff --git a/test/jdk/java/security/KeyAgreement/KeySizeTest.java b/test/jdk/java/security/KeyAgreement/KeySizeTest.java
index 5dfb2dc7315..6ac36a5ee86 100644
--- a/test/jdk/java/security/KeyAgreement/KeySizeTest.java
+++ b/test/jdk/java/security/KeyAgreement/KeySizeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -64,7 +64,7 @@ public class KeySizeTest {
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
- String provider = args[1];
+ String provider = System.getProperty("test.provider.name", args[1]);
String kpgAlgo = args[2];
int keySize = Integer.parseInt(args[3]);
testKeyAgreement(provider, kaAlgo, kpgAlgo, keySize);
diff --git a/test/jdk/java/security/KeyAgreement/KeySpecTest.java b/test/jdk/java/security/KeyAgreement/KeySpecTest.java
index 1e8742dd796..f5974738a12 100644
--- a/test/jdk/java/security/KeyAgreement/KeySpecTest.java
+++ b/test/jdk/java/security/KeyAgreement/KeySpecTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 8184359
+ * @library /test/lib
* @summary Standard tests on KeySpec, KeyFactory, KeyPairs and Keys.
* Arguments order
* @run main KeySpecTest DiffieHellman SunJCE DiffieHellman
@@ -55,13 +56,14 @@
import javax.crypto.KeyAgreement;
import javax.crypto.spec.DHPrivateKeySpec;
import javax.crypto.spec.DHPublicKeySpec;
+import jdk.test.lib.security.SecurityUtils;
public class KeySpecTest {
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
- String provider = args[1];
+ String provider = System.getProperty("test.provider.name", args[1]);
String kpgAlgo = args[2];
KeyPair kp = genKeyPair(provider, kpgAlgo,
(args.length > 3) ? args[3] : kpgAlgo);
@@ -78,7 +80,7 @@ private static KeyPair genKeyPair(String provider, String kpgAlgo,
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider);
switch (kpgInit) {
case "DiffieHellman":
- kpg.initialize(512);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgInit));
break;
case "EC":
kpg.initialize(256);
diff --git a/test/jdk/java/security/KeyAgreement/MultiThreadTest.java b/test/jdk/java/security/KeyAgreement/MultiThreadTest.java
index f53572a10b5..743e874a7de 100644
--- a/test/jdk/java/security/KeyAgreement/MultiThreadTest.java
+++ b/test/jdk/java/security/KeyAgreement/MultiThreadTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 8184359
+ * @library /test/lib
* @summary KeyPairGenerator Test with multiple threads.
* Arguments order
* @run main MultiThreadTest DiffieHellman SunJCE DiffieHellman
@@ -39,6 +40,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import javax.crypto.KeyAgreement;
+import jdk.test.lib.security.SecurityUtils;
/**
* This test targets KeyPairGenerator API related issue in a multi threaded
@@ -52,7 +54,7 @@ public class MultiThreadTest {
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
- String provider = args[1];
+ String provider = System.getProperty("test.provider.name", args[1]);
String kpgAlgo = args[2];
KeyPairGenerator kpg = genKeyGenerator(provider, kpgAlgo,
(args.length > 3) ? args[3] : kpgAlgo);
@@ -68,7 +70,7 @@ private static KeyPairGenerator genKeyGenerator(String provider,
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider);
switch (kpgInit) {
case "DiffieHellman":
- kpg.initialize(512);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgInit));
break;
case "EC":
kpg.initialize(256);
diff --git a/test/jdk/java/security/KeyAgreement/NegativeTest.java b/test/jdk/java/security/KeyAgreement/NegativeTest.java
index 864bf09aeeb..3ccb614ffc3 100644
--- a/test/jdk/java/security/KeyAgreement/NegativeTest.java
+++ b/test/jdk/java/security/KeyAgreement/NegativeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -35,7 +35,7 @@
* Arguments order
*
* @library /test/lib
- * @run main NegativeTest DiffieHellman SunJCE DiffieHellman 1024
+ * @run main NegativeTest DiffieHellman SunJCE DiffieHellman 2048
* @run main NegativeTest ECDH SunEC EC 256
* @run main NegativeTest XDH SunEC XDH 255 X25519
* @run main NegativeTest XDH SunEC XDH 448 X448
@@ -59,13 +59,14 @@
import java.util.Arrays;
import java.util.HexFormat;
import javax.crypto.KeyAgreement;
+import jdk.test.lib.security.SecurityUtils;
public class NegativeTest {
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
- String provider = args[1];
+ String provider = System.getProperty("test.provider.name", args[1]);
String kpgAlgo = args[2];
int keySize = Integer.parseInt(args[3]);
String kpgInit = (args.length > 4) ? args[4] : args[2];
@@ -93,7 +94,7 @@ private static KeyPair genKeyPair(String provider, String kpgAlgo,
Security.getProvider(provider));
switch (kpgInit) {
case "DiffieHellman":
- kpg.initialize(512);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgInit));
break;
case "EC":
kpg.initialize(256);
diff --git a/test/jdk/java/security/KeyFactory/Failover.java b/test/jdk/java/security/KeyFactory/Failover.java
index 6242758a9cf..7107ef1ad02 100644
--- a/test/jdk/java/security/KeyFactory/Failover.java
+++ b/test/jdk/java/security/KeyFactory/Failover.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -24,7 +24,7 @@
/**
* @test
* @bug 4894125 7054918 8130181
- * @library ../testlibrary
+ * @library ../testlibrary /test/lib
* @summary test that failover for KeyFactory works
* @author Andreas Sterbenz
*/
@@ -34,6 +34,7 @@
import java.security.*;
import java.security.interfaces.*;
import java.security.spec.*;
+import jdk.test.lib.security.SecurityUtils;
public class Failover {
@@ -72,8 +73,9 @@ public static void main0(String[] args) throws Exception {
// somewhat more real tests using DSA
System.out.println("DSA tests...");
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
- kpg.initialize(512);
+ String kpgAlgorithm = "DSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpg.generateKeyPair();
kf = KeyFactory.getInstance("DSA");
diff --git a/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java b/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java
index de37778b844..1c7cdba2598 100644
--- a/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java
+++ b/test/jdk/java/security/KeyFactory/GenerateRSAPrivateCrtKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2024, 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
@@ -51,7 +51,8 @@ public static void main(String[] args) throws Exception {
new BigInteger(1, coeff));
// Create an RSA private key from the CRT specification
- KeyFactory kf = KeyFactory.getInstance("RSA", "SunRsaSign");
+ KeyFactory kf = KeyFactory.getInstance("RSA",
+ System.getProperty("test.provider.name", "SunRsaSign"));
RSAPrivateCrtKey rsaPriKey =
(RSAPrivateCrtKey) kf.generatePrivate(rsaCrtSpec);
diff --git a/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java b/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java
index e5c4c5457f3..01893035e2a 100644
--- a/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java
+++ b/test/jdk/java/security/KeyFactory/KeyFactoryGetKeySpecForInvalidSpec.java
@@ -69,7 +69,8 @@ public BigInteger getModulus() {
}
public static void main(String[] args) throws Exception {
- KeyPairGenerator kg = KeyPairGenerator.getInstance("RSA", "SunRsaSign");
+ KeyPairGenerator kg = KeyPairGenerator.getInstance("RSA",
+ System.getProperty("test.provider.name", "SunRsaSign"));
kg.initialize(2048);
KeyPair pair = kg.generateKeyPair();
diff --git a/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java b/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java
index 2c68e5954fa..b2c87b1c38a 100644
--- a/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java
+++ b/test/jdk/java/security/KeyPairGenerator/GenerateKeypair.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2024, 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
@@ -24,18 +24,21 @@
/*
* @test
* @bug 4221800
+ * @library /test/lib
* @summary Test restored generateKeyPair method
*/
import java.security.KeyPairGenerator;
import java.security.KeyPair;
+import jdk.test.lib.security.SecurityUtils;
public class GenerateKeypair {
public static void main(String[] args) throws Exception {
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
- kpg.initialize(512);
+ String kpgAlgorithm = "DSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
// test generateKeyPair
KeyPair kpair = kpg.generateKeyPair();
diff --git a/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java b/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java
index eafd06ee3ec..1b9ace546dc 100644
--- a/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java
+++ b/test/jdk/java/security/KeyPairGenerator/GenerateRSAKeyPair.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 4297026
+ * @library /test/lib
* @summary Make sure that RSA Keypair generation using
* java.security.spec.RSAKeyGenParameterSpec passes
*/
@@ -31,14 +32,18 @@
import java.security.KeyPairGenerator;
import java.security.KeyPair;
import java.security.spec.RSAKeyGenParameterSpec;
+import jdk.test.lib.security.SecurityUtils;
public class GenerateRSAKeyPair {
public static void main(String[] args) throws Exception {
+ String kpgAlgorithm = "RSA";
RSAKeyGenParameterSpec rsaSpec =
- new RSAKeyGenParameterSpec (1024, RSAKeyGenParameterSpec.F4);
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "SunRsaSign");
+ new RSAKeyGenParameterSpec (SecurityUtils.getTestKeySize(kpgAlgorithm),
+ RSAKeyGenParameterSpec.F4);
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm,
+ System.getProperty("test.provider.name", "SunRsaSign"));
kpg.initialize(rsaSpec);
// test generateKeyPair
diff --git a/test/jdk/java/security/KeyRep/Serial.java b/test/jdk/java/security/KeyRep/Serial.java
index 413aa10661a..88c91a091e7 100644
--- a/test/jdk/java/security/KeyRep/Serial.java
+++ b/test/jdk/java/security/KeyRep/Serial.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 4532506 4999599
+ * @library /test/lib
* @summary Serializing KeyPair on one VM (Sun),
* and Deserializing on another (IBM) fails
* @run main/othervm/java.security.policy=Serial.policy Serial
@@ -34,19 +35,22 @@
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
+import jdk.test.lib.security.DiffieHellmanGroup;
+import jdk.test.lib.security.SecurityUtils;
public class Serial {
// providers
- private static final String SUN = "SUN";
- private static final String RSA = "SunRsaSign";
- private static final String JCE = "SunJCE";
+ private static final String SUN = System.getProperty("test.provider.name", "SUN");
+ private static final String RSA = System.getProperty("test.provider.name", "SunRsaSign");
+ private static final String JCE = System.getProperty("test.provider.name", "SunJCE");
public static void main(String[] args) throws Exception {
// generate DSA key pair
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", SUN);
- kpg.initialize(512);
+ String kpgAlgorithmDsa = "DSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithmDsa, SUN);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithmDsa));
KeyPair dsaKp = kpg.genKeyPair();
// serialize DSA key pair
@@ -67,8 +71,9 @@ public static void main(String[] args) throws Exception {
}
// generate RSA key pair
- kpg = KeyPairGenerator.getInstance("RSA", RSA);
- kpg.initialize(512);
+ String kpgAlgorithmRsa = "RSA";
+ kpg = KeyPairGenerator.getInstance(kpgAlgorithmRsa, RSA);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithmRsa));
KeyPair rsaKp = kpg.genKeyPair();
// serialize RSA key pair
@@ -89,8 +94,9 @@ public static void main(String[] args) throws Exception {
}
// generate DH key pair
+ DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup();
kpg = KeyPairGenerator.getInstance("DiffieHellman", JCE);
- kpg.initialize(new DHParameterSpec(skip1024Modulus, skip1024Base));
+ kpg.initialize(new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase()));
KeyPair dhKp = kpg.genKeyPair();
// serialize DH key pair
@@ -197,47 +203,4 @@ private static void checkKey(String algorithm, int size) throws Exception {
throw new SecurityException(algorithm + " test failed");
}
}
-
- // The 1024 bit Diffie-Hellman modulus values used by SKIP
- private static final byte skip1024ModulusBytes[] = {
- (byte)0xF4, (byte)0x88, (byte)0xFD, (byte)0x58,
- (byte)0x4E, (byte)0x49, (byte)0xDB, (byte)0xCD,
- (byte)0x20, (byte)0xB4, (byte)0x9D, (byte)0xE4,
- (byte)0x91, (byte)0x07, (byte)0x36, (byte)0x6B,
- (byte)0x33, (byte)0x6C, (byte)0x38, (byte)0x0D,
- (byte)0x45, (byte)0x1D, (byte)0x0F, (byte)0x7C,
- (byte)0x88, (byte)0xB3, (byte)0x1C, (byte)0x7C,
- (byte)0x5B, (byte)0x2D, (byte)0x8E, (byte)0xF6,
- (byte)0xF3, (byte)0xC9, (byte)0x23, (byte)0xC0,
- (byte)0x43, (byte)0xF0, (byte)0xA5, (byte)0x5B,
- (byte)0x18, (byte)0x8D, (byte)0x8E, (byte)0xBB,
- (byte)0x55, (byte)0x8C, (byte)0xB8, (byte)0x5D,
- (byte)0x38, (byte)0xD3, (byte)0x34, (byte)0xFD,
- (byte)0x7C, (byte)0x17, (byte)0x57, (byte)0x43,
- (byte)0xA3, (byte)0x1D, (byte)0x18, (byte)0x6C,
- (byte)0xDE, (byte)0x33, (byte)0x21, (byte)0x2C,
- (byte)0xB5, (byte)0x2A, (byte)0xFF, (byte)0x3C,
- (byte)0xE1, (byte)0xB1, (byte)0x29, (byte)0x40,
- (byte)0x18, (byte)0x11, (byte)0x8D, (byte)0x7C,
- (byte)0x84, (byte)0xA7, (byte)0x0A, (byte)0x72,
- (byte)0xD6, (byte)0x86, (byte)0xC4, (byte)0x03,
- (byte)0x19, (byte)0xC8, (byte)0x07, (byte)0x29,
- (byte)0x7A, (byte)0xCA, (byte)0x95, (byte)0x0C,
- (byte)0xD9, (byte)0x96, (byte)0x9F, (byte)0xAB,
- (byte)0xD0, (byte)0x0A, (byte)0x50, (byte)0x9B,
- (byte)0x02, (byte)0x46, (byte)0xD3, (byte)0x08,
- (byte)0x3D, (byte)0x66, (byte)0xA4, (byte)0x5D,
- (byte)0x41, (byte)0x9F, (byte)0x9C, (byte)0x7C,
- (byte)0xBD, (byte)0x89, (byte)0x4B, (byte)0x22,
- (byte)0x19, (byte)0x26, (byte)0xBA, (byte)0xAB,
- (byte)0xA2, (byte)0x5E, (byte)0xC3, (byte)0x55,
- (byte)0xE9, (byte)0x2F, (byte)0x78, (byte)0xC7
- };
-
- // The SKIP 1024 bit modulus
- private static final BigInteger skip1024Modulus
- = new BigInteger(1, skip1024ModulusBytes);
-
- // The base used with the SKIP 1024 bit modulus
- private static final BigInteger skip1024Base = BigInteger.valueOf(2);
}
diff --git a/test/jdk/java/security/KeyRep/Serial.policy b/test/jdk/java/security/KeyRep/Serial.policy
index 0c2c1d0868d..3c529c87a13 100644
--- a/test/jdk/java/security/KeyRep/Serial.policy
+++ b/test/jdk/java/security/KeyRep/Serial.policy
@@ -1,3 +1,4 @@
grant {
+ permission java.util.PropertyPermission "test.provider.name", "read";
// XXX note package access is *not* granted to the 'sun' package
};
diff --git a/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java b/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java
index d0aa21f8144..fde58a1cf33 100644
--- a/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java
+++ b/test/jdk/java/security/KeyStore/TestKeyStoreEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2024, 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
@@ -47,7 +47,7 @@ public class TestKeyStoreEntry {
private static final char[] PASSWDF = new String("guardian Angel")
.toCharArray();
private static final String[] KS_ALGOS = {
- "DES", "DESede", "Blowfish"
+ "DES", "DESede", "Blowfish", "AES"
};
private static final int NUM_ALGOS = KS_ALGOS.length;
diff --git a/test/jdk/java/security/MessageDigest/ByteBuffers.java b/test/jdk/java/security/MessageDigest/ByteBuffers.java
index dd3467d0e67..fc25b596d86 100644
--- a/test/jdk/java/security/MessageDigest/ByteBuffers.java
+++ b/test/jdk/java/security/MessageDigest/ByteBuffers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -27,6 +27,8 @@
* @summary Test the MessageDigest.update(ByteBuffer) method
* @author Andreas Sterbenz
* @key randomness
+ * @run main ByteBuffers MD5
+ * @run main ByteBuffers SHA-1
*/
import java.util.*;
@@ -37,13 +39,14 @@
public class ByteBuffers {
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SUN");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SUN"));
Random random = new Random();
int n = 10 * 1024;
byte[] t = new byte[n];
random.nextBytes(t);
- MessageDigest md = MessageDigest.getInstance("MD5", p);
+ String digestAlgo = args[0];
+ MessageDigest md = MessageDigest.getInstance(digestAlgo, p);
byte[] d1 = md.digest(t);
// test 1: ByteBuffer with an accessible backing array
diff --git a/test/jdk/java/security/MessageDigest/TestCloneable.java b/test/jdk/java/security/MessageDigest/TestCloneable.java
index 3a4feb82ff6..48236dbd447 100644
--- a/test/jdk/java/security/MessageDigest/TestCloneable.java
+++ b/test/jdk/java/security/MessageDigest/TestCloneable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -43,14 +43,16 @@ public class TestCloneable {
private static final Class CNSE =
CloneNotSupportedException.class;
+ private static String providerName = System.getProperty("test.provider.name", "SUN");
+
@DataProvider
public Object[][] testData() {
return new Object[][] {
- { "MD2", "SUN" }, { "MD5", "SUN" }, { "SHA-1", "SUN" },
- { "SHA-224", "SUN" }, { "SHA-256", "SUN" },
- { "SHA-384", "SUN" }, { "SHA-512", "SUN" },
- { "SHA3-224", "SUN" }, { "SHA3-256", "SUN" },
- { "SHA3-384", "SUN" }, { "SHA3-512", "SUN" }
+ { "MD2", providerName }, { "MD5", providerName }, { "SHA-1", providerName },
+ { "SHA-224", providerName }, { "SHA-256", providerName },
+ { "SHA-384", providerName }, { "SHA-512", providerName },
+ { "SHA3-224", providerName }, { "SHA3-256", providerName },
+ { "SHA3-384", providerName }, { "SHA3-512", providerName }
};
}
diff --git a/test/jdk/java/security/Provider/SupportsParameter.java b/test/jdk/java/security/Provider/SupportsParameter.java
index bc3cb031791..039fb3d0797 100644
--- a/test/jdk/java/security/Provider/SupportsParameter.java
+++ b/test/jdk/java/security/Provider/SupportsParameter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -24,6 +24,7 @@
/**
* @test
* @bug 4911081 8130181
+ * @library /test/lib
* @summary verify that Provider.Service.supportsParameter() works
* @author Andreas Sterbenz
*/
@@ -33,12 +34,14 @@
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
+import jdk.test.lib.security.SecurityUtils;
public class SupportsParameter {
public static void main(String[] args) throws Exception {
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
- kpg.initialize(512);
+ String kpgAlgorithm = "DSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpg.generateKeyPair();
PublicKey dsaPublicKey = kp.getPublic();
PrivateKey dsaPrivateKey = kp.getPrivate();
diff --git a/test/jdk/java/security/SecureRandom/DefaultAlgo.java b/test/jdk/java/security/SecureRandom/DefaultAlgo.java
index 06027f7162e..8f9e776f246 100644
--- a/test/jdk/java/security/SecureRandom/DefaultAlgo.java
+++ b/test/jdk/java/security/SecureRandom/DefaultAlgo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, 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
@@ -87,8 +87,9 @@ private static void checkDefault(Provider p, String ... algos) {
p.remove("SecureRandom." + s);
out.println("removed " + s);
}
- validate(new SecureRandom(), "SUN",
- SunEntries.DEF_SECURE_RANDOM_ALGO);
+ validate(new SecureRandom(), System.getProperty("test.provider.name", "SUN"),
+ System.getProperty("test.default.secure.random.algorithm.name",
+ SunEntries.DEF_SECURE_RANDOM_ALGO));
} else {
validate(new SecureRandom(), pName, algos[0]);
}
diff --git a/test/jdk/java/security/SecureRandom/DefaultProvider.java b/test/jdk/java/security/SecureRandom/DefaultProvider.java
index c80700b78c9..b9a393bd346 100644
--- a/test/jdk/java/security/SecureRandom/DefaultProvider.java
+++ b/test/jdk/java/security/SecureRandom/DefaultProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -42,7 +42,7 @@ public static void main(String[] args) throws NoSuchAlgorithmException {
out.println("TEST: Default provider with constructor");
SecureRandom secureRandom = new SecureRandom();
String provider = secureRandom.getProvider().getName();
- if (!provider.equals("SUN")) {
+ if (!provider.equals(System.getProperty("test.provider.name", "SUN"))) {
throw new RuntimeException("Unexpected provider name: "
+ provider);
}
@@ -51,7 +51,7 @@ public static void main(String[] args) throws NoSuchAlgorithmException {
/* Test default provider with getInstance(String algorithm) */
out.println("TEST: SHA1PRNG supported on all platforms by SUN provider");
String algorithm = "SHA1PRNG";
- provider = "SUN";
+ provider = System.getProperty("test.provider.name", "SUN");
SecureRandom instance = SecureRandom.getInstance(algorithm);
assertInstance(instance, algorithm, provider);
@@ -61,7 +61,7 @@ public static void main(String[] args) throws NoSuchAlgorithmException {
out.println("TEST: NativePRNG supported on all platforms"
+ "(except Windows), by SUN provider");
algorithm = "NativePRNG";
- provider = "SUN";
+ provider = System.getProperty("test.provider.name", "SUN");
} else {
out.println(
"TEST: Windows-PRNG supported on windows by SunMSCAPI provider");
diff --git a/test/jdk/java/security/SecureRandom/GetInstanceTest.java b/test/jdk/java/security/SecureRandom/GetInstanceTest.java
index c1fdf133305..e95557a7bcb 100644
--- a/test/jdk/java/security/SecureRandom/GetInstanceTest.java
+++ b/test/jdk/java/security/SecureRandom/GetInstanceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, 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
@@ -75,7 +75,8 @@ public static void main(String[] args) throws Exception {
+ "'securerandom.strongAlgorithms'.");
}
try {
- Security.setProperty(STRONG_ALG_SEC_PROP, "DRBG:SUN");
+ Security.setProperty(STRONG_ALG_SEC_PROP, "DRBG:" +
+ System.getProperty("test.provider.name", SUN_PROVIDER));
sr = matchExc(() -> SecureRandom.getInstanceStrong(),
PASS, NoSuchAlgorithmException.class,
"PASS - Undefined security Property "
@@ -123,7 +124,8 @@ private static void verifyInstance(String mech) throws Exception {
// Test for getInstance(algorithm, provider) method.
checkAttributes(
matchExc(() -> SecureRandom.getInstance(srAlgo,
- Security.getProvider(SUN_PROVIDER)),
+ Security.getProvider(
+ System.getProperty("test.provider.name", SUN_PROVIDER))),
!(nsa(mech)),
NoSuchAlgorithmException.class,
String.format("PASS - It is expected to fail for"
@@ -132,7 +134,8 @@ private static void verifyInstance(String mech) throws Exception {
mech);
// Test for getInstance(algorithm, providerName) method.
checkAttributes(
- matchExc(() -> SecureRandom.getInstance(srAlgo, SUN_PROVIDER),
+ matchExc(() -> SecureRandom.getInstance(srAlgo,
+ System.getProperty("test.provider.name", SUN_PROVIDER)),
!(nsa(mech)), NoSuchAlgorithmException.class,
String.format("PASS - It is expected to fail for "
+ "getInstance(algorithm, providerName) when "
@@ -175,7 +178,8 @@ private static void verifyInstance(String mech) throws Exception {
// Test for getInstance(algorithm, params, provider) method.
checkAttributes(
matchExc(() -> SecureRandom.getInstance(srAlgo, param,
- Security.getProvider(SUN_PROVIDER)),
+ Security.getProvider(System.getProperty(
+ "test.provider.name", SUN_PROVIDER))),
(isDRBG(mech)) && (isValidDRBGParam(param)),
getExcType(mech, param),
String.format("PASS - It is expected to fail "
@@ -186,7 +190,7 @@ private static void verifyInstance(String mech) throws Exception {
// Test for getInstance(algorithm, params, providerName) method.
checkAttributes(
matchExc(() -> SecureRandom.getInstance(srAlgo, param,
- SUN_PROVIDER),
+ System.getProperty("test.provider.name", SUN_PROVIDER)),
(isDRBG(mech)) && (isValidDRBGParam(param)),
getExcType(mech, param),
String.format("PASS - It is expected to fail "
@@ -306,7 +310,8 @@ private static void checkAttributes(SecureRandom sr, String mech) {
return;
}
Asserts.assertEquals(sr.getAlgorithm(), (isDRBG(mech) ? "DRBG" : mech));
- Asserts.assertEquals(sr.getProvider().getName(), SUN_PROVIDER);
+ String expectedProviderName = System.getProperty("test.provider.name", SUN_PROVIDER);
+ Asserts.assertEquals(sr.getProvider().getName(), expectedProviderName);
}
}
diff --git a/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java b/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java
index 2267c461e55..f29d368d6d1 100644
--- a/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java
+++ b/test/jdk/java/security/Security/CaseInsensitiveAlgNames.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2024, 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
@@ -41,10 +41,14 @@ public static void main(String[] args)
md = MessageDigest.getInstance("shA1");
// MessageDigest with provider
- md = MessageDigest.getInstance("SHA", "SUN");
- md = MessageDigest.getInstance("sha", "SUN");
- md = MessageDigest.getInstance("Sha-1", "SUN");
- md = MessageDigest.getInstance("shA1", "SUN");
+ md = MessageDigest.getInstance("SHA",
+ System.getProperty("test.provider.name", "SUN"));
+ md = MessageDigest.getInstance("sha",
+ System.getProperty("test.provider.name", "SUN"));
+ md = MessageDigest.getInstance("Sha-1",
+ System.getProperty("test.provider.name", "SUN"));
+ md = MessageDigest.getInstance("shA1",
+ System.getProperty("test.provider.name", "SUN"));
// KeyPairGenerator without provider
KeyPairGenerator kGen = KeyPairGenerator.getInstance("DSA");
@@ -54,11 +58,15 @@ public static void main(String[] args)
kGen = KeyPairGenerator.getInstance("1.2.840.10040.4.1");
// KeyPairGenerator with provider
- kGen = KeyPairGenerator.getInstance("DSA", "SUN");
- kGen = KeyPairGenerator.getInstance("dsa", "SUN");
- kGen = KeyPairGenerator.getInstance("dSA", "SUN");
+ kGen = KeyPairGenerator.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
+ kGen = KeyPairGenerator.getInstance("dsa",
+ System.getProperty("test.provider.name", "SUN"));
+ kGen = KeyPairGenerator.getInstance("dSA",
+ System.getProperty("test.provider.name", "SUN"));
kGen = KeyPairGenerator.getInstance("OId.1.2.840.10040.4.1",
- "SUN");
- kGen = KeyPairGenerator.getInstance("1.2.840.10040.4.1", "SUN");
+ System.getProperty("test.provider.name", "SUN"));
+ kGen = KeyPairGenerator.getInstance("1.2.840.10040.4.1",
+ System.getProperty("test.provider.name", "SUN"));
}
}
diff --git a/test/jdk/java/security/Signature/ByteBuffers.java b/test/jdk/java/security/Signature/ByteBuffers.java
index 937c9842c3b..9f03a9923ec 100644
--- a/test/jdk/java/security/Signature/ByteBuffers.java
+++ b/test/jdk/java/security/Signature/ByteBuffers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -27,6 +27,8 @@
* @summary Test the Signature.update(ByteBuffer) method
* @author Andreas Sterbenz
* @key randomness
+ * @run main ByteBuffers DSA 512
+ * @run main ByteBuffers SHA256withDSA 2048
*/
import java.util.*;
@@ -37,17 +39,21 @@
public class ByteBuffers {
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SUN");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SUN"));
Random random = new Random();
int n = 10 * 1024;
byte[] t = new byte[n];
random.nextBytes(t);
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", p);
- kpg.initialize(512);
+ String kpgAlgorithm = "DSA";
+ int keySize = Integer.parseInt(args[1]);
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, p);
+ kpg.initialize(keySize);
KeyPair kp = kpg.generateKeyPair();
- Signature sig = Signature.getInstance("DSA", p);
+ String signAlgo = args[0];
+ Signature sig = Signature.getInstance(signAlgo, p);
sig.initSign(kp.getPrivate());
sig.update(t);
byte[] signature = sig.sign();
diff --git a/test/jdk/java/security/Signature/NONEwithRSA.java b/test/jdk/java/security/Signature/NONEwithRSA.java
index 6d18c7ac96f..c7b08528e7e 100644
--- a/test/jdk/java/security/Signature/NONEwithRSA.java
+++ b/test/jdk/java/security/Signature/NONEwithRSA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -24,6 +24,7 @@
/**
* @test
* @bug 4955844
+ * @library /test/lib
* @summary ensure that the NONEwithRSA adapter works correctly
* @author Andreas Sterbenz
* @key randomness
@@ -34,17 +35,19 @@
import java.security.*;
import javax.crypto.*;
+import jdk.test.lib.security.SecurityUtils;
public class NONEwithRSA {
public static void main(String[] args) throws Exception {
-// showProvider(Security.getProvider("SUN"));
+// showProvider(Security.getProvider(System.getProperty("test.provider.name", "SUN")));
Random random = new Random();
byte[] b = new byte[16];
random.nextBytes(b);
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
- kpg.initialize(512);
+ String kpgAlgorithm = "RSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpg.generateKeyPair();
Signature sig = Signature.getInstance("NONEwithRSA");
@@ -66,9 +69,11 @@ public static void main(String[] args) throws Exception {
throw new Exception("decryption failed");
}
- sig = Signature.getInstance("NONEwithRSA", "SunJCE");
+ sig = Signature.getInstance("NONEwithRSA",
+ System.getProperty("test.provider.name", "SunJCE"));
sig.initSign(kp.getPrivate());
- sig = Signature.getInstance("NONEwithRSA", Security.getProvider("SunJCE"));
+ sig = Signature.getInstance("NONEwithRSA", Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE")));
sig.initSign(kp.getPrivate());
try {
diff --git a/test/jdk/java/security/Signature/ResetAfterException.java b/test/jdk/java/security/Signature/ResetAfterException.java
index fe5809652e9..1bdae29c411 100644
--- a/test/jdk/java/security/Signature/ResetAfterException.java
+++ b/test/jdk/java/security/Signature/ResetAfterException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, 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
@@ -24,10 +24,12 @@
/**
* @test
* @bug 8149802
+ * @library /test/lib
* @summary Ensure that Signature objects are reset after verification errored out.
*/
import java.util.Arrays;
import java.security.*;
+import jdk.test.lib.security.SecurityUtils;
public class ResetAfterException {
@@ -51,18 +53,19 @@ public static void main(String[] args) throws Exception {
boolean res = true;
System.out.println("Testing Provider: " + p.getName());
KeyPairGenerator keyGen = null;
+ String kpgAlgorithm = "RSA";
try {
// It's possible that some provider, e.g. SunMSCAPI,
// doesn't work well with keys from other providers
// so we use the same provider to generate key first
- keyGen = KeyPairGenerator.getInstance("RSA", p);
+ keyGen = KeyPairGenerator.getInstance(kpgAlgorithm, p);
} catch (NoSuchAlgorithmException nsae) {
- keyGen = KeyPairGenerator.getInstance("RSA");
+ keyGen = KeyPairGenerator.getInstance(kpgAlgorithm);
}
if (keyGen == null) {
throw new RuntimeException("Error: No support for RSA KeyPairGenerator");
}
- keyGen.initialize(1024);
+ keyGen.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair keyPair = keyGen.generateKeyPair();
sig.initSign(keyPair.getPrivate());
diff --git a/test/jdk/java/security/Signature/SignWithOutputBuffer.java b/test/jdk/java/security/Signature/SignWithOutputBuffer.java
index 5f4716391a7..0fcc0405f7c 100644
--- a/test/jdk/java/security/Signature/SignWithOutputBuffer.java
+++ b/test/jdk/java/security/Signature/SignWithOutputBuffer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2024, 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
@@ -26,6 +26,8 @@
* @bug 4114896
* @summary Signature should support a sign() method that places the signature
* in an already existing array.
+ * @run main SignWithOutputBuffer DSS 512
+ * @run main SignWithOutputBuffer SHA256withDSA 2048
*/
import java.security.*;
@@ -36,11 +38,14 @@ public static void main(String[] args) throws Exception {
int numBytes;
- KeyPairGenerator kpGen = KeyPairGenerator.getInstance("DSA");
- kpGen.initialize(512);
+ String kpgAlgorithm = "DSA";
+ int keySize = Integer.parseInt(args[1]);
+ KeyPairGenerator kpGen = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpGen.initialize(keySize);
KeyPair kp = kpGen.genKeyPair();
- Signature sig = Signature.getInstance("DSS");
+ String signAlgo = args[0];
+ Signature sig = Signature.getInstance(signAlgo);
sig.initSign(kp.getPrivate());
sig.update((byte)0xff);
@@ -55,10 +60,10 @@ public static void main(String[] args) throws Exception {
}
// Now repeat the same with a buffer that's big enough
- sig = Signature.getInstance("DSS");
+ sig = Signature.getInstance(signAlgo);
sig.initSign(kp.getPrivate());
sig.update((byte)0xff);
- out = new byte[48];
+ out = new byte[64];
numBytes = sig.sign(out, 0, out.length);
System.out.println("Signature len="+numBytes);
diff --git a/test/jdk/java/security/Signature/SignatureGetInstance.java b/test/jdk/java/security/Signature/SignatureGetInstance.java
index c246773f83a..821c20602a7 100644
--- a/test/jdk/java/security/Signature/SignatureGetInstance.java
+++ b/test/jdk/java/security/Signature/SignatureGetInstance.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, 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
@@ -27,7 +27,8 @@
* @summary Ensure the BC provider-reselection workaround in Signature class
* functions correctly
* @modules java.base/sun.security.util
- * @run main/othervm SignatureGetInstance
+ * @run main/othervm SignatureGetInstance default
+ * @run main/othervm SignatureGetInstance SHA-256
*/
import java.security.*;
import java.security.interfaces.*;
@@ -37,8 +38,12 @@
public class SignatureGetInstance {
private static final String SIGALG = "RSASSA-PSS";
+ private static PSSParameterSpec pssParamSpec;
public static void main(String[] args) throws Exception {
+ String mdName = args[0];
+ pssParamSpec = "default".equals(mdName) ? PSSParameterSpec.DEFAULT :
+ new PSSParameterSpec(mdName, "MGF1", new MGF1ParameterSpec(mdName), 20, 1);
Provider testProvider = new TestProvider();
// put test provider before SunRsaSign provider
Security.insertProviderAt(testProvider, 1);
@@ -50,7 +55,8 @@ public static void main(String[] args) throws Exception {
MyPubKey testPub = new MyPubKey();
testDblInit(testPriv, testPub, true, "TestProvider");
- testDblInit(kp.getPrivate(), kp.getPublic(), true, "SunRsaSign");
+ testDblInit(kp.getPrivate(), kp.getPublic(), true,
+ System.getProperty("test.provider.name", "SunRsaSign"));
testDblInit(testPriv, kp.getPublic(), false, null);
testDblInit(kp.getPrivate(), testPub, false, null);
@@ -59,7 +65,7 @@ public static void main(String[] args) throws Exception {
testSetAndInit(null, kp.getPrivate(), true);
testSetAndInit(null, kp.getPublic(), true);
- String provName = "SunRsaSign";
+ String provName = System.getProperty("test.provider.name", "SunRsaSign");
testSetAndInit(provName, testPriv, false);
testSetAndInit(provName, testPub, false);
testSetAndInit(provName, kp.getPrivate(), true);
@@ -84,7 +90,7 @@ private static void checkName(Signature s, String name) {
private static void testDblInit(PrivateKey key1, PublicKey key2,
boolean shouldPass, String expectedProvName) throws Exception {
Signature sig = Signature.getInstance(SIGALG);
- SignatureUtil.initSignWithParam(sig, key1, PSSParameterSpec.DEFAULT, null);
+ SignatureUtil.initSignWithParam(sig, key1, pssParamSpec, null);
try {
sig.initVerify(key2);
if (!shouldPass) {
@@ -107,7 +113,7 @@ private static void testSetAndInit(String provName, Key key,
} else {
sig = Signature.getInstance(SIGALG, provName);
}
- AlgorithmParameterSpec params = PSSParameterSpec.DEFAULT;
+ AlgorithmParameterSpec params = pssParamSpec;
boolean doSign = (key instanceof PrivateKey);
try {
if (doSign) {
diff --git a/test/jdk/java/security/Signature/TestCloneable.java b/test/jdk/java/security/Signature/TestCloneable.java
index 33e2383cfa4..97f69a8725b 100644
--- a/test/jdk/java/security/Signature/TestCloneable.java
+++ b/test/jdk/java/security/Signature/TestCloneable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -42,21 +42,25 @@ public class TestCloneable {
@DataProvider
public Object[][] testData() {
+ String dsaProviderName = System.getProperty("test.provider.name", "SUN");
+ String ecProviderName = System.getProperty("test.provider.name", "SunEC");
+ String rsaProviderName = System.getProperty("test.provider.name", "SunRsaSign");
+
return new Object[][] {
- { "SHA1withDSA", "SUN" }, { "NONEwithDSA", "SUN" },
- { "SHA224withDSA", "SUN" }, { "SHA256withDSA", "SUN" },
- { "EdDSA", "SunEC" }, { "Ed25519", "SunEC" }, { "Ed448", "SunEC" },
- { "SHA1withECDSA", "SunEC" }, { "SHA224withECDSA", "SunEC" },
- { "SHA256withECDSA", "SunEC" }, { "SHA384withECDSA", "SunEC" },
- { "SHA512withECDSA", "SunEC" }, { "NONEwithECDSA", "SunEC" },
- { "MD2withRSA", "SunRsaSign" }, { "MD5withRSA", "SunRsaSign" },
- { "SHA1withRSA", "SunRsaSign" }, { "SHA224withRSA", "SunRsaSign" },
- { "SHA256withRSA", "SunRsaSign" },
- { "SHA384withRSA", "SunRsaSign" },
- { "SHA512withRSA", "SunRsaSign" },
- { "SHA512/224withRSA", "SunRsaSign" },
- { "SHA512/256withRSA", "SunRsaSign" },
- { "RSASSA-PSS", "SunRsaSign" },
+ { "SHA1withDSA", dsaProviderName }, { "NONEwithDSA", dsaProviderName },
+ { "SHA224withDSA", dsaProviderName }, { "SHA256withDSA", dsaProviderName },
+ { "EdDSA", ecProviderName }, { "Ed25519", ecProviderName }, { "Ed448", ecProviderName },
+ { "SHA1withECDSA", ecProviderName }, { "SHA224withECDSA", ecProviderName },
+ { "SHA256withECDSA", ecProviderName }, { "SHA384withECDSA", ecProviderName },
+ { "SHA512withECDSA", ecProviderName }, { "NONEwithECDSA", ecProviderName },
+ { "MD2withRSA", rsaProviderName }, { "MD5withRSA", rsaProviderName },
+ { "SHA1withRSA", rsaProviderName }, { "SHA224withRSA", rsaProviderName },
+ { "SHA256withRSA", rsaProviderName },
+ { "SHA384withRSA", rsaProviderName },
+ { "SHA512withRSA", rsaProviderName },
+ { "SHA512/224withRSA", rsaProviderName },
+ { "SHA512/256withRSA", rsaProviderName },
+ { "RSASSA-PSS", rsaProviderName },
{ "NONEwithRSA", "SunMSCAPI" },
{ "SHA1withRSA", "SunMSCAPI" }, { "SHA256withRSA", "SunMSCAPI" },
{ "SHA384withRSA", "SunMSCAPI" }, { "SHA512withRSA", "SunMSCAPI" },
diff --git a/test/jdk/java/security/Signature/TestInitSignWithMyOwnRandom.java b/test/jdk/java/security/Signature/TestInitSignWithMyOwnRandom.java
index 0d2d7fd35a4..ac4199ec771 100644
--- a/test/jdk/java/security/Signature/TestInitSignWithMyOwnRandom.java
+++ b/test/jdk/java/security/Signature/TestInitSignWithMyOwnRandom.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -24,22 +24,30 @@
/**
* @test
* @bug 4716321
+ * @library /test/lib
* @summary Ensure the random source supplied in
* Signature.initSign(PrivateKey, SecureRandom) is used.
+ * @run main TestInitSignWithMyOwnRandom DSA 512
+ * @run main TestInitSignWithMyOwnRandom SHA256withDSA 2048
*/
import java.security.*;
+import jdk.test.lib.security.SecurityUtils;
public class TestInitSignWithMyOwnRandom {
- public static void main(String[] argv) throws Exception {
+ public static void main(String[] args) throws Exception {
// any signature implementation will do as long as
// it needs a random source
- Provider p = Security.getProvider("SUN");
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", p);
- kpg.initialize(512);
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SUN"));
+ String kpgAlgorithm = "DSA";
+ int keySize = Integer.parseInt(args[1]);
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, p);
+ kpg.initialize(keySize);
KeyPair kp = kpg.generateKeyPair();
TestRandomSource rand = new TestRandomSource();
- Signature sig = Signature.getInstance("DSA", p);
+ String signAlgo = args[0];
+ Signature sig = Signature.getInstance(signAlgo, p);
sig.initSign(kp.getPrivate(), rand);
sig.update(new byte[20]);
sig.sign();
diff --git a/test/jdk/java/security/Signature/VerifyRangeCheckOverflow.java b/test/jdk/java/security/Signature/VerifyRangeCheckOverflow.java
index b68d8ca9be7..397d7933274 100644
--- a/test/jdk/java/security/Signature/VerifyRangeCheckOverflow.java
+++ b/test/jdk/java/security/Signature/VerifyRangeCheckOverflow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -27,6 +27,7 @@
/* @test
* @bug 7172149
+ * @library /test/lib
* @summary AIOOBE from Signature.verify after integer overflow
* @author Jonathan Lu
*/
@@ -35,17 +36,19 @@
import java.security.KeyPairGenerator;
import java.security.PublicKey;
import java.security.Signature;
+import jdk.test.lib.security.SecurityUtils;
public class VerifyRangeCheckOverflow {
public static void main(String[] args) throws Exception {
- KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
- keyPairGenerator.initialize(1024);
+ String kpgAlgorithm = "DSA";
+ KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(kpgAlgorithm);
+ keyPairGenerator.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair keys = keyPairGenerator.generateKeyPair();
PublicKey publicKey = keys.getPublic();
byte[] sigBytes = new byte[100];
- Signature signature = Signature.getInstance("SHA1withDSA");
+ Signature signature = Signature.getInstance("SHA256withDSA");
signature.initVerify(publicKey);
try {
signature.verify(sigBytes, Integer.MAX_VALUE, 1);
diff --git a/test/jdk/java/security/SignedObject/Chain.java b/test/jdk/java/security/SignedObject/Chain.java
index b4a5ea794e6..883ac13890d 100644
--- a/test/jdk/java/security/SignedObject/Chain.java
+++ b/test/jdk/java/security/SignedObject/Chain.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -55,7 +55,10 @@ static enum Provider {
Sun("SUN"),
SunEC("SunEC"),
SunJSSE("SunJSSE"),
- SunMSCAPI("SunMSCAPI");
+ SunMSCAPI("SunMSCAPI"),
+ TestProvider_or_SunRsaSign(System.getProperty("test.provider.name", "SunRsaSign")),
+ TestProvider_or_Sun(System.getProperty("test.provider.name", "SUN")),
+ TestProvider_or_SunEC(System.getProperty("test.provider.name", "SunEC"));
final String name;
@@ -162,13 +165,15 @@ public String toString() {
new Test(SigAlg.SHA1withDSA, KeyAlg.DSA, Provider.Default, 1024),
new Test(SigAlg.MD2withRSA, KeyAlg.RSA, Provider.Default),
new Test(SigAlg.MD5withRSA, KeyAlg.RSA, Provider.Default),
+ new Test(SigAlg.SHA224withRSA, KeyAlg.RSA, Provider.Default),
+ new Test(SigAlg.SHA256withRSA, KeyAlg.RSA, Provider.Default),
new Test(SigAlg.SHA3_224withRSA, KeyAlg.RSA, Provider.Default),
new Test(SigAlg.SHA3_256withRSA, KeyAlg.RSA, Provider.Default),
new Test(SigAlg.SHA3_384withRSA, KeyAlg.RSA, Provider.Default),
new Test(SigAlg.SHA3_512withRSA, KeyAlg.RSA, Provider.Default),
- new Test(SigAlg.SHA1withDSA, KeyAlg.DSA, Provider.Sun, 1024),
- new Test(SigAlg.SHA224withDSA, KeyAlg.DSA, Provider.Sun, 2048),
- new Test(SigAlg.SHA256withDSA, KeyAlg.DSA, Provider.Sun, 2048),
+ new Test(SigAlg.SHA1withDSA, KeyAlg.DSA, Provider.TestProvider_or_Sun, 1024),
+ new Test(SigAlg.SHA224withDSA, KeyAlg.DSA, Provider.TestProvider_or_Sun, 2048),
+ new Test(SigAlg.SHA256withDSA, KeyAlg.DSA, Provider.TestProvider_or_Sun, 2048),
};
private static final String str = "to-be-signed";
@@ -190,7 +195,7 @@ private static boolean runTestPSS(int keysize) {
Iterator mdAlgs = SigTestUtil.getDigestAlgorithms
(SignatureType.RSASSA_PSS, keysize).iterator();
while (mdAlgs.hasNext()) {
- result &= runTest(new Test(pss, KeyAlg.RSA, Provider.SunRsaSign,
+ result &= runTest(new Test(pss, KeyAlg.RSA, Provider.TestProvider_or_SunRsaSign,
keysize, SigTestUtil.generateDefaultParameter
(SignatureType.RSASSA_PSS, mdAlgs.next())));
}
diff --git a/test/jdk/java/security/SignedObject/Copy.java b/test/jdk/java/security/SignedObject/Copy.java
index b6edfc031fc..3e36891173a 100644
--- a/test/jdk/java/security/SignedObject/Copy.java
+++ b/test/jdk/java/security/SignedObject/Copy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -31,31 +31,35 @@
* @test
* @bug 8050374
* @summary Checks if a signed object is a copy of an original object
+ * @run main Copy DSA 512
+ * @run main Copy SHA256withDSA 2048
*/
public class Copy {
private static final String DSA = "DSA";
- private static final int KEY_SIZE = 512;
private static final int MAGIC = 123;
public static void main(String args[]) throws Exception {
+ int keySize = Integer.parseInt(args[1]);
KeyPairGenerator kg = KeyPairGenerator.getInstance(DSA);
- kg.initialize(KEY_SIZE);
+ kg.initialize(keySize);
KeyPair kp = kg.genKeyPair();
- Signature signature = Signature.getInstance(DSA);
+ String signAlgo = args[0];
+ Signature signature = Signature.getInstance(signAlgo);
Test original = new Test();
SignedObject so = new SignedObject(original, kp.getPrivate(),
signature);
System.out.println("Signature algorithm: " + so.getAlgorithm());
- signature = Signature.getInstance(DSA, "SUN");
+ signature = Signature.getInstance(signAlgo,
+ System.getProperty("test.provider.name", "SUN"));
if (!so.verify(kp.getPublic(), signature)) {
throw new RuntimeException("Verification failed");
}
kg = KeyPairGenerator.getInstance(DSA);
- kg.initialize(KEY_SIZE);
+ kg.initialize(keySize);
kp = kg.genKeyPair();
if (so.verify(kp.getPublic(), signature)) {
diff --git a/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java b/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java
index 6d7a8345617..4867058c4c2 100644
--- a/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java
+++ b/test/jdk/java/security/cert/X509Certificate/GetSigAlgParams.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2024, 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
@@ -24,12 +24,14 @@
/*
* @test
* @bug 8259428
+ * @library /test/lib
* @summary Verify X509Certificate.getSigAlgParams() returns new array each
* time it is called
* @modules java.base/sun.security.tools.keytool java.base/sun.security.x509
*/
import java.security.cert.X509Certificate;
+import jdk.test.lib.security.SecurityUtils;
import sun.security.tools.keytool.CertAndKeyGen;
import sun.security.x509.X500Name;
@@ -38,7 +40,7 @@ public class GetSigAlgParams {
public static void main(String[] args) throws Exception {
CertAndKeyGen cakg = new CertAndKeyGen("RSASSA-PSS", "RSASSA-PSS");
- cakg.generate(1024);
+ cakg.generate(SecurityUtils.getTestKeySize("RSA"));
X509Certificate c = cakg.getSelfCertificate(new X500Name("CN=Me"), 100);
if (c.getSigAlgParams() == c.getSigAlgParams()) {
throw new Exception("Encoded params are the same byte array");
diff --git a/test/jdk/java/security/misc/GetInstanceNullsEmpties.java b/test/jdk/java/security/misc/GetInstanceNullsEmpties.java
index 75089208fa8..9fb1d43e6ed 100644
--- a/test/jdk/java/security/misc/GetInstanceNullsEmpties.java
+++ b/test/jdk/java/security/misc/GetInstanceNullsEmpties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, 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
@@ -44,7 +44,8 @@
*/
public class GetInstanceNullsEmpties {
- private static final Provider SUN = Security.getProvider("SUN");
+ private static final String providerName = System.getProperty("test.provider.name", "SUN");
+ private static final Provider provider = Security.getProvider(providerName);
/*
* See if there are more than "expected" number of getInstance() methods,
@@ -168,14 +169,14 @@ private static void testAlgorithmParameterGenerator() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -190,14 +191,14 @@ private static void testAlgorithmParameters() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -212,14 +213,14 @@ private static void testCertPathBuilder() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -234,14 +235,14 @@ private static void testCertPathValidator() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -257,14 +258,14 @@ private static void testCertStore() throws Exception {
run(m, NoSuchAlgorithmException.class, "", csp);
m = getInstance(clazz, STRING, CertStoreParameters.class, STRING);
- run(m, NullPointerException.class, null, csp, "SUN");
- run(m, NoSuchAlgorithmException.class, "", csp, "SUN");
+ run(m, NullPointerException.class, null, csp, providerName);
+ run(m, NoSuchAlgorithmException.class, "", csp, providerName);
run(m, IllegalArgumentException.class, "FOO", csp, null);
run(m, IllegalArgumentException.class, "FOO", csp, "");
m = getInstance(clazz, STRING, CertStoreParameters.class, PROVIDER);
- run(m, NullPointerException.class, null, csp, SUN);
- run(m, NoSuchAlgorithmException.class, "", csp, SUN);
+ run(m, NullPointerException.class, null, csp, provider);
+ run(m, NoSuchAlgorithmException.class, "", csp, provider);
run(m, IllegalArgumentException.class, "FOO", csp, null);
}
@@ -279,14 +280,14 @@ private static void testCertificateFactory() throws Exception {
run(m, CertificateException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, CertificateException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, CertificateException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, CertificateException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, CertificateException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -305,14 +306,14 @@ private static void testCipher() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NoSuchAlgorithmException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NoSuchAlgorithmException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NoSuchAlgorithmException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NoSuchAlgorithmException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -329,15 +330,15 @@ private static void testConfiguration() throws Exception {
run(m, NoSuchAlgorithmException.class, "", cp);
m = getInstance(clazz, STRING, Configuration.Parameters.class, STRING);
- run(m, NullPointerException.class, null, cp, "SUN");
- run(m, NoSuchAlgorithmException.class, "", cp, "SUN");
+ run(m, NullPointerException.class, null, cp, providerName);
+ run(m, NoSuchAlgorithmException.class, "", cp, providerName);
run(m, IllegalArgumentException.class, "FOO", cp, null);
run(m, IllegalArgumentException.class, "FOO", cp, "");
m = getInstance(clazz, STRING, Configuration.Parameters.class,
PROVIDER);
- run(m, NullPointerException.class, null, cp, SUN);
- run(m, NoSuchAlgorithmException.class, "", cp, SUN);
+ run(m, NullPointerException.class, null, cp, provider);
+ run(m, NoSuchAlgorithmException.class, "", cp, provider);
run(m, IllegalArgumentException.class, "FOO", cp, null);
}
@@ -352,14 +353,14 @@ private static void testExemptionMechanism() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -374,14 +375,14 @@ private static void testKeyAgreement() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -396,14 +397,14 @@ private static void testKeyFactory() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -418,14 +419,14 @@ private static void testKeyGenerator() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -440,14 +441,14 @@ private static void testKeyManagerFactory() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -462,14 +463,14 @@ private static void testKeyPairGenerator() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -488,14 +489,14 @@ private static void testKeyStore() throws Exception {
run(m, KeyStoreException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, KeyStoreException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, KeyStoreException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, KeyStoreException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, KeyStoreException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -510,14 +511,14 @@ private static void testMac() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -532,14 +533,14 @@ private static void testMessageDigest() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -556,14 +557,14 @@ private static void testPolicy() throws Exception {
run(m, NoSuchAlgorithmException.class, "", pp);
m = getInstance(clazz, STRING, Policy.Parameters.class, STRING);
- run(m, NullPointerException.class, null, pp, "SUN");
- run(m, NoSuchAlgorithmException.class, "", pp, "SUN");
+ run(m, NullPointerException.class, null, pp, providerName);
+ run(m, NoSuchAlgorithmException.class, "", pp, providerName);
run(m, IllegalArgumentException.class, "FOO", pp, null);
run(m, IllegalArgumentException.class, "FOO", pp, "");
m = getInstance(clazz, STRING, Policy.Parameters.class, PROVIDER);
- run(m, NullPointerException.class, null, pp, SUN);
- run(m, NoSuchAlgorithmException.class, "", pp, SUN);
+ run(m, NullPointerException.class, null, pp, provider);
+ run(m, NoSuchAlgorithmException.class, "", pp, provider);
run(m, IllegalArgumentException.class, "FOO", pp, null);
}
@@ -578,14 +579,14 @@ private static void testSSLContext() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -600,14 +601,14 @@ private static void testSecretKeyFactory() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -624,14 +625,14 @@ private static void testSecureRandom() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
m = getInstance(clazz, STRING, SecureRandomParameters.class);
@@ -639,14 +640,14 @@ private static void testSecureRandom() throws Exception {
run(m, NoSuchAlgorithmException.class, "", srp);
m = getInstance(clazz, STRING, SecureRandomParameters.class, STRING);
- run(m, NullPointerException.class, null, srp, "SUN");
- run(m, NoSuchAlgorithmException.class, "", srp, "SUN");
+ run(m, NullPointerException.class, null, srp, providerName);
+ run(m, NoSuchAlgorithmException.class, "", srp, providerName);
run(m, IllegalArgumentException.class, "FOO", srp, null);
run(m, IllegalArgumentException.class, "FOO", srp, "");
m = getInstance(clazz, STRING, SecureRandomParameters.class, PROVIDER);
- run(m, NullPointerException.class, null, srp, SUN);
- run(m, NoSuchAlgorithmException.class, "", srp, SUN);
+ run(m, NullPointerException.class, null, srp, provider);
+ run(m, NoSuchAlgorithmException.class, "", srp, provider);
run(m, IllegalArgumentException.class, "FOO", srp, null);
}
@@ -661,14 +662,14 @@ private static void testSignature() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
@@ -683,14 +684,14 @@ private static void testTrustManagerFactory() throws Exception {
run(m, NoSuchAlgorithmException.class, "");
m = getInstance(clazz, STRING, STRING);
- run(m, NullPointerException.class, null, "SUN");
- run(m, NoSuchAlgorithmException.class, "", "SUN");
+ run(m, NullPointerException.class, null, providerName);
+ run(m, NoSuchAlgorithmException.class, "", providerName);
run(m, IllegalArgumentException.class, "FOO", null);
run(m, IllegalArgumentException.class, "FOO", "");
m = getInstance(clazz, STRING, PROVIDER);
- run(m, NullPointerException.class, null, SUN);
- run(m, NoSuchAlgorithmException.class, "", SUN);
+ run(m, NullPointerException.class, null, provider);
+ run(m, NoSuchAlgorithmException.class, "", provider);
run(m, IllegalArgumentException.class, "FOO", null);
}
}
diff --git a/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java b/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java
index d5110d5f5d2..67c91e6ad7e 100644
--- a/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java
+++ b/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2023, 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
@@ -62,15 +62,19 @@
import static java.time.temporal.ChronoField.AMPM_OF_DAY;
import static java.time.temporal.ChronoField.EPOCH_DAY;
import static java.time.temporal.ChronoField.HOUR_OF_AMPM;
+import static java.time.temporal.ChronoField.HOUR_OF_DAY;
import static java.time.temporal.ChronoField.INSTANT_SECONDS;
import static java.time.temporal.ChronoField.MICRO_OF_SECOND;
import static java.time.temporal.ChronoField.MILLI_OF_SECOND;
+import static java.time.temporal.ChronoField.MINUTE_OF_HOUR;
import static java.time.temporal.ChronoField.NANO_OF_SECOND;
import static java.time.temporal.ChronoField.OFFSET_SECONDS;
import static java.time.temporal.ChronoField.SECOND_OF_DAY;
import static java.util.Locale.US;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import java.text.ParsePosition;
import java.time.DateTimeException;
import java.time.Instant;
import java.time.LocalDateTime;
@@ -80,7 +84,9 @@
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.DateTimeParseException;
+import java.time.format.SignStyle;
import java.time.temporal.TemporalAccessor;
+import java.util.Locale;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -88,7 +94,7 @@
/**
* @test
* @summary Test parsing of edge cases.
- * @bug 8223773 8272473
+ * @bug 8223773 8272473 8319640
*/
public class TestDateTimeParsing {
@@ -237,4 +243,30 @@ public void test_validateHourOfAmPm() {
}
}
}
+
+ // Checks ::toFormat().parseObject(text, pos) do not throw DateTimeException
+ @Test
+ public void test_toFormat_2arg_null_return_on_DateTimeException() {
+ var f = new DateTimeFormatterBuilder()
+ .appendValue(HOUR_OF_DAY, 2, 2, SignStyle.NOT_NEGATIVE)
+ .optionalStart()
+ .appendLiteral(':')
+ .appendValue(MINUTE_OF_HOUR, 2, 2, SignStyle.NOT_NEGATIVE)
+ .optionalEnd()
+ .optionalStart()
+ .appendOffset("+HHmm", "Z")
+ .optionalEnd()
+ .toFormatter(Locale.ROOT)
+ .toFormat();
+ assertNull(f.parseObject("17-30", new ParsePosition(0)));
+ }
+
+ // Checks ::toFormat().parseObject(text, pos) do not throw IOOBE
+ @Test
+ public void test_toFormat_2arg_null_return_on_IOOBE() {
+ var date = "2023-11-13";
+ assertNull(DateTimeFormatter.ISO_LOCAL_DATE
+ .toFormat()
+ .parseObject(date, new ParsePosition(date.length() + 1)));
+ }
}
diff --git a/test/jdk/java/util/TimeZone/TimeZoneData/VERSION b/test/jdk/java/util/TimeZone/TimeZoneData/VERSION
index bf027918ce7..f40be22e9ab 100644
--- a/test/jdk/java/util/TimeZone/TimeZoneData/VERSION
+++ b/test/jdk/java/util/TimeZone/TimeZoneData/VERSION
@@ -1 +1 @@
-tzdata2024a
+tzdata2024b
diff --git a/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt b/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt
index 82bad17c553..10d460f0b3f 100644
--- a/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt
+++ b/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt
@@ -53,6 +53,7 @@ Link America/Tijuana Mexico/BajaNorte
Link America/Mazatlan Mexico/BajaSur
Link America/Mexico_City Mexico/General
Link Pacific/Auckland NZ
+Link Asia/Ulaanbaatar Asia/Choibalsan
Link Pacific/Chatham NZ-CHAT
Link America/Denver Navajo #= America/Shiprock
Link Asia/Shanghai PRC
diff --git a/test/jdk/javax/crypto/Cipher/ByteBuffers.java b/test/jdk/javax/crypto/Cipher/ByteBuffers.java
index 233e62fb83a..4dd6d86b476 100644
--- a/test/jdk/javax/crypto/Cipher/ByteBuffers.java
+++ b/test/jdk/javax/crypto/Cipher/ByteBuffers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -27,6 +27,8 @@
* @summary Test the Cipher.update/doFinal(ByteBuffer, ByteBuffer) methods
* @author Andreas Sterbenz
* @key randomness
+ * @run main ByteBuffers DES 8
+ * @run main ByteBuffers AES 16
*/
import java.util.*;
@@ -40,17 +42,20 @@
public class ByteBuffers {
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
Random random = new Random();
int n = 10 * 1024;
byte[] t = new byte[n];
random.nextBytes(t);
- byte[] keyBytes = new byte[8];
+ int keyInt = Integer.parseInt(args[1]);
+ byte[] keyBytes = new byte[keyInt];
random.nextBytes(keyBytes);
- SecretKey key = new SecretKeySpec(keyBytes, "DES");
+ String algo = args[0];
+ SecretKey key = new SecretKeySpec(keyBytes, algo);
- Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding");
+ Cipher cipher = Cipher.getInstance(algo + "/ECB/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] outBytes = cipher.doFinal(t);
diff --git a/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java b/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java
index 15cacec707f..8ffbb6f6a26 100644
--- a/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java
+++ b/test/jdk/javax/crypto/Cipher/CipherInputStreamExceptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -357,10 +357,12 @@ static byte[] encryptedText(String mode, int length) throws Exception{
static byte[] encryptedText(String mode, byte[] pt) throws Exception{
Cipher c;
if (mode.compareTo("GCM") == 0) {
- c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ c = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
c.init(Cipher.ENCRYPT_MODE, key, gcmspec);
} else if (mode.compareTo("CBC") == 0) {
- c = Cipher.getInstance("AES/CBC/PKCS5Padding", "SunJCE");
+ c = Cipher.getInstance("AES/CBC/PKCS5Padding",
+ System.getProperty("test.provider.name", "SunJCE"));
c.init(Cipher.ENCRYPT_MODE, key, iv);
} else {
return null;
@@ -380,10 +382,12 @@ static CipherInputStream getStream(String mode, byte[] ct, int length)
Cipher c;
if (mode.compareTo("GCM") == 0) {
- c = Cipher.getInstance("AES/GCM/NoPadding", "SunJCE");
+ c = Cipher.getInstance("AES/GCM/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
c.init(Cipher.DECRYPT_MODE, key, gcmspec);
} else if (mode.compareTo("CBC") == 0) {
- c = Cipher.getInstance("AES/CBC/PKCS5Padding", "SunJCE");
+ c = Cipher.getInstance("AES/CBC/PKCS5Padding",
+ System.getProperty("test.provider.name", "SunJCE"));
c.init(Cipher.DECRYPT_MODE, key, iv);
} else {
return null;
diff --git a/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java b/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java
index 7ef6f439aac..ee0b9c487a6 100644
--- a/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java
+++ b/test/jdk/javax/crypto/Cipher/GetMaxAllowed.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -96,7 +96,8 @@ public static void main(String[] args) throws Exception {
// decide if the installed jurisdiction policy file is the
// unlimited version
boolean isUnlimited = true;
- Cipher c = Cipher.getInstance("AES", "SunJCE");
+ Cipher c = Cipher.getInstance("AES",
+ System.getProperty("test.provider.name", "SunJCE"));
try {
c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[24], "AES"));
} catch (InvalidKeyException ike) {
diff --git a/test/jdk/javax/crypto/Cipher/TestCipherMode.java b/test/jdk/javax/crypto/Cipher/TestCipherMode.java
index 19e854bca34..83ea6340871 100644
--- a/test/jdk/javax/crypto/Cipher/TestCipherMode.java
+++ b/test/jdk/javax/crypto/Cipher/TestCipherMode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2024, 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
@@ -103,7 +103,9 @@ private static Key getKey(String t, CipherMode m)
public static void main(String[] argv) throws Exception {
- TestCipherMode test = new TestCipherMode("SunJCE", TRANSFORMATIONS);
+ TestCipherMode test = new TestCipherMode(
+ System.getProperty("test.provider.name", "SunJCE"),
+ TRANSFORMATIONS);
System.out.println("All Tests Passed");
}
diff --git a/test/jdk/javax/crypto/Cipher/TestGetInstance.java b/test/jdk/javax/crypto/Cipher/TestGetInstance.java
index 01d60f63a84..8d261657498 100644
--- a/test/jdk/javax/crypto/Cipher/TestGetInstance.java
+++ b/test/jdk/javax/crypto/Cipher/TestGetInstance.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -26,10 +26,13 @@
* @bug 4898428
* @summary test that the new getInstance() implementation works correctly
* @author Andreas Sterbenz
+ * @run main TestGetInstance DES PBEWithMD5AndTripleDES
+ * @run main TestGetInstance AES PBEWithHmacSHA1AndAES_128
*/
import java.security.*;
import java.security.spec.*;
+import java.util.Locale;
import javax.crypto.*;
@@ -42,56 +45,64 @@ private static void same(Provider p1, Provider p2) throws Exception {
}
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SunJCE");
+ String algo = args[0];
+ String algoLC = algo.toLowerCase(Locale.ROOT);
+ String pbeAlgo = args[1];
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunJCE"));
Cipher c;
- c = Cipher.getInstance("PBEWithMD5AndTripleDES");
+ c = Cipher.getInstance(pbeAlgo);
same(p, c.getProvider());
- c = Cipher.getInstance("des", "SunJCE");
+ c = Cipher.getInstance(algoLC,
+ System.getProperty("test.provider.name", "SunJCE"));
same(p, c.getProvider());
- c = Cipher.getInstance("des/cbc/pkcs5padding", "SunJCE");
+ c = Cipher.getInstance(algoLC + "/cbc/pkcs5padding",
+ System.getProperty("test.provider.name", "SunJCE"));
same(p, c.getProvider());
- c = Cipher.getInstance("des", p);
+ c = Cipher.getInstance(algoLC, p);
same(p, c.getProvider());
- c = Cipher.getInstance("des/cbc/pkcs5padding", p);
+ c = Cipher.getInstance(algoLC + "/cbc/pkcs5padding", p);
same(p, c.getProvider());
try {
- c = Cipher.getInstance("DES/XYZ/PKCS5Padding");
+ c = Cipher.getInstance(algo + "/XYZ/PKCS5Padding");
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
}
try {
- c = Cipher.getInstance("DES/XYZ/PKCS5Padding", "SunJCE");
+ c = Cipher.getInstance(algo + "/XYZ/PKCS5Padding",
+ System.getProperty("test.provider.name", "SunJCE"));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
}
try {
- c = Cipher.getInstance("DES/XYZ/PKCS5Padding", p);
+ c = Cipher.getInstance(algo + "/XYZ/PKCS5Padding", p);
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
}
try {
- c = Cipher.getInstance("DES/CBC/XYZPadding");
+ c = Cipher.getInstance(algo + "/CBC/XYZPadding");
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
}
try {
- c = Cipher.getInstance("DES/CBC/XYZPadding", "SunJCE");
+ c = Cipher.getInstance(algo + "/CBC/XYZPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
throw new AssertionError();
} catch (NoSuchPaddingException e) {
System.out.println(e);
}
try {
- c = Cipher.getInstance("DES/CBC/XYZPadding", p);
+ c = Cipher.getInstance(algo + "/CBC/XYZPadding", p);
throw new AssertionError();
} catch (NoSuchPaddingException e) {
System.out.println(e);
@@ -104,7 +115,8 @@ public static void main(String[] args) throws Exception {
System.out.println(e);
}
try {
- c = Cipher.getInstance("foo", "SunJCE");
+ c = Cipher.getInstance("foo",
+ System.getProperty("test.provider.name", "SunJCE"));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
@@ -117,13 +129,15 @@ public static void main(String[] args) throws Exception {
}
try {
- c = Cipher.getInstance("foo", "SUN");
+ c = Cipher.getInstance("foo",
+ System.getProperty("test.provider.name", "SUN"));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
}
try {
- c = Cipher.getInstance("foo", Security.getProvider("SUN"));
+ c = Cipher.getInstance("foo", Security.getProvider(
+ System.getProperty("test.provider.name", "SUN")));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
diff --git a/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java b/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java
index 9e03c908660..9487792df08 100644
--- a/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java
+++ b/test/jdk/javax/crypto/CipherSpi/DirectBBRemaining.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -27,6 +27,8 @@
* @summary Cipher.doFinal(ByteBuffer,ByteBuffer) fails to
* process when in.remaining() == 0
* @key randomness
+ * @run main DirectBBRemaining DES 8
+ * @run main DirectBBRemaining AES 16
*/
import java.nio.ByteBuffer;
@@ -53,11 +55,14 @@ public static void main(String args[]) throws Exception {
boolean failedOnce = false;
Exception failedReason = null;
- byte[] keyBytes = new byte[8];
+ int keyInt = Integer.parseInt(args[1]);
+ byte[] keyBytes = new byte[keyInt];
random.nextBytes(keyBytes);
- SecretKey key = new SecretKeySpec(keyBytes, "DES");
+ String algo = args[0];
+ SecretKey key = new SecretKeySpec(keyBytes, algo);
- Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding", "SunJCE");
+ Cipher cipher = Cipher.getInstance(algo + "/CBC/PKCS5Padding",
+ System.getProperty("test.provider.name", "SunJCE"));
cipher.init(Cipher.ENCRYPT_MODE, key);
/*
diff --git a/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java b/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java
index d7a1ad40e39..c2fef8785e1 100644
--- a/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java
+++ b/test/jdk/javax/crypto/CryptoPermission/AllPermCheck.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -29,6 +29,8 @@
* crypto permssion checks failed.
* @author Valerie Peng
* @key randomness
+ * @run main AllPermCheck DES
+ * @run main AllPermCheck AES
*/
import java.io.*;
@@ -84,9 +86,10 @@ public static void runTest(Cipher c, Key key) throws Exception {
}
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + p.getName() + "...");
- if (Cipher.getMaxAllowedKeyLength("DES") == Integer.MAX_VALUE) {
+ String transformation = args[0];
+ if (Cipher.getMaxAllowedKeyLength(transformation) == Integer.MAX_VALUE) {
// skip this test for unlimited jurisdiction policy files
System.out.println("Skip this test due to unlimited version");
return;
diff --git a/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java b/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java
index c358cb10844..97f6f4fd103 100644
--- a/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java
+++ b/test/jdk/javax/crypto/CryptoPermission/LowercasePermCheck.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -46,9 +46,9 @@ public class LowercasePermCheck {
};
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + p.getName() + "...");
- if (Cipher.getMaxAllowedKeyLength("DES") == Integer.MAX_VALUE) {
+ if (Cipher.getMaxAllowedKeyLength("AES") == Integer.MAX_VALUE) {
// skip this test for unlimited jurisdiction policy files
System.out.println("Skip this test due to unlimited version");
return;
diff --git a/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java b/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java
index 4f54ff8ce3e..54ba18b98e1 100644
--- a/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java
+++ b/test/jdk/javax/crypto/CryptoPermission/RSANoLimit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -135,7 +135,7 @@ public class RSANoLimit {
};
public static void main(String[] args) throws Exception {
boolean result = true;
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
System.out.println("Testing provider " + p.getName() + "...");
// Test#1: make sure Cipher.getMaxAllowedKeyLength returns the
// correct value
diff --git a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java
index 4ea049d08ac..5f5afeabd30 100644
--- a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java
+++ b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetAlgName.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -52,9 +52,11 @@ public static void main(String[] argv) throws Exception {
String algo = ALGOS[i];
// generate AlgorithmParameters object
SecretKeyFactory skf =
- SecretKeyFactory.getInstance(algo, "SunJCE");
+ SecretKeyFactory.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
SecretKey key = skf.generateSecret(ks);
- Cipher c = Cipher.getInstance(algo, "SunJCE");
+ Cipher c = Cipher.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
c.init(Cipher.ENCRYPT_MODE, key);
c.doFinal(BYTES); // force the parameter generation if not already
diff --git a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java
index 314742cbf8d..cc0adc18e56 100644
--- a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java
+++ b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpec.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -26,6 +26,8 @@
* @bug 4508341
* @summary Test the EncryptedPrivateKeyInfo.getKeySpec(...) methods.
* @author Valerie Peng
+ * @run main/othervm -DcipherAlg=PBEWithMD5AndDES GetKeySpec
+ * @run main/othervm -DcipherAlg=PBEWithSHA1AndDESede GetKeySpec
*/
import java.util.*;
import java.nio.*;
@@ -37,16 +39,17 @@
import javax.crypto.spec.*;
public class GetKeySpec {
- private static final String cipherAlg = "PBEWithMD5AndDES";
+ private static String cipherAlg;
private static final char[] passwd = { 'p','a','s','s','w','d' };
private static AlgorithmParameters GOOD_PARAMS;
static {
try {
+ cipherAlg = System.getProperty("cipherAlg");
PBEParameterSpec goodParamSpec =
new PBEParameterSpec(new byte[8], 1024);
GOOD_PARAMS = AlgorithmParameters.getInstance
- (cipherAlg, "SunJCE");
+ (cipherAlg, System.getProperty("test.provider.name", "SunJCE"));
GOOD_PARAMS.init(goodParamSpec);
} catch (Exception ex) {
// should never happen
@@ -55,7 +58,8 @@ public class GetKeySpec {
}
private static String pkcs8Encoded = "30:82:01:53:02:01:00:30:0D:06:09:2A:86:48:86:F7:0D:01:01:01:05:00:04:82:01:3D:30:82:01:39:02:01:00:02:40:6E:A4:13:65:97:A2:C2:47:5E:F2:23:6B:94:D8:D7:25:13:BB:A4:AE:8A:AA:A7:27:A4:9A:04:DC:15:F7:9B:E4:39:18:99:9E:27:EA:92:BB:D0:0E:F3:26:F4:95:89:33:02:65:6D:84:69:2C:CE:B7:FA:68:8E:FE:8D:63:44:6B:02:03:01:00:01:02:40:59:6E:1C:13:98:FE:C1:04:89:75:35:36:27:29:22:B5:E0:7E:62:BD:86:6E:2C:10:7A:16:D8:68:C1:04:D4:A7:10:41:F7:B9:B4:84:05:03:A5:C0:28:73:24:A7:24:F1:1B:C3:4F:BF:05:20:D0:D9:00:08:7F:C3:29:64:1B:29:02:21:00:C4:63:4D:0C:32:51:44:AE:DD:90:A9:B7:B6:C2:6B:11:BE:D2:07:E7:B5:C2:4A:9F:4D:0F:2F:30:5F:E6:1C:6D:02:21:00:90:39:A4:2D:93:0B:08:AF:2F:6F:18:CC:1A:EF:B6:E6:01:E7:21:3A:7F:45:C7:3F:39:12:B8:CC:DF:44:2D:37:02:21:00:B3:9B:61:9E:B2:F2:12:4F:9E:C1:2C:06:A1:B5:A3:38:62:7D:31:CF:9F:32:67:0E:D3:E9:FC:2D:50:B7:61:ED:02:20:5B:FD:77:FB:5D:A3:97:09:6E:1E:D5:59:32:01:1D:CE:7C:FE:38:12:80:A5:38:1D:DA:40:57:C0:CC:D3:46:67:02:20:52:EC:61:05:0D:EC:8A:ED:F7:1E:95:67:D0:7C:8B:D9:AA:A5:33:B8:26:26:2E:8F:D7:A7:18:16:2A:83:63:5C";
- private static String encryptedPKCS8 = "AE:20:81:4F:4D:38:73:C0:51:70:42:DA:C2:EF:61:49:07:E9:B5:D5:55:6D:D1:50:54:B2:0B:41:3E:2F:B6:00:BC:30:89:7B:32:A5:5F:B6:86:92:9E:06:6E:E2:40:8E:3E:E8:0B:CA:97:DB:3E:72:3E:03:22:34:35:EA:5F:B0:71:B2:07:BC:0D:97:94:0A:E6:12:9B:60:7A:77:D4:6C:99:60:2E:68:D6:55:BE:83:B8:A9:0F:19:8A:BE:91:30:D0:FE:52:94:5A:4C:D7:24:07:B3:61:EB:B5:4A:C6:6F:96:8A:C0:20:E9:73:40:FA:A2:56:04:F2:43:35:90:EA:35:C9:8C:08:9D:0B:BC:37:F0:01:D5:DF:BE:E4:4A:57:E0:13:0C:D5:F0:E8:5C:3B:B3:CD:7E:B5:E8:A5:84:63:F6:DA:3E:F2:CF:53:1F:A2:86:44:61:DD:AF:C1:78:70:3A:E6:06:41:77:6C:5B:8D:FA:C4:39:D7:4D:2F:87:D8:31:F4:B6:2B:94:D9:87:17:0E:C8:E3:FA:54:C8:B2:44:56:E0:37:5F:4C:5D:B2:21:DD:15:9E:94:63:89:CF:07:8C:79:F8:65:B2:22:45:D5:F0:2A:70:19:61:16:1D:52:5E:0C:35:3B:20:88:17:7E:FD:05:CC:08:09:2F:05:61:F7:A8:F5:EA:DE:77:DE:5D:55:4E:A0:36:A1:13:FF:2D:57:E8:4E:06:CE:C9:C1:B1:AE:C6:52:A6:EB:35:4C:81:91:DE:71:BA:34:DA:8A:99:1A:47:2E:66:52:AF:E3:2A:E4:0A:27:7F:72:C4:90:7E:8D:8F:64:8D:21:7E:00:DC:1C:62:0F:CC:96:80:C7:E5:5B:70:48:A5:E7:34:27:1A:7C:48:A7:9E:8B:2B:A6:E2";
+ private static String sha1EncryptedPKCS8 = "0D:CA:00:8F:64:91:9C:60:36:F5:9B:BD:DD:C5:A9:A2:27:9E:6B:AE:CB:23:0E:2F:DA:76:03:A5:B7:C0:D5:3E:B9:03:60:62:41:2C:D6:51:37:F0:D9:ED:B2:CC:E7:99:28:03:CD:20:5D:EC:56:77:FC:61:57:D7:8C:F3:F6:10:F7:E5:BA:88:04:FE:1A:17:B3:8C:36:BF:70:2D:CD:6F:BF:83:ED:03:41:22:95:68:E3:08:90:76:B5:97:CB:FF:CE:51:27:14:F6:38:00:22:E9:0F:86:9F:64:D2:47:34:F6:50:DA:A9:80:F5:67:BF:C7:51:B3:38:AF:CD:15:96:50:8F:33:F3:8B:43:4C:AF:ED:DD:37:03:EC:B1:CC:57:53:0A:AF:0D:53:CD:D7:2B:A2:20:C5:37:AF:09:78:8E:3F:A0:E4:EC:22:C6:71:EC:D1:42:15:9D:1D:E9:E3:9D:8F:D6:0B:2A:99:C9:C8:90:B1:CD:AB:17:DD:A3:6F:64:43:23:26:25:7B:A5:E0:1F:2E:AF:18:89:C8:D6:97:28:32:A1:01:22:6F:14:B6:6C:4E:8A:83:47:16:99:51:B4:8D:85:9E:AB:00:B5:18:BB:49:97:47:59:F8:A7:A8:64:76:3F:41:5F:71:1A:F3:4A:96:F2:B4:44:38:42:4B:AE:0F:08:83:5C:33:F8:6A:8F:B9:6A:3D:1C:06:02:4E:07:48:46:E0:6D:6D:ED:E8:19:CB:3F:B0:6F:10:68:3A:5E:F5:8F:94:EF:B4:8B:58:5F:50:0A:E5:F2:13:54:59:14:99:C5:74:02:A2:B1:73:16:7F:F2:D4:DE:E0:12:86:55:46:9C:57:D1:7A:5C:8B:46:E1:7E:C3:32:14:31:52:64:07:52:9D:65:04:9D:54:89";
+ private static String md5EncryptedPKCS8 = "AE:20:81:4F:4D:38:73:C0:51:70:42:DA:C2:EF:61:49:07:E9:B5:D5:55:6D:D1:50:54:B2:0B:41:3E:2F:B6:00:BC:30:89:7B:32:A5:5F:B6:86:92:9E:06:6E:E2:40:8E:3E:E8:0B:CA:97:DB:3E:72:3E:03:22:34:35:EA:5F:B0:71:B2:07:BC:0D:97:94:0A:E6:12:9B:60:7A:77:D4:6C:99:60:2E:68:D6:55:BE:83:B8:A9:0F:19:8A:BE:91:30:D0:FE:52:94:5A:4C:D7:24:07:B3:61:EB:B5:4A:C6:6F:96:8A:C0:20:E9:73:40:FA:A2:56:04:F2:43:35:90:EA:35:C9:8C:08:9D:0B:BC:37:F0:01:D5:DF:BE:E4:4A:57:E0:13:0C:D5:F0:E8:5C:3B:B3:CD:7E:B5:E8:A5:84:63:F6:DA:3E:F2:CF:53:1F:A2:86:44:61:DD:AF:C1:78:70:3A:E6:06:41:77:6C:5B:8D:FA:C4:39:D7:4D:2F:87:D8:31:F4:B6:2B:94:D9:87:17:0E:C8:E3:FA:54:C8:B2:44:56:E0:37:5F:4C:5D:B2:21:DD:15:9E:94:63:89:CF:07:8C:79:F8:65:B2:22:45:D5:F0:2A:70:19:61:16:1D:52:5E:0C:35:3B:20:88:17:7E:FD:05:CC:08:09:2F:05:61:F7:A8:F5:EA:DE:77:DE:5D:55:4E:A0:36:A1:13:FF:2D:57:E8:4E:06:CE:C9:C1:B1:AE:C6:52:A6:EB:35:4C:81:91:DE:71:BA:34:DA:8A:99:1A:47:2E:66:52:AF:E3:2A:E4:0A:27:7F:72:C4:90:7E:8D:8F:64:8D:21:7E:00:DC:1C:62:0F:CC:96:80:C7:E5:5B:70:48:A5:E7:34:27:1A:7C:48:A7:9E:8B:2B:A6:E2";
private static byte[] parse(String s) {
try {
@@ -99,10 +103,10 @@ public static void main(String[] argv) throws Exception {
throw new Exception("Static parameter generation failed");
}
byte[] encodedKey = parse(pkcs8Encoded);
- byte[] encryptedData = parse(encryptedPKCS8);
+ byte[] encryptedData = parse(cipherAlg.contains("MD5") ? md5EncryptedPKCS8 : sha1EncryptedPKCS8);
boolean result = true;
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
// generate encrypted data and EncryptedPrivateKeyInfo object
EncryptedPrivateKeyInfo epki =
diff --git a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java
index e3ecb33d91c..f55f1eea42c 100644
--- a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java
+++ b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -28,6 +28,8 @@
* @summary Test the error conditions of
* EncryptedPrivateKeyInfo.getKeySpec(...) methods.
* @author Valerie Peng
+ * @run main/othervm -DcipherAlg=PBEWithMD5AndDES GetKeySpecException
+ * @run main/othervm -DcipherAlg=PBEWithSHA1AndDESede GetKeySpecException
*/
import java.security.*;
import java.util.Arrays;
@@ -37,7 +39,7 @@
import javax.crypto.spec.*;
public class GetKeySpecException {
- private static final String cipherAlg = "PBEWithMD5AndDES";
+ private static String cipherAlg;
private static final char[] passwd = { 'p','a','s','s','w','d' };
private static SecretKey cipherKey;
private static Cipher cipher = null;
@@ -50,7 +52,8 @@ public class GetKeySpecException {
static {
try {
- sunjce = Security.getProvider("SunJCE");
+ cipherAlg = System.getProperty("cipherAlg");
+ sunjce = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
PBEParameterSpec badParamSpec =
new PBEParameterSpec(new byte[10], 10);
BAD_PARAMS = AlgorithmParameters.getInstance(cipherAlg, sunjce);
@@ -61,7 +64,7 @@ public class GetKeySpecException {
GOOD_PARAMS.init(goodParamSpec);
PBEKeySpec keySpec = new PBEKeySpec(passwd);
SecretKeyFactory skf =
- SecretKeyFactory.getInstance(cipherAlg, "SunJCE");
+ SecretKeyFactory.getInstance(cipherAlg, System.getProperty("test.provider.name", "SunJCE"));
cipherKey = skf.generateSecret(keySpec);
} catch (Exception ex) {
// should never happen
@@ -164,7 +167,7 @@ public static void main0(String[] args) throws Exception {
// TEST#3: getKeySpec(Key, String)
System.out.println("Testing getKeySpec(Key, String)...");
try {
- pkcs8Spec = epki.getKeySpec(null, "SunJCE");
+ pkcs8Spec = epki.getKeySpec(null, System.getProperty("test.provider.name", "SunJCE"));
throwException("Should throw NPE for null Key!");
} catch (NullPointerException npe) {
System.out.println("Expected NPE thrown");
@@ -176,13 +179,13 @@ public static void main0(String[] args) throws Exception {
System.out.println("Expected NPE thrown");
}
try {
- pkcs8Spec = epki.getKeySpec(INVALID_KEY, "SunJCE");
+ pkcs8Spec = epki.getKeySpec(INVALID_KEY, System.getProperty("test.provider.name", "SunJCE"));
throwException("Should throw IKE for invalid Key!");
} catch (InvalidKeyException ikse) {
System.out.println("Expected IKE thrown");
}
try {
- pkcs8Spec = epkiBad.getKeySpec(cipherKey, "SunJCE");
+ pkcs8Spec = epkiBad.getKeySpec(cipherKey, System.getProperty("test.provider.name", "SunJCE"));
throwException("Should throw IKE for corrupted epki!");
} catch (InvalidKeyException ike) {
System.out.println("Expected IKE thrown");
@@ -195,8 +198,9 @@ public static void main0(String[] args) throws Exception {
System.out.println("Expected NSAE thrown");
}
try {
- Security.removeProvider("SunJCE");
- pkcs8Spec = epki.getKeySpec(cipherKey, "SunJCE");
+ Security.removeProvider(System.getProperty("test.provider.name", "SunJCE"));
+ pkcs8Spec = epki.getKeySpec(cipherKey,
+ System.getProperty("test.provider.name", "SunJCE"));
throwException("Should throw NSPE for unconfigured provider!");
} catch (NoSuchProviderException nspe) {
System.out.println("Expected NSPE thrown");
diff --git a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java
index a3f983d0ea4..1fad8b70071 100644
--- a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java
+++ b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecException2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2024, 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
@@ -28,6 +28,8 @@
* with wrong mode with EncryptedPrivateKeyInfo.getKeySpec
* (Cipher) method.
* @author Valerie Peng
+ * @run main GetKeySpecException2 PBEWithMD5AndDES
+ * @run main GetKeySpecException2 PBEWithSHA1AndDESede
*/
import java.security.*;
import java.util.Arrays;
@@ -38,11 +40,10 @@
import javax.crypto.spec.*;
public class GetKeySpecException2 {
- private static final String cipherAlg = "PBEWithMD5AndDES";
private static final char[] passwd = { 'p','a','s','s','w','d' };
- public static void main(String[] argv) throws Exception {
-
+ public static void main(String[] args) throws Exception {
+ String cipherAlg = args[0];
// use random data
byte[] encryptedData = new byte[30];
encryptedData[20] = (byte) 8;
@@ -54,7 +55,8 @@ public static void main(String[] argv) throws Exception {
// TEST#1: getKeySpec(Cipher) with Cipher in an illegal state,
// i.e. WRAP_MODE, UNWRAP_MODE.
System.out.println("Testing getKeySpec(Cipher) with WRAP_MODE...");
- Cipher c = Cipher.getInstance(cipherAlg, "SunJCE");
+ Cipher c = Cipher.getInstance(cipherAlg,
+ System.getProperty("test.provider.name", "SunJCE"));
MyPBEKey key = new MyPBEKey(passwd);
c.init(Cipher.WRAP_MODE, key);
try {
diff --git a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java
index fcc51332488..40c112b42ee 100644
--- a/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java
+++ b/test/jdk/javax/crypto/EncryptedPrivateKeyInfo/GetKeySpecInvalidEncoding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -28,6 +28,8 @@
* methods with scenarios where the decrypted bytes are not
* encoded correctly per PKCS#8 standard.
* @author Valerie Peng
+ * @run main/othervm -DcipherAlg=PBEWithMD5AndDES GetKeySpecInvalidEncoding
+ * @run main/othervm -DcipherAlg=PBEWithSHA1AndDESede GetKeySpecInvalidEncoding
*/
import java.util.*;
import java.nio.*;
@@ -39,16 +41,17 @@
import javax.crypto.spec.*;
public class GetKeySpecInvalidEncoding {
- private static final String cipherAlg = "PBEWithMD5AndDES";
+ private static String cipherAlg;
private static final char[] passwd = { 'p','a','s','s', 'w', 'd' };
private static AlgorithmParameters GOOD_PARAMS;
static {
try {
+ cipherAlg = System.getProperty("cipherAlg");
PBEParameterSpec goodParamSpec =
new PBEParameterSpec(new byte[8], 6);
GOOD_PARAMS = AlgorithmParameters.getInstance
- (cipherAlg, "SunJCE");
+ (cipherAlg, System.getProperty("test.provider.name", "SunJCE"));
GOOD_PARAMS.init(goodParamSpec);
} catch (Exception ex) {
// should never happen
@@ -101,7 +104,7 @@ public static void main(String[] argv) throws Exception {
}
byte[] encryptedData = parse(encryptedPKCS8);
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
// generate encrypted data and EncryptedPrivateKeyInfo object
EncryptedPrivateKeyInfo epki =
diff --git a/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java b/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java
index 53c766874ed..96e8f794d9b 100644
--- a/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java
+++ b/test/jdk/javax/crypto/KeyGenerator/TestGetInstance.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -26,6 +26,8 @@
* @bug 4898428
* @summary test that the new getInstance() implementation works correctly
* @author Andreas Sterbenz
+ * @run main TestGetInstance des
+ * @run main TestGetInstance aes
*/
import java.security.*;
@@ -43,15 +45,17 @@ private static void same(Object o1, Object o2) throws Exception {
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
KeyGenerator kg;
- kg = KeyGenerator.getInstance("des");
+ String algo = args[0];
+ kg = KeyGenerator.getInstance(algo);
System.out.println("Default: " + kg.getProvider().getName());
- kg = KeyGenerator.getInstance("des", "SunJCE");
+ kg = KeyGenerator.getInstance(algo,
+ System.getProperty("test.provider.name", "SunJCE"));
same(p, kg.getProvider());
- kg = KeyGenerator.getInstance("des", p);
+ kg = KeyGenerator.getInstance(algo, p);
same(p, kg.getProvider());
try {
@@ -61,7 +65,8 @@ public static void main(String[] args) throws Exception {
System.out.println(e);
}
try {
- kg = KeyGenerator.getInstance("foo", "SunJCE");
+ kg = KeyGenerator.getInstance("foo",
+ System.getProperty("test.provider.name", "SunJCE"));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
@@ -74,13 +79,15 @@ public static void main(String[] args) throws Exception {
}
try {
- kg = KeyGenerator.getInstance("foo", "SUN");
+ kg = KeyGenerator.getInstance("foo",
+ System.getProperty("test.provider.name", "SUN"));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
}
try {
- kg = KeyGenerator.getInstance("foo", Security.getProvider("SUN"));
+ kg = KeyGenerator.getInstance("foo",
+ Security.getProvider(System.getProperty("test.provider.name", "SUN")));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
diff --git a/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java b/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java
index efaefb06199..65e9b062de7 100644
--- a/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java
+++ b/test/jdk/javax/crypto/KeyGenerator/TestKGParity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -54,8 +54,10 @@ private void run() throws Exception {
Provider[] providers = Security.getProviders();
for (Provider p : providers) {
String prvName = p.getName();
- if (prvName.startsWith("SunJCE")
- || prvName.startsWith("SunPKCS11-")) {
+ if ((System.getProperty("test.provider.name") != null &&
+ prvName.equals(System.getProperty("test.provider.name"))) ||
+ (System.getProperty("test.provider.name") == null &&
+ (prvName.startsWith("SunJCE") || prvName.startsWith("SunPKCS11-")))) {
for (String algorithm : ALGORITHM_ARR) {
if (!runTest(p, algorithm)) {
throw new RuntimeException(
diff --git a/test/jdk/javax/crypto/Mac/ByteBuffers.java b/test/jdk/javax/crypto/Mac/ByteBuffers.java
index a00e5a43cd6..eafd2b89e1a 100644
--- a/test/jdk/javax/crypto/Mac/ByteBuffers.java
+++ b/test/jdk/javax/crypto/Mac/ByteBuffers.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -27,6 +27,8 @@
* @summary Test the Mac.update(ByteBuffer) method
* @author Andreas Sterbenz
* @key randomness
+ * @run main ByteBuffers HmacMD5
+ * @run main ByteBuffers HmacSha256
*/
import java.util.*;
@@ -40,17 +42,18 @@
public class ByteBuffers {
public static void main(String[] args) throws Exception {
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
Random random = new Random();
int n = 10 * 1024;
byte[] t = new byte[n];
random.nextBytes(t);
+ String algo = args[0];
byte[] keyBytes = new byte[16];
random.nextBytes(keyBytes);
- SecretKey key = new SecretKeySpec(keyBytes, "HmacMD5");
+ SecretKey key = new SecretKeySpec(keyBytes, algo);
- Mac mac = Mac.getInstance("HmacMD5");
+ Mac mac = Mac.getInstance(algo);
mac.init(key);
byte[] macValue = mac.doFinal(t);
diff --git a/test/jdk/javax/crypto/Mac/TestGetInstance.java b/test/jdk/javax/crypto/Mac/TestGetInstance.java
index 30d055423db..85982799bd0 100644
--- a/test/jdk/javax/crypto/Mac/TestGetInstance.java
+++ b/test/jdk/javax/crypto/Mac/TestGetInstance.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -26,6 +26,8 @@
* @bug 4898428
* @summary test that the new getInstance() implementation works correctly
* @author Andreas Sterbenz
+ * @run main TestGetInstance hmacmd5
+ * @run main TestGetInstance hmacsha256
*/
import java.security.*;
@@ -43,15 +45,16 @@ private static void same(Object o1, Object o2) throws Exception {
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- Provider p = Security.getProvider("SunJCE");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunJCE"));
Mac mac;
- mac = Mac.getInstance("hmacmd5");
+ String algo = args[0];
+ mac = Mac.getInstance(algo);
System.out.println("Default: " + mac.getProvider().getName());
- mac = Mac.getInstance("hmacmd5", "SunJCE");
+ mac = Mac.getInstance(algo, System.getProperty("test.provider.name", "SunJCE"));
same(p, mac.getProvider());
- mac = Mac.getInstance("hmacmd5", p);
+ mac = Mac.getInstance(algo, p);
same(p, mac.getProvider());
try {
@@ -61,7 +64,7 @@ public static void main(String[] args) throws Exception {
System.out.println(e);
}
try {
- mac = Mac.getInstance("foo", "SunJCE");
+ mac = Mac.getInstance("foo", System.getProperty("test.provider.name", "SunJCE"));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
@@ -74,13 +77,14 @@ public static void main(String[] args) throws Exception {
}
try {
- mac = Mac.getInstance("foo", "SUN");
+ mac = Mac.getInstance("foo", System.getProperty("test.provider.name", "SUN"));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
}
try {
- mac = Mac.getInstance("foo", Security.getProvider("SUN"));
+ mac = Mac.getInstance("foo", Security.getProvider(
+ System.getProperty("test.provider.name", "SUN")));
throw new AssertionError();
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
diff --git a/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java b/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java
index f1b5c825798..398cf12a97e 100644
--- a/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java
+++ b/test/jdk/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -50,7 +50,8 @@
*/
public class SecKFTranslateTest {
- private static final String SUN_JCE = "SunJCE";
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunJCE");
public static void main(String[] args) throws Exception {
@@ -77,10 +78,10 @@ private void runTest(Algorithm algo) throws NoSuchAlgorithmException,
Random random = new Random();
// Initialization
SecretKeyFactory skf = SecretKeyFactory.getInstance(algo.toString(),
- SUN_JCE);
+ PROVIDER_NAME);
random.nextBytes(plainText);
- Cipher ci = Cipher.getInstance(algo.toString(), SUN_JCE);
+ Cipher ci = Cipher.getInstance(algo.toString(), PROVIDER_NAME);
// Encryption
ci.init(Cipher.ENCRYPT_MODE, key1, aps[0]);
byte[] cipherText = new byte[ci.getOutputSize(plainText.length)];
diff --git a/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java b/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java
index c5080ba33c5..8501f888e0f 100644
--- a/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java
+++ b/test/jdk/javax/crypto/SecretKeyFactory/SecKeyFacSunJCEPrf.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, 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
@@ -42,11 +42,11 @@
public class SecKeyFacSunJCEPrf {
// One of the PBKDF2 HMAC-SHA1 test vectors from RFC 6070
- private static final byte[] SALT = "salt".getBytes();
+ private static final byte[] SALT = "16-byte salt val".getBytes();
private static final char[] PASS = "password".toCharArray();
private static final int ITER = 4096;
private static final byte[] EXP_OUT =
- HexFormat.of().parseHex("4B007901B765489ABEAD49D926F721D065A429C1");
+ HexFormat.of().parseHex("D2CACD3F1D44AF293C704F0B1005338D903C688C");
public static void main(String[] args) throws Exception {
// Instantiate the Evil Provider and insert it in the
@@ -56,7 +56,8 @@ public static void main(String[] args) throws Exception {
Security.insertProviderAt(evilProv, 1);
SecretKeyFactory pbkdf2 =
- SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1", "SunJCE");
+ SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1",
+ System.getProperty("test.provider.name", "SunJCE"));
PBEKeySpec pbks = new PBEKeySpec(PASS, SALT, ITER, 160);
SecretKey secKey1 = pbkdf2.generateSecret(pbks);
diff --git a/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java b/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java
index 017535a8bc4..50f66015f37 100644
--- a/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java
+++ b/test/jdk/javax/crypto/SecretKeyFactory/evilprov/com/evilprovider/EvilHmacSHA1.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, 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
@@ -35,7 +35,8 @@ public final class EvilHmacSHA1 extends MacSpi {
private final Mac internalMac;
public EvilHmacSHA1() throws GeneralSecurityException {
- internalMac = Mac.getInstance("HmacSHA1", "SunJCE");
+ internalMac = Mac.getInstance("HmacSHA1",
+ System.getProperty("test.provider.name", "SunJCE"));
}
@Override
diff --git a/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java b/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java
index 71570807e4a..6a664cebf7e 100644
--- a/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java
+++ b/test/jdk/javax/security/auth/Destroyable/KeyDestructionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 6263419
+ * @library /test/lib
* @summary No way to clean the memory for a java.security.Key
*/
@@ -32,10 +33,12 @@
import javax.crypto.*;
import javax.security.auth.Destroyable;
import javax.security.auth.DestroyFailedException;
+import jdk.test.lib.security.SecurityUtils;
public class KeyDestructionTest {
public static void main(String[] args) throws Exception {
- KeyPair keypair = generateKeyPair("RSA", 1024);
+ String kpgAlgorithm = "RSA";
+ KeyPair keypair = generateKeyPair(kpgAlgorithm, SecurityUtils.getTestKeySize(kpgAlgorithm));
// Check keys that support and have implemented key destruction
testKeyDestruction(new MyDestroyableSecretKey());
diff --git a/test/jdk/javax/security/auth/login/Configuration/GetInstance.java b/test/jdk/javax/security/auth/login/Configuration/GetInstance.java
index 4be056bd26c..41820c90743 100644
--- a/test/jdk/javax/security/auth/login/Configuration/GetInstance.java
+++ b/test/jdk/javax/security/auth/login/Configuration/GetInstance.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -84,12 +84,14 @@ private int testDefault(int testnum) throws Exception {
private int testStringProvider(int testnum) throws Exception {
// get an instance of JavaLoginConfig from SUN
- Configuration c = Configuration.getInstance(JAVA_CONFIG, null, "SUN");
+ Configuration c = Configuration.getInstance(JAVA_CONFIG, null,
+ System.getProperty("test.provider.name", "SUN"));
doTest(c, testnum++);
// get an instance of JavaLoginConfig from SunRsaSign
try {
- c = Configuration.getInstance(JAVA_CONFIG, null, "SunRsaSign");
+ c = Configuration.getInstance(JAVA_CONFIG, null,
+ System.getProperty("test.provider.name", "SunRsaSign"));
throw new SecurityException("test " + testnum++ + " failed");
} catch (NoSuchAlgorithmException nsae) {
// good
@@ -112,14 +114,16 @@ private int testProvider(int testnum) throws Exception {
// get an instance of JavaLoginConfig from SUN
Configuration c = Configuration.getInstance(JAVA_CONFIG,
null,
- Security.getProvider("SUN"));
+ Security.getProvider(
+ System.getProperty("test.provider.name", "SUN")));
doTest(c, testnum++);
// get an instance of JavaLoginConfig from SunRsaSign
try {
c = Configuration.getInstance(JAVA_CONFIG,
null,
- Security.getProvider("SunRsaSign"));
+ Security.getProvider(
+ System.getProperty("test.provider.name","SunRsaSign")));
throw new SecurityException("test " + testnum++ + " failed");
} catch (NoSuchAlgorithmException nsae) {
// good
@@ -186,7 +190,7 @@ private int testException(int testnum) throws Exception {
try {
Configuration c = Configuration.getInstance(JAVA_CONFIG,
new BadParam(),
- "SUN");
+ System.getProperty("test.provider.name","SUN"));
throw new SecurityException("test " + testnum++ + " failed");
} catch (IllegalArgumentException iae) {
// good
@@ -196,7 +200,7 @@ private int testException(int testnum) throws Exception {
try {
Configuration c = Configuration.getInstance(JAVA_CONFIG,
new BadParam(),
- Security.getProvider("SUN"));
+ Security.getProvider(System.getProperty("test.provider.name","SUN")));
throw new SecurityException("test " + testnum++ + " failed");
} catch (IllegalArgumentException iae) {
// good
@@ -285,7 +289,7 @@ private void doTest(Configuration c, int testnum) throws Exception {
testnum = doCommon(c, testnum);
// test getProvider
- if ("SUN".equals(c.getProvider().getName())) {
+ if (System.getProperty("test.provider.name","SUN").equals(c.getProvider().getName())) {
System.out.println("test " + testnum + " (getProvider) passed");
} else {
throw new SecurityException("test " + testnum +
@@ -325,7 +329,7 @@ private void doTestURI(Configuration c,
}
// test getProvider
- if ("SUN".equals(c.getProvider().getName())) {
+ if (System.getProperty("test.provider.name","SUN").equals(c.getProvider().getName())) {
System.out.println("test " + testnum + " (getProvider) passed");
} else {
throw new SecurityException("test " + testnum +
diff --git a/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy b/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy
index bcb47b245a7..f92b9fa63ad 100644
--- a/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy
+++ b/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.grantedPolicy
@@ -1,4 +1,5 @@
grant {
+ permission java.util.PropertyPermission "test.provider.name", "read";
permission java.util.PropertyPermission "test.src", "read";
permission java.io.FilePermission "${test.src}${/}*", "read";
diff --git a/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java b/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java
index fc2bec08221..68417a34bd9 100644
--- a/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java
+++ b/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2024, 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
@@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception {
try {
Configuration c = Configuration.getInstance
- (JAVA_CONFIG, null, "SUN");
+ (JAVA_CONFIG, null, System.getProperty("test.provider.name","SUN"));
throw new RuntimeException("did not catch security exception");
} catch (SecurityException se) {
// good
@@ -59,7 +59,8 @@ public static void main(String[] args) throws Exception {
try {
Configuration c = Configuration.getInstance
- (JAVA_CONFIG, null, Security.getProvider("SUN"));
+ (JAVA_CONFIG, null, Security.getProvider(
+ System.getProperty("test.provider.name","SUN")));
throw new RuntimeException("did not catch security exception");
} catch (SecurityException se) {
// good
@@ -71,7 +72,8 @@ public static void main(String[] args) throws Exception {
"GetInstanceSecurity.grantedPolicy");
URI uri = file.toURI();
URIParameter param = new URIParameter(uri);
- Policy p = Policy.getInstance("JavaPolicy", param, "SUN");
+ Policy p = Policy.getInstance("JavaPolicy", param,
+ System.getProperty("test.provider.name","SUN"));
Policy.setPolicy(p);
// retry operations
@@ -88,7 +90,7 @@ public static void main(String[] args) throws Exception {
try {
Configuration c = Configuration.getInstance
- (JAVA_CONFIG, uriParam, "SUN");
+ (JAVA_CONFIG, uriParam, System.getProperty("test.provider.name","SUN"));
// good
} catch (SecurityException se) {
throw new RuntimeException("unexpected SecurityException");
@@ -96,7 +98,8 @@ public static void main(String[] args) throws Exception {
try {
Configuration c = Configuration.getInstance
- (JAVA_CONFIG, uriParam, Security.getProvider("SUN"));
+ (JAVA_CONFIG, uriParam, Security.getProvider(
+ System.getProperty("test.provider.name","SUN")));
// good
} catch (SecurityException se) {
throw new RuntimeException("unexpected SecurityException");
diff --git a/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy b/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy
index 4c0f7acfc88..162168a3ffd 100644
--- a/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy
+++ b/test/jdk/javax/security/auth/login/Configuration/GetInstanceSecurity.policy
@@ -1,6 +1,6 @@
grant {
-
+ permission java.util.PropertyPermission "test.provider.name", "read";
permission java.util.PropertyPermission "test.src", "read";
permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www";
permission java.io.FilePermission
diff --git a/test/jdk/javax/swing/JInternalFrame/4202966/IntFrameCoord.java b/test/jdk/javax/swing/JInternalFrame/4202966/IntFrameCoord.java
new file mode 100644
index 00000000000..cd929f6b7f7
--- /dev/null
+++ b/test/jdk/javax/swing/JInternalFrame/4202966/IntFrameCoord.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 1999, 2022, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.AWTException;
+import java.awt.BorderLayout;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.JButton;
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.SwingUtilities;
+
+/*
+ * @test
+ * @bug 4202966
+ * @key headful
+ * @summary Wrong coordinates in events retargeted to subcomponents of
+ * JInternalFrame
+ * @run main IntFrameCoord
+ */
+
+public class IntFrameCoord {
+ private static JFrame frame;
+ private static JDesktopPane dt;
+ private static JButton tf;
+ private static volatile JButton b;
+ private static JInternalFrame if1;
+ private static JInternalFrame if2;
+ private static boolean isFail;
+
+ public static void main(String[] args) throws InterruptedException,
+ InvocationTargetException, AWTException {
+ Robot robot = new Robot();
+ robot.setAutoDelay(100);
+
+ SwingUtilities.invokeAndWait(IntFrameCoord::createGUI);
+
+ robot.delay(1000);
+
+ MouseListener mouseListener = new MouseAdapter() {
+ public void mousePressed(MouseEvent e) {
+ double height = b.getSize().getHeight();
+ if (e.getY() >= height) {
+ isFail = true;
+ } else {
+ isFail = false;
+ }
+ }
+ };
+
+ b.addMouseListener(mouseListener);
+
+ robot.waitForIdle();
+
+ robot.mouseMove(if2.getLocationOnScreen().x + (if2.getWidth() / 2),
+ if2.getLocationOnScreen().y + 10);
+ robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+ robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+
+ robot.mouseMove(if1.getLocationOnScreen().x + (if1.getWidth() / 2),
+ if1.getLocationOnScreen().y + 10);
+ robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+ robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+
+ robot.mouseMove(b.getLocationOnScreen().x + (b.getWidth() / 2),
+ b.getLocationOnScreen().y + (b.getHeight() / 2));
+ robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+ robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+
+ SwingUtilities.invokeAndWait(() -> frame.dispose());
+
+ if(isFail) {
+ throw new RuntimeException("Mouse coordinates wrong in " +
+ "retargeted JInternalFrame");
+ }
+ }
+
+ private static void createGUI() {
+ frame = new JFrame();
+ dt = new JDesktopPane();
+ frame.setLayout(new BorderLayout());
+ frame.add(BorderLayout.CENTER, dt);
+
+ if1 = new JInternalFrame("Click here second", true, true, true, true);
+ if1.setLayout(new BorderLayout());
+
+ tf = new JButton ("ignore");
+ if1.add(tf, BorderLayout.NORTH);
+
+ tf = new JButton ("ignore");
+ if1.add(tf, BorderLayout.CENTER);
+
+ if1.setBounds(300,0,300,100);
+
+ dt.add(if1);
+
+ if2 = new JInternalFrame("Click here first", true, true, true, true);
+ if2.setLayout(new BorderLayout());
+
+ tf = new JButton ("ignore");
+ if2.add(tf, BorderLayout.NORTH);
+
+ b = new JButton ("Click here third");
+ if2.add (b, BorderLayout.CENTER);
+
+ if2.setBounds(0,0,300,100);
+
+ dt.add(if2);
+
+ if1.setVisible(true);
+ if2.setVisible(true);
+
+ frame.setLocationRelativeTo(null);
+ frame.setTitle("test");
+ frame.setSize(500, 300);
+ frame.setVisible(true);
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ }
+}
diff --git a/test/jdk/jdk/security/jarsigner/Spec.java b/test/jdk/jdk/security/jarsigner/Spec.java
index b089f4af929..c8ab57700c6 100644
--- a/test/jdk/jdk/security/jarsigner/Spec.java
+++ b/test/jdk/jdk/security/jarsigner/Spec.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -38,6 +38,7 @@
import com.sun.jarsigner.ContentSignerParameters;
import jdk.security.jarsigner.JarSigner;
import jdk.test.lib.util.JarUtils;
+import jdk.test.lib.security.SecurityUtils;
import sun.security.provider.certpath.X509CertPath;
import java.io.File;
@@ -181,14 +182,16 @@ public static void main(String[] args) throws Exception {
assertTrue(JarSigner.Builder.getDefaultDigestAlgorithm().equals("SHA-256"));
// Calculating large DSA and RSA keys are too slow.
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
- kpg.initialize(1024);
+ String kpgRSA = "RSA";
+ String kpgDSA = "DSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgRSA);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgRSA));
assertTrue(JarSigner.Builder
.getDefaultSignatureAlgorithm(kpg.generateKeyPair().getPrivate())
.equals("SHA256withRSA"));
- kpg = KeyPairGenerator.getInstance("DSA");
- kpg.initialize(1024);
+ kpg = KeyPairGenerator.getInstance(kpgDSA);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgDSA));
assertTrue(JarSigner.Builder
.getDefaultSignatureAlgorithm(kpg.generateKeyPair().getPrivate())
.equals("SHA256withDSA"));
diff --git a/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java b/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java
index 727ca33a6bd..ddbca2c444d 100644
--- a/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java
+++ b/test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -41,8 +41,8 @@
import java.util.Set;
/**
- * Change file permission for out-of-the-box management an do test used by
- * PasswordFilePermissionTest and SSLConfigFilePermissionTest tests
+ * Change file permission for out-of-the-box management, and test.
+ * Used by PasswordFilePermissionTest and SSLConfigFilePermissionTest tests.
*
* @author Taras Ledkov
*/
@@ -140,13 +140,15 @@ private void test1() throws Exception {
perms_0700.add(PosixFilePermission.OWNER_EXECUTE);
Files.setPosixFilePermissions(file2PermissionTest, perms_0700);
- if (doTest() != 0) {
+ int e = doTest();
+ if (e != 0) {
+ System.out.println("FAILURE: expected exit code 0, got: " + e);
++failures;
}
}
/**
- * Test 1 - SSL config file is secure - VM should start
+ * Test 2 - SSL config file is NOT secure - VM should not start
*/
private void test2() throws Exception {
final Set perms = Files.getPosixFilePermissions(file2PermissionTest);
@@ -154,7 +156,9 @@ private void test2() throws Exception {
perms.add(PosixFilePermission.OTHERS_EXECUTE);
Files.setPosixFilePermissions(file2PermissionTest, perms);
- if (doTest() == 0) {
+ int e = doTest();
+ if (e == 0) {
+ System.out.println("FAILURE: expected exit code non-zero, got: " + e);
++failures;
}
}
@@ -172,7 +176,6 @@ private int doTest() throws Exception {
command.add(TEST_CLASSES);
command.add(className);
-
ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(command);
System.out.println("test cmdline: " + Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
@@ -181,13 +184,15 @@ private int doTest() throws Exception {
System.out.println("test output:");
System.out.println(output.getOutput());
- if ((output.getExitValue() == 0) ||
- !output.getOutput().contains("Exception thrown by the agent : " +
- "java.rmi.server.ExportException: Port already in use")) {
- return output.getExitValue();
+ if (output.getOutput().contains("Exception thrown by the agent: java.rmi.server.ExportException: Port already in use")) {
+ if (i < MAX_GET_FREE_PORT_TRIES - 1) {
+ System.out.println("Retrying...");
+ continue;
+ }
}
+ // Fail on too many port failures, and all other startup failures.
+ return output.getExitValue();
}
-
return -1;
}
diff --git a/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java b/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java
index f41347f7fd2..eacac578a38 100644
--- a/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java
+++ b/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java
@@ -21,6 +21,8 @@
* questions.
*/
+import jdk.test.lib.Utils;
+
import sun.management.jmxremote.ConnectorBootstrap;
import java.io.File;
diff --git a/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java b/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java
index 2d6dbbbbe0f..611a0e07a10 100644
--- a/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java
+++ b/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java
@@ -26,6 +26,7 @@
* */
import jdk.test.lib.Platform;
+import jdk.test.lib.Utils;
import java.io.File;
import java.io.FilenameFilter;
@@ -144,45 +145,6 @@ static List prepareTestFiles(String filenamePattern) throws IOException {
return Collections.unmodifiableList(propertyFiles);
}
- /**
- * Grant file access.
- *
- * @param file file to grant access
- * @param access user access or full access
- * @throws IOException if error occurs
- */
- static void grantAccess(Path file, AccessControl access) throws IOException {
- Set attr = file.getFileSystem().supportedFileAttributeViews();
- if (attr.contains("posix")) {
- String perms = access == AccessControl.OWNER ? "rw-------" : "rwxrwxrwx";
- Files.setPosixFilePermissions(file, PosixFilePermissions.fromString(perms));
- } else if (attr.contains("acl")) {
- AclFileAttributeView view = Files.getFileAttributeView(file, AclFileAttributeView.class);
- List acl = new ArrayList<>();
- for (AclEntry thisEntry : view.getAcl()) {
- if (access == AccessControl.OWNER) {
- if (thisEntry.principal().getName().equals(view.getOwner().getName())) {
- acl.add(Utils.allowAccess(thisEntry));
- } else if (thisEntry.type() == AclEntryType.ALLOW) {
- acl.add(Utils.revokeAccess(thisEntry));
- } else {
- acl.add(thisEntry);
- }
- } else {
- if (!thisEntry.principal().getName().contains("NULL SID")
- && thisEntry.type() != AclEntryType.ALLOW) {
- acl.add(Utils.allowAccess(thisEntry));
- } else {
- acl.add(thisEntry);
- }
- }
- }
- view.setAcl(acl);
- } else {
- throw new RuntimeException("Unsupported file attributes: " + attr);
- }
- }
-
/**
* Grant files' access.
*
@@ -190,9 +152,10 @@ static void grantAccess(Path file, AccessControl access) throws IOException {
* @param access user access or full access
* @throws IOException if error occurs
*/
- static void grantFilesAccess(List files, AccessControl access) throws IOException {
+ static void grantFilesAccess(List files, AccessControl access)
+ throws IOException {
for (Path thisFile : files) {
- grantAccess(thisFile, access);
+ Utils.grantFileAccess(thisFile, access == AccessControl.OWNER);
}
}
@@ -209,7 +172,7 @@ static void copySsl() throws IOException {
Utils.copyFiles(files, sslTarget, StandardCopyOption.REPLACE_EXISTING);
for (Path file : files) {
- grantAccess(sslTarget.resolve(file.getFileName()), AccessControl.EVERYONE);
+ Utils.fullAccess(sslTarget.resolve(file.getFileName()));
}
}
diff --git a/test/jdk/sun/management/jmxremote/bootstrap/Utils.java b/test/jdk/sun/management/jmxremote/bootstrap/Utils.java
deleted file mode 100644
index 3a7819fc61b..00000000000
--- a/test/jdk/sun/management/jmxremote/bootstrap/Utils.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.*;
-import java.nio.file.CopyOption;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.attribute.*;
-import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-/**
- * Utility class.
- */
-public class Utils {
- static private String fileSeparator = System.getProperty("file.separator");
-
- /**
- * Converts slashes in a pathname to backslashes
- * if slashes is not the file separator.
- */
- static String convertPath(String path) {
- // No need to do the conversion if file separator is '/'
- if (fileSeparator.length() == 1 && fileSeparator.charAt(0) == '/') {
- return path;
- }
-
- char[] cs = path.toCharArray();
- for (int i = 0; i < cs.length; i++) {
- if (cs[i] == '/') {
- cs[i] = '\\';
- }
- }
- String newPath = new String(cs);
- return newPath;
- }
-
- /**
- * Return file directories that satisfy the specified filter.
- *
- * @param searchDirectory the base directory to search
- * @param filter a filename filter
- * @return file directories
- */
- public static List findFiles(Path searchDirectory,
- FilenameFilter filter) {
- return Arrays.stream(searchDirectory.toFile().listFiles(filter))
- .map(f -> f.toPath())
- .collect(Collectors.toList());
- }
-
- /**
- * Copy files to the target path.
- *
- * @param source the paths to the files to copy
- * @param target the path to the target files
- * @param filenameMapper mapper function applied to filenames
- * @param options options specifying how the copy should be done
- * @return the paths to the target files
- * @throws IOException if error occurs
- */
- public static List copyFiles(List source, Path target,
- Function filenameMapper,
- CopyOption... options) throws IOException {
- List result = new ArrayList<>();
-
- if (!target.toFile().exists()) {
- Files.createDirectory(target);
- }
-
- for (Path file : source) {
- if (!file.toFile().exists()) {
- continue;
- }
-
- String baseName = file.getFileName().toString();
-
- Path targetFile = target.resolve(filenameMapper.apply(baseName));
- Files.copy(file, targetFile, options);
- result.add(targetFile);
- }
- return result;
- }
-
- /**
- * Copy files to the target path.
- *
- * @param source the paths to the files to copy
- * @param target the path to the target files
- * @param options options specifying how the copy should be done
- * @return the paths to the target files
- * @throws IOException if error occurs
- */
- public static List copyFiles(List source, Path target,
- CopyOption... options) throws IOException {
- return copyFiles(source, target, (s) -> s, options);
- }
-
- /**
- * Return an ACL entry that revokes owner access.
- *
- * @param acl original ACL entry to build from
- * @return an ACL entry that revokes all access
- */
- public static AclEntry revokeAccess(AclEntry acl) {
- return buildAclEntry(acl, AclEntryType.DENY);
- }
-
- /**
- * Return an ACL entry that allow owner access.
- * @param acl original ACL entry to build from
- * @return an ACL entry that allows all access
- */
- public static AclEntry allowAccess(AclEntry acl) {
- return buildAclEntry(acl, AclEntryType.ALLOW);
- }
-
- /**
- * Build an ACL entry with a given ACL entry type.
- *
- * @param acl original ACL entry to build from
- * @return an ACL entry with a given ACL entry type
- */
- public static AclEntry buildAclEntry(AclEntry acl, AclEntryType type) {
- return AclEntry.newBuilder()
- .setType(type)
- .setPrincipal(acl.principal())
- .setPermissions(acl.permissions())
- .build();
- }
-
- /**
- * Replace file string by applying the given mapper function.
- *
- * @param source the file to read
- * @param contentMapper the mapper function applied to file's content
- * @throws IOException if an I/O error occurs
- */
- public static void replaceFileString(Path source,
- Function contentMapper) throws IOException {
- StringBuilder sb = new StringBuilder();
- String lineSep = System.getProperty("line.separator");
-
- try (BufferedReader reader =
- new BufferedReader(new FileReader(source.toFile()))) {
-
- String line;
-
- // read all and replace all at once??
- while ((line = reader.readLine()) != null) {
- sb.append(contentMapper.apply(line))
- .append(lineSep);
- }
- }
-
- try (FileWriter writer = new FileWriter(source.toFile())) {
- writer.write(sb.toString());
- }
- }
-
- /**
- * Replace files' string by applying the given mapper function.
- *
- * @param source the file to read
- * @param contentMapper the mapper function applied to files' content
- * @throws IOException if an I/O error occurs
- */
- public static void replaceFilesString(List source,
- Function contentMapper) throws IOException {
- for (Path file : source) {
- replaceFileString(file, contentMapper);
- }
- }
-}
diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java
index 13a4f7bea73..3d125325449 100644
--- a/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java
+++ b/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -72,7 +72,7 @@ public class JMXStartStopTest {
private static final boolean verbose = false;
- private static ManagementAgentJcmd jcmd = new ManagementAgentJcmd(TEST_APP_NAME, verbose);
+ private static ManagementAgentJcmd jcmd;
private static void dbg_print(String msg) {
if (verbose) {
@@ -347,6 +347,7 @@ public synchronized void start() throws InterruptedException, IOException, Timeo
"the requested port not being available");
}
pid = p.pid();
+ jcmd = new ManagementAgentJcmd(p, verbose);
} catch (TimeoutException e) {
if (p != null) {
p.destroy();
diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
index fc7a0de2d06..e3703ba8dbc 100644
--- a/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
+++ b/test/jdk/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -67,7 +67,6 @@ public static void setupClass() throws Exception {
@BeforeTest
public void setup() {
- jcmd = new ManagementAgentJcmd(TEST_APP_NAME, false);
}
@BeforeMethod
@@ -76,6 +75,7 @@ public void startTestApp() throws Exception {
TEST_APP_NAME, testAppPb,
(Predicate)l->l.trim().equals("main enter")
);
+ jcmd = new ManagementAgentJcmd(testApp, false);
}
@AfterMethod
diff --git a/test/jdk/sun/security/ec/InvalidCurve.java b/test/jdk/sun/security/ec/InvalidCurve.java
index 4c696970b84..76d3b6b79e6 100644
--- a/test/jdk/sun/security/ec/InvalidCurve.java
+++ b/test/jdk/sun/security/ec/InvalidCurve.java
@@ -38,7 +38,8 @@ public static void main(String[] args) {
KeyPairGenerator keyGen;
try {
- keyGen = KeyPairGenerator.getInstance("EC", "SunEC");
+ keyGen = KeyPairGenerator.getInstance("EC",
+ System.getProperty("test.provider.name", "SunEC"));
ECGenParameterSpec brainpoolSpec =
new ECGenParameterSpec("brainpoolP160r1");
keyGen.initialize(brainpoolSpec);
diff --git a/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java b/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java
index cca4e77befb..ba209d7e429 100644
--- a/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java
+++ b/test/jdk/sun/security/ec/NSASuiteB/TestSHAwithECDSASignatureOids.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -45,7 +45,7 @@ public class TestSHAwithECDSASignatureOids {
public static void main(String[] args) throws Exception {
TestSignatureOidHelper helper = new TestSignatureOidHelper("EC",
- "SunEC", 256, DATA);
+ System.getProperty("test.provider.name", "SunEC"), 256, DATA);
helper.execute();
}
}
diff --git a/test/jdk/sun/security/ec/SignatureDigestTruncate.java b/test/jdk/sun/security/ec/SignatureDigestTruncate.java
index 47f0123a491..99048f85137 100644
--- a/test/jdk/sun/security/ec/SignatureDigestTruncate.java
+++ b/test/jdk/sun/security/ec/SignatureDigestTruncate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, 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
@@ -96,17 +96,20 @@ private static void runTest(String alg, String curveName,
byte[] expectedSig = hex.parseHex(sigStr);
AlgorithmParameters params =
- AlgorithmParameters.getInstance("EC", "SunEC");
+ AlgorithmParameters.getInstance("EC",
+ System.getProperty("test.provider.name", "SunEC"));
params.init(new ECGenParameterSpec(curveName));
ECParameterSpec ecParams =
params.getParameterSpec(ECParameterSpec.class);
- KeyFactory kf = KeyFactory.getInstance("EC", "SunEC");
+ KeyFactory kf = KeyFactory.getInstance("EC",
+ System.getProperty("test.provider.name", "SunEC"));
BigInteger s = new BigInteger(1, privateKey);
ECPrivateKeySpec privKeySpec = new ECPrivateKeySpec(s, ecParams);
PrivateKey privKey = kf.generatePrivate(privKeySpec);
- Signature sig = Signature.getInstance(alg, "SunEC");
+ Signature sig = Signature.getInstance(alg,
+ System.getProperty("test.provider.name", "SunEC"));
sig.initSign(privKey, new FixedRandom(k));
sig.update(msg);
byte[] computedSig = sig.sign();
diff --git a/test/jdk/sun/security/ec/SignatureKAT.java b/test/jdk/sun/security/ec/SignatureKAT.java
index 542d90d6ca5..802c74f3b69 100644
--- a/test/jdk/sun/security/ec/SignatureKAT.java
+++ b/test/jdk/sun/security/ec/SignatureKAT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -132,16 +132,19 @@ private static void runTest(TestData td) throws Exception {
System.out.println("Testing " + td.sigName + " with " + td.cd.name);
AlgorithmParameters params =
- AlgorithmParameters.getInstance("EC", "SunEC");
+ AlgorithmParameters.getInstance("EC",
+ System.getProperty("test.provider.name", "SunEC"));
params.init(new ECGenParameterSpec(td.cd.name));
ECParameterSpec ecParams =
params.getParameterSpec(ECParameterSpec.class);
- KeyFactory kf = KeyFactory.getInstance("EC", "SunEC");
+ KeyFactory kf = KeyFactory.getInstance("EC",
+ System.getProperty("test.provider.name", "SunEC"));
PrivateKey privKey = kf.generatePrivate
(new ECPrivateKeySpec(td.cd.priv, ecParams));
- Signature sig = Signature.getInstance(td.sigName, "SunEC");
+ Signature sig = Signature.getInstance(td.sigName,
+ System.getProperty("test.provider.name", "SunEC"));
sig.initSign(privKey);
sig.update(td.cd.msgBytes);
// NOTE: there is no way to set the nonce value into current SunEC
diff --git a/test/jdk/sun/security/ec/SignedObjectChain.java b/test/jdk/sun/security/ec/SignedObjectChain.java
index cfeff8c1ad5..e245a6caa2d 100644
--- a/test/jdk/sun/security/ec/SignedObjectChain.java
+++ b/test/jdk/sun/security/ec/SignedObjectChain.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -35,7 +35,7 @@ public class SignedObjectChain {
private static class Test extends Chain.Test {
public Test(Chain.SigAlg sigAlg) {
- super(sigAlg, Chain.KeyAlg.EC, Chain.Provider.SunEC);
+ super(sigAlg, Chain.KeyAlg.EC, Chain.Provider.TestProvider_or_SunEC);
}
}
diff --git a/test/jdk/sun/security/ec/TestEC.java b/test/jdk/sun/security/ec/TestEC.java
index de4f47ca5ed..dacb67ce892 100644
--- a/test/jdk/sun/security/ec/TestEC.java
+++ b/test/jdk/sun/security/ec/TestEC.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2024, 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
@@ -85,7 +85,7 @@ public static void main(String[] args) throws Exception {
}
public static void main0(String[] args) throws Exception {
- Provider p = Security.getProvider("SunEC");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name", "SunEC"));
if (p == null) {
throw new NoSuchProviderException("Can't get SunEC provider");
diff --git a/test/jdk/sun/security/ec/ed/EdCRLSign.java b/test/jdk/sun/security/ec/ed/EdCRLSign.java
index d2ac5f76bb8..d3f5dcbc6e9 100644
--- a/test/jdk/sun/security/ec/ed/EdCRLSign.java
+++ b/test/jdk/sun/security/ec/ed/EdCRLSign.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -44,7 +44,7 @@ public class EdCRLSign {
private static final String OID25519 = "OID.1.3.101.112";
private static final String OIDN448 = "1.3.101.113";
private static final String OID448 = "OID.1.3.101.113";
- private static final String PROVIDER = "SunEC";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC");
private static final SecureRandom S_RND = new SecureRandom(new byte[]{0x1});
public static void main(String[] args) throws Exception {
diff --git a/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java b/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java
index 4240ec53477..f3796073b71 100644
--- a/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java
+++ b/test/jdk/sun/security/ec/ed/EdDSAKeyCompatibility.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -54,7 +54,7 @@ public class EdDSAKeyCompatibility {
private static final String EDDSA = "EdDSA";
private static final String ED25519 = "Ed25519";
private static final String ED448 = "Ed448";
- private static final String PROVIDER = "SunEC";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC");
public static void main(String[] args) throws Exception {
diff --git a/test/jdk/sun/security/ec/ed/EdDSAKeySize.java b/test/jdk/sun/security/ec/ed/EdDSAKeySize.java
index d5a6bec6f5a..8cb207c8fe2 100644
--- a/test/jdk/sun/security/ec/ed/EdDSAKeySize.java
+++ b/test/jdk/sun/security/ec/ed/EdDSAKeySize.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -60,7 +60,7 @@ public class EdDSAKeySize {
private static final String OID25519 = "OID.1.3.101.112";
private static final String OIDN448 = "1.3.101.113";
private static final String OID448 = "OID.1.3.101.113";
- private static final String PROVIDER = "SunEC";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC");
private static final SecureRandom RND = new SecureRandom(new byte[]{0x1});
public static void main(String[] args) throws Exception {
diff --git a/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java b/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java
index c03249e8553..ba45be67575 100644
--- a/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java
+++ b/test/jdk/sun/security/ec/ed/EdDSANegativeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -48,7 +48,7 @@ public class EdDSANegativeTest {
private static final String EDDSA = "EdDSA";
private static final String ED25519 = "Ed25519";
private static final String ED448 = "Ed448";
- private static final String PROVIDER = "SunEC";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC");
private static final String OTHER = "other";
private static final byte[] MSG = "TEST".getBytes();
diff --git a/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java b/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java
index 046134f220d..b13f51a74a7 100644
--- a/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java
+++ b/test/jdk/sun/security/ec/ed/EdDSAParamSpec.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -43,7 +43,7 @@ public class EdDSAParamSpec {
private static final String EDDSA = "EdDSA";
private static final String ED25519 = "Ed25519";
private static final String ED448 = "Ed448";
- private static final String PROVIDER = "SunEC";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC");
private static final byte[] MSG = "TEST".getBytes();
private static final SecureRandom RND = new SecureRandom(new byte[]{0x1});
diff --git a/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java b/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java
index bebabb8539f..9e40b572513 100644
--- a/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java
+++ b/test/jdk/sun/security/ec/ed/EdDSAReuseTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -42,7 +42,7 @@ public class EdDSAReuseTest {
private static final String EDDSA = "EdDSA";
private static final String ED25519 = "Ed25519";
private static final String ED448 = "Ed448";
- private static final String PROVIDER = "SunEC";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC");
private static final String MSG = "TEST";
private static final int REUSE = 20;
private static final int ONCE = 1;
diff --git a/test/jdk/sun/security/ec/ed/EdDSATest.java b/test/jdk/sun/security/ec/ed/EdDSATest.java
index 5ba06b8970a..c154bca4252 100644
--- a/test/jdk/sun/security/ec/ed/EdDSATest.java
+++ b/test/jdk/sun/security/ec/ed/EdDSATest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -68,7 +68,7 @@ public class EdDSATest {
private static final String OID25519 = "OID.1.3.101.112";
private static final String OIDN448 = "1.3.101.113";
private static final String OID448 = "OID.1.3.101.113";
- private static final String PROVIDER = "SunEC";
+ private static final String PROVIDER = System.getProperty("test.provider.name", "SunEC");
private static final byte[] MSG = "TEST".getBytes();
private static final SecureRandom S_RND = new SecureRandom(new byte[]{0x1});
diff --git a/test/jdk/sun/security/ec/ed/TestEdDSA.java b/test/jdk/sun/security/ec/ed/TestEdDSA.java
index 511d92ab997..1990638496f 100644
--- a/test/jdk/sun/security/ec/ed/TestEdDSA.java
+++ b/test/jdk/sun/security/ec/ed/TestEdDSA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -462,10 +462,14 @@ private static void runBasicTest(String name, Object param)
* when the algorithm ID for a specific curve is specified.
*/
private static void runCurveMixTest() throws Exception {
- runCurveMixTest("SunEC", "Ed25519", 448);
- runCurveMixTest("SunEC", "Ed25519", "Ed448");
- runCurveMixTest("SunEC", "Ed448", 255);
- runCurveMixTest("SunEC", "Ed448", "Ed25519");
+ runCurveMixTest(System.getProperty("test.provider.name", "SunEC"),
+ "Ed25519", 448);
+ runCurveMixTest(System.getProperty("test.provider.name", "SunEC"),
+ "Ed25519", "Ed448");
+ runCurveMixTest(System.getProperty("test.provider.name", "SunEC"),
+ "Ed448", 255);
+ runCurveMixTest(System.getProperty("test.provider.name", "SunEC"),
+ "Ed448", "Ed25519");
}
private static void runCurveMixTest(String providerName, String name,
diff --git a/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java b/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java
index 58bcbe91153..cd74b5164d3 100644
--- a/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java
+++ b/test/jdk/sun/security/jca/PreferredProviderNegativeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -107,7 +107,7 @@ public static void main(String[] args)
String expected;
String value = args[1];
- expected = "SunJCE";
+ expected = System.getProperty("test.provider.name", "SunJCE");
if (args.length >= 2) {
switch (args[0]) {
diff --git a/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java b/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java
index 921a360b721..e8029f91387 100644
--- a/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java
+++ b/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -103,11 +103,13 @@ static void matrix(PSSParameterSpec pss) throws Exception {
"-------", "----------------", "------", "--------", "------");
// KeyPairGenerator chooses SPI when getInstance() is called.
- String[] provsForKPG = {"SunRsaSign", "SunMSCAPI"};
+ String[] provsForKPG = {System.getProperty("test.provider.name", "SunRsaSign"),
+ "SunMSCAPI"};
// "-" means no preferred provider. In this case, SPI is chosen
// when initSign/initVerify is called. Worth testing.
- String[] provsForSignature = {"SunRsaSign", "SunMSCAPI", "-"};
+ String[] provsForSignature = {System.getProperty("test.provider.name", "SunRsaSign"),
+ "SunMSCAPI", "-"};
int pos = 0;
for (String pg : provsForKPG) {
diff --git a/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java b/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java
index 1e389eb613f..9f3d72f8983 100644
--- a/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java
+++ b/test/jdk/sun/security/pkcs/pkcs10/PKCS10AttrEncoding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -30,7 +30,8 @@
* java.base/sun.security.util
* java.base/sun.security.x509
* @compile -XDignore.symbol.file PKCS10AttrEncoding.java
- * @run main PKCS10AttrEncoding
+ * @run main PKCS10AttrEncoding DSA 512
+ * @run main PKCS10AttrEncoding Sha256withDSA 2048
*/
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@@ -69,11 +70,13 @@ public static void main(String[] args) throws Exception {
constructedMap.put(ids[j], values[j]);
}
+ String kpgAlgorithm = "DSA";
X500Name subject = new X500Name("cn=Test");
- KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA");
- String sigAlg = "DSA";
+ KeyPairGenerator keyGen = KeyPairGenerator.getInstance(kpgAlgorithm);
+ String sigAlg = args[0];
+ int keySize = Integer.parseInt(args[1]);
- keyGen.initialize(512);
+ keyGen.initialize(keySize);
KeyPair pair = keyGen.generateKeyPair();
X509Key publicKey = (X509Key) pair.getPublic();
diff --git a/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java b/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java
index 875ca5935e4..37db7fe4e8f 100644
--- a/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java
+++ b/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -29,7 +29,8 @@
* @modules java.base/sun.security.pkcs
* java.base/sun.security.util
* java.base/sun.security.x509
- * @run main SignerOrder
+ * @run main SignerOrder default 1024
+ * @run main SignerOrder Sha256 2048
*/
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -63,20 +64,21 @@ public class SignerOrder {
static final byte[] data1 = "12345".getBytes();
static final byte[] data2 = "abcde".getBytes();
- public static void main(String[] argv) throws Exception {
-
+ public static void main(String[] args) throws Exception {
+ String digestAlg = "default".equals(args[0]) ? null : args[0];
+ int keySize = Integer.parseInt(args[1]);
SignerInfo[] signerInfos = new SignerInfo[9];
- SimpleSigner signer1 = new SimpleSigner(null, null, null, null);
+ SimpleSigner signer1 = new SimpleSigner(digestAlg, null, null, null, keySize);
signerInfos[8] = signer1.genSignerInfo(data1);
signerInfos[7] = signer1.genSignerInfo(new byte[]{});
signerInfos[6] = signer1.genSignerInfo(data2);
- SimpleSigner signer2 = new SimpleSigner(null, null, null, null);
+ SimpleSigner signer2 = new SimpleSigner(digestAlg, null, null, null, keySize);
signerInfos[5] = signer2.genSignerInfo(data1);
signerInfos[4] = signer2.genSignerInfo(new byte[]{});
signerInfos[3] = signer2.genSignerInfo(data2);
- SimpleSigner signer3 = new SimpleSigner(null, null, null, null);
+ SimpleSigner signer3 = new SimpleSigner(digestAlg, null, null, null, keySize);
signerInfos[2] = signer3.genSignerInfo(data1);
signerInfos[1] = signer3.genSignerInfo(new byte[]{});
signerInfos[0] = signer3.genSignerInfo(data2);
@@ -157,28 +159,33 @@ class SimpleSigner {
public SimpleSigner(String digestAlg,
String encryptionAlg,
KeyPair keyPair,
- X500Name agent) throws Exception {
+ X500Name agent,
+ int keySize) throws Exception {
+ String signAlgoDigest;
if (agent == null) {
agent = new X500Name("cn=test");
}
- if (digestAlg == null) {
- digestAlg = "SHA";
- }
if (encryptionAlg == null) {
encryptionAlg = "DSA";
}
+ if (digestAlg == null) {
+ digestAlg = "SHA";
+ signAlgoDigest = encryptionAlg;
+ } else {
+ signAlgoDigest = digestAlg + "with" + encryptionAlg;
+ }
if (keyPair == null) {
KeyPairGenerator keyGen =
KeyPairGenerator.getInstance(encryptionAlg);
- keyGen.initialize(1024);
+ keyGen.initialize(keySize);
keyPair = keyGen.generateKeyPair();
}
publicKey = (X509Key) keyPair.getPublic();
privateKey = keyPair.getPrivate();
if ("DSA".equals(encryptionAlg)) {
- this.sig = Signature.getInstance(encryptionAlg);
+ this.sig = Signature.getInstance(signAlgoDigest);
} else { // RSA
this.sig = Signature.getInstance(digestAlg + "/" + encryptionAlg);
}
diff --git a/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java b/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java
index 92a20450157..4291f4e25c1 100644
--- a/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java
+++ b/test/jdk/sun/security/pkcs/pkcs8/TestLeadingZeros.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2024, 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
@@ -50,7 +50,8 @@ public class TestLeadingZeros {
};
public static void main(String[] argv) throws Exception {
- KeyFactory factory = KeyFactory.getInstance("DSA", "SUN");
+ KeyFactory factory = KeyFactory.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
for (String encodings : PKCS8_ENCODINGS) {
byte[] encodingBytes = hexToBytes(encodings);
diff --git a/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java b/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java
index 8757c0bab7a..7e1f0561f6c 100644
--- a/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java
+++ b/test/jdk/sun/security/pkcs11/Cipher/EncryptionPadding.java
@@ -93,9 +93,10 @@ private static void testWithInputSize(Provider p, int inputSize,
sunPKCS11cipher.doFinal(ByteBuffer.allocate(0), cipherText);
}
- Cipher sunJCECipher = Cipher.getInstance(transformation, "SunJCE");
- sunJCECipher.init(Cipher.DECRYPT_MODE, key);
- byte[] sunJCEPlain = sunJCECipher.doFinal(cipherText.array());
+ Cipher providerCipher = Cipher.getInstance(transformation,
+ System.getProperty("test.provider.name", "SunJCE"));
+ providerCipher.init(Cipher.DECRYPT_MODE, key);
+ byte[] sunJCEPlain = providerCipher.doFinal(cipherText.array());
if (!Arrays.equals(plainText, sunJCEPlain)) {
throw new Exception("Cross-provider cipher test failed.");
diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java b/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java
index d192526bf4b..cf8e000fce7 100644
--- a/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2024, 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
@@ -78,7 +78,7 @@ public void main(Provider p) throws Exception {
KeyGenerator.getInstance(currTest.keyAlgo, p);
SecretKey key = kg.generateKey();
Cipher c1 = Cipher.getInstance(currTest.transformation,
- "SunJCE");
+ System.getProperty("test.provider.name", "SunJCE"));
c1.init(Cipher.ENCRYPT_MODE, key);
byte[] cipherText = c1.doFinal(plainText);
AlgorithmParameters params = c1.getParameters();
diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java b/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java
index 233cb4e623e..6799b19d3e7 100644
--- a/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -44,6 +44,7 @@
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
+import jdk.test.lib.security.SecurityUtils;
public class TestRSACipher extends PKCS11Test {
@@ -58,8 +59,10 @@ public void main(Provider p) throws Exception {
System.out.println("Not supported by provider, skipping");
return;
}
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
- kpg.initialize(1024);
+ String kpgAlgorithm = "RSA";
+ int keySize = SecurityUtils.getTestKeySize(kpgAlgorithm);
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, p);
+ kpg.initialize(keySize);
KeyPair kp = kpg.generateKeyPair();
PublicKey publicKey = kp.getPublic();
PrivateKey privateKey = kp.getPrivate();
@@ -70,7 +73,8 @@ public void main(Provider p) throws Exception {
for (String rsaAlgo: RSA_ALGOS) {
Cipher c1 = Cipher.getInstance(rsaAlgo, p);
- Cipher c2 = Cipher.getInstance(rsaAlgo, "SunJCE");
+ Cipher c2 = Cipher.getInstance(rsaAlgo,
+ System.getProperty("test.provider.name", "SunJCE"));
c1.init(Cipher.ENCRYPT_MODE, publicKey);
e = c1.doFinal(b);
@@ -112,7 +116,8 @@ public void main(Provider p) throws Exception {
c1.update(b);
e = c1.doFinal();
- c1.update(new byte[256]);
+ // Longer buffer size to verify IllegalBlockSizeException is thrown
+ c1.update(new byte[keySize / 4]);
try {
e = c1.doFinal();
throw new Exception("completed call");
diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java b/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java
index 7191d5baac5..0be916ebf9e 100644
--- a/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2024, 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
@@ -43,6 +43,7 @@
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
+import jdk.test.lib.security.SecurityUtils;
public class TestRSACipherWrap extends PKCS11Test {
@@ -57,13 +58,15 @@ public void main(Provider p) throws Exception {
System.out.println(RSA_ALGOS[0] + " unsupported, skipping");
return;
}
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
- kpg.initialize(1024);
+ String kpgAlgorithm = "RSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, p);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpg.generateKeyPair();
for (String rsaAlgo: RSA_ALGOS) {
Cipher cipherPKCS11 = Cipher.getInstance(rsaAlgo, p);
- Cipher cipherJce = Cipher.getInstance(rsaAlgo, "SunJCE");
+ Cipher cipherJce = Cipher.getInstance(rsaAlgo,
+ System.getProperty("test.provider.name", "SunJCE"));
String algos[] = {"AES", "RC2", "Blowfish"};
int keySizes[] = {128, 256};
diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java b/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java
index 9eceea3a394..fe6433d096e 100644
--- a/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2024, 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
@@ -41,6 +41,7 @@
import java.util.HexFormat;
import java.util.Random;
import javax.crypto.Cipher;
+import jdk.test.lib.security.SecurityUtils;
public class TestRawRSACipher extends PKCS11Test {
@@ -53,8 +54,9 @@ public void main(Provider p) throws Exception {
return;
}
- final int KEY_LEN = 1024;
- KeyPairGenerator kpGen = KeyPairGenerator.getInstance("RSA", p);
+ String kpgAlgorithm = "RSA";
+ final int KEY_LEN = SecurityUtils.getTestKeySize(kpgAlgorithm);
+ KeyPairGenerator kpGen = KeyPairGenerator.getInstance(kpgAlgorithm, p);
kpGen.initialize(KEY_LEN);
KeyPair kp = kpGen.generateKeyPair();
Random random = new Random();
@@ -64,7 +66,8 @@ public void main(Provider p) throws Exception {
plainText[0] = 0; // to ensure that it's less than modulus
Cipher c1 = Cipher.getInstance("RSA/ECB/NoPadding", p);
- Cipher c2 = Cipher.getInstance("RSA/ECB/NoPadding", "SunJCE");
+ Cipher c2 = Cipher.getInstance("RSA/ECB/NoPadding",
+ System.getProperty("test.provider.name", "SunJCE"));
c1.init(Cipher.ENCRYPT_MODE, kp.getPublic());
c2.init(Cipher.DECRYPT_MODE, kp.getPrivate());
diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java b/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java
index 2127256b5ec..5082336d36b 100644
--- a/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java
@@ -102,7 +102,7 @@ public void main(Provider p) throws Exception {
SecretKey key = kg.generateKey();
Cipher c1 = Cipher.getInstance(currTest.transformation, p);
Cipher c2 = Cipher.getInstance(currTest.transformation,
- "SunJCE");
+ System.getProperty("test.provider.name", "SunJCE"));
byte[] plainTxt = new byte[currTest.dataSize];
random.nextBytes(plainTxt);
diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java b/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java
index 8f53cda2f6b..ea5181e98dc 100644
--- a/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java
+++ b/test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java
@@ -87,7 +87,7 @@ public void main(Provider p) throws Exception {
SecretKey key = kg.generateKey();
Cipher c1 = Cipher.getInstance(currTest.transformation, p);
Cipher c2 = Cipher.getInstance(currTest.transformation,
- "SunJCE");
+ System.getProperty("test.provider.name", "SunJCE"));
byte[] plainTxt = new byte[currTest.dataSize];
random.nextBytes(plainTxt);
diff --git a/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java b/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java
index d5569f0f3cd..13b09d16dcf 100644
--- a/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java
+++ b/test/jdk/sun/security/pkcs11/KeyAgreement/TestDH.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -38,6 +38,7 @@
import java.util.Arrays;
import javax.crypto.KeyAgreement;
import javax.crypto.SecretKey;
+import jdk.test.lib.security.SecurityUtils;
public class TestDH extends PKCS11Test {
@@ -47,8 +48,9 @@ public void main(Provider p) throws Exception {
System.out.println("DH not supported, skipping");
return;
}
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", p);
- kpg.initialize(512);
+ String kpgAlgorithm = "DH";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, p);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp1 = kpg.generateKeyPair();
KeyPair kp2 = kpg.generateKeyPair();
@@ -68,7 +70,8 @@ public void main(Provider p) throws Exception {
throw new Exception("Secrets (1,2) do not match");
}
- ka2 = KeyAgreement.getInstance("DH", "SunJCE");
+ ka2 = KeyAgreement.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
ka2.init(kp1.getPrivate());
ka2.doPhase(kp2.getPublic(), true);
System.out.println("Derive 3...");
@@ -101,7 +104,8 @@ private static void testAlgorithm(KeyAgreement ka1, KeyPair kp1,
ka1.init(kp1.getPrivate());
ka1.doPhase(kp2.getPublic(), true);
- System.out.println("Derive " + algorithm + " using SunJCE...");
+ System.out.println("Derive " + algorithm + " using " +
+ System.getProperty("test.provider.name", "SunJCE") + "...");
key1 = ka1.generateSecret(algorithm);
ka2.init(kp1.getPrivate());
diff --git a/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java b/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java
index 146a6505423..7f6f79e767b 100644
--- a/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java
+++ b/test/jdk/sun/security/pkcs11/KeyAgreement/TestInterop.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -39,43 +39,40 @@
import javax.crypto.KeyAgreement;
import javax.crypto.spec.DHPrivateKeySpec;
import javax.crypto.spec.DHPublicKeySpec;
+import jdk.test.lib.security.DiffieHellmanGroup;
+import jdk.test.lib.security.SecurityUtils;
public class TestInterop extends PKCS11Test {
- private final static BigInteger p = new BigInteger
- ("171718397966129586011229151993178480901904202533705695869569760169920539"
- + "80807543778874708672297590042574075430109846864794139516459381007417046"
- + "27996080624930219892858374168155487210358743785481212360509485282294161"
- + "39585571568998066586304075565145536350296006867635076744949977849997684"
- + "222020336013226588207303");
-
- private final static BigInteger g = new BigInteger("2");
-
private final static BigInteger ya = new BigInteger
- ("687709211571508809414670982463565909269384277848448625781941269577397703"
- + "73675199968849153119146758339814638228795348558483510369322822476757204"
- + "22158455966026517829008713407587339322132253724742557954802911059639161"
- + "24827916158465757962384625410294483756242900146397201260757102085985457"
- + "09397033481077351036224");
+ ("22272412859242949963897309866268099957623364986192222381531147912319" +
+ "23153170556019072276127184001075566033823724518300406542189341984" +
+ "14728033901164887842157675409022004721268960808255834930605035809" +
+ "96449867261598768663006346373969582073599358922631400907241847771" +
+ "58539394502794451638884093173505103869438428833148912071609829581" +
+ "89477284513896649100113024962862016311693389603523142235630316916" +
+ "51727812401021776761600004971782662420311224757086651213529674905" +
+ "34921437167341469749945865459714558842881915928697452568830704027" +
+ "08840053484115995358953663434943150292283157101600109003253293611" +
+ "67575903571371898272633920086");
private final static BigInteger xa = new BigInteger
- ("104917367119952955556289227181599819745346393858545449202252025137706135"
- + "98100778613457655440586438263591136003106529323555991109623536177695714"
- + "66884181531401472902830508361532232717792847436112280721439936797741371"
- + "245140912614191507");
+ ("20959988947516815975588968321965141642005944293655257916834342975849");
private final static BigInteger yb = new BigInteger
- ("163887874871842952463100699681506173424091615364591742415764095471629919"
- + "08421025296419917755446931473037086355546823601999684501737493240373415"
- + "65608293667837249198973539289354492348897732633852665609611113031379864"
- + "58514616034107537409230452318065341748503347627733368519091332060477528"
- + "173423377887175351037810");
+ ("1788841814501653834923092375117807364896992833810838802030127811094" +
+ "8450381275318704655838368105000403140578033341448162321874634765" +
+ "6870663019881556386613144025875613921737258766185138415793010195" +
+ "3802511267742963370821568963965936108932734114202964873644126233" +
+ "6937947954023458790417933403303562491144788202839815534782475160" +
+ "7813094179390506418017926774832227342290968359943612529948409558" +
+ "4647213355501260440663649115694263879691520265343063263385211121" +
+ "3396751542827391711077192604441343359832896902306354119121777576" +
+ "6479255602858536672821464920683781338851326155035757018336622673" +
+ "39973666608754923308482789421630138499");
private final static BigInteger xb = new BigInteger
- ("127757517533485947079959908591028646859165238853082197617179368337276371"
- + "51601819447716934542027725311863797141734616730248519214531856941516613"
- + "30313414180008978013330410484011186019824874948204261839391153650949864"
- + "429505597086564709");
+ ("37339373137107550077381337769340105015086522284791968753218309293526");
@Override
public void main(Provider prov) throws Exception {
@@ -90,14 +87,20 @@ public void main(Provider prov) throws Exception {
DHPrivateKeySpec privateSpec;
KeyFactory kf = KeyFactory.getInstance("DH");
KeyAgreement ka = KeyAgreement.getInstance("DH", prov);
- KeyAgreement kbSunJCE = KeyAgreement.getInstance("DH", "SunJCE");
- DHPrivateKeySpec privSpecA = new DHPrivateKeySpec(xa, p, g);
- DHPublicKeySpec pubSpecA = new DHPublicKeySpec(ya, p, g);
+ KeyAgreement kbSunJCE = KeyAgreement.getInstance("DH",
+ System.getProperty("test.provider.name", "SunJCE"));
+ DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup();
+ DHPrivateKeySpec privSpecA = new DHPrivateKeySpec(xa, dhGroup.getPrime(),
+ dhGroup.getBase());
+ DHPublicKeySpec pubSpecA = new DHPublicKeySpec(ya, dhGroup.getPrime(),
+ dhGroup.getBase());
PrivateKey privA = kf.generatePrivate(privSpecA);
PublicKey pubA = kf.generatePublic(pubSpecA);
- DHPrivateKeySpec privSpecB = new DHPrivateKeySpec(xb, p, g);
- DHPublicKeySpec pubSpecB = new DHPublicKeySpec(yb, p, g);
+ DHPrivateKeySpec privSpecB = new DHPrivateKeySpec(xb, dhGroup.getPrime(),
+ dhGroup.getBase());
+ DHPublicKeySpec pubSpecB = new DHPublicKeySpec(yb, dhGroup.getPrime(),
+ dhGroup.getBase());
PrivateKey privB = kf.generatePrivate(privSpecB);
PublicKey pubB = kf.generatePublic(pubSpecB);
@@ -109,6 +112,10 @@ public void main(Provider prov) throws Exception {
kbSunJCE.doPhase(pubA, true);
byte[] n2 = kbSunJCE.generateSecret();
+ // verify that a leading zero is present in secrets
+ if (n1[0] != 0 || n2[0] != 0) {
+ throw new Exception("First byte is not zero as expected");
+ }
if (Arrays.equals(n1, n2) == false) {
throw new Exception("values mismatch!");
} else {
diff --git a/test/jdk/sun/security/pkcs11/KeyStore/Basic.java b/test/jdk/sun/security/pkcs11/KeyStore/Basic.java
index b7ae84ba363..1d2e226e364 100644
--- a/test/jdk/sun/security/pkcs11/KeyStore/Basic.java
+++ b/test/jdk/sun/security/pkcs11/KeyStore/Basic.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -142,7 +142,8 @@ public void main(Provider p) throws Exception {
// get private keys
KeyFactory kf = KeyFactory.getInstance("RSA");
- KeyFactory dsaKf = KeyFactory.getInstance("DSA", "SUN");
+ KeyFactory dsaKf = KeyFactory.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
ObjectInputStream ois1 = new ObjectInputStream
(new FileInputStream(new File(DIR, "pk1.key")));
diff --git a/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java b/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java
index 132ba84f679..90ed49b42f5 100644
--- a/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java
+++ b/test/jdk/sun/security/pkcs11/MessageDigest/ReinitDigest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -73,7 +73,8 @@ public void main(Provider p) throws Exception {
private void doTest(String alg, Provider p, byte[] data1, byte[] data2)
throws Exception {
System.out.println("Testing " + alg);
- MessageDigest md1 = MessageDigest.getInstance(alg, "SUN");
+ MessageDigest md1 = MessageDigest.getInstance(alg,
+ System.getProperty("test.provider.name", "SUN"));
byte[] d1 = md1.digest(data1);
MessageDigest md2 = MessageDigest.getInstance(alg, p);
checkInstances(md1, md2);
diff --git a/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java b/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java
index 11147022771..d5b22400bff 100644
--- a/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java
+++ b/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, 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
@@ -59,7 +59,8 @@ public void main(Provider p) throws Exception {
}
Signature sigSunRsaSign =
- Signature.getInstance("RSASSA-PSS", "SunRsaSign");
+ Signature.getInstance("RSASSA-PSS",
+ System.getProperty("test.provider.name", "SunRsaSign"));
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
kpg.initialize(3072);
diff --git a/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java b/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java
index b8ea9863327..0325b272f29 100644
--- a/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java
+++ b/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS2.java
@@ -51,9 +51,10 @@ public static void main(String[] args) throws Exception {
@Override
public void main(Provider p) throws Exception {
+ String providerName = System.getProperty("test.provider.name", "SunRsaSign");
Signature sigPkcs11;
Signature sigSunRsaSign =
- Signature.getInstance("RSASSA-PSS", "SunRsaSign");
+ Signature.getInstance("RSASSA-PSS", providerName);
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
kpg.initialize(3072);
diff --git a/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java b/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java
index b2ab96c90c6..d2515fa0f5a 100644
--- a/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java
+++ b/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java
@@ -62,7 +62,8 @@ protected boolean skipTest(Provider provider) {
@Override
public void main(Provider provider) throws Exception {
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", "SUN");
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
kpg.initialize(2048, new SecureRandom());
KeyPair pair = kpg.generateKeyPair();
diff --git a/test/jdk/sun/security/pkcs11/policy b/test/jdk/sun/security/pkcs11/policy
index 54281a78179..d5a78b6ba82 100644
--- a/test/jdk/sun/security/pkcs11/policy
+++ b/test/jdk/sun/security/pkcs11/policy
@@ -1,3 +1,4 @@
grant {
permission java.lang.RuntimePermission "setSecurityManager";
-};
\ No newline at end of file
+ permission java.util.PropertyPermission "test.provider.name", "read";
+};
diff --git a/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java b/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java
index 629a504a040..26178e9a576 100644
--- a/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java
+++ b/test/jdk/sun/security/pkcs11/rsa/GenKeyStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -74,7 +74,8 @@ private static void addToKeyStore(KeyStore ks, KeyPair kp, String name) throws E
private static void generateKeyPair(KeyStore ks, int keyLength, String alias) throws Exception {
System.out.println("Generating " + keyLength + " keypair " + alias + "...");
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "SunRsaSign");
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA",
+ System.getProperty("test.provider.name", "SunRsaSign"));
kpg.initialize(keyLength);
KeyPair kp = kpg.generateKeyPair();
addToKeyStore(ks, kp, alias);
diff --git a/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy b/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy
index 4a0b0d2c46d..6cc9a8f0248 100644
--- a/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy
+++ b/test/jdk/sun/security/pkcs11/rsa/rsakeys.ks.policy
@@ -1,4 +1,5 @@
grant {
permission java.lang.RuntimePermission "setSecurityManager";
permission java.io.FilePermission "${test.src}/rsakeys.ks", "read";
-};
\ No newline at end of file
+ permission java.util.PropertyPermission "test.provider.name", "read";
+};
diff --git a/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java b/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java
index 52a97b34a3e..5dcd86e2474 100644
--- a/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java
+++ b/test/jdk/sun/security/provider/DSA/SupportedDSAParamGen.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, 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
@@ -40,7 +40,8 @@ public class SupportedDSAParamGen {
public static void main(String[] args) throws Exception {
AlgorithmParameterGenerator apg =
- AlgorithmParameterGenerator.getInstance("DSA", "SUN");
+ AlgorithmParameterGenerator.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
DSAGenParameterSpec spec = new DSAGenParameterSpec(
Integer.valueOf(args[0]).intValue(),
diff --git a/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java b/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java
index cf39a5bab5e..2eac80d91bb 100644
--- a/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java
+++ b/test/jdk/sun/security/provider/DSA/TestAlgParameterGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -73,7 +73,8 @@ private static void checkParamStrength(AlgorithmParameters param,
public static void main(String[] args) throws Exception {
AlgorithmParameterGenerator apg
- = AlgorithmParameterGenerator.getInstance("DSA", "SUN");
+ = AlgorithmParameterGenerator.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
long start, stop;
// make sure no-init still works
diff --git a/test/jdk/sun/security/provider/DSA/TestDSA.java b/test/jdk/sun/security/provider/DSA/TestDSA.java
index 5d3228949f5..918f18ed081 100644
--- a/test/jdk/sun/security/provider/DSA/TestDSA.java
+++ b/test/jdk/sun/security/provider/DSA/TestDSA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -108,7 +108,7 @@ private static void verify(Provider provider, String alg, PublicKey key, byte[]
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- Provider provider = Security.getProvider("SUN");
+ Provider provider = Security.getProvider(System.getProperty("test.provider.name", "SUN"));
System.out.println("Testing provider " + provider + "...");
KeyFactory kf = KeyFactory.getInstance("DSA", provider);
diff --git a/test/jdk/sun/security/provider/DSA/TestDSA2.java b/test/jdk/sun/security/provider/DSA/TestDSA2.java
index 320acce4880..ed3111695f1 100644
--- a/test/jdk/sun/security/provider/DSA/TestDSA2.java
+++ b/test/jdk/sun/security/provider/DSA/TestDSA2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -39,7 +39,8 @@ public class TestDSA2 {
// NOTE: need to explictly specify provider since the more
// preferred provider SunPKCS11 provider only supports up
// 1024 bits.
- private static final String PROV = "SUN";
+ private static final String PROV =
+ System.getProperty("test.provider.name", "SUN");
private static final String[] SIG_ALGOS = {
"NONEwithDSA",
diff --git a/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java b/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java
index 105c50015da..f2ddcec9d8d 100644
--- a/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java
+++ b/test/jdk/sun/security/provider/DSA/TestKeyPairGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -57,10 +57,12 @@ public static void main(String[] args) throws Exception {
// problem was when not calling initialize()
// do that twice to artifically inflate the time
// on JDKs that do not have the fix
- kpg = KeyPairGenerator.getInstance("DSA", "SUN");
+ kpg = KeyPairGenerator.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
kp = kpg.generateKeyPair();
- kpg = KeyPairGenerator.getInstance("DSA", "SUN");
+ kpg = KeyPairGenerator.getInstance("DSA",
+ System.getProperty("test.provider.name", "SUN"));
kp = kpg.generateKeyPair();
// some other basic tests
diff --git a/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java b/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java
index e11a8ac87dc..fd47d0ac60f 100644
--- a/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java
+++ b/test/jdk/sun/security/provider/KeyStore/CaseSensitiveAliases.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 5091374 5100603
+ * @library /test/lib
* @summary make sure the JKS case sensitivity works correctly
* @author Andreas Sterbenz
*/
@@ -34,6 +35,7 @@
import java.security.*;
import java.security.cert.*;
import java.security.cert.Certificate;
+import jdk.test.lib.security.SecurityUtils;
public class CaseSensitiveAliases {
@@ -90,8 +92,9 @@ private static void main(String jks, boolean caseInsensitive) throws Exception {
X509Certificate[] a1 = {c1};
X509Certificate[] a2 = {c2};
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
- kpg.initialize(512);
+ String kpgAlgorithm = "RSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
PrivateKey p1 = kpg.generateKeyPair().getPrivate();
PrivateKey p2 = kpg.generateKeyPair().getPrivate();
diff --git a/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java b/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java
index 1f797330c48..ce3c9b3c7a9 100644
--- a/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java
+++ b/test/jdk/sun/security/provider/MessageDigest/DigestKAT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -177,7 +177,7 @@ private static Test t(String alg, byte[] data, String digest) {
static void runTests(Test[] tests) throws Exception {
long start = System.currentTimeMillis();
- Provider p = Security.getProvider("SUN");
+ Provider p = Security.getProvider(System.getProperty("test.provider.name","SUN"));
System.out.println("Testing provider " + p.getName() + "...");
for (int i = 0; i < tests.length; i++) {
Test test = tests[i];
diff --git a/test/jdk/sun/security/provider/MessageDigest/Offsets.java b/test/jdk/sun/security/provider/MessageDigest/Offsets.java
index 44850c2970d..2c800fcb854 100644
--- a/test/jdk/sun/security/provider/MessageDigest/Offsets.java
+++ b/test/jdk/sun/security/provider/MessageDigest/Offsets.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2024, 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
@@ -47,7 +47,8 @@ private static void outOfBounds(MessageDigest md, int arrayLen, int ofs, int len
private static void test(String algorithm, int minOfs, int maxOfs, int minLen, int maxLen) throws Exception {
Random random = new Random();
- MessageDigest md = MessageDigest.getInstance(algorithm, "SUN");
+ MessageDigest md = MessageDigest.getInstance(algorithm,
+ System.getProperty("test.provider.name", "SUN"));
System.out.println("Testing " + algorithm + "...");
outOfBounds(md, 16, 0, 32);
outOfBounds(md, 16, -8, 16);
diff --git a/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java b/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java
index ac809153b39..28c2dd6fb77 100644
--- a/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java
+++ b/test/jdk/sun/security/provider/MessageDigest/TestSHAClone.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, 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
@@ -75,7 +75,8 @@ private void run() throws Exception {
public static void main(String[] argv) throws Exception {
- Provider p = Security.getProvider("SUN");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SUN"));
for (int i=0; i DATA = Arrays.asList(
diff --git a/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java b/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java
index dad84ccfd7e..c7f1ce75ca4 100644
--- a/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java
+++ b/test/jdk/sun/security/provider/NSASuiteB/TestSHAwithDSASignatureOids.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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,10 +23,12 @@
import java.util.Arrays;
import java.util.List;
+import jdk.test.lib.security.SecurityUtils;
/*
* @test
* @bug 8075286
+ * @library /test/lib
* @summary Test the SHAwithDSA signature algorithm OIDs in JDK.
* OID and algorithm transformation string should match.
* Both could be able to be used to generate the algorithm instance.
@@ -40,8 +42,10 @@ public class TestSHAwithDSASignatureOids {
new OidAlgorithmPair("2.16.840.1.101.3.4.3.2", "SHA256withDSA"));
public static void main(String[] args) throws Exception {
- TestSignatureOidHelper helper = new TestSignatureOidHelper("DSA",
- "SUN", 1024, DATA);
+ String kpgAlgorithm = "DSA";
+ TestSignatureOidHelper helper = new TestSignatureOidHelper(kpgAlgorithm,
+ System.getProperty("test.provider.name", "SUN"),
+ SecurityUtils.getTestKeySize(kpgAlgorithm), DATA);
helper.execute();
}
}
diff --git a/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java b/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java
index 0f03cdde6fc..aef92647396 100644
--- a/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java
+++ b/test/jdk/sun/security/rsa/BrokenRSAPrivateCrtKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 4503229 8220016
+ * @library /test/lib
* @summary default RSA KeyFactory can return broken RSAPrivateCrtKey objects
* This test was taken directly from the bug report, which
* was fixed in the crippled JSAFE provider, and needed
@@ -35,12 +36,15 @@
import java.security.interfaces.*;
import java.security.spec.*;
import java.math.BigInteger;
+import jdk.test.lib.security.SecurityUtils;
public class BrokenRSAPrivateCrtKey {
public static void main(String[] args) throws Exception {
+ String kpgAlgorithm = "RSA";
KeyPairGenerator generator =
- KeyPairGenerator.getInstance("RSA", "SunRsaSign");
- generator.initialize(512);
+ KeyPairGenerator.getInstance(kpgAlgorithm,
+ System.getProperty("test.provider.name", "SunRsaSign"));
+ generator.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair pair = generator.generateKeyPair();
@@ -55,7 +59,8 @@ public static void main(String[] args) throws Exception {
privatekey.getPrimeExponentQ(),
privatekey.getCrtCoefficient());
- KeyFactory factory = KeyFactory.getInstance("RSA", "SunRsaSign");
+ KeyFactory factory = KeyFactory.getInstance("RSA",
+ System.getProperty("test.provider.name", "SunRsaSign"));
PrivateKey privatekey2 = factory.generatePrivate(spec);
diff --git a/test/jdk/sun/security/rsa/GenKeyStore.java b/test/jdk/sun/security/rsa/GenKeyStore.java
index 629a504a040..26178e9a576 100644
--- a/test/jdk/sun/security/rsa/GenKeyStore.java
+++ b/test/jdk/sun/security/rsa/GenKeyStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -74,7 +74,8 @@ private static void addToKeyStore(KeyStore ks, KeyPair kp, String name) throws E
private static void generateKeyPair(KeyStore ks, int keyLength, String alias) throws Exception {
System.out.println("Generating " + keyLength + " keypair " + alias + "...");
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "SunRsaSign");
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA",
+ System.getProperty("test.provider.name", "SunRsaSign"));
kpg.initialize(keyLength);
KeyPair kp = kpg.generateKeyPair();
addToKeyStore(ks, kp, alias);
diff --git a/test/jdk/sun/security/rsa/KeySizeTest.java b/test/jdk/sun/security/rsa/KeySizeTest.java
index 35f9902b8c3..129a3539b51 100644
--- a/test/jdk/sun/security/rsa/KeySizeTest.java
+++ b/test/jdk/sun/security/rsa/KeySizeTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -53,7 +53,8 @@ public class KeySizeTest {
/**
* JDK default RSA Provider.
*/
- private static final String PROVIDER_NAME = "SunRsaSign";
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunRsaSign");
public static void main(String[] args) throws Exception {
int iKeyPairSize = Integer.parseInt(args[0]);
diff --git a/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java b/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java
index 1a3a6df756a..3ed4aae37b0 100644
--- a/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java
+++ b/test/jdk/sun/security/rsa/PrivateKeyEqualityTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -46,7 +46,8 @@ public class PrivateKeyEqualityTest {
/**
* JDK default RSA Provider.
*/
- private static final String PROVIDER_NAME = "SunRsaSign";
+ private static final String PROVIDER_NAME =
+ System.getProperty("test.provider.name", "SunRsaSign");
public static void main(String[] args) throws NoSuchAlgorithmException,
NoSuchProviderException, InvalidKeySpecException {
diff --git a/test/jdk/sun/security/rsa/SignatureTest.java b/test/jdk/sun/security/rsa/SignatureTest.java
index 15df96354b3..d48d7ca481b 100644
--- a/test/jdk/sun/security/rsa/SignatureTest.java
+++ b/test/jdk/sun/security/rsa/SignatureTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -61,7 +61,8 @@ public class SignatureTest {
/**
* JDK default RSA Provider.
*/
- private static final String PROVIDER = "SunRsaSign";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunRsaSign");
/**
* How much times signature updated.
diff --git a/test/jdk/sun/security/rsa/SpecTest.java b/test/jdk/sun/security/rsa/SpecTest.java
index 43ccf3ca718..8cc0bca9898 100644
--- a/test/jdk/sun/security/rsa/SpecTest.java
+++ b/test/jdk/sun/security/rsa/SpecTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -53,7 +53,8 @@ public class SpecTest {
/**
* JDK default RSA Provider.
*/
- private static final String PROVIDER = "SunRsaSign";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunRsaSign");
/**
*
diff --git a/test/jdk/sun/security/rsa/TestCACerts.java b/test/jdk/sun/security/rsa/TestCACerts.java
index 14ed4229472..2d8a1246e5e 100644
--- a/test/jdk/sun/security/rsa/TestCACerts.java
+++ b/test/jdk/sun/security/rsa/TestCACerts.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -38,7 +38,8 @@
public class TestCACerts {
- private final static String PROVIDER = "SunRsaSign";
+ private final static String PROVIDER =
+ System.getProperty("test.provider.name", "SunRsaSign");
private final static char SEP = File.separatorChar;
diff --git a/test/jdk/sun/security/rsa/TestKeyFactory.java b/test/jdk/sun/security/rsa/TestKeyFactory.java
index 8a4f4b7f47f..8be2037a833 100644
--- a/test/jdk/sun/security/rsa/TestKeyFactory.java
+++ b/test/jdk/sun/security/rsa/TestKeyFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -228,7 +228,8 @@ private static void test(KeyFactory kf, Key key) throws Exception {
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
KeyStore ks = getKeyStore();
- KeyFactory kf = KeyFactory.getInstance("RSA", "SunRsaSign");
+ KeyFactory kf = KeyFactory.getInstance("RSA",
+ System.getProperty("test.provider.name", "SunRsaSign"));
for (Enumeration e = ks.aliases(); e.hasMoreElements(); ) {
String alias = (String)e.nextElement();
Key key = null;
diff --git a/test/jdk/sun/security/rsa/TestKeyPairGenerator.java b/test/jdk/sun/security/rsa/TestKeyPairGenerator.java
index 72ab7e73acf..f5bd6c47f3b 100644
--- a/test/jdk/sun/security/rsa/TestKeyPairGenerator.java
+++ b/test/jdk/sun/security/rsa/TestKeyPairGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -40,6 +40,7 @@
import java.security.interfaces.*;
import java.security.spec.*;
+import jdk.test.lib.security.SecurityUtils;
import jdk.test.lib.SigTestUtil;
import static jdk.test.lib.SigTestUtil.SignatureType;
@@ -85,9 +86,10 @@ private static void test(PrivateKey privateKey, PublicKey publicKey) throws Exce
}
// regression test for 4865198
- private static void testInvalidSignature(KeyPair kp1, KeyPair kp2) throws Exception {
+ private static void testInvalidSignature(KeyPair kp1, KeyPair kp2, String signAlgo)
+ throws Exception {
System.out.println("Testing signature with incorrect key...");
- Signature sig = Signature.getInstance("MD5withRSA", provider);
+ Signature sig = Signature.getInstance(signAlgo, provider);
sig.initSign(kp1.getPrivate());
byte[] data = new byte[100];
sig.update(data);
@@ -111,14 +113,16 @@ private static void testInvalidSignature(KeyPair kp1, KeyPair kp2) throws Except
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- provider = Security.getProvider("SunRsaSign");
+ provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunRsaSign"));
data = new byte[2048];
- // keypair generation is very slow, test only a few short keys
- int[] keyLengths = {512, 512, 1024};
+ String kpgAlgorithm = "RSA";
+ int keySize = SecurityUtils.getTestKeySize(kpgAlgorithm);
+ int[] keyLengths = {keySize, keySize, keySize + 1024};
BigInteger[] pubExps = {null, BigInteger.valueOf(3), null};
KeyPair[] keyPairs = new KeyPair[3];
new Random().nextBytes(data);
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", provider);
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm, provider);
for (int i = 0; i < keyLengths.length; i++) {
int len = keyLengths[i];
BigInteger exp = pubExps[i];
@@ -150,9 +154,14 @@ public static void main(String[] args) throws Exception {
}
test(privateKey, publicKey);
}
- testInvalidSignature(keyPairs[0], keyPairs[1]);
- testInvalidSignature(keyPairs[0], keyPairs[2]);
- testInvalidSignature(keyPairs[2], keyPairs[0]);
+ String md5Algo = "MD5withRSA";
+ String sha256Algo = "Sha256withRSA";
+ testInvalidSignature(keyPairs[0], keyPairs[1], md5Algo);
+ testInvalidSignature(keyPairs[0], keyPairs[2], md5Algo);
+ testInvalidSignature(keyPairs[2], keyPairs[0], md5Algo);
+ testInvalidSignature(keyPairs[0], keyPairs[1], sha256Algo);
+ testInvalidSignature(keyPairs[0], keyPairs[2], sha256Algo);
+ testInvalidSignature(keyPairs[2], keyPairs[0], sha256Algo);
long stop = System.currentTimeMillis();
System.out.println("All tests passed (" + (stop - start) + " ms).");
}
diff --git a/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java b/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java
index 7f17ed7bc48..2c60d66664e 100644
--- a/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java
+++ b/test/jdk/sun/security/rsa/TestKeyPairGeneratorExponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -24,6 +24,7 @@
/**
* @test
* @bug 8216012
+ * @library /test/lib
* @summary Tests the RSA public key exponent for KeyPairGenerator
* @run main/timeout=60 TestKeyPairGeneratorExponent
*/
@@ -33,14 +34,16 @@
import java.security.*;
import java.security.interfaces.*;
import java.security.spec.*;
+import jdk.test.lib.security.SecurityUtils;
public class TestKeyPairGeneratorExponent {
- private static int keyLen = 512;
+ private static final String KPG_ALGORITHM = "RSA";
+ private static final int KEY_LENGTH = SecurityUtils.getTestKeySize(KPG_ALGORITHM);
private static BigInteger[] validExponents = new BigInteger[] {
RSAKeyGenParameterSpec.F0,
RSAKeyGenParameterSpec.F4,
- BigInteger.ONE.shiftLeft(keyLen - 1).subtract(BigInteger.ONE)
+ BigInteger.ONE.shiftLeft(KEY_LENGTH - 1).subtract(BigInteger.ONE)
};
private static BigInteger[] invalidExponents = new BigInteger[] {
@@ -55,7 +58,7 @@ public static void testValidExponents(KeyPairGenerator kpg,
BigInteger exponent) {
System.out.println("Testing exponent = " + exponent.toString(16));
try {
- kpg.initialize(new RSAKeyGenParameterSpec(keyLen, exponent));
+ kpg.initialize(new RSAKeyGenParameterSpec(KEY_LENGTH, exponent));
kpg.generateKeyPair();
System.out.println("OK, key pair generated");
} catch(InvalidAlgorithmParameterException iape){
@@ -67,7 +70,7 @@ public static void testInvalidExponents(KeyPairGenerator kpg,
BigInteger exponent) {
System.out.println("Testing exponent = " + exponent.toString(16));
try {
- kpg.initialize(new RSAKeyGenParameterSpec(keyLen, exponent));
+ kpg.initialize(new RSAKeyGenParameterSpec(KEY_LENGTH, exponent));
kpg.generateKeyPair();
throw new RuntimeException("Error: Expected IAPE not thrown.");
} catch(InvalidAlgorithmParameterException iape){
@@ -81,7 +84,8 @@ public static void testInvalidExponents(KeyPairGenerator kpg,
public static void main(String[] args) throws Exception {
KeyPairGenerator kpg =
- KeyPairGenerator.getInstance("RSA", "SunRsaSign");
+ KeyPairGenerator.getInstance(KPG_ALGORITHM,
+ System.getProperty("test.provider.name", "SunRsaSign"));
for(BigInteger validExponent : validExponents) {
testValidExponents(kpg, validExponent);
diff --git a/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java b/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java
index e87d5a5b6a4..7d85c56e684 100644
--- a/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java
+++ b/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -24,11 +24,13 @@
/**
* @test
* @bug 8211049
+ * @library /test/lib
* @summary make sure the supplied SecureRandom object is used
*/
import java.security.*;
import java.security.interfaces.*;
+import jdk.test.lib.security.SecurityUtils;
public class TestKeyPairGeneratorInit {
@@ -45,10 +47,12 @@ public void nextBytes(byte[] bytes) {
}
public static void main(String[] args) throws Exception {
+ String kpgAlgorithm = "RSA";
KeyPairGenerator kpg =
- KeyPairGenerator.getInstance("RSA", "SunRsaSign");
+ KeyPairGenerator.getInstance(kpgAlgorithm,
+ System.getProperty("test.provider.name", "SunRsaSign"));
MySecureRandom rnd = new MySecureRandom();
- kpg.initialize(2048, rnd);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm), rnd);
System.out.println("Generate keypair then check");
KeyPair kp = kpg.generateKeyPair();
if (!rnd.isUsed) {
diff --git a/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java b/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java
index 8959ede5f30..765ca485bbc 100644
--- a/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java
+++ b/test/jdk/sun/security/rsa/TestKeyPairGeneratorLength.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2024, 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
@@ -24,23 +24,28 @@
/**
* @test
* @bug 5078280
+ * @library /test/lib
* @summary make sure generated key pairs are exactly the requested length
* @author Andreas Sterbenz
*/
import java.security.*;
import java.security.interfaces.*;
+import jdk.test.lib.security.SecurityUtils;
public class TestKeyPairGeneratorLength {
+ private static final String KPG_ALGORITHM = "RSA";
+ private static final int KEY_LENGTH = SecurityUtils.getTestKeySize(KPG_ALGORITHM);
public static void main(String[] args) throws Exception {
- test(512);
- test(513);
+ test(KEY_LENGTH);
+ test(KEY_LENGTH + 1);
System.out.println("Done.");
}
private static void test(int len) throws Exception {
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "SunRsaSign");
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(KPG_ALGORITHM,
+ System.getProperty("test.provider.name", "SunRsaSign"));
kpg.initialize(len);
for (int i = 0; i < 6; i++) {
System.out.println("Generating keypair " + len + " bit keypair " + (i + 1) + "...");
diff --git a/test/jdk/sun/security/rsa/TestRSAOidSupport.java b/test/jdk/sun/security/rsa/TestRSAOidSupport.java
index 2cd06258609..551fa33cd8a 100644
--- a/test/jdk/sun/security/rsa/TestRSAOidSupport.java
+++ b/test/jdk/sun/security/rsa/TestRSAOidSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -59,14 +59,16 @@ public static void main(String[] args) throws Exception {
X509EncodedKeySpec x509Spec = new X509EncodedKeySpec
(toByteArray(DER_BYTES));
String keyAlgo = "RSA";
- KeyFactory kf = KeyFactory.getInstance(keyAlgo, "SunRsaSign");
+ KeyFactory kf = KeyFactory.getInstance(keyAlgo,
+ System.getProperty("test.provider.name", "SunRsaSign"));
RSAPublicKey rsaKey = (RSAPublicKey) kf.generatePublic(x509Spec);
if (rsaKey.getAlgorithm() != keyAlgo) {
throw new RuntimeException("Key algo should be " + keyAlgo +
", but got " + rsaKey.getAlgorithm());
}
- kf = KeyFactory.getInstance("RSASSA-PSS", "SunRsaSign");
+ kf = KeyFactory.getInstance("RSASSA-PSS",
+ System.getProperty("test.provider.name", "SunRsaSign"));
try {
kf.generatePublic(x509Spec);
throw new RuntimeException("Should throw IKSE");
diff --git a/test/jdk/sun/security/rsa/TestSigGen15.java b/test/jdk/sun/security/rsa/TestSigGen15.java
index 12cc028b072..480ed8d878c 100644
--- a/test/jdk/sun/security/rsa/TestSigGen15.java
+++ b/test/jdk/sun/security/rsa/TestSigGen15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -71,7 +71,8 @@ public static void main(String[] args) throws Exception {
static boolean runTest(List records) throws Exception {
boolean success = true;
//for (Provider provider : Security.getProviders()) {
- Provider p = Security.getProvider("SunRsaSign");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name","SunRsaSign"));
KeyFactory kf = KeyFactory.getInstance("RSA", p);
for (SigRecord sr : records) {
System.out.println("==Testing Record : " + sr + "==");
diff --git a/test/jdk/sun/security/rsa/TestSignatures.java b/test/jdk/sun/security/rsa/TestSignatures.java
index 3a6a086b7db..0296ac21d64 100644
--- a/test/jdk/sun/security/rsa/TestSignatures.java
+++ b/test/jdk/sun/security/rsa/TestSignatures.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, 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
@@ -111,7 +111,8 @@ private static void test(PrivateKey privateKey, PublicKey publicKey)
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
- provider = Security.getProvider("SunRsaSign");
+ provider = Security.getProvider(
+ System.getProperty("test.provider.name", "SunRsaSign"));
data = new byte[2048];
new Random().nextBytes(data);
KeyStore ks = getKeyStore();
diff --git a/test/jdk/sun/security/rsa/WithoutNULL.java b/test/jdk/sun/security/rsa/WithoutNULL.java
index 64cf831099d..39daca6d304 100644
--- a/test/jdk/sun/security/rsa/WithoutNULL.java
+++ b/test/jdk/sun/security/rsa/WithoutNULL.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2024, 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
@@ -48,7 +48,8 @@ public static void main(String[] args) throws Exception {
b8oaWkxk069jDTM1RhllPJZkAjeQRbw4gkg4N6wKZz9B/jdSRMNJg/b9QdRYZOHOBxsEHMbUREPV
DoCOLaxB8eIXX0EWkiE=""");
- Signature s = Signature.getInstance("SHA1withRSA", "SunRsaSign");
+ Signature s = Signature.getInstance("SHA1withRSA",
+ System.getProperty("test.provider.name", "SunRsaSign"));
s.initVerify(KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(key)));
if (!s.verify(sig)) {
throw new RuntimeException("Does not verify");
diff --git a/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java b/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java
index 05526a91480..c67472069f7 100644
--- a/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java
+++ b/test/jdk/sun/security/rsa/pss/DefaultParamSpec.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -30,10 +30,12 @@
import java.security.spec.PSSParameterSpec;
import java.security.spec.RSAKeyGenParameterSpec;
import java.util.Date;
+import jdk.test.lib.security.SecurityUtils;
/**
* @test
* @bug 8242811
+ * @library /test/lib
* @modules java.base/sun.security.x509
* @summary AlgorithmId::getDefaultAlgorithmParameterSpec returns incompatible
* PSSParameterSpec for an RSASSA-PSS key
@@ -42,7 +44,7 @@ public class DefaultParamSpec {
public static void main(String[] args) throws Exception {
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSASSA-PSS");
KeyFactory kf = KeyFactory.getInstance("RSASSA-PSS");
- kpg.initialize(new RSAKeyGenParameterSpec(2048,
+ kpg.initialize(new RSAKeyGenParameterSpec(SecurityUtils.getTestKeySize("RSA"),
RSAKeyGenParameterSpec.F4,
new PSSParameterSpec(
"SHA-384", "MGF1",
diff --git a/test/jdk/sun/security/rsa/pss/InitAgain.java b/test/jdk/sun/security/rsa/pss/InitAgain.java
index 209d5f46178..9fe8d1a0131 100644
--- a/test/jdk/sun/security/rsa/pss/InitAgain.java
+++ b/test/jdk/sun/security/rsa/pss/InitAgain.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -22,26 +22,34 @@
*/
import java.security.*;
import java.security.spec.*;
+import jdk.test.lib.security.SecurityUtils;
/**
* @test
* @bug 8205445
+ * @library /test/lib
* @summary Make sure old state is cleared when init is called again
+ * @run main InitAgain default
+ * @run main InitAgain SHA-256
*/
public class InitAgain {
public static void main(String[] args) throws Exception {
+ String mdName = args[0];
+ PSSParameterSpec pssParamSpec = "default".equals(mdName) ? PSSParameterSpec.DEFAULT :
+ new PSSParameterSpec(mdName, "MGF1", new MGF1ParameterSpec(mdName), 20, 1);
byte[] msg = "hello".getBytes();
Signature s1 = Signature.getInstance("RSASSA-PSS");
Signature s2 = Signature.getInstance("RSASSA-PSS");
- s1.setParameter(PSSParameterSpec.DEFAULT);
- s2.setParameter(PSSParameterSpec.DEFAULT);
+ s1.setParameter(pssParamSpec);
+ s2.setParameter(pssParamSpec);
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
- kpg.initialize(1024);
+ String kpgAlgorithm = "RSA";
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm);
+ kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpg.generateKeyPair();
s1.initSign(kp.getPrivate());
diff --git a/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java b/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java
index 4961a2a2ad8..5515e770c26 100644
--- a/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java
+++ b/test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -51,7 +51,8 @@ public class PSSKeyCompatibility {
private static final String ALGO = "RSASSA-PSS";
private static final String OID = "1.2.840.113549.1.1.10";
- private static final String PROVIDER = "SunRsaSign";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunRsaSign");
public static void main(String[] args) {
diff --git a/test/jdk/sun/security/rsa/pss/PSSParametersTest.java b/test/jdk/sun/security/rsa/pss/PSSParametersTest.java
index c71e5bb34a4..a489b3273ad 100644
--- a/test/jdk/sun/security/rsa/pss/PSSParametersTest.java
+++ b/test/jdk/sun/security/rsa/pss/PSSParametersTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -39,7 +39,8 @@ public class PSSParametersTest {
/**
* JDK default RSA Provider.
*/
- private static final String PROVIDER = "SunRsaSign";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunRsaSign");
private static final String PSS_ALGO = "RSASSA-PSS";
private static final String PSS_OID = "1.2.840.113549.1.1.10";
diff --git a/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java b/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java
index eb0bd1dde7a..f946427092c 100644
--- a/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java
+++ b/test/jdk/sun/security/rsa/pss/SerializedPSSKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024, 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
@@ -50,9 +50,11 @@
import java.security.spec.RSAPublicKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Arrays;
+import jdk.test.lib.security.SecurityUtils;
/**
* @test @bug 8242335
+ * @library /test/lib
* @summary Test RSASSA-PSS serialized keys
* @run main SerializedPSSKey
*/
@@ -60,8 +62,9 @@ public class SerializedPSSKey {
private static final String ALGO = "RSASSA-PSS";
private static final String OID = "1.2.840.113549.1.1.10";
- private static final String PROVIDER = "SunRsaSign";
- private static final int KEY_SIZE = 2048;
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunRsaSign");
+ private static final int KEY_SIZE = SecurityUtils.getTestKeySize("RSA");
private static final byte[] DATA = "Test".getBytes();
/**
* Digest algorithms to test w/ RSASSA-PSS signature algorithms
diff --git a/test/jdk/sun/security/rsa/pss/SignatureTest2.java b/test/jdk/sun/security/rsa/pss/SignatureTest2.java
index ea548d04dad..7d3d76ef0ae 100644
--- a/test/jdk/sun/security/rsa/pss/SignatureTest2.java
+++ b/test/jdk/sun/security/rsa/pss/SignatureTest2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -51,7 +51,8 @@ public class SignatureTest2 {
/**
* JDK default RSA Provider.
*/
- private static final String PROVIDER = "SunRsaSign";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunRsaSign");
/**
* How much times signature updated.
diff --git a/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java b/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java
index daa0fc51d8a..82580b0c354 100644
--- a/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java
+++ b/test/jdk/sun/security/rsa/pss/SignatureTestPSS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -57,7 +57,8 @@ public class SignatureTestPSS {
/**
* JDK default RSA Provider.
*/
- private static final String PROVIDER = "SunRsaSign";
+ private static final String PROVIDER =
+ System.getProperty("test.provider.name", "SunRsaSign");
/**
* How much times signature updated.
diff --git a/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java b/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java
index 5e8c48a178a..44d1324b00e 100644
--- a/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java
+++ b/test/jdk/sun/security/rsa/pss/TestPSSKeySupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -24,6 +24,7 @@
/**
* @test
* @bug 8146293 8242556 8172366 8254717
+ * @library /test/lib
* @summary Test RSASSA-PSS Key related support such as KeyPairGenerator
* and KeyFactory of the SunRsaSign provider
*/
@@ -35,6 +36,7 @@
import java.security.*;
import java.security.interfaces.*;
import java.security.spec.*;
+import jdk.test.lib.security.SecurityUtils;
public class TestPSSKeySupport {
@@ -130,11 +132,13 @@ private static void checkKeyPair(KeyPair kp) throws Exception {
}
public static void main(String[] args) throws Exception {
+ int keySize = SecurityUtils.getTestKeySize("RSA");
KeyPairGenerator kpg =
- KeyPairGenerator.getInstance(ALGO, "SunRsaSign");
+ KeyPairGenerator.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunRsaSign"));
// Algorithm-Independent Initialization
- kpg.initialize(2048);
+ kpg.initialize(keySize);
KeyPair kp = kpg.generateKeyPair();
checkKeyPair(kp);
BigInteger pubExp = ((RSAPublicKey)kp.getPublic()).getPublicExponent();
@@ -142,17 +146,18 @@ public static void main(String[] args) throws Exception {
// Algorithm-specific Initialization
PSSParameterSpec params = new PSSParameterSpec("SHA-256", "MGF1",
MGF1ParameterSpec.SHA256, 32, 1);
- kpg.initialize(new RSAKeyGenParameterSpec(2048, pubExp, params));
+ kpg.initialize(new RSAKeyGenParameterSpec(keySize, pubExp, params));
KeyPair kp2 = kpg.generateKeyPair();
checkKeyPair(kp2);
params = new PSSParameterSpec("SHA3-256", "MGF1",
new MGF1ParameterSpec("SHA3-256"), 32, 1);
- kpg.initialize(new RSAKeyGenParameterSpec(2048, pubExp, params));
+ kpg.initialize(new RSAKeyGenParameterSpec(keySize, pubExp, params));
KeyPair kp3 = kpg.generateKeyPair();
checkKeyPair(kp3);
- KeyFactory kf = KeyFactory.getInstance(ALGO, "SunRsaSign");
+ KeyFactory kf = KeyFactory.getInstance(ALGO,
+ System.getProperty("test.provider.name", "SunRsaSign"));
test(kf, kp.getPublic());
test(kf, kp.getPrivate());
test(kf, kp2.getPublic());
diff --git a/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java b/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java
index dfadef03f04..cbda2b1df93 100644
--- a/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java
+++ b/test/jdk/sun/security/rsa/pss/TestSigGenPSS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -62,7 +62,8 @@ public void nextBytes(byte[] bytes) {
public static void main(String[] args) throws Exception {
//for (Provider provider : Security.getProviders()) {
- Provider p = Security.getProvider("SunRsaSign");
+ Provider p = Security.getProvider(
+ System.getProperty("test.provider.name", "SunRsaSign"));
Signature sig;
try {
sig = Signature.getInstance("RSASSA-PSS", p);
diff --git a/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java b/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java
index a92de6fff6e..437973049a8 100644
--- a/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java
+++ b/test/jdk/sun/security/ssl/HandshakeHash/DigestBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -59,13 +59,13 @@ public MD5() throws Exception {
public static final class SHA extends DigestBase {
public SHA() throws Exception {
- super("SHA", "SUN");
+ super("SHA", System.getProperty("test.provider.name", "SUN"));
}
}
public static final class SHA256 extends DigestBase {
public SHA256() throws Exception {
- super("SHA-256", "SUN");
+ super("SHA-256", System.getProperty("test.provider.name", "SUN"));
}
}
}
diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java b/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java
index 1cf22f04293..e2e5e066f9c 100644
--- a/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java
+++ b/test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2024, 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
@@ -56,354 +56,495 @@
*
* TLS server certificate:
* server private key:
- * -----BEGIN RSA PRIVATE KEY-----
- * Proc-Type: 4,ENCRYPTED
- * DEK-Info: DES-EDE3-CBC,D9AE407F6D0E389A
*
- * WPrA7TFol/cQCcp9oHnXWNpYlvRbbIcQj0m+RKT2Iuzfus+DHt3Zadf8nJpKfX2e
- * h2rnhlzCN9M7djRDooZKDOPCsdBn51Au7HlZF3S3Opgo7D8XFM1a8t1Je4ke14oI
- * nw6QKYsBblRziPnP2PZ0zvX24nOv7bbY8beynlJHGs00VWSFdoH2DS0aE1p6D+3n
- * ptJuJ75dVfZFK4X7162APlNXevX8D6PEQpSiRw1rjjGGcnvQ4HdWk3BxDVDcCNJb
- * Y1aGNRxsjTDvPi3R9Qx2M+W03QzEPx4SR3ZHVskeSJHaetM0TM/w/45Paq4GokXP
- * ZeTnbEx1xmjkA7h+t4doLL4watx5F6yLsJzu8xB3lt/1EtmkYtLz1t7X4BetPAXz
- * zS69X/VwhKfsOI3qXBWuL2oHPyhDmT1gcaUQwEPSV6ogHEEQEDXdiUS8heNK13KF
- * TCQYFkETvV2BLxUhV1hypPzRQ6tUpJiAbD5KmoK2lD9slshG2QtvKQq0/bgkDY5J
- * LhDHV2dtcZ3kDPkkZXpbcJQvoeH3d09C5sIsuTFo2zgNR6oETHUc5TzP6FY2YYRa
- * QcK5HcmtsRRiXFm01ac+aMejJUIujjFt84SiKWT/73vC8AmY4tYcJBLjCg4XIxSH
- * fdDFLL1YZENNO5ivlp8mdiHqcawx+36L7DrEZQ8RZt6cqST5t/+XTdM74s6k81GT
- * pNsa82P2K2zmIUZ/DL2mKjW1vfRByw1NQFEBkN3vdyZxYfM/JyUzX4hbjXBEkh9Q
- * QYrcwLKLjis2QzSvK04B3bvRzRb+4ocWiso8ZPAXAIxZFBWDpTMM2A==
- * -----END RSA PRIVATE KEY-----
- *
- * -----BEGIN RSA PRIVATE KEY-----
- * MIICXAIBAAKBgQClrFscN6LdmYktsnm4j9VIpecchBeNaZzGrG358h0fORna03Ie
- * buxEzHCk3LoAMPagTz1UemFqzFfQCn+VKBg/mtmU8hvIJIh+/p0PPftXUwizIDPU
- * PxdHFNHN6gjYDnVOr77M0uyvqXpJ38LZrLgkQJCmA1Yq0DAFQCxPq9l0iQIDAQAB
- * AoGAbqcbg1E1mkR99uOJoNeQYKFOJyGiiXTMnXV1TseC4+PDfQBU7Dax35GcesBi
- * CtapIpFKKS5D+ozY6b7ZT8ojxuQ/uHLPAvz0WDR3ds4iRF8tyu71Q1ZHcQsJa17y
- * yO7UbkSSKn/Mp9Rb+/dKqftUGNXVFLqgHBOzN2s3We3bbbECQQDYBPKOg3hkaGHo
- * OhpHKqtQ6EVkldihG/3i4WejRonelXN+HRh1KrB2HBx0M8D/qAzP1i3rNSlSHer4
- * 59YRTJnHAkEAxFX/sVYSn07BHv9Zhn6XXct/Cj43z/tKNbzlNbcxqQwQerw3IH51
- * 8UH2YOA+GD3lXbKp+MytoFLWv8zg4YT/LwJAfqan75Z1R6lLffRS49bIiq8jwE16
- * rTrUJ+kv8jKxMqc9B3vXkxpsS1M/+4E8bqgAmvpgAb8xcsvHsBd9ErdukQJBAKs2
- * j67W75BrPjBI34pQ1LEfp56IGWXOrq1kF8IbCjxv3+MYRT6Z6UJFkpRymNPNDjsC
- * dgUYgITiGJHUGXuw3lMCQHEHqo9ZtXz92yFT+VhsNc29B8m/sqUJdtCcMd/jGpAF
- * u6GHufjqIZBpQsk63wbwESAPZZ+kk1O1kS5GIRLX608=
- * -----END RSA PRIVATE KEY-----
- *
- * Private-Key: (1024 bit)
+ * Private-Key: (2048 bit, 2 primes)
* modulus:
- * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f:
- * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2:
- * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc:
- * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a:
- * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe:
- * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14:
- * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9:
- * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0:
- * 30:05:40:2c:4f:ab:d9:74:89
+ * 00:9a:0c:e0:8f:a8:02:7e:5a:ef:ed:b2:42:ad:08:
+ * 4e:91:ba:c2:ad:9b:79:d7:9b:0f:fd:d2:f8:15:2f:
+ * 19:89:80:10:00:02:19:6d:27:c2:90:d7:a5:23:53:
+ * 74:6e:64:28:7c:24:aa:ed:ea:21:59:dc:a3:5c:b5:
+ * c9:42:31:4f:a2:de:fb:09:7c:73:ed:88:04:34:f1:
+ * 15:ad:3d:60:cd:ca:c5:13:99:d3:9f:9b:b2:92:70:
+ * cb:ba:4b:3d:20:96:ad:be:92:53:ed:54:3b:c5:14:
+ * bd:cf:d4:0f:cb:05:4f:fd:2b:9e:e0:50:bb:65:13:
+ * 92:c0:d6:bd:4d:02:0c:70:b6:65:d4:7d:b4:4d:c3:
+ * df:2c:08:9e:d2:3e:69:32:46:6f:6f:ca:d1:73:a4:
+ * 94:07:ef:14:e3:da:9e:2f:c0:ac:0e:10:33:4c:68:
+ * 79:f3:79:40:d6:e9:3c:c2:e6:70:e0:89:ce:a0:7a:
+ * a8:84:28:85:32:37:08:b0:cf:b1:7f:5f:bc:1f:a5:
+ * 3d:ef:d6:68:a8:17:21:5f:87:d5:4b:b5:cc:ee:78:
+ * 8d:dd:b1:28:6a:c0:fb:64:bd:b7:70:02:33:03:0b:
+ * b8:b8:bb:08:82:f6:8e:05:27:d1:3b:e6:c5:ac:4d:
+ * 85:5b:a1:1d:a3:48:5d:03:15:76:63:6c:71:21:3e:
+ * 98:cd
* publicExponent: 65537 (0x10001)
* privateExponent:
- * 6e:a7:1b:83:51:35:9a:44:7d:f6:e3:89:a0:d7:90:
- * 60:a1:4e:27:21:a2:89:74:cc:9d:75:75:4e:c7:82:
- * e3:e3:c3:7d:00:54:ec:36:b1:df:91:9c:7a:c0:62:
- * 0a:d6:a9:22:91:4a:29:2e:43:fa:8c:d8:e9:be:d9:
- * 4f:ca:23:c6:e4:3f:b8:72:cf:02:fc:f4:58:34:77:
- * 76:ce:22:44:5f:2d:ca:ee:f5:43:56:47:71:0b:09:
- * 6b:5e:f2:c8:ee:d4:6e:44:92:2a:7f:cc:a7:d4:5b:
- * fb:f7:4a:a9:fb:54:18:d5:d5:14:ba:a0:1c:13:b3:
- * 37:6b:37:59:ed:db:6d:b1
+ * 68:87:36:54:a3:c6:d5:5f:f5:0f:4f:76:c8:9c:2b:
+ * 5b:dc:e2:be:14:12:2f:c7:0a:a9:cb:5e:04:59:ca:
+ * 35:2f:8d:2b:c4:40:e6:7d:25:1b:4d:07:c3:99:9c:
+ * 16:4f:a5:dc:de:b0:90:f0:de:22:70:80:f4:a6:70:
+ * e2:96:3d:18:21:bf:2b:27:a4:2d:d7:ae:2b:12:2f:
+ * 08:36:ee:99:94:ed:f6:a7:d9:1d:a2:f3:1f:44:a4:
+ * 28:4b:67:35:d6:a8:1b:f8:84:34:34:84:bd:ec:9e:
+ * 03:08:3c:93:20:8e:af:15:cb:1f:20:08:97:c4:19:
+ * 3e:fa:36:c6:ab:0e:2f:e7:b3:c0:a7:bc:e4:e0:a6:
+ * 08:1c:69:20:4d:78:bd:7a:e5:25:48:60:9e:2e:50:
+ * 8d:36:1e:07:e9:d5:0d:39:67:41:42:24:db:87:e5:
+ * 77:76:fd:5e:d5:c6:e5:d3:b0:98:71:48:69:47:4f:
+ * 46:05:0c:9e:58:45:2e:e2:27:d0:f6:11:05:78:ad:
+ * 83:5a:5b:ec:d7:2e:26:5a:a5:4f:9e:52:84:2c:1f:
+ * 59:1a:78:56:0a:44:54:c6:37:64:01:ca:e4:a8:01:
+ * c7:86:c1:b4:d6:6c:7a:15:9a:65:69:46:9e:fd:f6:
+ * 08:17:0c:6c:ac:38:bd:c2:cd:da:ef:54:7a:48:92:
+ * 4d
* prime1:
- * 00:d8:04:f2:8e:83:78:64:68:61:e8:3a:1a:47:2a:
- * ab:50:e8:45:64:95:d8:a1:1b:fd:e2:e1:67:a3:46:
- * 89:de:95:73:7e:1d:18:75:2a:b0:76:1c:1c:74:33:
- * c0:ff:a8:0c:cf:d6:2d:eb:35:29:52:1d:ea:f8:e7:
- * d6:11:4c:99:c7
+ * 00:e4:43:cc:51:25:aa:1d:90:41:95:2c:e8:9f:aa:
+ * 1c:9b:ea:bd:fd:29:e5:68:6b:28:00:ec:31:31:36:
+ * d0:3d:84:db:c5:5d:32:f6:38:b9:04:4f:45:cb:19:
+ * f5:88:cd:a8:fc:70:b8:6d:98:68:a6:b4:9e:c1:da:
+ * fd:db:eb:1a:53:3c:3b:e6:85:d2:6f:03:45:7a:ad:
+ * 49:8c:c3:96:a7:46:a4:bb:3b:48:d3:d7:1c:b4:3c:
+ * f7:04:0a:a3:85:9d:94:3e:bd:35:f5:34:21:3d:08:
+ * 89:df:c5:54:af:cf:90:f7:d8:5c:57:c5:77:5a:c8:
+ * d1:b3:8f:ee:01:5c:07:13:3f
* prime2:
- * 00:c4:55:ff:b1:56:12:9f:4e:c1:1e:ff:59:86:7e:
- * 97:5d:cb:7f:0a:3e:37:cf:fb:4a:35:bc:e5:35:b7:
- * 31:a9:0c:10:7a:bc:37:20:7e:75:f1:41:f6:60:e0:
- * 3e:18:3d:e5:5d:b2:a9:f8:cc:ad:a0:52:d6:bf:cc:
- * e0:e1:84:ff:2f
+ * 00:ac:c4:a0:cc:7c:51:db:65:0a:02:da:bc:d8:77:
+ * 21:8c:d3:30:ae:ec:50:60:4b:b9:39:c7:2d:bd:98:
+ * aa:4f:9b:44:74:ab:f8:86:de:e2:44:15:73:7a:cd:
+ * d5:46:f2:03:62:c5:87:9c:6d:91:d5:7a:9a:17:c2:
+ * c6:2f:29:0e:8a:a4:a9:f4:c2:63:a2:77:97:bf:c6:
+ * 90:e8:39:70:87:cc:fd:62:4f:d2:3d:e7:47:70:fb:
+ * f3:bd:bd:5c:9c:77:fe:23:33:7d:83:ef:cb:0e:4e:
+ * f1:dd:05:47:40:97:f4:da:b6:1f:b9:8d:e2:92:04:
+ * 09:be:fb:6a:97:29:27:ac:f3
* exponent1:
- * 7e:a6:a7:ef:96:75:47:a9:4b:7d:f4:52:e3:d6:c8:
- * 8a:af:23:c0:4d:7a:ad:3a:d4:27:e9:2f:f2:32:b1:
- * 32:a7:3d:07:7b:d7:93:1a:6c:4b:53:3f:fb:81:3c:
- * 6e:a8:00:9a:fa:60:01:bf:31:72:cb:c7:b0:17:7d:
- * 12:b7:6e:91
+ * 3f:08:1d:b6:56:b1:38:02:aa:a9:77:c2:30:bc:b7:
+ * b3:b2:49:8e:4b:f0:66:3a:18:cc:d0:6b:f1:0c:12:
+ * ca:ba:12:39:d8:b7:86:d8:38:f6:e0:b1:04:19:81:
+ * fc:a9:d5:bd:07:9f:55:dc:1d:21:d3:84:77:41:72:
+ * 92:34:c4:8b:31:79:d4:f9:25:17:b4:8e:8e:06:a5:
+ * e5:b1:e8:ba:fe:3d:e4:d9:c5:0d:82:3c:11:e5:37:
+ * cc:ac:e7:64:b1:13:cb:93:52:00:08:ca:18:e1:6f:
+ * b9:13:f3:83:ac:cc:7a:34:0b:a3:cd:0a:5d:4e:50:
+ * e1:c5:9f:d2:4e:48:41:df
* exponent2:
- * 00:ab:36:8f:ae:d6:ef:90:6b:3e:30:48:df:8a:50:
- * d4:b1:1f:a7:9e:88:19:65:ce:ae:ad:64:17:c2:1b:
- * 0a:3c:6f:df:e3:18:45:3e:99:e9:42:45:92:94:72:
- * 98:d3:cd:0e:3b:02:76:05:18:80:84:e2:18:91:d4:
- * 19:7b:b0:de:53
+ * 02:c7:fb:8a:af:29:a6:2d:7f:36:c2:8c:ad:b3:65:
+ * 3f:de:1a:77:86:68:58:d4:7f:3b:d5:df:ff:a0:58:
+ * 85:85:8b:59:91:77:23:bc:ac:c9:c9:ca:9d:1c:79:
+ * 25:76:39:e5:ba:26:4f:b7:57:d4:a6:ef:9a:18:51:
+ * 96:6a:c3:c8:29:94:6e:d3:3e:45:5c:45:7e:19:d5:
+ * 35:57:cf:5e:f0:46:d7:f1:4f:02:1e:1a:01:50:9d:
+ * 00:dd:ee:82:ba:4f:c6:03:4b:2e:f7:8a:3e:45:b9:
+ * 11:04:c7:bb:db:76:5e:9a:f5:f1:c7:bd:f0:f9:cd:
+ * aa:5c:63:bf:e1:32:b9:4f
* coefficient:
- * 71:07:aa:8f:59:b5:7c:fd:db:21:53:f9:58:6c:35:
- * cd:bd:07:c9:bf:b2:a5:09:76:d0:9c:31:df:e3:1a:
- * 90:05:bb:a1:87:b9:f8:ea:21:90:69:42:c9:3a:df:
- * 06:f0:11:20:0f:65:9f:a4:93:53:b5:91:2e:46:21:
- * 12:d7:eb:4f
- *
+ * 50:4c:e6:1e:23:f3:e2:2b:d6:3f:87:53:fb:19:53:
+ * 4b:84:21:0b:77:31:ed:8d:c3:0c:ea:31:b0:a6:38:
+ * a9:e6:44:6e:18:05:53:8f:4a:5f:75:e5:3e:b5:26:
+ * 9b:46:3d:73:e7:c1:2a:a6:3e:c3:cd:41:b1:a6:55:
+ * 57:84:11:13:ec:44:92:59:7f:dd:0d:67:30:d3:b7:
+ * 13:ee:9e:2d:ea:be:b3:ca:4a:f0:6e:4f:22:e8:be:
+ * 8b:8d:9b:2c:30:a5:ed:2c:2b:13:4c:f7:61:19:64:
+ * 35:9d:b0:c8:10:85:01:e7:2a:70:13:00:39:c5:73:
+ * 63:34:fd:28:2d:7f:8d:20
+ * -----BEGIN PRIVATE KEY-----
+ * MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCaDOCPqAJ+Wu/t
+ * skKtCE6RusKtm3nXmw/90vgVLxmJgBAAAhltJ8KQ16UjU3RuZCh8JKrt6iFZ3KNc
+ * tclCMU+i3vsJfHPtiAQ08RWtPWDNysUTmdOfm7KScMu6Sz0glq2+klPtVDvFFL3P
+ * 1A/LBU/9K57gULtlE5LA1r1NAgxwtmXUfbRNw98sCJ7SPmkyRm9vytFzpJQH7xTj
+ * 2p4vwKwOEDNMaHnzeUDW6TzC5nDgic6geqiEKIUyNwiwz7F/X7wfpT3v1mioFyFf
+ * h9VLtczueI3dsShqwPtkvbdwAjMDC7i4uwiC9o4FJ9E75sWsTYVboR2jSF0DFXZj
+ * bHEhPpjNAgMBAAECggEAaIc2VKPG1V/1D092yJwrW9zivhQSL8cKqcteBFnKNS+N
+ * K8RA5n0lG00Hw5mcFk+l3N6wkPDeInCA9KZw4pY9GCG/KyekLdeuKxIvCDbumZTt
+ * 9qfZHaLzH0SkKEtnNdaoG/iENDSEveyeAwg8kyCOrxXLHyAIl8QZPvo2xqsOL+ez
+ * wKe85OCmCBxpIE14vXrlJUhgni5QjTYeB+nVDTlnQUIk24fld3b9XtXG5dOwmHFI
+ * aUdPRgUMnlhFLuIn0PYRBXitg1pb7NcuJlqlT55ShCwfWRp4VgpEVMY3ZAHK5KgB
+ * x4bBtNZsehWaZWlGnv32CBcMbKw4vcLN2u9UekiSTQKBgQDkQ8xRJaodkEGVLOif
+ * qhyb6r39KeVoaygA7DExNtA9hNvFXTL2OLkET0XLGfWIzaj8cLhtmGimtJ7B2v3b
+ * 6xpTPDvmhdJvA0V6rUmMw5anRqS7O0jT1xy0PPcECqOFnZQ+vTX1NCE9CInfxVSv
+ * z5D32FxXxXdayNGzj+4BXAcTPwKBgQCsxKDMfFHbZQoC2rzYdyGM0zCu7FBgS7k5
+ * xy29mKpPm0R0q/iG3uJEFXN6zdVG8gNixYecbZHVepoXwsYvKQ6KpKn0wmOid5e/
+ * xpDoOXCHzP1iT9I950dw+/O9vVycd/4jM32D78sOTvHdBUdAl/Tath+5jeKSBAm+
+ * +2qXKSes8wKBgD8IHbZWsTgCqql3wjC8t7OySY5L8GY6GMzQa/EMEsq6EjnYt4bY
+ * OPbgsQQZgfyp1b0Hn1XcHSHThHdBcpI0xIsxedT5JRe0jo4GpeWx6Lr+PeTZxQ2C
+ * PBHlN8ys52SxE8uTUgAIyhjhb7kT84OszHo0C6PNCl1OUOHFn9JOSEHfAoGAAsf7
+ * iq8ppi1/NsKMrbNlP94ad4ZoWNR/O9Xf/6BYhYWLWZF3I7ysycnKnRx5JXY55bom
+ * T7dX1KbvmhhRlmrDyCmUbtM+RVxFfhnVNVfPXvBG1/FPAh4aAVCdAN3ugrpPxgNL
+ * LveKPkW5EQTHu9t2Xpr18ce98PnNqlxjv+EyuU8CgYBQTOYeI/PiK9Y/h1P7GVNL
+ * hCELdzHtjcMM6jGwpjip5kRuGAVTj0pfdeU+tSabRj1z58Eqpj7DzUGxplVXhBET
+ * 7ESSWX/dDWcw07cT7p4t6r6zykrwbk8i6L6LjZssMKXtLCsTTPdhGWQ1nbDIEIUB
+ * 5ypwEwA5xXNjNP0oLX+NIA==
+ * -----END PRIVATE KEY-----
*
* server certificate:
- * Data:
- * Version: 3 (0x2)
- * Serial Number: 8 (0x8)
- * Signature Algorithm: md5WithRSAEncryption
- * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
- * Validity
- * Not Before: Dec 8 03:43:04 2008 GMT
- * Not After : Aug 25 03:43:04 2028 GMT
- * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Server, CN=localhost
- * Subject Public Key Info:
- * Public Key Algorithm: rsaEncryption
- * RSA Public Key: (1024 bit)
- * Modulus (1024 bit):
- * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f:
- * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2:
- * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc:
- * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a:
- * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe:
- * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14:
- * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9:
- * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0:
- * 30:05:40:2c:4f:ab:d9:74:89
- * Exponent: 65537 (0x10001)
- * X509v3 extensions:
- * X509v3 Basic Constraints:
- * CA:FALSE
- * X509v3 Key Usage:
- * Digital Signature, Non Repudiation, Key Encipherment
- * X509v3 Subject Key Identifier:
- * ED:6E:DB:F4:B5:56:C8:FB:1A:06:61:3F:0F:08:BB:A6:04:D8:16:54
- * X509v3 Authority Key Identifier:
- * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
- *
- * X509v3 Subject Alternative Name: critical
- * DNS:localhost
- * Signature Algorithm: md5WithRSAEncryption0
- *
+ * Data:
+ * Version: 3 (0x2)
+ * Serial Number: 106315679 (0x6563f9f)
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org
+ * Validity
+ * Not Before: Jul 1 04:16:55 2024 GMT
+ * Not After : Jul 2 04:16:55 2034 GMT
+ * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, CN=localhost ou=SSL-Server
+ * Subject Public Key Info:
+ * Public Key Algorithm: rsaEncryption
+ * Public-Key: (2048 bit)
+ * Modulus:
+ * 00:9a:0c:e0:8f:a8:02:7e:5a:ef:ed:b2:42:ad:08:
+ * 4e:91:ba:c2:ad:9b:79:d7:9b:0f:fd:d2:f8:15:2f:
+ * 19:89:80:10:00:02:19:6d:27:c2:90:d7:a5:23:53:
+ * 74:6e:64:28:7c:24:aa:ed:ea:21:59:dc:a3:5c:b5:
+ * c9:42:31:4f:a2:de:fb:09:7c:73:ed:88:04:34:f1:
+ * 15:ad:3d:60:cd:ca:c5:13:99:d3:9f:9b:b2:92:70:
+ * cb:ba:4b:3d:20:96:ad:be:92:53:ed:54:3b:c5:14:
+ * bd:cf:d4:0f:cb:05:4f:fd:2b:9e:e0:50:bb:65:13:
+ * 92:c0:d6:bd:4d:02:0c:70:b6:65:d4:7d:b4:4d:c3:
+ * df:2c:08:9e:d2:3e:69:32:46:6f:6f:ca:d1:73:a4:
+ * 94:07:ef:14:e3:da:9e:2f:c0:ac:0e:10:33:4c:68:
+ * 79:f3:79:40:d6:e9:3c:c2:e6:70:e0:89:ce:a0:7a:
+ * a8:84:28:85:32:37:08:b0:cf:b1:7f:5f:bc:1f:a5:
+ * 3d:ef:d6:68:a8:17:21:5f:87:d5:4b:b5:cc:ee:78:
+ * 8d:dd:b1:28:6a:c0:fb:64:bd:b7:70:02:33:03:0b:
+ * b8:b8:bb:08:82:f6:8e:05:27:d1:3b:e6:c5:ac:4d:
+ * 85:5b:a1:1d:a3:48:5d:03:15:76:63:6c:71:21:3e:
+ * 98:cd
+ * Exponent: 65537 (0x10001)
+ * X509v3 extensions:
+ * X509v3 Subject Key Identifier:
+ * 5C:AF:44:B1:48:B8:59:9A:64:53:9D:2E:A6:B2:09:D3:0A:92:04:83
+ * X509v3 Key Usage:
+ * Digital Signature, Non Repudiation, Key Encipherment
+ * X509v3 Subject Alternative Name: critical
+ * DNS:localhost
+ * X509v3 Basic Constraints:
+ * CA:FALSE
+ * X509v3 Authority Key Identifier:
+ * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Signature Value:
+ * 9d:22:49:5f:56:23:e6:80:35:cc:ab:44:1c:27:bd:c9:8d:89:
+ * 93:49:58:e8:c1:7a:68:dd:cf:bd:e0:12:76:06:54:cd:2f:62:
+ * 9b:54:84:f2:bb:90:a0:bb:37:e2:13:1d:f3:df:41:aa:e0:fe:
+ * c0:ef:46:78:8d:aa:f4:1b:70:ad:a9:16:24:fa:15:4a:c6:0a:
+ * 8d:e1:99:93:00:a9:d4:b6:08:5d:8e:65:03:dc:d0:95:fc:95:
+ * 61:a6:ad:b5:ab:4d:a6:e0:05:48:8c:db:42:42:8a:d6:5e:c0:
+ * 2a:a0:11:15:b8:07:69:5c:3f:99:a0:bd:53:65:db:4e:cf:46:
+ * 61:93:09:7b:81:40:ff:5c:fe:4c:eb:f4:ac:de:1f:38:ad:b2:
+ * 60:28:f6:0e:9f:46:e7:07:8f:20:9a:a4:e1:8f:ab:54:99:76:
+ * 82:d8:9e:70:c4:da:98:85:71:af:3b:54:e4:01:b4:9e:83:d0:
+ * 7b:c6:8d:1f:ed:25:08:89:05:e9:87:97:76:5a:a3:85:c3:f8:
+ * 59:d7:bb:3b:5a:db:cb:ed:5d:ff:ac:21:b9:9a:e2:65:0a:bc:
+ * de:d1:dc:53:94:98:44:97:91:b3:1b:6b:80:0b:9b:57:b3:ae:
+ * 5c:7c:35:ca:39:71:f7:4e:8f:4a:d7:eb:0b:25:da:b2:1e:17:
+ * 48:b8:eb:09
* -----BEGIN CERTIFICATE-----
- * MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET
- * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK
- * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ
- * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp
- * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD
- * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3
- * ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6
- * YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS
- * 7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw
- * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV
- * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh
- * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac
- * PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi
- * nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn
- * JqCpf5uZGOo=
+ * MIIDpTCCAo2gAwIBAgIEBlY/nzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV
+ * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD
+ * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTVaFw0zNDA3MDIwNDE2NTVaMGsx
+ * CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l
+ * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9
+ * U1NMLVNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoM4I+o
+ * An5a7+2yQq0ITpG6wq2bedebD/3S+BUvGYmAEAACGW0nwpDXpSNTdG5kKHwkqu3q
+ * IVnco1y1yUIxT6Le+wl8c+2IBDTxFa09YM3KxROZ05+bspJwy7pLPSCWrb6SU+1U
+ * O8UUvc/UD8sFT/0rnuBQu2UTksDWvU0CDHC2ZdR9tE3D3ywIntI+aTJGb2/K0XOk
+ * lAfvFOPani/ArA4QM0xoefN5QNbpPMLmcOCJzqB6qIQohTI3CLDPsX9fvB+lPe/W
+ * aKgXIV+H1Uu1zO54jd2xKGrA+2S9t3ACMwMLuLi7CIL2jgUn0TvmxaxNhVuhHaNI
+ * XQMVdmNscSE+mM0CAwEAAaNzMHEwHQYDVR0OBBYEFFyvRLFIuFmaZFOdLqayCdMK
+ * kgSDMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T
+ * BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B
+ * AQUFAAOCAQEAnSJJX1Yj5oA1zKtEHCe9yY2Jk0lY6MF6aN3PveASdgZUzS9im1SE
+ * 8ruQoLs34hMd899BquD+wO9GeI2q9BtwrakWJPoVSsYKjeGZkwCp1LYIXY5lA9zQ
+ * lfyVYaattatNpuAFSIzbQkKK1l7AKqARFbgHaVw/maC9U2XbTs9GYZMJe4FA/1z+
+ * TOv0rN4fOK2yYCj2Dp9G5wePIJqk4Y+rVJl2gtiecMTamIVxrztU5AG0noPQe8aN
+ * H+0lCIkF6YeXdlqjhcP4Wde7O1rby+1d/6whuZriZQq83tHcU5SYRJeRsxtrgAub
+ * V7OuXHw1yjlx906PStfrCyXash4XSLjrCQ==
* -----END CERTIFICATE-----
*
*
* TLS client certificate:
* client private key:
- * ----BEGIN RSA PRIVATE KEY-----
- * Proc-Type: 4,ENCRYPTED
- * DEK-Info: DES-EDE3-CBC,FA2A435CD35A9390
- *
- * Z+Y2uaETbsUWIyJUyVu1UV2G4rgFYJyACZT6Tp1KjRtxflSh2kXkJ9MpuXMXA0V4
- * Yy3fDzPqCL9NJmQAYRlAx/W/+j4F5EyMWDIx8fUxzONRZyoiwF7jLm+KscAfv6Pf
- * q7ItWOdj3z7IYrwlB8YIGd3F2cDKT3S+lYRk7rKb/qT7itbuHnY4Ardh3yl+MZak
- * jBp+ELUlRsUqSr1V0LoM+0rCCykarpyfhpxEcqsrl0v9Cyi5uhU50/oKv5zql3SH
- * l2ImgDjp3batAs8+Bd4NF2aqi0a7Hy44JUHxRm4caZryU/i/D9N1MbuM6882HLat
- * 5N0G+NaIUfywa8mjwq2D5aiit18HqKA6XeRRYeJ5Dvu9DCO4GeFSwcUFIBMI0L46
- * 7s114+oDodg57pMgITi+04vmUxvqlN9aiyd7f5Fgd7PeHGeOdbMz1NaJLJaPI9++
- * NakK8eK9iwT/Gdq0Uap5/CHW7vCT5PO+h3HY0STH0lWStXhdWnFO04zTdywsbSp+
- * DLpHeFT66shfeUlxR0PsCbG9vPRt/QmGLeYQZITppWo/ylSq4j+pRIuXvuWHdBRN
- * rTZ8QF4Y7AxQUXVz1j1++s6ZMHTzaK2i9HrhmDs1MbJl+QwWre3Xpv3LvTVz3k5U
- * wX8kuY1m3STt71QCaRWENq5sRaMImLxZbxc/ivFl9RAzUqo4NCxLod/QgA4iLqtO
- * ztnlpzwlC/F8HbQ1oqYWwnZAPhzU/cULtstl+Yrws2c2atO323LbPXZqbASySgig
- * sNpFXQMObdfP6LN23bY+1SvtK7V4NUTNhpdIc6INQAQ=
- * -----END RSA PRIVATE KEY-----
- *
- * -----BEGIN RSA PRIVATE KEY-----
- * MIICWwIBAAKBgQC78EA2rCZUTvSjWgAvaSFvuXo6k+yi9uGOx2PYLxIwmS6w8o/4
- * Jy0keCiE9wG/jUR53TvSVfPOPLJbIX3v/TNKsaP/xsibuQ98QTWX+ds6BWAFFa9Z
- * F5KjEK0WHOQHU6+odqJWKpLT+SjgeM9eH0irXBnd4WdDunWN9YKsQ5JEGwIDAQAB
- * AoGAEbdqNj0wN85hnWyEi/ObJU8UyKTdL9eaF72QGfcF/fLSxfd3vurihIeXOkGW
- * tpn4lIxYcVGM9CognhqgJpl11jFTQzn1KqZ+NEJRKkCHA4hDabKJbSC9fXHvRwrf
- * BsFpZqgiNxp3HseUTiwnaUVeyPgMt/jAj5nB5Sib+UyUxrECQQDnNQBiF2aifEg6
- * zbJOOC7he5CHAdkFxSxWVFVHL6EfXfqdLVkUohMbgZv+XxyIeU2biOExSg49Kds3
- * FOKgTau1AkEA0Bd1haj6QuCo8I0AXm2WO+MMTZMTvtHD/bGjKNM+fT4I8rKYnQRX
- * 1acHdqS9Xx2rNJqZgkMmpESIdPR2fc4yjwJALFeM6EMmqvj8/VIf5UJ/Mz14fXwM
- * PEARfckUxd9LnnFutCBTWlKvKXJVEZb6KO5ixPaegc57Jp3Vbh3yTN44lQJADD/1
- * SSMDaIB1MYP7a5Oj7m6VQNPRq8AJe5vDcRnOae0G9dKRrVyeFxO4GsHj6/+BHp2j
- * P8nYMn9eURQ7DXjf/QJAAQzMlWnKGSO8pyTDtnQx3hRMoUkOEhmNq4bQhLkYqtnY
- * FcqpUQ2qMjW+NiNWk5HnTrMS3L9EdJobMUzaNZLy4w==
- * -----END RSA PRIVATE KEY-----
*
- * Private-Key: (1024 bit)
+ * Private-Key: (2048 bit, 2 primes)
* modulus:
- * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69:
- * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f:
- * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7:
- * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21:
- * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41:
- * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10:
- * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9:
- * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba:
- * 75:8d:f5:82:ac:43:92:44:1b
+ * 00:cc:bf:92:3c:a6:57:74:1f:58:ad:c7:69:88:6f:
+ * 59:32:47:50:60:22:e4:98:49:0e:3e:1d:b8:ba:e2:
+ * 3b:b6:71:5b:fd:64:02:6d:0d:50:77:72:6e:a8:3d:
+ * 5d:d4:bd:1f:76:51:dc:9a:d0:d6:3e:d0:31:a5:24:
+ * 5a:2c:be:77:fa:88:a1:fa:06:41:c8:0f:47:70:47:
+ * 24:99:50:52:44:5b:30:62:5b:65:35:c4:28:b0:5c:
+ * ee:d0:1b:eb:39:2b:0b:a1:ac:96:48:da:56:6c:e0:
+ * e3:e6:e3:dd:45:cb:51:33:8d:40:43:d7:f0:a4:31:
+ * aa:b5:c0:df:4b:df:2b:0a:ed:7e:10:0c:ae:1f:96:
+ * a2:10:1e:6b:d0:f9:37:8b:df:0d:0e:02:35:f8:58:
+ * bc:6e:b5:57:0e:2f:ea:20:e6:73:9a:e5:6b:82:70:
+ * 25:bb:51:9a:7c:9d:e2:50:3d:cf:1e:24:3e:92:55:
+ * cf:2a:ad:0d:84:8f:a8:43:24:cd:ad:50:64:74:c2:
+ * 73:b6:e1:92:1c:b2:2b:8c:2d:7b:96:a6:41:61:5c:
+ * 1b:8f:78:28:51:40:ed:41:90:ce:1d:b8:26:81:47:
+ * 6b:e3:57:41:74:4e:20:f0:5a:1b:97:37:91:86:19:
+ * c5:f2:6d:04:c9:78:2b:5a:16:bc:fc:2b:71:5b:d0:
+ * 00:4f
* publicExponent: 65537 (0x10001)
* privateExponent:
- * 11:b7:6a:36:3d:30:37:ce:61:9d:6c:84:8b:f3:9b:
- * 25:4f:14:c8:a4:dd:2f:d7:9a:17:bd:90:19:f7:05:
- * fd:f2:d2:c5:f7:77:be:ea:e2:84:87:97:3a:41:96:
- * b6:99:f8:94:8c:58:71:51:8c:f4:2a:20:9e:1a:a0:
- * 26:99:75:d6:31:53:43:39:f5:2a:a6:7e:34:42:51:
- * 2a:40:87:03:88:43:69:b2:89:6d:20:bd:7d:71:ef:
- * 47:0a:df:06:c1:69:66:a8:22:37:1a:77:1e:c7:94:
- * 4e:2c:27:69:45:5e:c8:f8:0c:b7:f8:c0:8f:99:c1:
- * e5:28:9b:f9:4c:94:c6:b1
+ * 62:b2:d6:63:b6:2b:e2:26:5a:31:2b:37:8c:35:60:
+ * e2:03:ce:93:09:3e:f8:c9:fe:bb:a2:c8:32:0e:6c:
+ * 8a:7e:0a:c2:13:3b:b8:25:fa:ec:19:95:8e:34:46:
+ * cf:0e:7b:e4:25:82:1a:7f:21:48:16:44:58:3f:35:
+ * d8:eb:d8:1a:45:53:0f:9b:84:8a:54:13:33:e4:97:
+ * 97:f0:48:37:fb:5d:4f:8c:8f:35:63:e1:d9:62:73:
+ * 1c:8e:d8:cd:2e:1a:e5:4c:b5:05:59:7a:df:f1:68:
+ * eb:1c:5c:c6:10:44:8c:7d:42:c5:71:8a:e7:1b:aa:
+ * 17:03:6a:a0:c0:6b:97:50:17:ad:6e:5e:d9:db:6f:
+ * 3e:e9:3f:35:c3:45:bc:e8:3d:5a:b4:b9:3f:53:80:
+ * 64:dc:12:24:35:35:bd:98:bb:8d:fa:19:a3:5e:9e:
+ * ac:70:4a:fc:8d:ae:55:8b:71:81:0e:4d:c8:2f:87:
+ * b0:44:f7:4f:dc:a8:c8:50:b5:95:24:63:74:13:54:
+ * 58:de:fc:e0:75:eb:f4:06:58:83:12:4c:56:c4:c4:
+ * 18:0c:ea:a3:e7:25:a3:de:19:23:a2:5a:2a:b6:56:
+ * 04:bc:65:ba:7c:0a:f4:91:10:22:88:3f:9d:be:58:
+ * 43:4c:2e:ad:db:d6:32:cf:8e:b5:05:55:39:8b:e1:
+ * 01
* prime1:
- * 00:e7:35:00:62:17:66:a2:7c:48:3a:cd:b2:4e:38:
- * 2e:e1:7b:90:87:01:d9:05:c5:2c:56:54:55:47:2f:
- * a1:1f:5d:fa:9d:2d:59:14:a2:13:1b:81:9b:fe:5f:
- * 1c:88:79:4d:9b:88:e1:31:4a:0e:3d:29:db:37:14:
- * e2:a0:4d:ab:b5
+ * 00:f1:da:c2:8a:e5:66:45:8a:14:fc:08:6e:fb:aa:
+ * 50:d2:8c:b1:c4:f4:88:26:d4:b8:c4:63:30:ca:e3:
+ * 0c:6c:50:d4:93:5c:1c:13:37:60:21:11:3b:d1:f1:
+ * 9f:4c:0d:7b:0e:53:3d:c9:a4:fb:fa:6b:9e:b4:0a:
+ * 5d:d3:50:88:d7:be:c3:88:b2:b1:8a:6e:7b:d6:70:
+ * 88:96:a4:fe:90:ef:d1:84:ad:a8:9e:9f:3a:68:3f:
+ * 3f:82:07:be:c2:44:1e:d5:a1:a9:1a:db:39:d7:7f:
+ * 0c:6e:35:5b:1d:33:1b:a9:cd:38:2a:64:d1:70:2a:
+ * fe:b9:c2:b6:ed:59:19:73:b1
* prime2:
- * 00:d0:17:75:85:a8:fa:42:e0:a8:f0:8d:00:5e:6d:
- * 96:3b:e3:0c:4d:93:13:be:d1:c3:fd:b1:a3:28:d3:
- * 3e:7d:3e:08:f2:b2:98:9d:04:57:d5:a7:07:76:a4:
- * bd:5f:1d:ab:34:9a:99:82:43:26:a4:44:88:74:f4:
- * 76:7d:ce:32:8f
+ * 00:d8:b9:3a:38:6c:79:cd:0b:1f:2b:34:74:bf:7a:
+ * 3d:0c:21:5a:a6:ea:f2:9e:de:68:42:05:7f:ea:a5:
+ * 00:c9:10:f8:fd:c5:05:8d:03:45:5d:4f:6f:fa:6e:
+ * 9d:ef:ad:8a:ec:83:d4:ed:57:f3:86:73:15:2f:d2:
+ * 67:70:d1:62:ef:1d:25:08:59:47:20:62:47:16:35:
+ * e1:57:38:bf:39:dd:fc:b9:c8:d8:23:53:e2:02:7d:
+ * 22:31:4c:66:72:96:df:d8:7c:01:2c:71:00:89:18:
+ * e9:8c:08:44:8c:64:1f:93:9b:7a:97:26:c9:50:d0:
+ * 87:b2:48:a8:19:71:e1:b3:ff
* exponent1:
- * 2c:57:8c:e8:43:26:aa:f8:fc:fd:52:1f:e5:42:7f:
- * 33:3d:78:7d:7c:0c:3c:40:11:7d:c9:14:c5:df:4b:
- * 9e:71:6e:b4:20:53:5a:52:af:29:72:55:11:96:fa:
- * 28:ee:62:c4:f6:9e:81:ce:7b:26:9d:d5:6e:1d:f2:
- * 4c:de:38:95
+ * 23:98:dd:35:70:5a:43:35:f5:ac:ba:d9:0a:f5:a0:
+ * 7b:bc:f5:95:55:a0:8c:86:96:c3:61:0e:17:6e:9f:
+ * af:79:9e:30:2a:48:7f:93:90:f4:8d:02:ce:fd:cf:
+ * 42:74:61:7e:54:46:2d:dd:b8:b0:bd:12:58:d1:85:
+ * c9:ca:7a:b9:b6:7c:35:2c:87:f1:26:1d:d8:0c:2c:
+ * 2e:70:0e:7f:ea:ac:5d:e8:e9:7e:9f:55:0b:6e:f3:
+ * bc:01:c3:d3:f8:0e:c9:c6:c7:8b:0a:65:53:10:82:
+ * 15:de:88:90:9d:ab:1e:ac:f3:ed:59:75:72:1b:01:
+ * ee:f9:77:cf:2b:64:11:a1
* exponent2:
- * 0c:3f:f5:49:23:03:68:80:75:31:83:fb:6b:93:a3:
- * ee:6e:95:40:d3:d1:ab:c0:09:7b:9b:c3:71:19:ce:
- * 69:ed:06:f5:d2:91:ad:5c:9e:17:13:b8:1a:c1:e3:
- * eb:ff:81:1e:9d:a3:3f:c9:d8:32:7f:5e:51:14:3b:
- * 0d:78:df:fd
+ * 00:9e:29:6f:87:c6:02:8d:d5:54:05:df:de:63:ee:
+ * fd:a6:60:a1:1b:b7:d3:20:86:07:68:47:43:37:26:
+ * fc:0f:c0:c7:35:cc:17:64:f5:c2:25:7a:d7:a9:d8:
+ * 18:82:d6:0f:d0:d3:d5:0c:f1:66:d3:f4:20:be:29:
+ * bb:3b:e6:53:61:55:cf:b4:ec:12:b0:5b:88:ad:78:
+ * dc:df:1e:96:cf:d0:65:a3:e0:23:7c:84:b7:28:41:
+ * d2:36:50:1f:63:f9:1f:9b:89:c4:01:7e:e6:79:27:
+ * 29:29:fc:ce:a9:f6:57:e5:0d:4e:c6:08:94:5a:da:
+ * 14:6d:d4:00:79:b1:56:9a:59
* coefficient:
- * 01:0c:cc:95:69:ca:19:23:bc:a7:24:c3:b6:74:31:
- * de:14:4c:a1:49:0e:12:19:8d:ab:86:d0:84:b9:18:
- * aa:d9:d8:15:ca:a9:51:0d:aa:32:35:be:36:23:56:
- * 93:91:e7:4e:b3:12:dc:bf:44:74:9a:1b:31:4c:da:
- * 35:92:f2:e3
+ * 6c:73:0d:fe:c7:22:15:5d:8c:a1:91:2b:d1:88:e8:
+ * 91:f9:d0:3e:d0:ba:c4:74:88:ce:14:20:4e:1e:4b:
+ * c5:91:8f:c1:56:e9:74:e0:f6:cf:71:91:ed:2c:f5:
+ * 90:9d:d6:c8:cd:f5:79:dc:6e:b3:83:3e:fa:d6:b4:
+ * 60:d9:3a:52:12:76:9d:92:fb:db:26:ee:43:33:c4:
+ * 0b:84:74:1b:91:e0:41:8b:cc:cc:24:da:52:af:2d:
+ * 42:e7:11:57:0d:aa:66:af:1a:ba:c2:8e:6a:ee:8f:
+ * 2c:e6:5b:76:38:96:bb:7a:2f:59:fe:de:a1:02:fc:
+ * 12:3a:aa:9f:3c:0e:a4:78
+ * writing RSA key
+ * -----BEGIN PRIVATE KEY-----
+ * MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDMv5I8pld0H1it
+ * x2mIb1kyR1BgIuSYSQ4+Hbi64ju2cVv9ZAJtDVB3cm6oPV3UvR92Udya0NY+0DGl
+ * JFosvnf6iKH6BkHID0dwRySZUFJEWzBiW2U1xCiwXO7QG+s5KwuhrJZI2lZs4OPm
+ * 491Fy1EzjUBD1/CkMaq1wN9L3ysK7X4QDK4flqIQHmvQ+TeL3w0OAjX4WLxutVcO
+ * L+og5nOa5WuCcCW7UZp8neJQPc8eJD6SVc8qrQ2Ej6hDJM2tUGR0wnO24ZIcsiuM
+ * LXuWpkFhXBuPeChRQO1BkM4duCaBR2vjV0F0TiDwWhuXN5GGGcXybQTJeCtaFrz8
+ * K3Fb0ABPAgMBAAECggEAYrLWY7Yr4iZaMSs3jDVg4gPOkwk++Mn+u6LIMg5sin4K
+ * whM7uCX67BmVjjRGzw575CWCGn8hSBZEWD812OvYGkVTD5uEilQTM+SXl/BIN/td
+ * T4yPNWPh2WJzHI7YzS4a5Uy1BVl63/Fo6xxcxhBEjH1CxXGK5xuqFwNqoMBrl1AX
+ * rW5e2dtvPuk/NcNFvOg9WrS5P1OAZNwSJDU1vZi7jfoZo16erHBK/I2uVYtxgQ5N
+ * yC+HsET3T9yoyFC1lSRjdBNUWN784HXr9AZYgxJMVsTEGAzqo+clo94ZI6JaKrZW
+ * BLxlunwK9JEQIog/nb5YQ0wurdvWMs+OtQVVOYvhAQKBgQDx2sKK5WZFihT8CG77
+ * qlDSjLHE9Igm1LjEYzDK4wxsUNSTXBwTN2AhETvR8Z9MDXsOUz3JpPv6a560Cl3T
+ * UIjXvsOIsrGKbnvWcIiWpP6Q79GEraienzpoPz+CB77CRB7Voaka2znXfwxuNVsd
+ * MxupzTgqZNFwKv65wrbtWRlzsQKBgQDYuTo4bHnNCx8rNHS/ej0MIVqm6vKe3mhC
+ * BX/qpQDJEPj9xQWNA0VdT2/6bp3vrYrsg9TtV/OGcxUv0mdw0WLvHSUIWUcgYkcW
+ * NeFXOL853fy5yNgjU+ICfSIxTGZylt/YfAEscQCJGOmMCESMZB+Tm3qXJslQ0Iey
+ * SKgZceGz/wKBgCOY3TVwWkM19ay62Qr1oHu89ZVVoIyGlsNhDhdun695njAqSH+T
+ * kPSNAs79z0J0YX5URi3duLC9EljRhcnKerm2fDUsh/EmHdgMLC5wDn/qrF3o6X6f
+ * VQtu87wBw9P4DsnGx4sKZVMQghXeiJCdqx6s8+1ZdXIbAe75d88rZBGhAoGBAJ4p
+ * b4fGAo3VVAXf3mPu/aZgoRu30yCGB2hHQzcm/A/AxzXMF2T1wiV616nYGILWD9DT
+ * 1QzxZtP0IL4puzvmU2FVz7TsErBbiK143N8els/QZaPgI3yEtyhB0jZQH2P5H5uJ
+ * xAF+5nknKSn8zqn2V+UNTsYIlFraFG3UAHmxVppZAoGAbHMN/sciFV2MoZEr0Yjo
+ * kfnQPtC6xHSIzhQgTh5LxZGPwVbpdOD2z3GR7Sz1kJ3WyM31edxus4M++ta0YNk6
+ * UhJ2nZL72ybuQzPEC4R0G5HgQYvMzCTaUq8tQucRVw2qZq8ausKOau6PLOZbdjiW
+ * u3ovWf7eoQL8EjqqnzwOpHg=
+ * -----END PRIVATE KEY-----
*
* client certificate:
- * Data:
- * Version: 3 (0x2)
- * Serial Number: 9 (0x9)
- * Signature Algorithm: md5WithRSAEncryption
- * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
- * Validity
- * Not Before: Dec 8 03:43:24 2008 GMT
- * Not After : Aug 25 03:43:24 2028 GMT
- * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Client, CN=localhost
- * Subject Public Key Info:
- * Public Key Algorithm: rsaEncryption
- * RSA Public Key: (1024 bit)
- * Modulus (1024 bit):
- * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69:
- * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f:
- * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7:
- * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21:
- * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41:
- * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10:
- * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9:
- * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba:
- * 75:8d:f5:82:ac:43:92:44:1b
- * Exponent: 65537 (0x10001)
- * X509v3 extensions:
- * X509v3 Basic Constraints:
- * CA:FALSE
- * X509v3 Key Usage:
- * Digital Signature, Non Repudiation, Key Encipherment
- * X509v3 Subject Key Identifier:
- * CD:BB:C8:85:AA:91:BD:FD:1D:BE:CD:67:7C:FF:B3:E9:4C:A8:22:E6
- * X509v3 Authority Key Identifier:
- * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
- *
- * X509v3 Subject Alternative Name: critical
- * DNS:localhost
- * Signature Algorithm: md5WithRSAEncryption
- *
+ * Data:
+ * Version: 3 (0x2)
+ * Serial Number: 1500699355 (0x5972dadb)
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org
+ * Validity
+ * Not Before: Jul 1 04:16:52 2024 GMT
+ * Not After : Jul 2 04:16:52 2034 GMT
+ * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, CN=localhost ou=SSL-Client
+ * Subject Public Key Info:
+ * Public Key Algorithm: rsaEncryption
+ * Public-Key: (2048 bit)
+ * Modulus:
+ * 00:cc:bf:92:3c:a6:57:74:1f:58:ad:c7:69:88:6f:
+ * 59:32:47:50:60:22:e4:98:49:0e:3e:1d:b8:ba:e2:
+ * 3b:b6:71:5b:fd:64:02:6d:0d:50:77:72:6e:a8:3d:
+ * 5d:d4:bd:1f:76:51:dc:9a:d0:d6:3e:d0:31:a5:24:
+ * 5a:2c:be:77:fa:88:a1:fa:06:41:c8:0f:47:70:47:
+ * 24:99:50:52:44:5b:30:62:5b:65:35:c4:28:b0:5c:
+ * ee:d0:1b:eb:39:2b:0b:a1:ac:96:48:da:56:6c:e0:
+ * e3:e6:e3:dd:45:cb:51:33:8d:40:43:d7:f0:a4:31:
+ * aa:b5:c0:df:4b:df:2b:0a:ed:7e:10:0c:ae:1f:96:
+ * a2:10:1e:6b:d0:f9:37:8b:df:0d:0e:02:35:f8:58:
+ * bc:6e:b5:57:0e:2f:ea:20:e6:73:9a:e5:6b:82:70:
+ * 25:bb:51:9a:7c:9d:e2:50:3d:cf:1e:24:3e:92:55:
+ * cf:2a:ad:0d:84:8f:a8:43:24:cd:ad:50:64:74:c2:
+ * 73:b6:e1:92:1c:b2:2b:8c:2d:7b:96:a6:41:61:5c:
+ * 1b:8f:78:28:51:40:ed:41:90:ce:1d:b8:26:81:47:
+ * 6b:e3:57:41:74:4e:20:f0:5a:1b:97:37:91:86:19:
+ * c5:f2:6d:04:c9:78:2b:5a:16:bc:fc:2b:71:5b:d0:
+ * 00:4f
+ * Exponent: 65537 (0x10001)
+ * X509v3 extensions:
+ * X509v3 Subject Key Identifier:
+ * CD:45:E2:05:92:88:A3:C7:49:28:E7:D3:37:B7:13:92:FB:B1:36:C4
+ * X509v3 Key Usage:
+ * Digital Signature, Non Repudiation, Key Encipherment
+ * X509v3 Subject Alternative Name: critical
+ * DNS:localhost
+ * X509v3 Basic Constraints:
+ * CA:FALSE
+ * X509v3 Authority Key Identifier:
+ * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Signature Value:
+ * 23:6e:e9:5d:80:0d:b3:86:c9:cd:17:81:33:bd:5b:aa:c0:65:
+ * 4c:6b:9f:fa:ee:32:e9:89:e1:d0:c7:1d:5c:43:7e:94:ac:83:
+ * af:91:90:4c:26:61:8d:fe:6b:1a:aa:6e:61:39:b3:24:4a:dc:
+ * 92:c8:ca:f2:80:b0:05:41:0c:b3:dd:ed:b7:81:42:9a:1e:4e:
+ * f2:80:6c:72:62:8b:bd:d4:cd:23:7d:7c:e8:6f:e3:67:89:6a:
+ * 79:19:dd:f6:57:62:12:fa:eb:cd:66:c3:d2:d8:40:5a:1c:dd:
+ * 7f:9f:b2:34:e9:2a:d6:14:52:ba:6e:a8:9b:0d:a9:a1:03:bf:
+ * c4:0d:92:3d:59:e4:a9:8e:20:41:39:99:81:70:9d:d0:68:98:
+ * fc:5f:49:4a:92:e5:a2:c1:51:61:f6:1e:49:56:0b:b6:8c:57:
+ * db:08:2a:f0:a3:04:dc:a1:04:a2:5c:d0:90:4f:13:8d:1c:e6:
+ * 2e:7a:63:9c:32:40:65:59:04:5d:71:90:5a:a8:db:6a:30:42:
+ * 57:5b:0b:df:ce:a1:1f:fa:23:71:f3:57:12:c4:1c:66:3b:37:
+ * 77:32:28:a7:fb:ad:ee:86:51:4c:80:2f:dd:c8:5b:9f:a7:15:
+ * 07:fa:2b:5a:ee:93:00:5f:a6:43:22:1b:40:52:15:66:01:84:
+ * 32:9e:71:21
* -----BEGIN CERTIFICATE-----
- * MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET
- * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK
- * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ
- * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp
- * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD
- * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas
- * JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV
- * 8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq
- * ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw
- * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV
- * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh
- * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F
- * HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj
- * XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN
- * cl/epUcHL7E=
+ * MIIDpTCCAo2gAwIBAgIEWXLa2zANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV
+ * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD
+ * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTJaFw0zNDA3MDIwNDE2NTJaMGsx
+ * CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l
+ * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9
+ * U1NMLUNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy/kjym
+ * V3QfWK3HaYhvWTJHUGAi5JhJDj4duLriO7ZxW/1kAm0NUHdybqg9XdS9H3ZR3JrQ
+ * 1j7QMaUkWiy+d/qIofoGQcgPR3BHJJlQUkRbMGJbZTXEKLBc7tAb6zkrC6Gslkja
+ * Vmzg4+bj3UXLUTONQEPX8KQxqrXA30vfKwrtfhAMrh+WohAea9D5N4vfDQ4CNfhY
+ * vG61Vw4v6iDmc5rla4JwJbtRmnyd4lA9zx4kPpJVzyqtDYSPqEMkza1QZHTCc7bh
+ * khyyK4wte5amQWFcG494KFFA7UGQzh24JoFHa+NXQXROIPBaG5c3kYYZxfJtBMl4
+ * K1oWvPwrcVvQAE8CAwEAAaNzMHEwHQYDVR0OBBYEFM1F4gWSiKPHSSjn0ze3E5L7
+ * sTbEMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T
+ * BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B
+ * AQUFAAOCAQEAI27pXYANs4bJzReBM71bqsBlTGuf+u4y6Ynh0McdXEN+lKyDr5GQ
+ * TCZhjf5rGqpuYTmzJErcksjK8oCwBUEMs93tt4FCmh5O8oBscmKLvdTNI3186G/j
+ * Z4lqeRnd9ldiEvrrzWbD0thAWhzdf5+yNOkq1hRSum6omw2poQO/xA2SPVnkqY4g
+ * QTmZgXCd0GiY/F9JSpLlosFRYfYeSVYLtoxX2wgq8KME3KEEolzQkE8TjRzmLnpj
+ * nDJAZVkEXXGQWqjbajBCV1sL386hH/ojcfNXEsQcZjs3dzIop/ut7oZRTIAv3chb
+ * n6cVB/orWu6TAF+mQyIbQFIVZgGEMp5xIQ==
* -----END CERTIFICATE-----
*
*
- *
* Trusted CA certificate:
* Certificate:
* Data:
- * Version: 3 (0x2)
- * Serial Number: 0 (0x0)
- * Signature Algorithm: md5WithRSAEncryption
- * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
- * Validity
- * Not Before: Dec 8 02:43:36 2008 GMT
- * Not After : Aug 25 02:43:36 2028 GMT
- * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org
- * Subject Public Key Info:
- * Public Key Algorithm: rsaEncryption
- * RSA Public Key: (1024 bit)
- * Modulus (1024 bit):
- * 00:cb:c4:38:20:07:be:88:a7:93:b0:a1:43:51:2d:
- * d7:8e:85:af:54:dd:ad:a2:7b:23:5b:cf:99:13:53:
- * 99:45:7d:ee:6d:ba:2d:bf:e3:ad:6e:3d:9f:1a:f9:
- * 03:97:e0:17:55:ae:11:26:57:de:01:29:8e:05:3f:
- * 21:f7:e7:36:e8:2e:37:d7:48:ac:53:d6:60:0e:c7:
- * 50:6d:f6:c5:85:f7:8b:a6:c5:91:35:72:3c:94:ee:
- * f1:17:f0:71:e3:ec:1b:ce:ca:4e:40:42:b0:6d:ee:
- * 6a:0e:d6:e5:ad:3c:0f:c9:ba:82:4f:78:f8:89:97:
- * 89:2a:95:12:4c:d8:09:2a:e9
- * Exponent: 65537 (0x10001)
- * X509v3 extensions:
- * X509v3 Subject Key Identifier:
- * FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
- * X509v3 Authority Key Identifier:
- * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
- * DirName:/C=US/ST=Some-State/L=Some-City/O=Some-Org
- * serial:00
- *
- * X509v3 Basic Constraints:
- * CA:TRUE
- * Signature Algorithm: md5WithRSAEncryption
- *
+ * Version: 3 (0x2)
+ * Serial Number: 1539881479 (0x5bc8ba07)
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org
+ * Validity
+ * Not Before: Jul 1 04:16:50 2024 GMT
+ * Not After : Jul 2 04:16:50 2034 GMT
+ * Subject: C=Us, ST=Some-State, L=Some-City, O=Some-Org
+ * Subject Public Key Info:
+ * Public Key Algorithm: rsaEncryption
+ * Public-Key: (2048 bit)
+ * Modulus:
+ * 00:bc:a6:55:60:3f:17:74:39:ba:71:8c:ef:11:3f:
+ * 9d:36:47:d5:02:d1:4d:9d:7e:b8:fe:59:b1:2b:f1:
+ * b7:b0:0c:31:57:eb:9c:9d:13:f5:4c:5f:fc:c4:9e:
+ * f9:75:09:0f:96:8f:05:77:30:a8:35:48:71:96:e4:
+ * a5:7d:1a:81:fb:e6:bf:90:80:60:5d:11:20:54:16:
+ * 0b:6d:df:64:de:18:d5:98:51:38:9d:c9:d6:5f:de:
+ * 9d:de:fe:a8:5f:d3:25:3d:ad:f3:2b:45:c8:4a:80:
+ * 97:14:7b:85:9d:cf:59:08:bb:c7:67:ac:8b:29:f3:
+ * 1e:93:bf:fb:82:53:c5:ae:b4:bc:55:30:15:a8:7e:
+ * 3f:82:22:59:43:cc:d2:62:e7:65:67:72:ec:10:8a:
+ * fc:05:90:91:72:dd:e9:6f:e2:9f:0c:ab:a1:83:55:
+ * 02:23:b7:a3:c3:50:ab:be:0b:bb:51:75:50:d1:a8:
+ * c9:e5:f5:06:fe:00:09:a6:1b:8a:16:29:0d:ab:00:
+ * 3e:bc:d2:73:d9:37:d7:d9:9a:58:6e:2d:2a:f6:76:
+ * ae:f4:ea:6d:70:de:7f:e3:04:43:c0:4f:91:3f:78:
+ * 58:d7:c2:ad:74:eb:04:9d:d0:7e:82:b8:7a:97:44:
+ * 61:fa:41:45:a6:ca:7d:a5:2e:fc:f9:a6:cf:61:cd:
+ * 75:bf
+ * Exponent: 65537 (0x10001)
+ * X509v3 extensions:
+ * X509v3 Subject Key Identifier:
+ * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40
+ * X509v3 Basic Constraints: critical
+ * CA:TRUE
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Signature Value:
+ * 1f:89:34:e3:ee:05:33:3b:18:ca:96:13:3d:ad:cd:5a:e6:24:
+ * 46:94:36:ad:37:a5:36:a9:92:37:f9:ed:07:dd:44:5b:c9:2e:
+ * 68:f7:82:f3:58:1c:64:ed:64:d0:ad:eb:30:15:e0:04:3a:d7:
+ * c8:c7:9d:65:76:ae:84:e4:2e:2d:0d:68:09:0d:e5:ae:cc:a7:
+ * 54:86:ad:ff:00:95:85:01:49:db:5b:8e:c2:6f:e7:19:10:17:
+ * f7:03:b9:a8:97:21:a2:fc:7f:c0:e0:7a:12:64:b8:70:f5:e8:
+ * b6:e1:25:f7:eb:32:3e:46:ce:43:55:fc:0b:62:59:90:61:63:
+ * f9:94:6c:95:63:31:1b:00:59:1f:72:9d:d0:0b:4f:cd:02:eb:
+ * de:20:4e:60:48:4e:ea:ad:3c:0f:1d:bf:1a:69:3d:a8:3d:8b:
+ * f5:a2:ae:8c:4f:d7:0e:b3:e1:9b:b3:2c:89:19:18:da:db:e1:
+ * 6d:d5:ab:c8:b8:48:57:d8:8b:33:01:d4:97:91:d9:da:34:a1:
+ * ef:36:00:e1:38:19:34:8f:0d:47:af:57:cf:59:d6:8b:0d:9e:
+ * 89:05:82:3d:3c:f3:45:1d:4a:3f:0e:0f:5a:28:6f:5c:e1:e9:
+ * 60:72:87:28:b6:97:44:8b:d7:c6:cd:cb:dc:5a:5d:60:f1:b4:
+ * 37:ee:44:db
* -----BEGIN CERTIFICATE-----
- * MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET
- * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK
- * EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ
- * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp
- * dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
- * gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX
- * 4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj
- * 7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G
- * A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ
- * hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt
- * U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw
- * DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA
- * ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ
- * LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P
- * 6Mvf0r1PNTY2hwTJLJmKtg==
- * -----END CERTIFICATE---
+ * MIIDQjCCAiqgAwIBAgIEW8i6BzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV
+ * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD
+ * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTBaFw0zNDA3MDIwNDE2NTBaMEkx
+ * CzAJBgNVBAYTAlVzMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l
+ * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
+ * MIIBCgKCAQEAvKZVYD8XdDm6cYzvET+dNkfVAtFNnX64/lmxK/G3sAwxV+ucnRP1
+ * TF/8xJ75dQkPlo8FdzCoNUhxluSlfRqB++a/kIBgXREgVBYLbd9k3hjVmFE4ncnW
+ * X96d3v6oX9MlPa3zK0XISoCXFHuFnc9ZCLvHZ6yLKfMek7/7glPFrrS8VTAVqH4/
+ * giJZQ8zSYudlZ3LsEIr8BZCRct3pb+KfDKuhg1UCI7ejw1Crvgu7UXVQ0ajJ5fUG
+ * /gAJphuKFikNqwA+vNJz2TfX2ZpYbi0q9nau9OptcN5/4wRDwE+RP3hY18KtdOsE
+ * ndB+grh6l0Rh+kFFpsp9pS78+abPYc11vwIDAQABozIwMDAdBgNVHQ4EFgQU4AOQ
+ * 9k+7V+Z+r1yUJbOF2hYKUUAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUF
+ * AAOCAQEAH4k04+4FMzsYypYTPa3NWuYkRpQ2rTelNqmSN/ntB91EW8kuaPeC81gc
+ * ZO1k0K3rMBXgBDrXyMedZXauhOQuLQ1oCQ3lrsynVIat/wCVhQFJ21uOwm/nGRAX
+ * 9wO5qJchovx/wOB6EmS4cPXotuEl9+syPkbOQ1X8C2JZkGFj+ZRslWMxGwBZH3Kd
+ * 0AtPzQLr3iBOYEhO6q08Dx2/Gmk9qD2L9aKujE/XDrPhm7MsiRkY2tvhbdWryLhI
+ * V9iLMwHUl5HZ2jSh7zYA4TgZNI8NR69Xz1nWiw2eiQWCPTzzRR1KPw4PWihvXOHp
+ * YHKHKLaXRIvXxs3L3FpdYPG0N+5E2w==
+ *
*/
@@ -427,201 +568,342 @@ public class PKIXExtendedTM {
*/
static String trusedCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
- "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
- "EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ\n" +
- "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
- "dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" +
- "gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX\n" +
- "4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj\n" +
- "7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G\n" +
- "A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ\n" +
- "hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt\n" +
- "U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw\n" +
- "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA\n" +
- "ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ\n" +
- "LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P\n" +
- "6Mvf0r1PNTY2hwTJLJmKtg==\n" +
+ "MIIDQjCCAiqgAwIBAgIEW8i6BzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" +
+ "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" +
+ "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTBaFw0zNDA3MDIwNDE2NTBaMEkx\n" +
+ "CzAJBgNVBAYTAlVzMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" +
+ "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n" +
+ "MIIBCgKCAQEAvKZVYD8XdDm6cYzvET+dNkfVAtFNnX64/lmxK/G3sAwxV+ucnRP1\n" +
+ "TF/8xJ75dQkPlo8FdzCoNUhxluSlfRqB++a/kIBgXREgVBYLbd9k3hjVmFE4ncnW\n" +
+ "X96d3v6oX9MlPa3zK0XISoCXFHuFnc9ZCLvHZ6yLKfMek7/7glPFrrS8VTAVqH4/\n" +
+ "giJZQ8zSYudlZ3LsEIr8BZCRct3pb+KfDKuhg1UCI7ejw1Crvgu7UXVQ0ajJ5fUG\n" +
+ "/gAJphuKFikNqwA+vNJz2TfX2ZpYbi0q9nau9OptcN5/4wRDwE+RP3hY18KtdOsE\n" +
+ "ndB+grh6l0Rh+kFFpsp9pS78+abPYc11vwIDAQABozIwMDAdBgNVHQ4EFgQU4AOQ\n" +
+ "9k+7V+Z+r1yUJbOF2hYKUUAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUF\n" +
+ "AAOCAQEAH4k04+4FMzsYypYTPa3NWuYkRpQ2rTelNqmSN/ntB91EW8kuaPeC81gc\n" +
+ "ZO1k0K3rMBXgBDrXyMedZXauhOQuLQ1oCQ3lrsynVIat/wCVhQFJ21uOwm/nGRAX\n" +
+ "9wO5qJchovx/wOB6EmS4cPXotuEl9+syPkbOQ1X8C2JZkGFj+ZRslWMxGwBZH3Kd\n" +
+ "0AtPzQLr3iBOYEhO6q08Dx2/Gmk9qD2L9aKujE/XDrPhm7MsiRkY2tvhbdWryLhI\n" +
+ "V9iLMwHUl5HZ2jSh7zYA4TgZNI8NR69Xz1nWiw2eiQWCPTzzRR1KPw4PWihvXOHp\n" +
+ "YHKHKLaXRIvXxs3L3FpdYPG0N+5E2w==\n" +
"-----END CERTIFICATE-----";
static String serverCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
- "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
- "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ\n" +
- "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
- "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD\n" +
- "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3\n" +
- "ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6\n" +
- "YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS\n" +
- "7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" +
- "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV\n" +
- "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" +
- "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac\n" +
- "PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi\n" +
- "nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn\n" +
- "JqCpf5uZGOo=\n" +
+ "MIIDpTCCAo2gAwIBAgIEBlY/nzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" +
+ "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" +
+ "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTVaFw0zNDA3MDIwNDE2NTVaMGsx\n" +
+ "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" +
+ "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9\n" +
+ "U1NMLVNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoM4I+o\n" +
+ "An5a7+2yQq0ITpG6wq2bedebD/3S+BUvGYmAEAACGW0nwpDXpSNTdG5kKHwkqu3q\n" +
+ "IVnco1y1yUIxT6Le+wl8c+2IBDTxFa09YM3KxROZ05+bspJwy7pLPSCWrb6SU+1U\n" +
+ "O8UUvc/UD8sFT/0rnuBQu2UTksDWvU0CDHC2ZdR9tE3D3ywIntI+aTJGb2/K0XOk\n" +
+ "lAfvFOPani/ArA4QM0xoefN5QNbpPMLmcOCJzqB6qIQohTI3CLDPsX9fvB+lPe/W\n" +
+ "aKgXIV+H1Uu1zO54jd2xKGrA+2S9t3ACMwMLuLi7CIL2jgUn0TvmxaxNhVuhHaNI\n" +
+ "XQMVdmNscSE+mM0CAwEAAaNzMHEwHQYDVR0OBBYEFFyvRLFIuFmaZFOdLqayCdMK\n" +
+ "kgSDMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T\n" +
+ "BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B\n" +
+ "AQUFAAOCAQEAnSJJX1Yj5oA1zKtEHCe9yY2Jk0lY6MF6aN3PveASdgZUzS9im1SE\n" +
+ "8ruQoLs34hMd899BquD+wO9GeI2q9BtwrakWJPoVSsYKjeGZkwCp1LYIXY5lA9zQ\n" +
+ "lfyVYaattatNpuAFSIzbQkKK1l7AKqARFbgHaVw/maC9U2XbTs9GYZMJe4FA/1z+\n" +
+ "TOv0rN4fOK2yYCj2Dp9G5wePIJqk4Y+rVJl2gtiecMTamIVxrztU5AG0noPQe8aN\n" +
+ "H+0lCIkF6YeXdlqjhcP4Wde7O1rby+1d/6whuZriZQq83tHcU5SYRJeRsxtrgAub\n" +
+ "V7OuXHw1yjlx906PStfrCyXash4XSLjrCQ==\n" +
"-----END CERTIFICATE-----";
static String clientCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
- "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
- "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ\n" +
- "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
- "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD\n" +
- "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas\n" +
- "JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV\n" +
- "8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq\n" +
- "ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" +
- "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV\n" +
- "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" +
- "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F\n" +
- "HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj\n" +
- "XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN\n" +
- "cl/epUcHL7E=\n" +
+ "MIIDpTCCAo2gAwIBAgIEWXLa2zANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" +
+ "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" +
+ "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTJaFw0zNDA3MDIwNDE2NTJaMGsx\n" +
+ "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" +
+ "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9\n" +
+ "U1NMLUNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy/kjym\n" +
+ "V3QfWK3HaYhvWTJHUGAi5JhJDj4duLriO7ZxW/1kAm0NUHdybqg9XdS9H3ZR3JrQ\n" +
+ "1j7QMaUkWiy+d/qIofoGQcgPR3BHJJlQUkRbMGJbZTXEKLBc7tAb6zkrC6Gslkja\n" +
+ "Vmzg4+bj3UXLUTONQEPX8KQxqrXA30vfKwrtfhAMrh+WohAea9D5N4vfDQ4CNfhY\n" +
+ "vG61Vw4v6iDmc5rla4JwJbtRmnyd4lA9zx4kPpJVzyqtDYSPqEMkza1QZHTCc7bh\n" +
+ "khyyK4wte5amQWFcG494KFFA7UGQzh24JoFHa+NXQXROIPBaG5c3kYYZxfJtBMl4\n" +
+ "K1oWvPwrcVvQAE8CAwEAAaNzMHEwHQYDVR0OBBYEFM1F4gWSiKPHSSjn0ze3E5L7\n" +
+ "sTbEMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T\n" +
+ "BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B\n" +
+ "AQUFAAOCAQEAI27pXYANs4bJzReBM71bqsBlTGuf+u4y6Ynh0McdXEN+lKyDr5GQ\n" +
+ "TCZhjf5rGqpuYTmzJErcksjK8oCwBUEMs93tt4FCmh5O8oBscmKLvdTNI3186G/j\n" +
+ "Z4lqeRnd9ldiEvrrzWbD0thAWhzdf5+yNOkq1hRSum6omw2poQO/xA2SPVnkqY4g\n" +
+ "QTmZgXCd0GiY/F9JSpLlosFRYfYeSVYLtoxX2wgq8KME3KEEolzQkE8TjRzmLnpj\n" +
+ "nDJAZVkEXXGQWqjbajBCV1sL386hH/ojcfNXEsQcZjs3dzIop/ut7oZRTIAv3chb\n" +
+ "n6cVB/orWu6TAF+mQyIbQFIVZgGEMp5xIQ==\n" +
"-----END CERTIFICATE-----";
static byte serverPrivateExponent[] = {
- (byte)0x6e, (byte)0xa7, (byte)0x1b, (byte)0x83,
- (byte)0x51, (byte)0x35, (byte)0x9a, (byte)0x44,
- (byte)0x7d, (byte)0xf6, (byte)0xe3, (byte)0x89,
- (byte)0xa0, (byte)0xd7, (byte)0x90, (byte)0x60,
- (byte)0xa1, (byte)0x4e, (byte)0x27, (byte)0x21,
- (byte)0xa2, (byte)0x89, (byte)0x74, (byte)0xcc,
- (byte)0x9d, (byte)0x75, (byte)0x75, (byte)0x4e,
- (byte)0xc7, (byte)0x82, (byte)0xe3, (byte)0xe3,
- (byte)0xc3, (byte)0x7d, (byte)0x00, (byte)0x54,
- (byte)0xec, (byte)0x36, (byte)0xb1, (byte)0xdf,
- (byte)0x91, (byte)0x9c, (byte)0x7a, (byte)0xc0,
- (byte)0x62, (byte)0x0a, (byte)0xd6, (byte)0xa9,
- (byte)0x22, (byte)0x91, (byte)0x4a, (byte)0x29,
- (byte)0x2e, (byte)0x43, (byte)0xfa, (byte)0x8c,
- (byte)0xd8, (byte)0xe9, (byte)0xbe, (byte)0xd9,
- (byte)0x4f, (byte)0xca, (byte)0x23, (byte)0xc6,
- (byte)0xe4, (byte)0x3f, (byte)0xb8, (byte)0x72,
- (byte)0xcf, (byte)0x02, (byte)0xfc, (byte)0xf4,
- (byte)0x58, (byte)0x34, (byte)0x77, (byte)0x76,
- (byte)0xce, (byte)0x22, (byte)0x44, (byte)0x5f,
- (byte)0x2d, (byte)0xca, (byte)0xee, (byte)0xf5,
- (byte)0x43, (byte)0x56, (byte)0x47, (byte)0x71,
- (byte)0x0b, (byte)0x09, (byte)0x6b, (byte)0x5e,
- (byte)0xf2, (byte)0xc8, (byte)0xee, (byte)0xd4,
- (byte)0x6e, (byte)0x44, (byte)0x92, (byte)0x2a,
- (byte)0x7f, (byte)0xcc, (byte)0xa7, (byte)0xd4,
- (byte)0x5b, (byte)0xfb, (byte)0xf7, (byte)0x4a,
- (byte)0xa9, (byte)0xfb, (byte)0x54, (byte)0x18,
- (byte)0xd5, (byte)0xd5, (byte)0x14, (byte)0xba,
- (byte)0xa0, (byte)0x1c, (byte)0x13, (byte)0xb3,
- (byte)0x37, (byte)0x6b, (byte)0x37, (byte)0x59,
- (byte)0xed, (byte)0xdb, (byte)0x6d, (byte)0xb1
+ (byte)0x68, (byte)0x87, (byte)0x36, (byte)0x54,
+ (byte)0xa3, (byte)0xc6, (byte)0xd5, (byte)0x5f,
+ (byte)0xf5, (byte)0x0f, (byte)0x4f, (byte)0x76,
+ (byte)0xc8, (byte)0x9c, (byte)0x2b, (byte)0x5b,
+ (byte)0xdc, (byte)0xe2, (byte)0xbe, (byte)0x14,
+ (byte)0x12, (byte)0x2f, (byte)0xc7, (byte)0x0a,
+ (byte)0xa9, (byte)0xcb, (byte)0x5e, (byte)0x04,
+ (byte)0x59, (byte)0xca, (byte)0x35, (byte)0x2f,
+ (byte)0x8d, (byte)0x2b, (byte)0xc4, (byte)0x40,
+ (byte)0xe6, (byte)0x7d, (byte)0x25, (byte)0x1b,
+ (byte)0x4d, (byte)0x07, (byte)0xc3, (byte)0x99,
+ (byte)0x9c, (byte)0x16, (byte)0x4f, (byte)0xa5,
+ (byte)0xdc, (byte)0xde, (byte)0xb0, (byte)0x90,
+ (byte)0xf0, (byte)0xde, (byte)0x22, (byte)0x70,
+ (byte)0x80, (byte)0xf4, (byte)0xa6, (byte)0x70,
+ (byte)0xe2, (byte)0x96, (byte)0x3d, (byte)0x18,
+ (byte)0x21, (byte)0xbf, (byte)0x2b, (byte)0x27,
+ (byte)0xa4, (byte)0x2d, (byte)0xd7, (byte)0xae,
+ (byte)0x2b, (byte)0x12, (byte)0x2f, (byte)0x08,
+ (byte)0x36, (byte)0xee, (byte)0x99, (byte)0x94,
+ (byte)0xed, (byte)0xf6, (byte)0xa7, (byte)0xd9,
+ (byte)0x1d, (byte)0xa2, (byte)0xf3, (byte)0x1f,
+ (byte)0x44, (byte)0xa4, (byte)0x28, (byte)0x4b,
+ (byte)0x67, (byte)0x35, (byte)0xd6, (byte)0xa8,
+ (byte)0x1b, (byte)0xf8, (byte)0x84, (byte)0x34,
+ (byte)0x34, (byte)0x84, (byte)0xbd, (byte)0xec,
+ (byte)0x9e, (byte)0x03, (byte)0x08, (byte)0x3c,
+ (byte)0x93, (byte)0x20, (byte)0x8e, (byte)0xaf,
+ (byte)0x15, (byte)0xcb, (byte)0x1f, (byte)0x20,
+ (byte)0x08, (byte)0x97, (byte)0xc4, (byte)0x19,
+ (byte)0x3e, (byte)0xfa, (byte)0x36, (byte)0xc6,
+ (byte)0xab, (byte)0x0e, (byte)0x2f, (byte)0xe7,
+ (byte)0xb3, (byte)0xc0, (byte)0xa7, (byte)0xbc,
+ (byte)0xe4, (byte)0xe0, (byte)0xa6, (byte)0x08,
+ (byte)0x1c, (byte)0x69, (byte)0x20, (byte)0x4d,
+ (byte)0x78, (byte)0xbd, (byte)0x7a, (byte)0xe5,
+ (byte)0x25, (byte)0x48, (byte)0x60, (byte)0x9e,
+ (byte)0x2e, (byte)0x50, (byte)0x8d, (byte)0x36,
+ (byte)0x1e, (byte)0x07, (byte)0xe9, (byte)0xd5,
+ (byte)0x0d, (byte)0x39, (byte)0x67, (byte)0x41,
+ (byte)0x42, (byte)0x24, (byte)0xdb, (byte)0x87,
+ (byte)0xe5, (byte)0x77, (byte)0x76, (byte)0xfd,
+ (byte)0x5e, (byte)0xd5, (byte)0xc6, (byte)0xe5,
+ (byte)0xd3, (byte)0xb0, (byte)0x98, (byte)0x71,
+ (byte)0x48, (byte)0x69, (byte)0x47, (byte)0x4f,
+ (byte)0x46, (byte)0x05, (byte)0x0c, (byte)0x9e,
+ (byte)0x58, (byte)0x45, (byte)0x2e, (byte)0xe2,
+ (byte)0x27, (byte)0xd0, (byte)0xf6, (byte)0x11,
+ (byte)0x05, (byte)0x78, (byte)0xad, (byte)0x83,
+ (byte)0x5a, (byte)0x5b, (byte)0xec, (byte)0xd7,
+ (byte)0x2e, (byte)0x26, (byte)0x5a, (byte)0xa5,
+ (byte)0x4f, (byte)0x9e, (byte)0x52, (byte)0x84,
+ (byte)0x2c, (byte)0x1f, (byte)0x59, (byte)0x1a,
+ (byte)0x78, (byte)0x56, (byte)0x0a, (byte)0x44,
+ (byte)0x54, (byte)0xc6, (byte)0x37, (byte)0x64,
+ (byte)0x01, (byte)0xca, (byte)0xe4, (byte)0xa8,
+ (byte)0x01, (byte)0xc7, (byte)0x86, (byte)0xc1,
+ (byte)0xb4, (byte)0xd6, (byte)0x6c, (byte)0x7a,
+ (byte)0x15, (byte)0x9a, (byte)0x65, (byte)0x69,
+ (byte)0x46, (byte)0x9e, (byte)0xfd, (byte)0xf6,
+ (byte)0x08, (byte)0x17, (byte)0x0c, (byte)0x6c,
+ (byte)0xac, (byte)0x38, (byte)0xbd, (byte)0xc2,
+ (byte)0xcd, (byte)0xda, (byte)0xef, (byte)0x54,
+ (byte)0x7a, (byte)0x48, (byte)0x92, (byte)0x4d
};
static byte serverModulus[] = {
- (byte)0x00,
- (byte)0xa5, (byte)0xac, (byte)0x5b, (byte)0x1c,
- (byte)0x37, (byte)0xa2, (byte)0xdd, (byte)0x99,
- (byte)0x89, (byte)0x2d, (byte)0xb2, (byte)0x79,
- (byte)0xb8, (byte)0x8f, (byte)0xd5, (byte)0x48,
- (byte)0xa5, (byte)0xe7, (byte)0x1c, (byte)0x84,
- (byte)0x17, (byte)0x8d, (byte)0x69, (byte)0x9c,
- (byte)0xc6, (byte)0xac, (byte)0x6d, (byte)0xf9,
- (byte)0xf2, (byte)0x1d, (byte)0x1f, (byte)0x39,
- (byte)0x19, (byte)0xda, (byte)0xd3, (byte)0x72,
- (byte)0x1e, (byte)0x6e, (byte)0xec, (byte)0x44,
- (byte)0xcc, (byte)0x70, (byte)0xa4, (byte)0xdc,
- (byte)0xba, (byte)0x00, (byte)0x30, (byte)0xf6,
- (byte)0xa0, (byte)0x4f, (byte)0x3d, (byte)0x54,
- (byte)0x7a, (byte)0x61, (byte)0x6a, (byte)0xcc,
- (byte)0x57, (byte)0xd0, (byte)0x0a, (byte)0x7f,
- (byte)0x95, (byte)0x28, (byte)0x18, (byte)0x3f,
- (byte)0x9a, (byte)0xd9, (byte)0x94, (byte)0xf2,
- (byte)0x1b, (byte)0xc8, (byte)0x24, (byte)0x88,
- (byte)0x7e, (byte)0xfe, (byte)0x9d, (byte)0x0f,
- (byte)0x3d, (byte)0xfb, (byte)0x57, (byte)0x53,
- (byte)0x08, (byte)0xb3, (byte)0x20, (byte)0x33,
- (byte)0xd4, (byte)0x3f, (byte)0x17, (byte)0x47,
- (byte)0x14, (byte)0xd1, (byte)0xcd, (byte)0xea,
- (byte)0x08, (byte)0xd8, (byte)0x0e, (byte)0x75,
- (byte)0x4e, (byte)0xaf, (byte)0xbe, (byte)0xcc,
- (byte)0xd2, (byte)0xec, (byte)0xaf, (byte)0xa9,
- (byte)0x7a, (byte)0x49, (byte)0xdf, (byte)0xc2,
- (byte)0xd9, (byte)0xac, (byte)0xb8, (byte)0x24,
- (byte)0x40, (byte)0x90, (byte)0xa6, (byte)0x03,
- (byte)0x56, (byte)0x2a, (byte)0xd0, (byte)0x30,
- (byte)0x05, (byte)0x40, (byte)0x2c, (byte)0x4f,
- (byte)0xab, (byte)0xd9, (byte)0x74, (byte)0x89
+ (byte)0x00, (byte)0x9a, (byte)0x0c, (byte)0xe0,
+ (byte)0x8f, (byte)0xa8, (byte)0x02, (byte)0x7e,
+ (byte)0x5a, (byte)0xef, (byte)0xed, (byte)0xb2,
+ (byte)0x42, (byte)0xad, (byte)0x08, (byte)0x4e,
+ (byte)0x91, (byte)0xba, (byte)0xc2, (byte)0xad,
+ (byte)0x9b, (byte)0x79, (byte)0xd7, (byte)0x9b,
+ (byte)0x0f, (byte)0xfd, (byte)0xd2, (byte)0xf8,
+ (byte)0x15, (byte)0x2f, (byte)0x19, (byte)0x89,
+ (byte)0x80, (byte)0x10, (byte)0x00, (byte)0x02,
+ (byte)0x19, (byte)0x6d, (byte)0x27, (byte)0xc2,
+ (byte)0x90, (byte)0xd7, (byte)0xa5, (byte)0x23,
+ (byte)0x53, (byte)0x74, (byte)0x6e, (byte)0x64,
+ (byte)0x28, (byte)0x7c, (byte)0x24, (byte)0xaa,
+ (byte)0xed, (byte)0xea, (byte)0x21, (byte)0x59,
+ (byte)0xdc, (byte)0xa3, (byte)0x5c, (byte)0xb5,
+ (byte)0xc9, (byte)0x42, (byte)0x31, (byte)0x4f,
+ (byte)0xa2, (byte)0xde, (byte)0xfb, (byte)0x09,
+ (byte)0x7c, (byte)0x73, (byte)0xed, (byte)0x88,
+ (byte)0x04, (byte)0x34, (byte)0xf1, (byte)0x15,
+ (byte)0xad, (byte)0x3d, (byte)0x60, (byte)0xcd,
+ (byte)0xca, (byte)0xc5, (byte)0x13, (byte)0x99,
+ (byte)0xd3, (byte)0x9f, (byte)0x9b, (byte)0xb2,
+ (byte)0x92, (byte)0x70, (byte)0xcb, (byte)0xba,
+ (byte)0x4b, (byte)0x3d, (byte)0x20, (byte)0x96,
+ (byte)0xad, (byte)0xbe, (byte)0x92, (byte)0x53,
+ (byte)0xed, (byte)0x54, (byte)0x3b, (byte)0xc5,
+ (byte)0x14, (byte)0xbd, (byte)0xcf, (byte)0xd4,
+ (byte)0x0f, (byte)0xcb, (byte)0x05, (byte)0x4f,
+ (byte)0xfd, (byte)0x2b, (byte)0x9e, (byte)0xe0,
+ (byte)0x50, (byte)0xbb, (byte)0x65, (byte)0x13,
+ (byte)0x92, (byte)0xc0, (byte)0xd6, (byte)0xbd,
+ (byte)0x4d, (byte)0x02, (byte)0x0c, (byte)0x70,
+ (byte)0xb6, (byte)0x65, (byte)0xd4, (byte)0x7d,
+ (byte)0xb4, (byte)0x4d, (byte)0xc3, (byte)0xdf,
+ (byte)0x2c, (byte)0x08, (byte)0x9e, (byte)0xd2,
+ (byte)0x3e, (byte)0x69, (byte)0x32, (byte)0x46,
+ (byte)0x6f, (byte)0x6f, (byte)0xca, (byte)0xd1,
+ (byte)0x73, (byte)0xa4, (byte)0x94, (byte)0x07,
+ (byte)0xef, (byte)0x14, (byte)0xe3, (byte)0xda,
+ (byte)0x9e, (byte)0x2f, (byte)0xc0, (byte)0xac,
+ (byte)0x0e, (byte)0x10, (byte)0x33, (byte)0x4c,
+ (byte)0x68, (byte)0x79, (byte)0xf3, (byte)0x79,
+ (byte)0x40, (byte)0xd6, (byte)0xe9, (byte)0x3c,
+ (byte)0xc2, (byte)0xe6, (byte)0x70, (byte)0xe0,
+ (byte)0x89, (byte)0xce, (byte)0xa0, (byte)0x7a,
+ (byte)0xa8, (byte)0x84, (byte)0x28, (byte)0x85,
+ (byte)0x32, (byte)0x37, (byte)0x08, (byte)0xb0,
+ (byte)0xcf, (byte)0xb1, (byte)0x7f, (byte)0x5f,
+ (byte)0xbc, (byte)0x1f, (byte)0xa5, (byte)0x3d,
+ (byte)0xef, (byte)0xd6, (byte)0x68, (byte)0xa8,
+ (byte)0x17, (byte)0x21, (byte)0x5f, (byte)0x87,
+ (byte)0xd5, (byte)0x4b, (byte)0xb5, (byte)0xcc,
+ (byte)0xee, (byte)0x78, (byte)0x8d, (byte)0xdd,
+ (byte)0xb1, (byte)0x28, (byte)0x6a, (byte)0xc0,
+ (byte)0xfb, (byte)0x64, (byte)0xbd, (byte)0xb7,
+ (byte)0x70, (byte)0x02, (byte)0x33, (byte)0x03,
+ (byte)0x0b, (byte)0xb8, (byte)0xb8, (byte)0xbb,
+ (byte)0x08, (byte)0x82, (byte)0xf6, (byte)0x8e,
+ (byte)0x05, (byte)0x27, (byte)0xd1, (byte)0x3b,
+ (byte)0xe6, (byte)0xc5, (byte)0xac, (byte)0x4d,
+ (byte)0x85, (byte)0x5b, (byte)0xa1, (byte)0x1d,
+ (byte)0xa3, (byte)0x48, (byte)0x5d, (byte)0x03,
+ (byte)0x15, (byte)0x76, (byte)0x63, (byte)0x6c,
+ (byte)0x71, (byte)0x21, (byte)0x3e, (byte)0x98,
+ (byte)0xcd
};
static byte clientPrivateExponent[] = {
- (byte)0x11, (byte)0xb7, (byte)0x6a, (byte)0x36,
- (byte)0x3d, (byte)0x30, (byte)0x37, (byte)0xce,
- (byte)0x61, (byte)0x9d, (byte)0x6c, (byte)0x84,
- (byte)0x8b, (byte)0xf3, (byte)0x9b, (byte)0x25,
- (byte)0x4f, (byte)0x14, (byte)0xc8, (byte)0xa4,
- (byte)0xdd, (byte)0x2f, (byte)0xd7, (byte)0x9a,
- (byte)0x17, (byte)0xbd, (byte)0x90, (byte)0x19,
- (byte)0xf7, (byte)0x05, (byte)0xfd, (byte)0xf2,
- (byte)0xd2, (byte)0xc5, (byte)0xf7, (byte)0x77,
- (byte)0xbe, (byte)0xea, (byte)0xe2, (byte)0x84,
- (byte)0x87, (byte)0x97, (byte)0x3a, (byte)0x41,
- (byte)0x96, (byte)0xb6, (byte)0x99, (byte)0xf8,
- (byte)0x94, (byte)0x8c, (byte)0x58, (byte)0x71,
- (byte)0x51, (byte)0x8c, (byte)0xf4, (byte)0x2a,
- (byte)0x20, (byte)0x9e, (byte)0x1a, (byte)0xa0,
- (byte)0x26, (byte)0x99, (byte)0x75, (byte)0xd6,
- (byte)0x31, (byte)0x53, (byte)0x43, (byte)0x39,
- (byte)0xf5, (byte)0x2a, (byte)0xa6, (byte)0x7e,
- (byte)0x34, (byte)0x42, (byte)0x51, (byte)0x2a,
- (byte)0x40, (byte)0x87, (byte)0x03, (byte)0x88,
- (byte)0x43, (byte)0x69, (byte)0xb2, (byte)0x89,
- (byte)0x6d, (byte)0x20, (byte)0xbd, (byte)0x7d,
- (byte)0x71, (byte)0xef, (byte)0x47, (byte)0x0a,
- (byte)0xdf, (byte)0x06, (byte)0xc1, (byte)0x69,
- (byte)0x66, (byte)0xa8, (byte)0x22, (byte)0x37,
- (byte)0x1a, (byte)0x77, (byte)0x1e, (byte)0xc7,
- (byte)0x94, (byte)0x4e, (byte)0x2c, (byte)0x27,
- (byte)0x69, (byte)0x45, (byte)0x5e, (byte)0xc8,
- (byte)0xf8, (byte)0x0c, (byte)0xb7, (byte)0xf8,
- (byte)0xc0, (byte)0x8f, (byte)0x99, (byte)0xc1,
- (byte)0xe5, (byte)0x28, (byte)0x9b, (byte)0xf9,
- (byte)0x4c, (byte)0x94, (byte)0xc6, (byte)0xb1
+ (byte)0x62, (byte)0xb2, (byte)0xd6, (byte)0x63,
+ (byte)0xb6, (byte)0x2b, (byte)0xe2, (byte)0x26,
+ (byte)0x5a, (byte)0x31, (byte)0x2b, (byte)0x37,
+ (byte)0x8c, (byte)0x35, (byte)0x60, (byte)0xe2,
+ (byte)0x03, (byte)0xce, (byte)0x93, (byte)0x09,
+ (byte)0x3e, (byte)0xf8, (byte)0xc9, (byte)0xfe,
+ (byte)0xbb, (byte)0xa2, (byte)0xc8, (byte)0x32,
+ (byte)0x0e, (byte)0x6c, (byte)0x8a, (byte)0x7e,
+ (byte)0x0a, (byte)0xc2, (byte)0x13, (byte)0x3b,
+ (byte)0xb8, (byte)0x25, (byte)0xfa, (byte)0xec,
+ (byte)0x19, (byte)0x95, (byte)0x8e, (byte)0x34,
+ (byte)0x46, (byte)0xcf, (byte)0x0e, (byte)0x7b,
+ (byte)0xe4, (byte)0x25, (byte)0x82, (byte)0x1a,
+ (byte)0x7f, (byte)0x21, (byte)0x48, (byte)0x16,
+ (byte)0x44, (byte)0x58, (byte)0x3f, (byte)0x35,
+ (byte)0xd8, (byte)0xeb, (byte)0xd8, (byte)0x1a,
+ (byte)0x45, (byte)0x53, (byte)0x0f, (byte)0x9b,
+ (byte)0x84, (byte)0x8a, (byte)0x54, (byte)0x13,
+ (byte)0x33, (byte)0xe4, (byte)0x97, (byte)0x97,
+ (byte)0xf0, (byte)0x48, (byte)0x37, (byte)0xfb,
+ (byte)0x5d, (byte)0x4f, (byte)0x8c, (byte)0x8f,
+ (byte)0x35, (byte)0x63, (byte)0xe1, (byte)0xd9,
+ (byte)0x62, (byte)0x73, (byte)0x1c, (byte)0x8e,
+ (byte)0xd8, (byte)0xcd, (byte)0x2e, (byte)0x1a,
+ (byte)0xe5, (byte)0x4c, (byte)0xb5, (byte)0x05,
+ (byte)0x59, (byte)0x7a, (byte)0xdf, (byte)0xf1,
+ (byte)0x68, (byte)0xeb, (byte)0x1c, (byte)0x5c,
+ (byte)0xc6, (byte)0x10, (byte)0x44, (byte)0x8c,
+ (byte)0x7d, (byte)0x42, (byte)0xc5, (byte)0x71,
+ (byte)0x8a, (byte)0xe7, (byte)0x1b, (byte)0xaa,
+ (byte)0x17, (byte)0x03, (byte)0x6a, (byte)0xa0,
+ (byte)0xc0, (byte)0x6b, (byte)0x97, (byte)0x50,
+ (byte)0x17, (byte)0xad, (byte)0x6e, (byte)0x5e,
+ (byte)0xd9, (byte)0xdb, (byte)0x6f, (byte)0x3e,
+ (byte)0xe9, (byte)0x3f, (byte)0x35, (byte)0xc3,
+ (byte)0x45, (byte)0xbc, (byte)0xe8, (byte)0x3d,
+ (byte)0x5a, (byte)0xb4, (byte)0xb9, (byte)0x3f,
+ (byte)0x53, (byte)0x80, (byte)0x64, (byte)0xdc,
+ (byte)0x12, (byte)0x24, (byte)0x35, (byte)0x35,
+ (byte)0xbd, (byte)0x98, (byte)0xbb, (byte)0x8d,
+ (byte)0xfa, (byte)0x19, (byte)0xa3, (byte)0x5e,
+ (byte)0x9e, (byte)0xac, (byte)0x70, (byte)0x4a,
+ (byte)0xfc, (byte)0x8d, (byte)0xae, (byte)0x55,
+ (byte)0x8b, (byte)0x71, (byte)0x81, (byte)0x0e,
+ (byte)0x4d, (byte)0xc8, (byte)0x2f, (byte)0x87,
+ (byte)0xb0, (byte)0x44, (byte)0xf7, (byte)0x4f,
+ (byte)0xdc, (byte)0xa8, (byte)0xc8, (byte)0x50,
+ (byte)0xb5, (byte)0x95, (byte)0x24, (byte)0x63,
+ (byte)0x74, (byte)0x13, (byte)0x54, (byte)0x58,
+ (byte)0xde, (byte)0xfc, (byte)0xe0, (byte)0x75,
+ (byte)0xeb, (byte)0xf4, (byte)0x06, (byte)0x58,
+ (byte)0x83, (byte)0x12, (byte)0x4c, (byte)0x56,
+ (byte)0xc4, (byte)0xc4, (byte)0x18, (byte)0x0c,
+ (byte)0xea, (byte)0xa3, (byte)0xe7, (byte)0x25,
+ (byte)0xa3, (byte)0xde, (byte)0x19, (byte)0x23,
+ (byte)0xa2, (byte)0x5a, (byte)0x2a, (byte)0xb6,
+ (byte)0x56, (byte)0x04, (byte)0xbc, (byte)0x65,
+ (byte)0xba, (byte)0x7c, (byte)0x0a, (byte)0xf4,
+ (byte)0x91, (byte)0x10, (byte)0x22, (byte)0x88,
+ (byte)0x3f, (byte)0x9d, (byte)0xbe, (byte)0x58,
+ (byte)0x43, (byte)0x4c, (byte)0x2e, (byte)0xad,
+ (byte)0xdb, (byte)0xd6, (byte)0x32, (byte)0xcf,
+ (byte)0x8e, (byte)0xb5, (byte)0x05, (byte)0x55,
+ (byte)0x39, (byte)0x8b, (byte)0xe1, (byte)0x01
};
static byte clientModulus[] = {
- (byte)0x00,
- (byte)0xbb, (byte)0xf0, (byte)0x40, (byte)0x36,
- (byte)0xac, (byte)0x26, (byte)0x54, (byte)0x4e,
- (byte)0xf4, (byte)0xa3, (byte)0x5a, (byte)0x00,
- (byte)0x2f, (byte)0x69, (byte)0x21, (byte)0x6f,
- (byte)0xb9, (byte)0x7a, (byte)0x3a, (byte)0x93,
- (byte)0xec, (byte)0xa2, (byte)0xf6, (byte)0xe1,
- (byte)0x8e, (byte)0xc7, (byte)0x63, (byte)0xd8,
- (byte)0x2f, (byte)0x12, (byte)0x30, (byte)0x99,
- (byte)0x2e, (byte)0xb0, (byte)0xf2, (byte)0x8f,
- (byte)0xf8, (byte)0x27, (byte)0x2d, (byte)0x24,
- (byte)0x78, (byte)0x28, (byte)0x84, (byte)0xf7,
- (byte)0x01, (byte)0xbf, (byte)0x8d, (byte)0x44,
- (byte)0x79, (byte)0xdd, (byte)0x3b, (byte)0xd2,
- (byte)0x55, (byte)0xf3, (byte)0xce, (byte)0x3c,
- (byte)0xb2, (byte)0x5b, (byte)0x21, (byte)0x7d,
- (byte)0xef, (byte)0xfd, (byte)0x33, (byte)0x4a,
- (byte)0xb1, (byte)0xa3, (byte)0xff, (byte)0xc6,
- (byte)0xc8, (byte)0x9b, (byte)0xb9, (byte)0x0f,
- (byte)0x7c, (byte)0x41, (byte)0x35, (byte)0x97,
- (byte)0xf9, (byte)0xdb, (byte)0x3a, (byte)0x05,
- (byte)0x60, (byte)0x05, (byte)0x15, (byte)0xaf,
- (byte)0x59, (byte)0x17, (byte)0x92, (byte)0xa3,
- (byte)0x10, (byte)0xad, (byte)0x16, (byte)0x1c,
- (byte)0xe4, (byte)0x07, (byte)0x53, (byte)0xaf,
- (byte)0xa8, (byte)0x76, (byte)0xa2, (byte)0x56,
- (byte)0x2a, (byte)0x92, (byte)0xd3, (byte)0xf9,
- (byte)0x28, (byte)0xe0, (byte)0x78, (byte)0xcf,
- (byte)0x5e, (byte)0x1f, (byte)0x48, (byte)0xab,
- (byte)0x5c, (byte)0x19, (byte)0xdd, (byte)0xe1,
- (byte)0x67, (byte)0x43, (byte)0xba, (byte)0x75,
- (byte)0x8d, (byte)0xf5, (byte)0x82, (byte)0xac,
- (byte)0x43, (byte)0x92, (byte)0x44, (byte)0x1b
+ (byte)0x00, (byte)0xcc, (byte)0xbf, (byte)0x92,
+ (byte)0x3c, (byte)0xa6, (byte)0x57, (byte)0x74,
+ (byte)0x1f, (byte)0x58, (byte)0xad, (byte)0xc7,
+ (byte)0x69, (byte)0x88, (byte)0x6f, (byte)0x59,
+ (byte)0x32, (byte)0x47, (byte)0x50, (byte)0x60,
+ (byte)0x22, (byte)0xe4, (byte)0x98, (byte)0x49,
+ (byte)0x0e, (byte)0x3e, (byte)0x1d, (byte)0xb8,
+ (byte)0xba, (byte)0xe2, (byte)0x3b, (byte)0xb6,
+ (byte)0x71, (byte)0x5b, (byte)0xfd, (byte)0x64,
+ (byte)0x02, (byte)0x6d, (byte)0x0d, (byte)0x50,
+ (byte)0x77, (byte)0x72, (byte)0x6e, (byte)0xa8,
+ (byte)0x3d, (byte)0x5d, (byte)0xd4, (byte)0xbd,
+ (byte)0x1f, (byte)0x76, (byte)0x51, (byte)0xdc,
+ (byte)0x9a, (byte)0xd0, (byte)0xd6, (byte)0x3e,
+ (byte)0xd0, (byte)0x31, (byte)0xa5, (byte)0x24,
+ (byte)0x5a, (byte)0x2c, (byte)0xbe, (byte)0x77,
+ (byte)0xfa, (byte)0x88, (byte)0xa1, (byte)0xfa,
+ (byte)0x06, (byte)0x41, (byte)0xc8, (byte)0x0f,
+ (byte)0x47, (byte)0x70, (byte)0x47, (byte)0x24,
+ (byte)0x99, (byte)0x50, (byte)0x52, (byte)0x44,
+ (byte)0x5b, (byte)0x30, (byte)0x62, (byte)0x5b,
+ (byte)0x65, (byte)0x35, (byte)0xc4, (byte)0x28,
+ (byte)0xb0, (byte)0x5c, (byte)0xee, (byte)0xd0,
+ (byte)0x1b, (byte)0xeb, (byte)0x39, (byte)0x2b,
+ (byte)0x0b, (byte)0xa1, (byte)0xac, (byte)0x96,
+ (byte)0x48, (byte)0xda, (byte)0x56, (byte)0x6c,
+ (byte)0xe0, (byte)0xe3, (byte)0xe6, (byte)0xe3,
+ (byte)0xdd, (byte)0x45, (byte)0xcb, (byte)0x51,
+ (byte)0x33, (byte)0x8d, (byte)0x40, (byte)0x43,
+ (byte)0xd7, (byte)0xf0, (byte)0xa4, (byte)0x31,
+ (byte)0xaa, (byte)0xb5, (byte)0xc0, (byte)0xdf,
+ (byte)0x4b, (byte)0xdf, (byte)0x2b, (byte)0x0a,
+ (byte)0xed, (byte)0x7e, (byte)0x10, (byte)0x0c,
+ (byte)0xae, (byte)0x1f, (byte)0x96, (byte)0xa2,
+ (byte)0x10, (byte)0x1e, (byte)0x6b, (byte)0xd0,
+ (byte)0xf9, (byte)0x37, (byte)0x8b, (byte)0xdf,
+ (byte)0x0d, (byte)0x0e, (byte)0x02, (byte)0x35,
+ (byte)0xf8, (byte)0x58, (byte)0xbc, (byte)0x6e,
+ (byte)0xb5, (byte)0x57, (byte)0x0e, (byte)0x2f,
+ (byte)0xea, (byte)0x20, (byte)0xe6, (byte)0x73,
+ (byte)0x9a, (byte)0xe5, (byte)0x6b, (byte)0x82,
+ (byte)0x70, (byte)0x25, (byte)0xbb, (byte)0x51,
+ (byte)0x9a, (byte)0x7c, (byte)0x9d, (byte)0xe2,
+ (byte)0x50, (byte)0x3d, (byte)0xcf, (byte)0x1e,
+ (byte)0x24, (byte)0x3e, (byte)0x92, (byte)0x55,
+ (byte)0xcf, (byte)0x2a, (byte)0xad, (byte)0x0d,
+ (byte)0x84, (byte)0x8f, (byte)0xa8, (byte)0x43,
+ (byte)0x24, (byte)0xcd, (byte)0xad, (byte)0x50,
+ (byte)0x64, (byte)0x74, (byte)0xc2, (byte)0x73,
+ (byte)0xb6, (byte)0xe1, (byte)0x92, (byte)0x1c,
+ (byte)0xb2, (byte)0x2b, (byte)0x8c, (byte)0x2d,
+ (byte)0x7b, (byte)0x96, (byte)0xa6, (byte)0x41,
+ (byte)0x61, (byte)0x5c, (byte)0x1b, (byte)0x8f,
+ (byte)0x78, (byte)0x28, (byte)0x51, (byte)0x40,
+ (byte)0xed, (byte)0x41, (byte)0x90, (byte)0xce,
+ (byte)0x1d, (byte)0xb8, (byte)0x26, (byte)0x81,
+ (byte)0x47, (byte)0x6b, (byte)0xe3, (byte)0x57,
+ (byte)0x41, (byte)0x74, (byte)0x4e, (byte)0x20,
+ (byte)0xf0, (byte)0x5a, (byte)0x1b, (byte)0x97,
+ (byte)0x37, (byte)0x91, (byte)0x86, (byte)0x19,
+ (byte)0xc5, (byte)0xf2, (byte)0x6d, (byte)0x04,
+ (byte)0xc9, (byte)0x78, (byte)0x2b, (byte)0x5a,
+ (byte)0x16, (byte)0xbc, (byte)0xfc, (byte)0x2b,
+ (byte)0x71, (byte)0x5b, (byte)0xd0, (byte)0x00,
+ (byte)0x4f
};
static char passphrase[] = "passphrase".toCharArray();
@@ -808,26 +1090,26 @@ static class Test {
}
static Test[] tests = {
- // MD5 is used in this test case, don't disable MD5 algorithm.
+ // SHA1 is used in this test case, don't disable SHA1 algorithm.
new Test(
"SSLv3, RC4, DH keySize < 768",
"MD2, RSA keySize < 1024",
false),
- // Disable MD5 but only if cert chains back to public root CA, should
- // pass because the MD5 cert in this test case is issued by test CA
+ // Disable SHA1 but only if cert chains back to public root CA, should
+ // pass because the SHA1 cert in this test case is issued by test CA
new Test(
"SSLv3, RC4, DH keySize < 768",
- "MD2, MD5 jdkCA, RSA keySize < 1024",
+ "MD2, SHA1 jdkCA, RSA keySize < 1024",
false),
- // Disable MD5 alg via TLS property and expect failure
+ // Disable SHA1 alg via TLS property and expect failure
new Test(
- "SSLv3, MD5, RC4, DH keySize < 768",
+ "SSLv3, SHA1, RC4, DH keySize < 768",
"MD2, RSA keySize < 1024",
true),
- // Disable MD5 alg via certpath property and expect failure
+ // Disable SHA1 alg via certpath property and expect failure
new Test(
"SSLv3, RC4, DH keySize < 768",
- "MD2, MD5, RSA keySize < 1024",
+ "MD2, SHA1, RSA keySize < 1024",
true),
};
@@ -850,7 +1132,7 @@ public static void main(String args[]) throws Exception {
try {
new PKIXExtendedTM();
if (test.fail) {
- throw new Exception("Expected MD5 certificate to be blocked");
+ throw new Exception("Expected SHA1 certificate to be blocked");
}
} catch (Exception e) {
if (test.fail) {
diff --git a/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java b/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java
index ec893f90703..f95aee76dab 100644
--- a/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java
+++ b/test/jdk/sun/security/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2024, 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
@@ -52,357 +52,497 @@
*
* TLS server certificate:
* server private key:
- * -----BEGIN RSA PRIVATE KEY-----
- * Proc-Type: 4,ENCRYPTED
- * DEK-Info: DES-EDE3-CBC,D9AE407F6D0E389A
*
- * WPrA7TFol/cQCcp9oHnXWNpYlvRbbIcQj0m+RKT2Iuzfus+DHt3Zadf8nJpKfX2e
- * h2rnhlzCN9M7djRDooZKDOPCsdBn51Au7HlZF3S3Opgo7D8XFM1a8t1Je4ke14oI
- * nw6QKYsBblRziPnP2PZ0zvX24nOv7bbY8beynlJHGs00VWSFdoH2DS0aE1p6D+3n
- * ptJuJ75dVfZFK4X7162APlNXevX8D6PEQpSiRw1rjjGGcnvQ4HdWk3BxDVDcCNJb
- * Y1aGNRxsjTDvPi3R9Qx2M+W03QzEPx4SR3ZHVskeSJHaetM0TM/w/45Paq4GokXP
- * ZeTnbEx1xmjkA7h+t4doLL4watx5F6yLsJzu8xB3lt/1EtmkYtLz1t7X4BetPAXz
- * zS69X/VwhKfsOI3qXBWuL2oHPyhDmT1gcaUQwEPSV6ogHEEQEDXdiUS8heNK13KF
- * TCQYFkETvV2BLxUhV1hypPzRQ6tUpJiAbD5KmoK2lD9slshG2QtvKQq0/bgkDY5J
- * LhDHV2dtcZ3kDPkkZXpbcJQvoeH3d09C5sIsuTFo2zgNR6oETHUc5TzP6FY2YYRa
- * QcK5HcmtsRRiXFm01ac+aMejJUIujjFt84SiKWT/73vC8AmY4tYcJBLjCg4XIxSH
- * fdDFLL1YZENNO5ivlp8mdiHqcawx+36L7DrEZQ8RZt6cqST5t/+XTdM74s6k81GT
- * pNsa82P2K2zmIUZ/DL2mKjW1vfRByw1NQFEBkN3vdyZxYfM/JyUzX4hbjXBEkh9Q
- * QYrcwLKLjis2QzSvK04B3bvRzRb+4ocWiso8ZPAXAIxZFBWDpTMM2A==
- * -----END RSA PRIVATE KEY-----
- *
- * -----BEGIN RSA PRIVATE KEY-----
- * MIICXAIBAAKBgQClrFscN6LdmYktsnm4j9VIpecchBeNaZzGrG358h0fORna03Ie
- * buxEzHCk3LoAMPagTz1UemFqzFfQCn+VKBg/mtmU8hvIJIh+/p0PPftXUwizIDPU
- * PxdHFNHN6gjYDnVOr77M0uyvqXpJ38LZrLgkQJCmA1Yq0DAFQCxPq9l0iQIDAQAB
- * AoGAbqcbg1E1mkR99uOJoNeQYKFOJyGiiXTMnXV1TseC4+PDfQBU7Dax35GcesBi
- * CtapIpFKKS5D+ozY6b7ZT8ojxuQ/uHLPAvz0WDR3ds4iRF8tyu71Q1ZHcQsJa17y
- * yO7UbkSSKn/Mp9Rb+/dKqftUGNXVFLqgHBOzN2s3We3bbbECQQDYBPKOg3hkaGHo
- * OhpHKqtQ6EVkldihG/3i4WejRonelXN+HRh1KrB2HBx0M8D/qAzP1i3rNSlSHer4
- * 59YRTJnHAkEAxFX/sVYSn07BHv9Zhn6XXct/Cj43z/tKNbzlNbcxqQwQerw3IH51
- * 8UH2YOA+GD3lXbKp+MytoFLWv8zg4YT/LwJAfqan75Z1R6lLffRS49bIiq8jwE16
- * rTrUJ+kv8jKxMqc9B3vXkxpsS1M/+4E8bqgAmvpgAb8xcsvHsBd9ErdukQJBAKs2
- * j67W75BrPjBI34pQ1LEfp56IGWXOrq1kF8IbCjxv3+MYRT6Z6UJFkpRymNPNDjsC
- * dgUYgITiGJHUGXuw3lMCQHEHqo9ZtXz92yFT+VhsNc29B8m/sqUJdtCcMd/jGpAF
- * u6GHufjqIZBpQsk63wbwESAPZZ+kk1O1kS5GIRLX608=
- * -----END RSA PRIVATE KEY-----
- *
- * Private-Key: (1024 bit)
+ * Private-Key: (2048 bit, 2 primes)
* modulus:
- * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f:
- * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2:
- * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc:
- * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a:
- * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe:
- * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14:
- * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9:
- * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0:
- * 30:05:40:2c:4f:ab:d9:74:89
+ * 00:9a:0c:e0:8f:a8:02:7e:5a:ef:ed:b2:42:ad:08:
+ * 4e:91:ba:c2:ad:9b:79:d7:9b:0f:fd:d2:f8:15:2f:
+ * 19:89:80:10:00:02:19:6d:27:c2:90:d7:a5:23:53:
+ * 74:6e:64:28:7c:24:aa:ed:ea:21:59:dc:a3:5c:b5:
+ * c9:42:31:4f:a2:de:fb:09:7c:73:ed:88:04:34:f1:
+ * 15:ad:3d:60:cd:ca:c5:13:99:d3:9f:9b:b2:92:70:
+ * cb:ba:4b:3d:20:96:ad:be:92:53:ed:54:3b:c5:14:
+ * bd:cf:d4:0f:cb:05:4f:fd:2b:9e:e0:50:bb:65:13:
+ * 92:c0:d6:bd:4d:02:0c:70:b6:65:d4:7d:b4:4d:c3:
+ * df:2c:08:9e:d2:3e:69:32:46:6f:6f:ca:d1:73:a4:
+ * 94:07:ef:14:e3:da:9e:2f:c0:ac:0e:10:33:4c:68:
+ * 79:f3:79:40:d6:e9:3c:c2:e6:70:e0:89:ce:a0:7a:
+ * a8:84:28:85:32:37:08:b0:cf:b1:7f:5f:bc:1f:a5:
+ * 3d:ef:d6:68:a8:17:21:5f:87:d5:4b:b5:cc:ee:78:
+ * 8d:dd:b1:28:6a:c0:fb:64:bd:b7:70:02:33:03:0b:
+ * b8:b8:bb:08:82:f6:8e:05:27:d1:3b:e6:c5:ac:4d:
+ * 85:5b:a1:1d:a3:48:5d:03:15:76:63:6c:71:21:3e:
+ * 98:cd
* publicExponent: 65537 (0x10001)
* privateExponent:
- * 6e:a7:1b:83:51:35:9a:44:7d:f6:e3:89:a0:d7:90:
- * 60:a1:4e:27:21:a2:89:74:cc:9d:75:75:4e:c7:82:
- * e3:e3:c3:7d:00:54:ec:36:b1:df:91:9c:7a:c0:62:
- * 0a:d6:a9:22:91:4a:29:2e:43:fa:8c:d8:e9:be:d9:
- * 4f:ca:23:c6:e4:3f:b8:72:cf:02:fc:f4:58:34:77:
- * 76:ce:22:44:5f:2d:ca:ee:f5:43:56:47:71:0b:09:
- * 6b:5e:f2:c8:ee:d4:6e:44:92:2a:7f:cc:a7:d4:5b:
- * fb:f7:4a:a9:fb:54:18:d5:d5:14:ba:a0:1c:13:b3:
- * 37:6b:37:59:ed:db:6d:b1
+ * 68:87:36:54:a3:c6:d5:5f:f5:0f:4f:76:c8:9c:2b:
+ * 5b:dc:e2:be:14:12:2f:c7:0a:a9:cb:5e:04:59:ca:
+ * 35:2f:8d:2b:c4:40:e6:7d:25:1b:4d:07:c3:99:9c:
+ * 16:4f:a5:dc:de:b0:90:f0:de:22:70:80:f4:a6:70:
+ * e2:96:3d:18:21:bf:2b:27:a4:2d:d7:ae:2b:12:2f:
+ * 08:36:ee:99:94:ed:f6:a7:d9:1d:a2:f3:1f:44:a4:
+ * 28:4b:67:35:d6:a8:1b:f8:84:34:34:84:bd:ec:9e:
+ * 03:08:3c:93:20:8e:af:15:cb:1f:20:08:97:c4:19:
+ * 3e:fa:36:c6:ab:0e:2f:e7:b3:c0:a7:bc:e4:e0:a6:
+ * 08:1c:69:20:4d:78:bd:7a:e5:25:48:60:9e:2e:50:
+ * 8d:36:1e:07:e9:d5:0d:39:67:41:42:24:db:87:e5:
+ * 77:76:fd:5e:d5:c6:e5:d3:b0:98:71:48:69:47:4f:
+ * 46:05:0c:9e:58:45:2e:e2:27:d0:f6:11:05:78:ad:
+ * 83:5a:5b:ec:d7:2e:26:5a:a5:4f:9e:52:84:2c:1f:
+ * 59:1a:78:56:0a:44:54:c6:37:64:01:ca:e4:a8:01:
+ * c7:86:c1:b4:d6:6c:7a:15:9a:65:69:46:9e:fd:f6:
+ * 08:17:0c:6c:ac:38:bd:c2:cd:da:ef:54:7a:48:92:
+ * 4d
* prime1:
- * 00:d8:04:f2:8e:83:78:64:68:61:e8:3a:1a:47:2a:
- * ab:50:e8:45:64:95:d8:a1:1b:fd:e2:e1:67:a3:46:
- * 89:de:95:73:7e:1d:18:75:2a:b0:76:1c:1c:74:33:
- * c0:ff:a8:0c:cf:d6:2d:eb:35:29:52:1d:ea:f8:e7:
- * d6:11:4c:99:c7
+ * 00:e4:43:cc:51:25:aa:1d:90:41:95:2c:e8:9f:aa:
+ * 1c:9b:ea:bd:fd:29:e5:68:6b:28:00:ec:31:31:36:
+ * d0:3d:84:db:c5:5d:32:f6:38:b9:04:4f:45:cb:19:
+ * f5:88:cd:a8:fc:70:b8:6d:98:68:a6:b4:9e:c1:da:
+ * fd:db:eb:1a:53:3c:3b:e6:85:d2:6f:03:45:7a:ad:
+ * 49:8c:c3:96:a7:46:a4:bb:3b:48:d3:d7:1c:b4:3c:
+ * f7:04:0a:a3:85:9d:94:3e:bd:35:f5:34:21:3d:08:
+ * 89:df:c5:54:af:cf:90:f7:d8:5c:57:c5:77:5a:c8:
+ * d1:b3:8f:ee:01:5c:07:13:3f
* prime2:
- * 00:c4:55:ff:b1:56:12:9f:4e:c1:1e:ff:59:86:7e:
- * 97:5d:cb:7f:0a:3e:37:cf:fb:4a:35:bc:e5:35:b7:
- * 31:a9:0c:10:7a:bc:37:20:7e:75:f1:41:f6:60:e0:
- * 3e:18:3d:e5:5d:b2:a9:f8:cc:ad:a0:52:d6:bf:cc:
- * e0:e1:84:ff:2f
+ * 00:ac:c4:a0:cc:7c:51:db:65:0a:02:da:bc:d8:77:
+ * 21:8c:d3:30:ae:ec:50:60:4b:b9:39:c7:2d:bd:98:
+ * aa:4f:9b:44:74:ab:f8:86:de:e2:44:15:73:7a:cd:
+ * d5:46:f2:03:62:c5:87:9c:6d:91:d5:7a:9a:17:c2:
+ * c6:2f:29:0e:8a:a4:a9:f4:c2:63:a2:77:97:bf:c6:
+ * 90:e8:39:70:87:cc:fd:62:4f:d2:3d:e7:47:70:fb:
+ * f3:bd:bd:5c:9c:77:fe:23:33:7d:83:ef:cb:0e:4e:
+ * f1:dd:05:47:40:97:f4:da:b6:1f:b9:8d:e2:92:04:
+ * 09:be:fb:6a:97:29:27:ac:f3
* exponent1:
- * 7e:a6:a7:ef:96:75:47:a9:4b:7d:f4:52:e3:d6:c8:
- * 8a:af:23:c0:4d:7a:ad:3a:d4:27:e9:2f:f2:32:b1:
- * 32:a7:3d:07:7b:d7:93:1a:6c:4b:53:3f:fb:81:3c:
- * 6e:a8:00:9a:fa:60:01:bf:31:72:cb:c7:b0:17:7d:
- * 12:b7:6e:91
+ * 3f:08:1d:b6:56:b1:38:02:aa:a9:77:c2:30:bc:b7:
+ * b3:b2:49:8e:4b:f0:66:3a:18:cc:d0:6b:f1:0c:12:
+ * ca:ba:12:39:d8:b7:86:d8:38:f6:e0:b1:04:19:81:
+ * fc:a9:d5:bd:07:9f:55:dc:1d:21:d3:84:77:41:72:
+ * 92:34:c4:8b:31:79:d4:f9:25:17:b4:8e:8e:06:a5:
+ * e5:b1:e8:ba:fe:3d:e4:d9:c5:0d:82:3c:11:e5:37:
+ * cc:ac:e7:64:b1:13:cb:93:52:00:08:ca:18:e1:6f:
+ * b9:13:f3:83:ac:cc:7a:34:0b:a3:cd:0a:5d:4e:50:
+ * e1:c5:9f:d2:4e:48:41:df
* exponent2:
- * 00:ab:36:8f:ae:d6:ef:90:6b:3e:30:48:df:8a:50:
- * d4:b1:1f:a7:9e:88:19:65:ce:ae:ad:64:17:c2:1b:
- * 0a:3c:6f:df:e3:18:45:3e:99:e9:42:45:92:94:72:
- * 98:d3:cd:0e:3b:02:76:05:18:80:84:e2:18:91:d4:
- * 19:7b:b0:de:53
+ * 02:c7:fb:8a:af:29:a6:2d:7f:36:c2:8c:ad:b3:65:
+ * 3f:de:1a:77:86:68:58:d4:7f:3b:d5:df:ff:a0:58:
+ * 85:85:8b:59:91:77:23:bc:ac:c9:c9:ca:9d:1c:79:
+ * 25:76:39:e5:ba:26:4f:b7:57:d4:a6:ef:9a:18:51:
+ * 96:6a:c3:c8:29:94:6e:d3:3e:45:5c:45:7e:19:d5:
+ * 35:57:cf:5e:f0:46:d7:f1:4f:02:1e:1a:01:50:9d:
+ * 00:dd:ee:82:ba:4f:c6:03:4b:2e:f7:8a:3e:45:b9:
+ * 11:04:c7:bb:db:76:5e:9a:f5:f1:c7:bd:f0:f9:cd:
+ * aa:5c:63:bf:e1:32:b9:4f
* coefficient:
- * 71:07:aa:8f:59:b5:7c:fd:db:21:53:f9:58:6c:35:
- * cd:bd:07:c9:bf:b2:a5:09:76:d0:9c:31:df:e3:1a:
- * 90:05:bb:a1:87:b9:f8:ea:21:90:69:42:c9:3a:df:
- * 06:f0:11:20:0f:65:9f:a4:93:53:b5:91:2e:46:21:
- * 12:d7:eb:4f
- *
+ * 50:4c:e6:1e:23:f3:e2:2b:d6:3f:87:53:fb:19:53:
+ * 4b:84:21:0b:77:31:ed:8d:c3:0c:ea:31:b0:a6:38:
+ * a9:e6:44:6e:18:05:53:8f:4a:5f:75:e5:3e:b5:26:
+ * 9b:46:3d:73:e7:c1:2a:a6:3e:c3:cd:41:b1:a6:55:
+ * 57:84:11:13:ec:44:92:59:7f:dd:0d:67:30:d3:b7:
+ * 13:ee:9e:2d:ea:be:b3:ca:4a:f0:6e:4f:22:e8:be:
+ * 8b:8d:9b:2c:30:a5:ed:2c:2b:13:4c:f7:61:19:64:
+ * 35:9d:b0:c8:10:85:01:e7:2a:70:13:00:39:c5:73:
+ * 63:34:fd:28:2d:7f:8d:20
+ * -----BEGIN PRIVATE KEY-----
+ * MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCaDOCPqAJ+Wu/t
+ * skKtCE6RusKtm3nXmw/90vgVLxmJgBAAAhltJ8KQ16UjU3RuZCh8JKrt6iFZ3KNc
+ * tclCMU+i3vsJfHPtiAQ08RWtPWDNysUTmdOfm7KScMu6Sz0glq2+klPtVDvFFL3P
+ * 1A/LBU/9K57gULtlE5LA1r1NAgxwtmXUfbRNw98sCJ7SPmkyRm9vytFzpJQH7xTj
+ * 2p4vwKwOEDNMaHnzeUDW6TzC5nDgic6geqiEKIUyNwiwz7F/X7wfpT3v1mioFyFf
+ * h9VLtczueI3dsShqwPtkvbdwAjMDC7i4uwiC9o4FJ9E75sWsTYVboR2jSF0DFXZj
+ * bHEhPpjNAgMBAAECggEAaIc2VKPG1V/1D092yJwrW9zivhQSL8cKqcteBFnKNS+N
+ * K8RA5n0lG00Hw5mcFk+l3N6wkPDeInCA9KZw4pY9GCG/KyekLdeuKxIvCDbumZTt
+ * 9qfZHaLzH0SkKEtnNdaoG/iENDSEveyeAwg8kyCOrxXLHyAIl8QZPvo2xqsOL+ez
+ * wKe85OCmCBxpIE14vXrlJUhgni5QjTYeB+nVDTlnQUIk24fld3b9XtXG5dOwmHFI
+ * aUdPRgUMnlhFLuIn0PYRBXitg1pb7NcuJlqlT55ShCwfWRp4VgpEVMY3ZAHK5KgB
+ * x4bBtNZsehWaZWlGnv32CBcMbKw4vcLN2u9UekiSTQKBgQDkQ8xRJaodkEGVLOif
+ * qhyb6r39KeVoaygA7DExNtA9hNvFXTL2OLkET0XLGfWIzaj8cLhtmGimtJ7B2v3b
+ * 6xpTPDvmhdJvA0V6rUmMw5anRqS7O0jT1xy0PPcECqOFnZQ+vTX1NCE9CInfxVSv
+ * z5D32FxXxXdayNGzj+4BXAcTPwKBgQCsxKDMfFHbZQoC2rzYdyGM0zCu7FBgS7k5
+ * xy29mKpPm0R0q/iG3uJEFXN6zdVG8gNixYecbZHVepoXwsYvKQ6KpKn0wmOid5e/
+ * xpDoOXCHzP1iT9I950dw+/O9vVycd/4jM32D78sOTvHdBUdAl/Tath+5jeKSBAm+
+ * +2qXKSes8wKBgD8IHbZWsTgCqql3wjC8t7OySY5L8GY6GMzQa/EMEsq6EjnYt4bY
+ * OPbgsQQZgfyp1b0Hn1XcHSHThHdBcpI0xIsxedT5JRe0jo4GpeWx6Lr+PeTZxQ2C
+ * PBHlN8ys52SxE8uTUgAIyhjhb7kT84OszHo0C6PNCl1OUOHFn9JOSEHfAoGAAsf7
+ * iq8ppi1/NsKMrbNlP94ad4ZoWNR/O9Xf/6BYhYWLWZF3I7ysycnKnRx5JXY55bom
+ * T7dX1KbvmhhRlmrDyCmUbtM+RVxFfhnVNVfPXvBG1/FPAh4aAVCdAN3ugrpPxgNL
+ * LveKPkW5EQTHu9t2Xpr18ce98PnNqlxjv+EyuU8CgYBQTOYeI/PiK9Y/h1P7GVNL
+ * hCELdzHtjcMM6jGwpjip5kRuGAVTj0pfdeU+tSabRj1z58Eqpj7DzUGxplVXhBET
+ * 7ESSWX/dDWcw07cT7p4t6r6zykrwbk8i6L6LjZssMKXtLCsTTPdhGWQ1nbDIEIUB
+ * 5ypwEwA5xXNjNP0oLX+NIA==
+ * -----END PRIVATE KEY-----
*
* server certificate:
- * Data:
- * Version: 3 (0x2)
- * Serial Number: 8 (0x8)
- * Signature Algorithm: md5WithRSAEncryption
- * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
- * Validity
- * Not Before: Dec 8 03:43:04 2008 GMT
- * Not After : Aug 25 03:43:04 2028 GMT
- * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Server, CN=localhost
- * Subject Public Key Info:
- * Public Key Algorithm: rsaEncryption
- * RSA Public Key: (1024 bit)
- * Modulus (1024 bit):
- * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f:
- * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2:
- * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc:
- * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a:
- * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe:
- * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14:
- * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9:
- * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0:
- * 30:05:40:2c:4f:ab:d9:74:89
- * Exponent: 65537 (0x10001)
- * X509v3 extensions:
- * X509v3 Basic Constraints:
- * CA:FALSE
- * X509v3 Key Usage:
- * Digital Signature, Non Repudiation, Key Encipherment
- * X509v3 Subject Key Identifier:
- * ED:6E:DB:F4:B5:56:C8:FB:1A:06:61:3F:0F:08:BB:A6:04:D8:16:54
- * X509v3 Authority Key Identifier:
- * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
- *
- * X509v3 Subject Alternative Name: critical
- * DNS:localhost
- * Signature Algorithm: md5WithRSAEncryption0
- *
+ * Data:
+ * Version: 3 (0x2)
+ * Serial Number: 106315679 (0x6563f9f)
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org
+ * Validity
+ * Not Before: Jul 1 04:16:55 2024 GMT
+ * Not After : Jul 2 04:16:55 2034 GMT
+ * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, CN=localhost ou=SSL-Server
+ * Subject Public Key Info:
+ * Public Key Algorithm: rsaEncryption
+ * Public-Key: (2048 bit)
+ * Modulus:
+ * 00:9a:0c:e0:8f:a8:02:7e:5a:ef:ed:b2:42:ad:08:
+ * 4e:91:ba:c2:ad:9b:79:d7:9b:0f:fd:d2:f8:15:2f:
+ * 19:89:80:10:00:02:19:6d:27:c2:90:d7:a5:23:53:
+ * 74:6e:64:28:7c:24:aa:ed:ea:21:59:dc:a3:5c:b5:
+ * c9:42:31:4f:a2:de:fb:09:7c:73:ed:88:04:34:f1:
+ * 15:ad:3d:60:cd:ca:c5:13:99:d3:9f:9b:b2:92:70:
+ * cb:ba:4b:3d:20:96:ad:be:92:53:ed:54:3b:c5:14:
+ * bd:cf:d4:0f:cb:05:4f:fd:2b:9e:e0:50:bb:65:13:
+ * 92:c0:d6:bd:4d:02:0c:70:b6:65:d4:7d:b4:4d:c3:
+ * df:2c:08:9e:d2:3e:69:32:46:6f:6f:ca:d1:73:a4:
+ * 94:07:ef:14:e3:da:9e:2f:c0:ac:0e:10:33:4c:68:
+ * 79:f3:79:40:d6:e9:3c:c2:e6:70:e0:89:ce:a0:7a:
+ * a8:84:28:85:32:37:08:b0:cf:b1:7f:5f:bc:1f:a5:
+ * 3d:ef:d6:68:a8:17:21:5f:87:d5:4b:b5:cc:ee:78:
+ * 8d:dd:b1:28:6a:c0:fb:64:bd:b7:70:02:33:03:0b:
+ * b8:b8:bb:08:82:f6:8e:05:27:d1:3b:e6:c5:ac:4d:
+ * 85:5b:a1:1d:a3:48:5d:03:15:76:63:6c:71:21:3e:
+ * 98:cd
+ * Exponent: 65537 (0x10001)
+ * X509v3 extensions:
+ * X509v3 Subject Key Identifier:
+ * 5C:AF:44:B1:48:B8:59:9A:64:53:9D:2E:A6:B2:09:D3:0A:92:04:83
+ * X509v3 Key Usage:
+ * Digital Signature, Non Repudiation, Key Encipherment
+ * X509v3 Subject Alternative Name: critical
+ * DNS:localhost
+ * X509v3 Basic Constraints:
+ * CA:FALSE
+ * X509v3 Authority Key Identifier:
+ * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Signature Value:
+ * 9d:22:49:5f:56:23:e6:80:35:cc:ab:44:1c:27:bd:c9:8d:89:
+ * 93:49:58:e8:c1:7a:68:dd:cf:bd:e0:12:76:06:54:cd:2f:62:
+ * 9b:54:84:f2:bb:90:a0:bb:37:e2:13:1d:f3:df:41:aa:e0:fe:
+ * c0:ef:46:78:8d:aa:f4:1b:70:ad:a9:16:24:fa:15:4a:c6:0a:
+ * 8d:e1:99:93:00:a9:d4:b6:08:5d:8e:65:03:dc:d0:95:fc:95:
+ * 61:a6:ad:b5:ab:4d:a6:e0:05:48:8c:db:42:42:8a:d6:5e:c0:
+ * 2a:a0:11:15:b8:07:69:5c:3f:99:a0:bd:53:65:db:4e:cf:46:
+ * 61:93:09:7b:81:40:ff:5c:fe:4c:eb:f4:ac:de:1f:38:ad:b2:
+ * 60:28:f6:0e:9f:46:e7:07:8f:20:9a:a4:e1:8f:ab:54:99:76:
+ * 82:d8:9e:70:c4:da:98:85:71:af:3b:54:e4:01:b4:9e:83:d0:
+ * 7b:c6:8d:1f:ed:25:08:89:05:e9:87:97:76:5a:a3:85:c3:f8:
+ * 59:d7:bb:3b:5a:db:cb:ed:5d:ff:ac:21:b9:9a:e2:65:0a:bc:
+ * de:d1:dc:53:94:98:44:97:91:b3:1b:6b:80:0b:9b:57:b3:ae:
+ * 5c:7c:35:ca:39:71:f7:4e:8f:4a:d7:eb:0b:25:da:b2:1e:17:
+ * 48:b8:eb:09
* -----BEGIN CERTIFICATE-----
- * MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET
- * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK
- * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ
- * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp
- * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD
- * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3
- * ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6
- * YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS
- * 7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw
- * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV
- * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh
- * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac
- * PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi
- * nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn
- * JqCpf5uZGOo=
+ * MIIDpTCCAo2gAwIBAgIEBlY/nzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV
+ * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD
+ * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTVaFw0zNDA3MDIwNDE2NTVaMGsx
+ * CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l
+ * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9
+ * U1NMLVNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoM4I+o
+ * An5a7+2yQq0ITpG6wq2bedebD/3S+BUvGYmAEAACGW0nwpDXpSNTdG5kKHwkqu3q
+ * IVnco1y1yUIxT6Le+wl8c+2IBDTxFa09YM3KxROZ05+bspJwy7pLPSCWrb6SU+1U
+ * O8UUvc/UD8sFT/0rnuBQu2UTksDWvU0CDHC2ZdR9tE3D3ywIntI+aTJGb2/K0XOk
+ * lAfvFOPani/ArA4QM0xoefN5QNbpPMLmcOCJzqB6qIQohTI3CLDPsX9fvB+lPe/W
+ * aKgXIV+H1Uu1zO54jd2xKGrA+2S9t3ACMwMLuLi7CIL2jgUn0TvmxaxNhVuhHaNI
+ * XQMVdmNscSE+mM0CAwEAAaNzMHEwHQYDVR0OBBYEFFyvRLFIuFmaZFOdLqayCdMK
+ * kgSDMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T
+ * BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B
+ * AQUFAAOCAQEAnSJJX1Yj5oA1zKtEHCe9yY2Jk0lY6MF6aN3PveASdgZUzS9im1SE
+ * 8ruQoLs34hMd899BquD+wO9GeI2q9BtwrakWJPoVSsYKjeGZkwCp1LYIXY5lA9zQ
+ * lfyVYaattatNpuAFSIzbQkKK1l7AKqARFbgHaVw/maC9U2XbTs9GYZMJe4FA/1z+
+ * TOv0rN4fOK2yYCj2Dp9G5wePIJqk4Y+rVJl2gtiecMTamIVxrztU5AG0noPQe8aN
+ * H+0lCIkF6YeXdlqjhcP4Wde7O1rby+1d/6whuZriZQq83tHcU5SYRJeRsxtrgAub
+ * V7OuXHw1yjlx906PStfrCyXash4XSLjrCQ==
* -----END CERTIFICATE-----
*
*
* TLS client certificate:
* client private key:
- * ----BEGIN RSA PRIVATE KEY-----
- * Proc-Type: 4,ENCRYPTED
- * DEK-Info: DES-EDE3-CBC,FA2A435CD35A9390
- *
- * Z+Y2uaETbsUWIyJUyVu1UV2G4rgFYJyACZT6Tp1KjRtxflSh2kXkJ9MpuXMXA0V4
- * Yy3fDzPqCL9NJmQAYRlAx/W/+j4F5EyMWDIx8fUxzONRZyoiwF7jLm+KscAfv6Pf
- * q7ItWOdj3z7IYrwlB8YIGd3F2cDKT3S+lYRk7rKb/qT7itbuHnY4Ardh3yl+MZak
- * jBp+ELUlRsUqSr1V0LoM+0rCCykarpyfhpxEcqsrl0v9Cyi5uhU50/oKv5zql3SH
- * l2ImgDjp3batAs8+Bd4NF2aqi0a7Hy44JUHxRm4caZryU/i/D9N1MbuM6882HLat
- * 5N0G+NaIUfywa8mjwq2D5aiit18HqKA6XeRRYeJ5Dvu9DCO4GeFSwcUFIBMI0L46
- * 7s114+oDodg57pMgITi+04vmUxvqlN9aiyd7f5Fgd7PeHGeOdbMz1NaJLJaPI9++
- * NakK8eK9iwT/Gdq0Uap5/CHW7vCT5PO+h3HY0STH0lWStXhdWnFO04zTdywsbSp+
- * DLpHeFT66shfeUlxR0PsCbG9vPRt/QmGLeYQZITppWo/ylSq4j+pRIuXvuWHdBRN
- * rTZ8QF4Y7AxQUXVz1j1++s6ZMHTzaK2i9HrhmDs1MbJl+QwWre3Xpv3LvTVz3k5U
- * wX8kuY1m3STt71QCaRWENq5sRaMImLxZbxc/ivFl9RAzUqo4NCxLod/QgA4iLqtO
- * ztnlpzwlC/F8HbQ1oqYWwnZAPhzU/cULtstl+Yrws2c2atO323LbPXZqbASySgig
- * sNpFXQMObdfP6LN23bY+1SvtK7V4NUTNhpdIc6INQAQ=
- * -----END RSA PRIVATE KEY-----
- *
- * -----BEGIN RSA PRIVATE KEY-----
- * MIICWwIBAAKBgQC78EA2rCZUTvSjWgAvaSFvuXo6k+yi9uGOx2PYLxIwmS6w8o/4
- * Jy0keCiE9wG/jUR53TvSVfPOPLJbIX3v/TNKsaP/xsibuQ98QTWX+ds6BWAFFa9Z
- * F5KjEK0WHOQHU6+odqJWKpLT+SjgeM9eH0irXBnd4WdDunWN9YKsQ5JEGwIDAQAB
- * AoGAEbdqNj0wN85hnWyEi/ObJU8UyKTdL9eaF72QGfcF/fLSxfd3vurihIeXOkGW
- * tpn4lIxYcVGM9CognhqgJpl11jFTQzn1KqZ+NEJRKkCHA4hDabKJbSC9fXHvRwrf
- * BsFpZqgiNxp3HseUTiwnaUVeyPgMt/jAj5nB5Sib+UyUxrECQQDnNQBiF2aifEg6
- * zbJOOC7he5CHAdkFxSxWVFVHL6EfXfqdLVkUohMbgZv+XxyIeU2biOExSg49Kds3
- * FOKgTau1AkEA0Bd1haj6QuCo8I0AXm2WO+MMTZMTvtHD/bGjKNM+fT4I8rKYnQRX
- * 1acHdqS9Xx2rNJqZgkMmpESIdPR2fc4yjwJALFeM6EMmqvj8/VIf5UJ/Mz14fXwM
- * PEARfckUxd9LnnFutCBTWlKvKXJVEZb6KO5ixPaegc57Jp3Vbh3yTN44lQJADD/1
- * SSMDaIB1MYP7a5Oj7m6VQNPRq8AJe5vDcRnOae0G9dKRrVyeFxO4GsHj6/+BHp2j
- * P8nYMn9eURQ7DXjf/QJAAQzMlWnKGSO8pyTDtnQx3hRMoUkOEhmNq4bQhLkYqtnY
- * FcqpUQ2qMjW+NiNWk5HnTrMS3L9EdJobMUzaNZLy4w==
- * -----END RSA PRIVATE KEY-----
*
- * Private-Key: (1024 bit)
+ * Private-Key: (2048 bit, 2 primes)
* modulus:
- * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69:
- * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f:
- * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7:
- * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21:
- * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41:
- * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10:
- * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9:
- * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba:
- * 75:8d:f5:82:ac:43:92:44:1b
+ * 00:cc:bf:92:3c:a6:57:74:1f:58:ad:c7:69:88:6f:
+ * 59:32:47:50:60:22:e4:98:49:0e:3e:1d:b8:ba:e2:
+ * 3b:b6:71:5b:fd:64:02:6d:0d:50:77:72:6e:a8:3d:
+ * 5d:d4:bd:1f:76:51:dc:9a:d0:d6:3e:d0:31:a5:24:
+ * 5a:2c:be:77:fa:88:a1:fa:06:41:c8:0f:47:70:47:
+ * 24:99:50:52:44:5b:30:62:5b:65:35:c4:28:b0:5c:
+ * ee:d0:1b:eb:39:2b:0b:a1:ac:96:48:da:56:6c:e0:
+ * e3:e6:e3:dd:45:cb:51:33:8d:40:43:d7:f0:a4:31:
+ * aa:b5:c0:df:4b:df:2b:0a:ed:7e:10:0c:ae:1f:96:
+ * a2:10:1e:6b:d0:f9:37:8b:df:0d:0e:02:35:f8:58:
+ * bc:6e:b5:57:0e:2f:ea:20:e6:73:9a:e5:6b:82:70:
+ * 25:bb:51:9a:7c:9d:e2:50:3d:cf:1e:24:3e:92:55:
+ * cf:2a:ad:0d:84:8f:a8:43:24:cd:ad:50:64:74:c2:
+ * 73:b6:e1:92:1c:b2:2b:8c:2d:7b:96:a6:41:61:5c:
+ * 1b:8f:78:28:51:40:ed:41:90:ce:1d:b8:26:81:47:
+ * 6b:e3:57:41:74:4e:20:f0:5a:1b:97:37:91:86:19:
+ * c5:f2:6d:04:c9:78:2b:5a:16:bc:fc:2b:71:5b:d0:
+ * 00:4f
* publicExponent: 65537 (0x10001)
* privateExponent:
- * 11:b7:6a:36:3d:30:37:ce:61:9d:6c:84:8b:f3:9b:
- * 25:4f:14:c8:a4:dd:2f:d7:9a:17:bd:90:19:f7:05:
- * fd:f2:d2:c5:f7:77:be:ea:e2:84:87:97:3a:41:96:
- * b6:99:f8:94:8c:58:71:51:8c:f4:2a:20:9e:1a:a0:
- * 26:99:75:d6:31:53:43:39:f5:2a:a6:7e:34:42:51:
- * 2a:40:87:03:88:43:69:b2:89:6d:20:bd:7d:71:ef:
- * 47:0a:df:06:c1:69:66:a8:22:37:1a:77:1e:c7:94:
- * 4e:2c:27:69:45:5e:c8:f8:0c:b7:f8:c0:8f:99:c1:
- * e5:28:9b:f9:4c:94:c6:b1
+ * 62:b2:d6:63:b6:2b:e2:26:5a:31:2b:37:8c:35:60:
+ * e2:03:ce:93:09:3e:f8:c9:fe:bb:a2:c8:32:0e:6c:
+ * 8a:7e:0a:c2:13:3b:b8:25:fa:ec:19:95:8e:34:46:
+ * cf:0e:7b:e4:25:82:1a:7f:21:48:16:44:58:3f:35:
+ * d8:eb:d8:1a:45:53:0f:9b:84:8a:54:13:33:e4:97:
+ * 97:f0:48:37:fb:5d:4f:8c:8f:35:63:e1:d9:62:73:
+ * 1c:8e:d8:cd:2e:1a:e5:4c:b5:05:59:7a:df:f1:68:
+ * eb:1c:5c:c6:10:44:8c:7d:42:c5:71:8a:e7:1b:aa:
+ * 17:03:6a:a0:c0:6b:97:50:17:ad:6e:5e:d9:db:6f:
+ * 3e:e9:3f:35:c3:45:bc:e8:3d:5a:b4:b9:3f:53:80:
+ * 64:dc:12:24:35:35:bd:98:bb:8d:fa:19:a3:5e:9e:
+ * ac:70:4a:fc:8d:ae:55:8b:71:81:0e:4d:c8:2f:87:
+ * b0:44:f7:4f:dc:a8:c8:50:b5:95:24:63:74:13:54:
+ * 58:de:fc:e0:75:eb:f4:06:58:83:12:4c:56:c4:c4:
+ * 18:0c:ea:a3:e7:25:a3:de:19:23:a2:5a:2a:b6:56:
+ * 04:bc:65:ba:7c:0a:f4:91:10:22:88:3f:9d:be:58:
+ * 43:4c:2e:ad:db:d6:32:cf:8e:b5:05:55:39:8b:e1:
+ * 01
* prime1:
- * 00:e7:35:00:62:17:66:a2:7c:48:3a:cd:b2:4e:38:
- * 2e:e1:7b:90:87:01:d9:05:c5:2c:56:54:55:47:2f:
- * a1:1f:5d:fa:9d:2d:59:14:a2:13:1b:81:9b:fe:5f:
- * 1c:88:79:4d:9b:88:e1:31:4a:0e:3d:29:db:37:14:
- * e2:a0:4d:ab:b5
+ * 00:f1:da:c2:8a:e5:66:45:8a:14:fc:08:6e:fb:aa:
+ * 50:d2:8c:b1:c4:f4:88:26:d4:b8:c4:63:30:ca:e3:
+ * 0c:6c:50:d4:93:5c:1c:13:37:60:21:11:3b:d1:f1:
+ * 9f:4c:0d:7b:0e:53:3d:c9:a4:fb:fa:6b:9e:b4:0a:
+ * 5d:d3:50:88:d7:be:c3:88:b2:b1:8a:6e:7b:d6:70:
+ * 88:96:a4:fe:90:ef:d1:84:ad:a8:9e:9f:3a:68:3f:
+ * 3f:82:07:be:c2:44:1e:d5:a1:a9:1a:db:39:d7:7f:
+ * 0c:6e:35:5b:1d:33:1b:a9:cd:38:2a:64:d1:70:2a:
+ * fe:b9:c2:b6:ed:59:19:73:b1
* prime2:
- * 00:d0:17:75:85:a8:fa:42:e0:a8:f0:8d:00:5e:6d:
- * 96:3b:e3:0c:4d:93:13:be:d1:c3:fd:b1:a3:28:d3:
- * 3e:7d:3e:08:f2:b2:98:9d:04:57:d5:a7:07:76:a4:
- * bd:5f:1d:ab:34:9a:99:82:43:26:a4:44:88:74:f4:
- * 76:7d:ce:32:8f
+ * 00:d8:b9:3a:38:6c:79:cd:0b:1f:2b:34:74:bf:7a:
+ * 3d:0c:21:5a:a6:ea:f2:9e:de:68:42:05:7f:ea:a5:
+ * 00:c9:10:f8:fd:c5:05:8d:03:45:5d:4f:6f:fa:6e:
+ * 9d:ef:ad:8a:ec:83:d4:ed:57:f3:86:73:15:2f:d2:
+ * 67:70:d1:62:ef:1d:25:08:59:47:20:62:47:16:35:
+ * e1:57:38:bf:39:dd:fc:b9:c8:d8:23:53:e2:02:7d:
+ * 22:31:4c:66:72:96:df:d8:7c:01:2c:71:00:89:18:
+ * e9:8c:08:44:8c:64:1f:93:9b:7a:97:26:c9:50:d0:
+ * 87:b2:48:a8:19:71:e1:b3:ff
* exponent1:
- * 2c:57:8c:e8:43:26:aa:f8:fc:fd:52:1f:e5:42:7f:
- * 33:3d:78:7d:7c:0c:3c:40:11:7d:c9:14:c5:df:4b:
- * 9e:71:6e:b4:20:53:5a:52:af:29:72:55:11:96:fa:
- * 28:ee:62:c4:f6:9e:81:ce:7b:26:9d:d5:6e:1d:f2:
- * 4c:de:38:95
+ * 23:98:dd:35:70:5a:43:35:f5:ac:ba:d9:0a:f5:a0:
+ * 7b:bc:f5:95:55:a0:8c:86:96:c3:61:0e:17:6e:9f:
+ * af:79:9e:30:2a:48:7f:93:90:f4:8d:02:ce:fd:cf:
+ * 42:74:61:7e:54:46:2d:dd:b8:b0:bd:12:58:d1:85:
+ * c9:ca:7a:b9:b6:7c:35:2c:87:f1:26:1d:d8:0c:2c:
+ * 2e:70:0e:7f:ea:ac:5d:e8:e9:7e:9f:55:0b:6e:f3:
+ * bc:01:c3:d3:f8:0e:c9:c6:c7:8b:0a:65:53:10:82:
+ * 15:de:88:90:9d:ab:1e:ac:f3:ed:59:75:72:1b:01:
+ * ee:f9:77:cf:2b:64:11:a1
* exponent2:
- * 0c:3f:f5:49:23:03:68:80:75:31:83:fb:6b:93:a3:
- * ee:6e:95:40:d3:d1:ab:c0:09:7b:9b:c3:71:19:ce:
- * 69:ed:06:f5:d2:91:ad:5c:9e:17:13:b8:1a:c1:e3:
- * eb:ff:81:1e:9d:a3:3f:c9:d8:32:7f:5e:51:14:3b:
- * 0d:78:df:fd
+ * 00:9e:29:6f:87:c6:02:8d:d5:54:05:df:de:63:ee:
+ * fd:a6:60:a1:1b:b7:d3:20:86:07:68:47:43:37:26:
+ * fc:0f:c0:c7:35:cc:17:64:f5:c2:25:7a:d7:a9:d8:
+ * 18:82:d6:0f:d0:d3:d5:0c:f1:66:d3:f4:20:be:29:
+ * bb:3b:e6:53:61:55:cf:b4:ec:12:b0:5b:88:ad:78:
+ * dc:df:1e:96:cf:d0:65:a3:e0:23:7c:84:b7:28:41:
+ * d2:36:50:1f:63:f9:1f:9b:89:c4:01:7e:e6:79:27:
+ * 29:29:fc:ce:a9:f6:57:e5:0d:4e:c6:08:94:5a:da:
+ * 14:6d:d4:00:79:b1:56:9a:59
* coefficient:
- * 01:0c:cc:95:69:ca:19:23:bc:a7:24:c3:b6:74:31:
- * de:14:4c:a1:49:0e:12:19:8d:ab:86:d0:84:b9:18:
- * aa:d9:d8:15:ca:a9:51:0d:aa:32:35:be:36:23:56:
- * 93:91:e7:4e:b3:12:dc:bf:44:74:9a:1b:31:4c:da:
- * 35:92:f2:e3
+ * 6c:73:0d:fe:c7:22:15:5d:8c:a1:91:2b:d1:88:e8:
+ * 91:f9:d0:3e:d0:ba:c4:74:88:ce:14:20:4e:1e:4b:
+ * c5:91:8f:c1:56:e9:74:e0:f6:cf:71:91:ed:2c:f5:
+ * 90:9d:d6:c8:cd:f5:79:dc:6e:b3:83:3e:fa:d6:b4:
+ * 60:d9:3a:52:12:76:9d:92:fb:db:26:ee:43:33:c4:
+ * 0b:84:74:1b:91:e0:41:8b:cc:cc:24:da:52:af:2d:
+ * 42:e7:11:57:0d:aa:66:af:1a:ba:c2:8e:6a:ee:8f:
+ * 2c:e6:5b:76:38:96:bb:7a:2f:59:fe:de:a1:02:fc:
+ * 12:3a:aa:9f:3c:0e:a4:78
+ * writing RSA key
+ * -----BEGIN PRIVATE KEY-----
+ * MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDMv5I8pld0H1it
+ * x2mIb1kyR1BgIuSYSQ4+Hbi64ju2cVv9ZAJtDVB3cm6oPV3UvR92Udya0NY+0DGl
+ * JFosvnf6iKH6BkHID0dwRySZUFJEWzBiW2U1xCiwXO7QG+s5KwuhrJZI2lZs4OPm
+ * 491Fy1EzjUBD1/CkMaq1wN9L3ysK7X4QDK4flqIQHmvQ+TeL3w0OAjX4WLxutVcO
+ * L+og5nOa5WuCcCW7UZp8neJQPc8eJD6SVc8qrQ2Ej6hDJM2tUGR0wnO24ZIcsiuM
+ * LXuWpkFhXBuPeChRQO1BkM4duCaBR2vjV0F0TiDwWhuXN5GGGcXybQTJeCtaFrz8
+ * K3Fb0ABPAgMBAAECggEAYrLWY7Yr4iZaMSs3jDVg4gPOkwk++Mn+u6LIMg5sin4K
+ * whM7uCX67BmVjjRGzw575CWCGn8hSBZEWD812OvYGkVTD5uEilQTM+SXl/BIN/td
+ * T4yPNWPh2WJzHI7YzS4a5Uy1BVl63/Fo6xxcxhBEjH1CxXGK5xuqFwNqoMBrl1AX
+ * rW5e2dtvPuk/NcNFvOg9WrS5P1OAZNwSJDU1vZi7jfoZo16erHBK/I2uVYtxgQ5N
+ * yC+HsET3T9yoyFC1lSRjdBNUWN784HXr9AZYgxJMVsTEGAzqo+clo94ZI6JaKrZW
+ * BLxlunwK9JEQIog/nb5YQ0wurdvWMs+OtQVVOYvhAQKBgQDx2sKK5WZFihT8CG77
+ * qlDSjLHE9Igm1LjEYzDK4wxsUNSTXBwTN2AhETvR8Z9MDXsOUz3JpPv6a560Cl3T
+ * UIjXvsOIsrGKbnvWcIiWpP6Q79GEraienzpoPz+CB77CRB7Voaka2znXfwxuNVsd
+ * MxupzTgqZNFwKv65wrbtWRlzsQKBgQDYuTo4bHnNCx8rNHS/ej0MIVqm6vKe3mhC
+ * BX/qpQDJEPj9xQWNA0VdT2/6bp3vrYrsg9TtV/OGcxUv0mdw0WLvHSUIWUcgYkcW
+ * NeFXOL853fy5yNgjU+ICfSIxTGZylt/YfAEscQCJGOmMCESMZB+Tm3qXJslQ0Iey
+ * SKgZceGz/wKBgCOY3TVwWkM19ay62Qr1oHu89ZVVoIyGlsNhDhdun695njAqSH+T
+ * kPSNAs79z0J0YX5URi3duLC9EljRhcnKerm2fDUsh/EmHdgMLC5wDn/qrF3o6X6f
+ * VQtu87wBw9P4DsnGx4sKZVMQghXeiJCdqx6s8+1ZdXIbAe75d88rZBGhAoGBAJ4p
+ * b4fGAo3VVAXf3mPu/aZgoRu30yCGB2hHQzcm/A/AxzXMF2T1wiV616nYGILWD9DT
+ * 1QzxZtP0IL4puzvmU2FVz7TsErBbiK143N8els/QZaPgI3yEtyhB0jZQH2P5H5uJ
+ * xAF+5nknKSn8zqn2V+UNTsYIlFraFG3UAHmxVppZAoGAbHMN/sciFV2MoZEr0Yjo
+ * kfnQPtC6xHSIzhQgTh5LxZGPwVbpdOD2z3GR7Sz1kJ3WyM31edxus4M++ta0YNk6
+ * UhJ2nZL72ybuQzPEC4R0G5HgQYvMzCTaUq8tQucRVw2qZq8ausKOau6PLOZbdjiW
+ * u3ovWf7eoQL8EjqqnzwOpHg=
+ * -----END PRIVATE KEY-----
*
* client certificate:
- * Data:
- * Version: 3 (0x2)
- * Serial Number: 9 (0x9)
- * Signature Algorithm: md5WithRSAEncryption
- * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
- * Validity
- * Not Before: Dec 8 03:43:24 2008 GMT
- * Not After : Aug 25 03:43:24 2028 GMT
- * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Client, CN=localhost
- * Subject Public Key Info:
- * Public Key Algorithm: rsaEncryption
- * RSA Public Key: (1024 bit)
- * Modulus (1024 bit):
- * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69:
- * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f:
- * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7:
- * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21:
- * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41:
- * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10:
- * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9:
- * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba:
- * 75:8d:f5:82:ac:43:92:44:1b
- * Exponent: 65537 (0x10001)
- * X509v3 extensions:
- * X509v3 Basic Constraints:
- * CA:FALSE
- * X509v3 Key Usage:
- * Digital Signature, Non Repudiation, Key Encipherment
- * X509v3 Subject Key Identifier:
- * CD:BB:C8:85:AA:91:BD:FD:1D:BE:CD:67:7C:FF:B3:E9:4C:A8:22:E6
- * X509v3 Authority Key Identifier:
- * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
- *
- * X509v3 Subject Alternative Name: critical
- * DNS:localhost
- * Signature Algorithm: md5WithRSAEncryption
- *
+ * Data:
+ * Version: 3 (0x2)
+ * Serial Number: 1500699355 (0x5972dadb)
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org
+ * Validity
+ * Not Before: Jul 1 04:16:52 2024 GMT
+ * Not After : Jul 2 04:16:52 2034 GMT
+ * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, CN=localhost ou=SSL-Client
+ * Subject Public Key Info:
+ * Public Key Algorithm: rsaEncryption
+ * Public-Key: (2048 bit)
+ * Modulus:
+ * 00:cc:bf:92:3c:a6:57:74:1f:58:ad:c7:69:88:6f:
+ * 59:32:47:50:60:22:e4:98:49:0e:3e:1d:b8:ba:e2:
+ * 3b:b6:71:5b:fd:64:02:6d:0d:50:77:72:6e:a8:3d:
+ * 5d:d4:bd:1f:76:51:dc:9a:d0:d6:3e:d0:31:a5:24:
+ * 5a:2c:be:77:fa:88:a1:fa:06:41:c8:0f:47:70:47:
+ * 24:99:50:52:44:5b:30:62:5b:65:35:c4:28:b0:5c:
+ * ee:d0:1b:eb:39:2b:0b:a1:ac:96:48:da:56:6c:e0:
+ * e3:e6:e3:dd:45:cb:51:33:8d:40:43:d7:f0:a4:31:
+ * aa:b5:c0:df:4b:df:2b:0a:ed:7e:10:0c:ae:1f:96:
+ * a2:10:1e:6b:d0:f9:37:8b:df:0d:0e:02:35:f8:58:
+ * bc:6e:b5:57:0e:2f:ea:20:e6:73:9a:e5:6b:82:70:
+ * 25:bb:51:9a:7c:9d:e2:50:3d:cf:1e:24:3e:92:55:
+ * cf:2a:ad:0d:84:8f:a8:43:24:cd:ad:50:64:74:c2:
+ * 73:b6:e1:92:1c:b2:2b:8c:2d:7b:96:a6:41:61:5c:
+ * 1b:8f:78:28:51:40:ed:41:90:ce:1d:b8:26:81:47:
+ * 6b:e3:57:41:74:4e:20:f0:5a:1b:97:37:91:86:19:
+ * c5:f2:6d:04:c9:78:2b:5a:16:bc:fc:2b:71:5b:d0:
+ * 00:4f
+ * Exponent: 65537 (0x10001)
+ * X509v3 extensions:
+ * X509v3 Subject Key Identifier:
+ * CD:45:E2:05:92:88:A3:C7:49:28:E7:D3:37:B7:13:92:FB:B1:36:C4
+ * X509v3 Key Usage:
+ * Digital Signature, Non Repudiation, Key Encipherment
+ * X509v3 Subject Alternative Name: critical
+ * DNS:localhost
+ * X509v3 Basic Constraints:
+ * CA:FALSE
+ * X509v3 Authority Key Identifier:
+ * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Signature Value:
+ * 23:6e:e9:5d:80:0d:b3:86:c9:cd:17:81:33:bd:5b:aa:c0:65:
+ * 4c:6b:9f:fa:ee:32:e9:89:e1:d0:c7:1d:5c:43:7e:94:ac:83:
+ * af:91:90:4c:26:61:8d:fe:6b:1a:aa:6e:61:39:b3:24:4a:dc:
+ * 92:c8:ca:f2:80:b0:05:41:0c:b3:dd:ed:b7:81:42:9a:1e:4e:
+ * f2:80:6c:72:62:8b:bd:d4:cd:23:7d:7c:e8:6f:e3:67:89:6a:
+ * 79:19:dd:f6:57:62:12:fa:eb:cd:66:c3:d2:d8:40:5a:1c:dd:
+ * 7f:9f:b2:34:e9:2a:d6:14:52:ba:6e:a8:9b:0d:a9:a1:03:bf:
+ * c4:0d:92:3d:59:e4:a9:8e:20:41:39:99:81:70:9d:d0:68:98:
+ * fc:5f:49:4a:92:e5:a2:c1:51:61:f6:1e:49:56:0b:b6:8c:57:
+ * db:08:2a:f0:a3:04:dc:a1:04:a2:5c:d0:90:4f:13:8d:1c:e6:
+ * 2e:7a:63:9c:32:40:65:59:04:5d:71:90:5a:a8:db:6a:30:42:
+ * 57:5b:0b:df:ce:a1:1f:fa:23:71:f3:57:12:c4:1c:66:3b:37:
+ * 77:32:28:a7:fb:ad:ee:86:51:4c:80:2f:dd:c8:5b:9f:a7:15:
+ * 07:fa:2b:5a:ee:93:00:5f:a6:43:22:1b:40:52:15:66:01:84:
+ * 32:9e:71:21
* -----BEGIN CERTIFICATE-----
- * MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET
- * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK
- * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ
- * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp
- * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD
- * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas
- * JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV
- * 8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq
- * ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw
- * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV
- * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh
- * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F
- * HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj
- * XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN
- * cl/epUcHL7E=
+ * MIIDpTCCAo2gAwIBAgIEWXLa2zANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV
+ * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD
+ * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTJaFw0zNDA3MDIwNDE2NTJaMGsx
+ * CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l
+ * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9
+ * U1NMLUNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy/kjym
+ * V3QfWK3HaYhvWTJHUGAi5JhJDj4duLriO7ZxW/1kAm0NUHdybqg9XdS9H3ZR3JrQ
+ * 1j7QMaUkWiy+d/qIofoGQcgPR3BHJJlQUkRbMGJbZTXEKLBc7tAb6zkrC6Gslkja
+ * Vmzg4+bj3UXLUTONQEPX8KQxqrXA30vfKwrtfhAMrh+WohAea9D5N4vfDQ4CNfhY
+ * vG61Vw4v6iDmc5rla4JwJbtRmnyd4lA9zx4kPpJVzyqtDYSPqEMkza1QZHTCc7bh
+ * khyyK4wte5amQWFcG494KFFA7UGQzh24JoFHa+NXQXROIPBaG5c3kYYZxfJtBMl4
+ * K1oWvPwrcVvQAE8CAwEAAaNzMHEwHQYDVR0OBBYEFM1F4gWSiKPHSSjn0ze3E5L7
+ * sTbEMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T
+ * BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B
+ * AQUFAAOCAQEAI27pXYANs4bJzReBM71bqsBlTGuf+u4y6Ynh0McdXEN+lKyDr5GQ
+ * TCZhjf5rGqpuYTmzJErcksjK8oCwBUEMs93tt4FCmh5O8oBscmKLvdTNI3186G/j
+ * Z4lqeRnd9ldiEvrrzWbD0thAWhzdf5+yNOkq1hRSum6omw2poQO/xA2SPVnkqY4g
+ * QTmZgXCd0GiY/F9JSpLlosFRYfYeSVYLtoxX2wgq8KME3KEEolzQkE8TjRzmLnpj
+ * nDJAZVkEXXGQWqjbajBCV1sL386hH/ojcfNXEsQcZjs3dzIop/ut7oZRTIAv3chb
+ * n6cVB/orWu6TAF+mQyIbQFIVZgGEMp5xIQ==
* -----END CERTIFICATE-----
*
*
- *
* Trusted CA certificate:
* Certificate:
* Data:
- * Version: 3 (0x2)
- * Serial Number: 0 (0x0)
- * Signature Algorithm: md5WithRSAEncryption
- * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
- * Validity
- * Not Before: Dec 8 02:43:36 2008 GMT
- * Not After : Aug 25 02:43:36 2028 GMT
- * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org
- * Subject Public Key Info:
- * Public Key Algorithm: rsaEncryption
- * RSA Public Key: (1024 bit)
- * Modulus (1024 bit):
- * 00:cb:c4:38:20:07:be:88:a7:93:b0:a1:43:51:2d:
- * d7:8e:85:af:54:dd:ad:a2:7b:23:5b:cf:99:13:53:
- * 99:45:7d:ee:6d:ba:2d:bf:e3:ad:6e:3d:9f:1a:f9:
- * 03:97:e0:17:55:ae:11:26:57:de:01:29:8e:05:3f:
- * 21:f7:e7:36:e8:2e:37:d7:48:ac:53:d6:60:0e:c7:
- * 50:6d:f6:c5:85:f7:8b:a6:c5:91:35:72:3c:94:ee:
- * f1:17:f0:71:e3:ec:1b:ce:ca:4e:40:42:b0:6d:ee:
- * 6a:0e:d6:e5:ad:3c:0f:c9:ba:82:4f:78:f8:89:97:
- * 89:2a:95:12:4c:d8:09:2a:e9
- * Exponent: 65537 (0x10001)
- * X509v3 extensions:
- * X509v3 Subject Key Identifier:
- * FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
- * X509v3 Authority Key Identifier:
- * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
- * DirName:/C=US/ST=Some-State/L=Some-City/O=Some-Org
- * serial:00
- *
- * X509v3 Basic Constraints:
- * CA:TRUE
- * Signature Algorithm: md5WithRSAEncryption
- *
+ * Version: 3 (0x2)
+ * Serial Number: 1539881479 (0x5bc8ba07)
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Issuer: C=Us, ST=Some-State, L=Some-City, O=Some-Org
+ * Validity
+ * Not Before: Jul 1 04:16:50 2024 GMT
+ * Not After : Jul 2 04:16:50 2034 GMT
+ * Subject: C=Us, ST=Some-State, L=Some-City, O=Some-Org
+ * Subject Public Key Info:
+ * Public Key Algorithm: rsaEncryption
+ * Public-Key: (2048 bit)
+ * Modulus:
+ * 00:bc:a6:55:60:3f:17:74:39:ba:71:8c:ef:11:3f:
+ * 9d:36:47:d5:02:d1:4d:9d:7e:b8:fe:59:b1:2b:f1:
+ * b7:b0:0c:31:57:eb:9c:9d:13:f5:4c:5f:fc:c4:9e:
+ * f9:75:09:0f:96:8f:05:77:30:a8:35:48:71:96:e4:
+ * a5:7d:1a:81:fb:e6:bf:90:80:60:5d:11:20:54:16:
+ * 0b:6d:df:64:de:18:d5:98:51:38:9d:c9:d6:5f:de:
+ * 9d:de:fe:a8:5f:d3:25:3d:ad:f3:2b:45:c8:4a:80:
+ * 97:14:7b:85:9d:cf:59:08:bb:c7:67:ac:8b:29:f3:
+ * 1e:93:bf:fb:82:53:c5:ae:b4:bc:55:30:15:a8:7e:
+ * 3f:82:22:59:43:cc:d2:62:e7:65:67:72:ec:10:8a:
+ * fc:05:90:91:72:dd:e9:6f:e2:9f:0c:ab:a1:83:55:
+ * 02:23:b7:a3:c3:50:ab:be:0b:bb:51:75:50:d1:a8:
+ * c9:e5:f5:06:fe:00:09:a6:1b:8a:16:29:0d:ab:00:
+ * 3e:bc:d2:73:d9:37:d7:d9:9a:58:6e:2d:2a:f6:76:
+ * ae:f4:ea:6d:70:de:7f:e3:04:43:c0:4f:91:3f:78:
+ * 58:d7:c2:ad:74:eb:04:9d:d0:7e:82:b8:7a:97:44:
+ * 61:fa:41:45:a6:ca:7d:a5:2e:fc:f9:a6:cf:61:cd:
+ * 75:bf
+ * Exponent: 65537 (0x10001)
+ * X509v3 extensions:
+ * X509v3 Subject Key Identifier:
+ * E0:03:90:F6:4F:BB:57:E6:7E:AF:5C:94:25:B3:85:DA:16:0A:51:40
+ * X509v3 Basic Constraints: critical
+ * CA:TRUE
+ * Signature Algorithm: sha1WithRSAEncryption
+ * Signature Value:
+ * 1f:89:34:e3:ee:05:33:3b:18:ca:96:13:3d:ad:cd:5a:e6:24:
+ * 46:94:36:ad:37:a5:36:a9:92:37:f9:ed:07:dd:44:5b:c9:2e:
+ * 68:f7:82:f3:58:1c:64:ed:64:d0:ad:eb:30:15:e0:04:3a:d7:
+ * c8:c7:9d:65:76:ae:84:e4:2e:2d:0d:68:09:0d:e5:ae:cc:a7:
+ * 54:86:ad:ff:00:95:85:01:49:db:5b:8e:c2:6f:e7:19:10:17:
+ * f7:03:b9:a8:97:21:a2:fc:7f:c0:e0:7a:12:64:b8:70:f5:e8:
+ * b6:e1:25:f7:eb:32:3e:46:ce:43:55:fc:0b:62:59:90:61:63:
+ * f9:94:6c:95:63:31:1b:00:59:1f:72:9d:d0:0b:4f:cd:02:eb:
+ * de:20:4e:60:48:4e:ea:ad:3c:0f:1d:bf:1a:69:3d:a8:3d:8b:
+ * f5:a2:ae:8c:4f:d7:0e:b3:e1:9b:b3:2c:89:19:18:da:db:e1:
+ * 6d:d5:ab:c8:b8:48:57:d8:8b:33:01:d4:97:91:d9:da:34:a1:
+ * ef:36:00:e1:38:19:34:8f:0d:47:af:57:cf:59:d6:8b:0d:9e:
+ * 89:05:82:3d:3c:f3:45:1d:4a:3f:0e:0f:5a:28:6f:5c:e1:e9:
+ * 60:72:87:28:b6:97:44:8b:d7:c6:cd:cb:dc:5a:5d:60:f1:b4:
+ * 37:ee:44:db
* -----BEGIN CERTIFICATE-----
- * MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET
- * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK
- * EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ
- * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp
- * dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
- * gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX
- * 4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj
- * 7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G
- * A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ
- * hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt
- * U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw
- * DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA
- * ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ
- * LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P
- * 6Mvf0r1PNTY2hwTJLJmKtg==
+ * MIIDQjCCAiqgAwIBAgIEW8i6BzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV
+ * czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD
+ * VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTBaFw0zNDA3MDIwNDE2NTBaMEkx
+ * CzAJBgNVBAYTAlVzMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l
+ * LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
+ * MIIBCgKCAQEAvKZVYD8XdDm6cYzvET+dNkfVAtFNnX64/lmxK/G3sAwxV+ucnRP1
+ * TF/8xJ75dQkPlo8FdzCoNUhxluSlfRqB++a/kIBgXREgVBYLbd9k3hjVmFE4ncnW
+ * X96d3v6oX9MlPa3zK0XISoCXFHuFnc9ZCLvHZ6yLKfMek7/7glPFrrS8VTAVqH4/
+ * giJZQ8zSYudlZ3LsEIr8BZCRct3pb+KfDKuhg1UCI7ejw1Crvgu7UXVQ0ajJ5fUG
+ * /gAJphuKFikNqwA+vNJz2TfX2ZpYbi0q9nau9OptcN5/4wRDwE+RP3hY18KtdOsE
+ * ndB+grh6l0Rh+kFFpsp9pS78+abPYc11vwIDAQABozIwMDAdBgNVHQ4EFgQU4AOQ
+ * 9k+7V+Z+r1yUJbOF2hYKUUAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUF
+ * AAOCAQEAH4k04+4FMzsYypYTPa3NWuYkRpQ2rTelNqmSN/ntB91EW8kuaPeC81gc
+ * ZO1k0K3rMBXgBDrXyMedZXauhOQuLQ1oCQ3lrsynVIat/wCVhQFJ21uOwm/nGRAX
+ * 9wO5qJchovx/wOB6EmS4cPXotuEl9+syPkbOQ1X8C2JZkGFj+ZRslWMxGwBZH3Kd
+ * 0AtPzQLr3iBOYEhO6q08Dx2/Gmk9qD2L9aKujE/XDrPhm7MsiRkY2tvhbdWryLhI
+ * V9iLMwHUl5HZ2jSh7zYA4TgZNI8NR69Xz1nWiw2eiQWCPTzzRR1KPw4PWihvXOHp
+ * YHKHKLaXRIvXxs3L3FpdYPG0N+5E2w==
* -----END CERTIFICATE---
*/
-
public class SunX509ExtendedTM {
/*
@@ -423,201 +563,342 @@ public class SunX509ExtendedTM {
*/
static String trusedCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
- "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
- "EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ\n" +
- "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
- "dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" +
- "gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX\n" +
- "4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj\n" +
- "7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G\n" +
- "A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ\n" +
- "hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt\n" +
- "U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw\n" +
- "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA\n" +
- "ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ\n" +
- "LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P\n" +
- "6Mvf0r1PNTY2hwTJLJmKtg==\n" +
+ "MIIDQjCCAiqgAwIBAgIEW8i6BzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" +
+ "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" +
+ "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTBaFw0zNDA3MDIwNDE2NTBaMEkx\n" +
+ "CzAJBgNVBAYTAlVzMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" +
+ "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n" +
+ "MIIBCgKCAQEAvKZVYD8XdDm6cYzvET+dNkfVAtFNnX64/lmxK/G3sAwxV+ucnRP1\n" +
+ "TF/8xJ75dQkPlo8FdzCoNUhxluSlfRqB++a/kIBgXREgVBYLbd9k3hjVmFE4ncnW\n" +
+ "X96d3v6oX9MlPa3zK0XISoCXFHuFnc9ZCLvHZ6yLKfMek7/7glPFrrS8VTAVqH4/\n" +
+ "giJZQ8zSYudlZ3LsEIr8BZCRct3pb+KfDKuhg1UCI7ejw1Crvgu7UXVQ0ajJ5fUG\n" +
+ "/gAJphuKFikNqwA+vNJz2TfX2ZpYbi0q9nau9OptcN5/4wRDwE+RP3hY18KtdOsE\n" +
+ "ndB+grh6l0Rh+kFFpsp9pS78+abPYc11vwIDAQABozIwMDAdBgNVHQ4EFgQU4AOQ\n" +
+ "9k+7V+Z+r1yUJbOF2hYKUUAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUF\n" +
+ "AAOCAQEAH4k04+4FMzsYypYTPa3NWuYkRpQ2rTelNqmSN/ntB91EW8kuaPeC81gc\n" +
+ "ZO1k0K3rMBXgBDrXyMedZXauhOQuLQ1oCQ3lrsynVIat/wCVhQFJ21uOwm/nGRAX\n" +
+ "9wO5qJchovx/wOB6EmS4cPXotuEl9+syPkbOQ1X8C2JZkGFj+ZRslWMxGwBZH3Kd\n" +
+ "0AtPzQLr3iBOYEhO6q08Dx2/Gmk9qD2L9aKujE/XDrPhm7MsiRkY2tvhbdWryLhI\n" +
+ "V9iLMwHUl5HZ2jSh7zYA4TgZNI8NR69Xz1nWiw2eiQWCPTzzRR1KPw4PWihvXOHp\n" +
+ "YHKHKLaXRIvXxs3L3FpdYPG0N+5E2w==\n" +
"-----END CERTIFICATE-----";
static String serverCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
- "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
- "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ\n" +
- "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
- "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD\n" +
- "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3\n" +
- "ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6\n" +
- "YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS\n" +
- "7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" +
- "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV\n" +
- "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" +
- "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac\n" +
- "PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi\n" +
- "nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn\n" +
- "JqCpf5uZGOo=\n" +
+ "MIIDpTCCAo2gAwIBAgIEBlY/nzANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" +
+ "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" +
+ "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTVaFw0zNDA3MDIwNDE2NTVaMGsx\n" +
+ "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" +
+ "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9\n" +
+ "U1NMLVNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoM4I+o\n" +
+ "An5a7+2yQq0ITpG6wq2bedebD/3S+BUvGYmAEAACGW0nwpDXpSNTdG5kKHwkqu3q\n" +
+ "IVnco1y1yUIxT6Le+wl8c+2IBDTxFa09YM3KxROZ05+bspJwy7pLPSCWrb6SU+1U\n" +
+ "O8UUvc/UD8sFT/0rnuBQu2UTksDWvU0CDHC2ZdR9tE3D3ywIntI+aTJGb2/K0XOk\n" +
+ "lAfvFOPani/ArA4QM0xoefN5QNbpPMLmcOCJzqB6qIQohTI3CLDPsX9fvB+lPe/W\n" +
+ "aKgXIV+H1Uu1zO54jd2xKGrA+2S9t3ACMwMLuLi7CIL2jgUn0TvmxaxNhVuhHaNI\n" +
+ "XQMVdmNscSE+mM0CAwEAAaNzMHEwHQYDVR0OBBYEFFyvRLFIuFmaZFOdLqayCdMK\n" +
+ "kgSDMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T\n" +
+ "BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B\n" +
+ "AQUFAAOCAQEAnSJJX1Yj5oA1zKtEHCe9yY2Jk0lY6MF6aN3PveASdgZUzS9im1SE\n" +
+ "8ruQoLs34hMd899BquD+wO9GeI2q9BtwrakWJPoVSsYKjeGZkwCp1LYIXY5lA9zQ\n" +
+ "lfyVYaattatNpuAFSIzbQkKK1l7AKqARFbgHaVw/maC9U2XbTs9GYZMJe4FA/1z+\n" +
+ "TOv0rN4fOK2yYCj2Dp9G5wePIJqk4Y+rVJl2gtiecMTamIVxrztU5AG0noPQe8aN\n" +
+ "H+0lCIkF6YeXdlqjhcP4Wde7O1rby+1d/6whuZriZQq83tHcU5SYRJeRsxtrgAub\n" +
+ "V7OuXHw1yjlx906PStfrCyXash4XSLjrCQ==\n" +
"-----END CERTIFICATE-----";
static String clientCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
- "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
- "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ\n" +
- "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
- "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD\n" +
- "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas\n" +
- "JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV\n" +
- "8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq\n" +
- "ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" +
- "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV\n" +
- "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" +
- "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F\n" +
- "HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj\n" +
- "XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN\n" +
- "cl/epUcHL7E=\n" +
+ "MIIDpTCCAo2gAwIBAgIEWXLa2zANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJV\n" +
+ "czETMBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYD\n" +
+ "VQQKEwhTb21lLU9yZzAeFw0yNDA3MDEwNDE2NTJaFw0zNDA3MDIwNDE2NTJaMGsx\n" +
+ "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21l\n" +
+ "LUNpdHkxETAPBgNVBAoTCFNvbWUtT3JnMSAwHgYDVQQDExdsb2NhbGhvc3Qgb3U9\n" +
+ "U1NMLUNsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy/kjym\n" +
+ "V3QfWK3HaYhvWTJHUGAi5JhJDj4duLriO7ZxW/1kAm0NUHdybqg9XdS9H3ZR3JrQ\n" +
+ "1j7QMaUkWiy+d/qIofoGQcgPR3BHJJlQUkRbMGJbZTXEKLBc7tAb6zkrC6Gslkja\n" +
+ "Vmzg4+bj3UXLUTONQEPX8KQxqrXA30vfKwrtfhAMrh+WohAea9D5N4vfDQ4CNfhY\n" +
+ "vG61Vw4v6iDmc5rla4JwJbtRmnyd4lA9zx4kPpJVzyqtDYSPqEMkza1QZHTCc7bh\n" +
+ "khyyK4wte5amQWFcG494KFFA7UGQzh24JoFHa+NXQXROIPBaG5c3kYYZxfJtBMl4\n" +
+ "K1oWvPwrcVvQAE8CAwEAAaNzMHEwHQYDVR0OBBYEFM1F4gWSiKPHSSjn0ze3E5L7\n" +
+ "sTbEMAsGA1UdDwQEAwIF4DAXBgNVHREBAf8EDTALgglsb2NhbGhvc3QwCQYDVR0T\n" +
+ "BAIwADAfBgNVHSMEGDAWgBTgA5D2T7tX5n6vXJQls4XaFgpRQDANBgkqhkiG9w0B\n" +
+ "AQUFAAOCAQEAI27pXYANs4bJzReBM71bqsBlTGuf+u4y6Ynh0McdXEN+lKyDr5GQ\n" +
+ "TCZhjf5rGqpuYTmzJErcksjK8oCwBUEMs93tt4FCmh5O8oBscmKLvdTNI3186G/j\n" +
+ "Z4lqeRnd9ldiEvrrzWbD0thAWhzdf5+yNOkq1hRSum6omw2poQO/xA2SPVnkqY4g\n" +
+ "QTmZgXCd0GiY/F9JSpLlosFRYfYeSVYLtoxX2wgq8KME3KEEolzQkE8TjRzmLnpj\n" +
+ "nDJAZVkEXXGQWqjbajBCV1sL386hH/ojcfNXEsQcZjs3dzIop/ut7oZRTIAv3chb\n" +
+ "n6cVB/orWu6TAF+mQyIbQFIVZgGEMp5xIQ==\n" +
"-----END CERTIFICATE-----";
static byte serverPrivateExponent[] = {
- (byte)0x6e, (byte)0xa7, (byte)0x1b, (byte)0x83,
- (byte)0x51, (byte)0x35, (byte)0x9a, (byte)0x44,
- (byte)0x7d, (byte)0xf6, (byte)0xe3, (byte)0x89,
- (byte)0xa0, (byte)0xd7, (byte)0x90, (byte)0x60,
- (byte)0xa1, (byte)0x4e, (byte)0x27, (byte)0x21,
- (byte)0xa2, (byte)0x89, (byte)0x74, (byte)0xcc,
- (byte)0x9d, (byte)0x75, (byte)0x75, (byte)0x4e,
- (byte)0xc7, (byte)0x82, (byte)0xe3, (byte)0xe3,
- (byte)0xc3, (byte)0x7d, (byte)0x00, (byte)0x54,
- (byte)0xec, (byte)0x36, (byte)0xb1, (byte)0xdf,
- (byte)0x91, (byte)0x9c, (byte)0x7a, (byte)0xc0,
- (byte)0x62, (byte)0x0a, (byte)0xd6, (byte)0xa9,
- (byte)0x22, (byte)0x91, (byte)0x4a, (byte)0x29,
- (byte)0x2e, (byte)0x43, (byte)0xfa, (byte)0x8c,
- (byte)0xd8, (byte)0xe9, (byte)0xbe, (byte)0xd9,
- (byte)0x4f, (byte)0xca, (byte)0x23, (byte)0xc6,
- (byte)0xe4, (byte)0x3f, (byte)0xb8, (byte)0x72,
- (byte)0xcf, (byte)0x02, (byte)0xfc, (byte)0xf4,
- (byte)0x58, (byte)0x34, (byte)0x77, (byte)0x76,
- (byte)0xce, (byte)0x22, (byte)0x44, (byte)0x5f,
- (byte)0x2d, (byte)0xca, (byte)0xee, (byte)0xf5,
- (byte)0x43, (byte)0x56, (byte)0x47, (byte)0x71,
- (byte)0x0b, (byte)0x09, (byte)0x6b, (byte)0x5e,
- (byte)0xf2, (byte)0xc8, (byte)0xee, (byte)0xd4,
- (byte)0x6e, (byte)0x44, (byte)0x92, (byte)0x2a,
- (byte)0x7f, (byte)0xcc, (byte)0xa7, (byte)0xd4,
- (byte)0x5b, (byte)0xfb, (byte)0xf7, (byte)0x4a,
- (byte)0xa9, (byte)0xfb, (byte)0x54, (byte)0x18,
- (byte)0xd5, (byte)0xd5, (byte)0x14, (byte)0xba,
- (byte)0xa0, (byte)0x1c, (byte)0x13, (byte)0xb3,
- (byte)0x37, (byte)0x6b, (byte)0x37, (byte)0x59,
- (byte)0xed, (byte)0xdb, (byte)0x6d, (byte)0xb1
+ (byte)0x68, (byte)0x87, (byte)0x36, (byte)0x54,
+ (byte)0xa3, (byte)0xc6, (byte)0xd5, (byte)0x5f,
+ (byte)0xf5, (byte)0x0f, (byte)0x4f, (byte)0x76,
+ (byte)0xc8, (byte)0x9c, (byte)0x2b, (byte)0x5b,
+ (byte)0xdc, (byte)0xe2, (byte)0xbe, (byte)0x14,
+ (byte)0x12, (byte)0x2f, (byte)0xc7, (byte)0x0a,
+ (byte)0xa9, (byte)0xcb, (byte)0x5e, (byte)0x04,
+ (byte)0x59, (byte)0xca, (byte)0x35, (byte)0x2f,
+ (byte)0x8d, (byte)0x2b, (byte)0xc4, (byte)0x40,
+ (byte)0xe6, (byte)0x7d, (byte)0x25, (byte)0x1b,
+ (byte)0x4d, (byte)0x07, (byte)0xc3, (byte)0x99,
+ (byte)0x9c, (byte)0x16, (byte)0x4f, (byte)0xa5,
+ (byte)0xdc, (byte)0xde, (byte)0xb0, (byte)0x90,
+ (byte)0xf0, (byte)0xde, (byte)0x22, (byte)0x70,
+ (byte)0x80, (byte)0xf4, (byte)0xa6, (byte)0x70,
+ (byte)0xe2, (byte)0x96, (byte)0x3d, (byte)0x18,
+ (byte)0x21, (byte)0xbf, (byte)0x2b, (byte)0x27,
+ (byte)0xa4, (byte)0x2d, (byte)0xd7, (byte)0xae,
+ (byte)0x2b, (byte)0x12, (byte)0x2f, (byte)0x08,
+ (byte)0x36, (byte)0xee, (byte)0x99, (byte)0x94,
+ (byte)0xed, (byte)0xf6, (byte)0xa7, (byte)0xd9,
+ (byte)0x1d, (byte)0xa2, (byte)0xf3, (byte)0x1f,
+ (byte)0x44, (byte)0xa4, (byte)0x28, (byte)0x4b,
+ (byte)0x67, (byte)0x35, (byte)0xd6, (byte)0xa8,
+ (byte)0x1b, (byte)0xf8, (byte)0x84, (byte)0x34,
+ (byte)0x34, (byte)0x84, (byte)0xbd, (byte)0xec,
+ (byte)0x9e, (byte)0x03, (byte)0x08, (byte)0x3c,
+ (byte)0x93, (byte)0x20, (byte)0x8e, (byte)0xaf,
+ (byte)0x15, (byte)0xcb, (byte)0x1f, (byte)0x20,
+ (byte)0x08, (byte)0x97, (byte)0xc4, (byte)0x19,
+ (byte)0x3e, (byte)0xfa, (byte)0x36, (byte)0xc6,
+ (byte)0xab, (byte)0x0e, (byte)0x2f, (byte)0xe7,
+ (byte)0xb3, (byte)0xc0, (byte)0xa7, (byte)0xbc,
+ (byte)0xe4, (byte)0xe0, (byte)0xa6, (byte)0x08,
+ (byte)0x1c, (byte)0x69, (byte)0x20, (byte)0x4d,
+ (byte)0x78, (byte)0xbd, (byte)0x7a, (byte)0xe5,
+ (byte)0x25, (byte)0x48, (byte)0x60, (byte)0x9e,
+ (byte)0x2e, (byte)0x50, (byte)0x8d, (byte)0x36,
+ (byte)0x1e, (byte)0x07, (byte)0xe9, (byte)0xd5,
+ (byte)0x0d, (byte)0x39, (byte)0x67, (byte)0x41,
+ (byte)0x42, (byte)0x24, (byte)0xdb, (byte)0x87,
+ (byte)0xe5, (byte)0x77, (byte)0x76, (byte)0xfd,
+ (byte)0x5e, (byte)0xd5, (byte)0xc6, (byte)0xe5,
+ (byte)0xd3, (byte)0xb0, (byte)0x98, (byte)0x71,
+ (byte)0x48, (byte)0x69, (byte)0x47, (byte)0x4f,
+ (byte)0x46, (byte)0x05, (byte)0x0c, (byte)0x9e,
+ (byte)0x58, (byte)0x45, (byte)0x2e, (byte)0xe2,
+ (byte)0x27, (byte)0xd0, (byte)0xf6, (byte)0x11,
+ (byte)0x05, (byte)0x78, (byte)0xad, (byte)0x83,
+ (byte)0x5a, (byte)0x5b, (byte)0xec, (byte)0xd7,
+ (byte)0x2e, (byte)0x26, (byte)0x5a, (byte)0xa5,
+ (byte)0x4f, (byte)0x9e, (byte)0x52, (byte)0x84,
+ (byte)0x2c, (byte)0x1f, (byte)0x59, (byte)0x1a,
+ (byte)0x78, (byte)0x56, (byte)0x0a, (byte)0x44,
+ (byte)0x54, (byte)0xc6, (byte)0x37, (byte)0x64,
+ (byte)0x01, (byte)0xca, (byte)0xe4, (byte)0xa8,
+ (byte)0x01, (byte)0xc7, (byte)0x86, (byte)0xc1,
+ (byte)0xb4, (byte)0xd6, (byte)0x6c, (byte)0x7a,
+ (byte)0x15, (byte)0x9a, (byte)0x65, (byte)0x69,
+ (byte)0x46, (byte)0x9e, (byte)0xfd, (byte)0xf6,
+ (byte)0x08, (byte)0x17, (byte)0x0c, (byte)0x6c,
+ (byte)0xac, (byte)0x38, (byte)0xbd, (byte)0xc2,
+ (byte)0xcd, (byte)0xda, (byte)0xef, (byte)0x54,
+ (byte)0x7a, (byte)0x48, (byte)0x92, (byte)0x4d
};
static byte serverModulus[] = {
- (byte)0x00,
- (byte)0xa5, (byte)0xac, (byte)0x5b, (byte)0x1c,
- (byte)0x37, (byte)0xa2, (byte)0xdd, (byte)0x99,
- (byte)0x89, (byte)0x2d, (byte)0xb2, (byte)0x79,
- (byte)0xb8, (byte)0x8f, (byte)0xd5, (byte)0x48,
- (byte)0xa5, (byte)0xe7, (byte)0x1c, (byte)0x84,
- (byte)0x17, (byte)0x8d, (byte)0x69, (byte)0x9c,
- (byte)0xc6, (byte)0xac, (byte)0x6d, (byte)0xf9,
- (byte)0xf2, (byte)0x1d, (byte)0x1f, (byte)0x39,
- (byte)0x19, (byte)0xda, (byte)0xd3, (byte)0x72,
- (byte)0x1e, (byte)0x6e, (byte)0xec, (byte)0x44,
- (byte)0xcc, (byte)0x70, (byte)0xa4, (byte)0xdc,
- (byte)0xba, (byte)0x00, (byte)0x30, (byte)0xf6,
- (byte)0xa0, (byte)0x4f, (byte)0x3d, (byte)0x54,
- (byte)0x7a, (byte)0x61, (byte)0x6a, (byte)0xcc,
- (byte)0x57, (byte)0xd0, (byte)0x0a, (byte)0x7f,
- (byte)0x95, (byte)0x28, (byte)0x18, (byte)0x3f,
- (byte)0x9a, (byte)0xd9, (byte)0x94, (byte)0xf2,
- (byte)0x1b, (byte)0xc8, (byte)0x24, (byte)0x88,
- (byte)0x7e, (byte)0xfe, (byte)0x9d, (byte)0x0f,
- (byte)0x3d, (byte)0xfb, (byte)0x57, (byte)0x53,
- (byte)0x08, (byte)0xb3, (byte)0x20, (byte)0x33,
- (byte)0xd4, (byte)0x3f, (byte)0x17, (byte)0x47,
- (byte)0x14, (byte)0xd1, (byte)0xcd, (byte)0xea,
- (byte)0x08, (byte)0xd8, (byte)0x0e, (byte)0x75,
- (byte)0x4e, (byte)0xaf, (byte)0xbe, (byte)0xcc,
- (byte)0xd2, (byte)0xec, (byte)0xaf, (byte)0xa9,
- (byte)0x7a, (byte)0x49, (byte)0xdf, (byte)0xc2,
- (byte)0xd9, (byte)0xac, (byte)0xb8, (byte)0x24,
- (byte)0x40, (byte)0x90, (byte)0xa6, (byte)0x03,
- (byte)0x56, (byte)0x2a, (byte)0xd0, (byte)0x30,
- (byte)0x05, (byte)0x40, (byte)0x2c, (byte)0x4f,
- (byte)0xab, (byte)0xd9, (byte)0x74, (byte)0x89
+ (byte)0x00, (byte)0x9a, (byte)0x0c, (byte)0xe0,
+ (byte)0x8f, (byte)0xa8, (byte)0x02, (byte)0x7e,
+ (byte)0x5a, (byte)0xef, (byte)0xed, (byte)0xb2,
+ (byte)0x42, (byte)0xad, (byte)0x08, (byte)0x4e,
+ (byte)0x91, (byte)0xba, (byte)0xc2, (byte)0xad,
+ (byte)0x9b, (byte)0x79, (byte)0xd7, (byte)0x9b,
+ (byte)0x0f, (byte)0xfd, (byte)0xd2, (byte)0xf8,
+ (byte)0x15, (byte)0x2f, (byte)0x19, (byte)0x89,
+ (byte)0x80, (byte)0x10, (byte)0x00, (byte)0x02,
+ (byte)0x19, (byte)0x6d, (byte)0x27, (byte)0xc2,
+ (byte)0x90, (byte)0xd7, (byte)0xa5, (byte)0x23,
+ (byte)0x53, (byte)0x74, (byte)0x6e, (byte)0x64,
+ (byte)0x28, (byte)0x7c, (byte)0x24, (byte)0xaa,
+ (byte)0xed, (byte)0xea, (byte)0x21, (byte)0x59,
+ (byte)0xdc, (byte)0xa3, (byte)0x5c, (byte)0xb5,
+ (byte)0xc9, (byte)0x42, (byte)0x31, (byte)0x4f,
+ (byte)0xa2, (byte)0xde, (byte)0xfb, (byte)0x09,
+ (byte)0x7c, (byte)0x73, (byte)0xed, (byte)0x88,
+ (byte)0x04, (byte)0x34, (byte)0xf1, (byte)0x15,
+ (byte)0xad, (byte)0x3d, (byte)0x60, (byte)0xcd,
+ (byte)0xca, (byte)0xc5, (byte)0x13, (byte)0x99,
+ (byte)0xd3, (byte)0x9f, (byte)0x9b, (byte)0xb2,
+ (byte)0x92, (byte)0x70, (byte)0xcb, (byte)0xba,
+ (byte)0x4b, (byte)0x3d, (byte)0x20, (byte)0x96,
+ (byte)0xad, (byte)0xbe, (byte)0x92, (byte)0x53,
+ (byte)0xed, (byte)0x54, (byte)0x3b, (byte)0xc5,
+ (byte)0x14, (byte)0xbd, (byte)0xcf, (byte)0xd4,
+ (byte)0x0f, (byte)0xcb, (byte)0x05, (byte)0x4f,
+ (byte)0xfd, (byte)0x2b, (byte)0x9e, (byte)0xe0,
+ (byte)0x50, (byte)0xbb, (byte)0x65, (byte)0x13,
+ (byte)0x92, (byte)0xc0, (byte)0xd6, (byte)0xbd,
+ (byte)0x4d, (byte)0x02, (byte)0x0c, (byte)0x70,
+ (byte)0xb6, (byte)0x65, (byte)0xd4, (byte)0x7d,
+ (byte)0xb4, (byte)0x4d, (byte)0xc3, (byte)0xdf,
+ (byte)0x2c, (byte)0x08, (byte)0x9e, (byte)0xd2,
+ (byte)0x3e, (byte)0x69, (byte)0x32, (byte)0x46,
+ (byte)0x6f, (byte)0x6f, (byte)0xca, (byte)0xd1,
+ (byte)0x73, (byte)0xa4, (byte)0x94, (byte)0x07,
+ (byte)0xef, (byte)0x14, (byte)0xe3, (byte)0xda,
+ (byte)0x9e, (byte)0x2f, (byte)0xc0, (byte)0xac,
+ (byte)0x0e, (byte)0x10, (byte)0x33, (byte)0x4c,
+ (byte)0x68, (byte)0x79, (byte)0xf3, (byte)0x79,
+ (byte)0x40, (byte)0xd6, (byte)0xe9, (byte)0x3c,
+ (byte)0xc2, (byte)0xe6, (byte)0x70, (byte)0xe0,
+ (byte)0x89, (byte)0xce, (byte)0xa0, (byte)0x7a,
+ (byte)0xa8, (byte)0x84, (byte)0x28, (byte)0x85,
+ (byte)0x32, (byte)0x37, (byte)0x08, (byte)0xb0,
+ (byte)0xcf, (byte)0xb1, (byte)0x7f, (byte)0x5f,
+ (byte)0xbc, (byte)0x1f, (byte)0xa5, (byte)0x3d,
+ (byte)0xef, (byte)0xd6, (byte)0x68, (byte)0xa8,
+ (byte)0x17, (byte)0x21, (byte)0x5f, (byte)0x87,
+ (byte)0xd5, (byte)0x4b, (byte)0xb5, (byte)0xcc,
+ (byte)0xee, (byte)0x78, (byte)0x8d, (byte)0xdd,
+ (byte)0xb1, (byte)0x28, (byte)0x6a, (byte)0xc0,
+ (byte)0xfb, (byte)0x64, (byte)0xbd, (byte)0xb7,
+ (byte)0x70, (byte)0x02, (byte)0x33, (byte)0x03,
+ (byte)0x0b, (byte)0xb8, (byte)0xb8, (byte)0xbb,
+ (byte)0x08, (byte)0x82, (byte)0xf6, (byte)0x8e,
+ (byte)0x05, (byte)0x27, (byte)0xd1, (byte)0x3b,
+ (byte)0xe6, (byte)0xc5, (byte)0xac, (byte)0x4d,
+ (byte)0x85, (byte)0x5b, (byte)0xa1, (byte)0x1d,
+ (byte)0xa3, (byte)0x48, (byte)0x5d, (byte)0x03,
+ (byte)0x15, (byte)0x76, (byte)0x63, (byte)0x6c,
+ (byte)0x71, (byte)0x21, (byte)0x3e, (byte)0x98,
+ (byte)0xcd
};
static byte clientPrivateExponent[] = {
- (byte)0x11, (byte)0xb7, (byte)0x6a, (byte)0x36,
- (byte)0x3d, (byte)0x30, (byte)0x37, (byte)0xce,
- (byte)0x61, (byte)0x9d, (byte)0x6c, (byte)0x84,
- (byte)0x8b, (byte)0xf3, (byte)0x9b, (byte)0x25,
- (byte)0x4f, (byte)0x14, (byte)0xc8, (byte)0xa4,
- (byte)0xdd, (byte)0x2f, (byte)0xd7, (byte)0x9a,
- (byte)0x17, (byte)0xbd, (byte)0x90, (byte)0x19,
- (byte)0xf7, (byte)0x05, (byte)0xfd, (byte)0xf2,
- (byte)0xd2, (byte)0xc5, (byte)0xf7, (byte)0x77,
- (byte)0xbe, (byte)0xea, (byte)0xe2, (byte)0x84,
- (byte)0x87, (byte)0x97, (byte)0x3a, (byte)0x41,
- (byte)0x96, (byte)0xb6, (byte)0x99, (byte)0xf8,
- (byte)0x94, (byte)0x8c, (byte)0x58, (byte)0x71,
- (byte)0x51, (byte)0x8c, (byte)0xf4, (byte)0x2a,
- (byte)0x20, (byte)0x9e, (byte)0x1a, (byte)0xa0,
- (byte)0x26, (byte)0x99, (byte)0x75, (byte)0xd6,
- (byte)0x31, (byte)0x53, (byte)0x43, (byte)0x39,
- (byte)0xf5, (byte)0x2a, (byte)0xa6, (byte)0x7e,
- (byte)0x34, (byte)0x42, (byte)0x51, (byte)0x2a,
- (byte)0x40, (byte)0x87, (byte)0x03, (byte)0x88,
- (byte)0x43, (byte)0x69, (byte)0xb2, (byte)0x89,
- (byte)0x6d, (byte)0x20, (byte)0xbd, (byte)0x7d,
- (byte)0x71, (byte)0xef, (byte)0x47, (byte)0x0a,
- (byte)0xdf, (byte)0x06, (byte)0xc1, (byte)0x69,
- (byte)0x66, (byte)0xa8, (byte)0x22, (byte)0x37,
- (byte)0x1a, (byte)0x77, (byte)0x1e, (byte)0xc7,
- (byte)0x94, (byte)0x4e, (byte)0x2c, (byte)0x27,
- (byte)0x69, (byte)0x45, (byte)0x5e, (byte)0xc8,
- (byte)0xf8, (byte)0x0c, (byte)0xb7, (byte)0xf8,
- (byte)0xc0, (byte)0x8f, (byte)0x99, (byte)0xc1,
- (byte)0xe5, (byte)0x28, (byte)0x9b, (byte)0xf9,
- (byte)0x4c, (byte)0x94, (byte)0xc6, (byte)0xb1
+ (byte)0x62, (byte)0xb2, (byte)0xd6, (byte)0x63,
+ (byte)0xb6, (byte)0x2b, (byte)0xe2, (byte)0x26,
+ (byte)0x5a, (byte)0x31, (byte)0x2b, (byte)0x37,
+ (byte)0x8c, (byte)0x35, (byte)0x60, (byte)0xe2,
+ (byte)0x03, (byte)0xce, (byte)0x93, (byte)0x09,
+ (byte)0x3e, (byte)0xf8, (byte)0xc9, (byte)0xfe,
+ (byte)0xbb, (byte)0xa2, (byte)0xc8, (byte)0x32,
+ (byte)0x0e, (byte)0x6c, (byte)0x8a, (byte)0x7e,
+ (byte)0x0a, (byte)0xc2, (byte)0x13, (byte)0x3b,
+ (byte)0xb8, (byte)0x25, (byte)0xfa, (byte)0xec,
+ (byte)0x19, (byte)0x95, (byte)0x8e, (byte)0x34,
+ (byte)0x46, (byte)0xcf, (byte)0x0e, (byte)0x7b,
+ (byte)0xe4, (byte)0x25, (byte)0x82, (byte)0x1a,
+ (byte)0x7f, (byte)0x21, (byte)0x48, (byte)0x16,
+ (byte)0x44, (byte)0x58, (byte)0x3f, (byte)0x35,
+ (byte)0xd8, (byte)0xeb, (byte)0xd8, (byte)0x1a,
+ (byte)0x45, (byte)0x53, (byte)0x0f, (byte)0x9b,
+ (byte)0x84, (byte)0x8a, (byte)0x54, (byte)0x13,
+ (byte)0x33, (byte)0xe4, (byte)0x97, (byte)0x97,
+ (byte)0xf0, (byte)0x48, (byte)0x37, (byte)0xfb,
+ (byte)0x5d, (byte)0x4f, (byte)0x8c, (byte)0x8f,
+ (byte)0x35, (byte)0x63, (byte)0xe1, (byte)0xd9,
+ (byte)0x62, (byte)0x73, (byte)0x1c, (byte)0x8e,
+ (byte)0xd8, (byte)0xcd, (byte)0x2e, (byte)0x1a,
+ (byte)0xe5, (byte)0x4c, (byte)0xb5, (byte)0x05,
+ (byte)0x59, (byte)0x7a, (byte)0xdf, (byte)0xf1,
+ (byte)0x68, (byte)0xeb, (byte)0x1c, (byte)0x5c,
+ (byte)0xc6, (byte)0x10, (byte)0x44, (byte)0x8c,
+ (byte)0x7d, (byte)0x42, (byte)0xc5, (byte)0x71,
+ (byte)0x8a, (byte)0xe7, (byte)0x1b, (byte)0xaa,
+ (byte)0x17, (byte)0x03, (byte)0x6a, (byte)0xa0,
+ (byte)0xc0, (byte)0x6b, (byte)0x97, (byte)0x50,
+ (byte)0x17, (byte)0xad, (byte)0x6e, (byte)0x5e,
+ (byte)0xd9, (byte)0xdb, (byte)0x6f, (byte)0x3e,
+ (byte)0xe9, (byte)0x3f, (byte)0x35, (byte)0xc3,
+ (byte)0x45, (byte)0xbc, (byte)0xe8, (byte)0x3d,
+ (byte)0x5a, (byte)0xb4, (byte)0xb9, (byte)0x3f,
+ (byte)0x53, (byte)0x80, (byte)0x64, (byte)0xdc,
+ (byte)0x12, (byte)0x24, (byte)0x35, (byte)0x35,
+ (byte)0xbd, (byte)0x98, (byte)0xbb, (byte)0x8d,
+ (byte)0xfa, (byte)0x19, (byte)0xa3, (byte)0x5e,
+ (byte)0x9e, (byte)0xac, (byte)0x70, (byte)0x4a,
+ (byte)0xfc, (byte)0x8d, (byte)0xae, (byte)0x55,
+ (byte)0x8b, (byte)0x71, (byte)0x81, (byte)0x0e,
+ (byte)0x4d, (byte)0xc8, (byte)0x2f, (byte)0x87,
+ (byte)0xb0, (byte)0x44, (byte)0xf7, (byte)0x4f,
+ (byte)0xdc, (byte)0xa8, (byte)0xc8, (byte)0x50,
+ (byte)0xb5, (byte)0x95, (byte)0x24, (byte)0x63,
+ (byte)0x74, (byte)0x13, (byte)0x54, (byte)0x58,
+ (byte)0xde, (byte)0xfc, (byte)0xe0, (byte)0x75,
+ (byte)0xeb, (byte)0xf4, (byte)0x06, (byte)0x58,
+ (byte)0x83, (byte)0x12, (byte)0x4c, (byte)0x56,
+ (byte)0xc4, (byte)0xc4, (byte)0x18, (byte)0x0c,
+ (byte)0xea, (byte)0xa3, (byte)0xe7, (byte)0x25,
+ (byte)0xa3, (byte)0xde, (byte)0x19, (byte)0x23,
+ (byte)0xa2, (byte)0x5a, (byte)0x2a, (byte)0xb6,
+ (byte)0x56, (byte)0x04, (byte)0xbc, (byte)0x65,
+ (byte)0xba, (byte)0x7c, (byte)0x0a, (byte)0xf4,
+ (byte)0x91, (byte)0x10, (byte)0x22, (byte)0x88,
+ (byte)0x3f, (byte)0x9d, (byte)0xbe, (byte)0x58,
+ (byte)0x43, (byte)0x4c, (byte)0x2e, (byte)0xad,
+ (byte)0xdb, (byte)0xd6, (byte)0x32, (byte)0xcf,
+ (byte)0x8e, (byte)0xb5, (byte)0x05, (byte)0x55,
+ (byte)0x39, (byte)0x8b, (byte)0xe1, (byte)0x01
};
static byte clientModulus[] = {
- (byte)0x00,
- (byte)0xbb, (byte)0xf0, (byte)0x40, (byte)0x36,
- (byte)0xac, (byte)0x26, (byte)0x54, (byte)0x4e,
- (byte)0xf4, (byte)0xa3, (byte)0x5a, (byte)0x00,
- (byte)0x2f, (byte)0x69, (byte)0x21, (byte)0x6f,
- (byte)0xb9, (byte)0x7a, (byte)0x3a, (byte)0x93,
- (byte)0xec, (byte)0xa2, (byte)0xf6, (byte)0xe1,
- (byte)0x8e, (byte)0xc7, (byte)0x63, (byte)0xd8,
- (byte)0x2f, (byte)0x12, (byte)0x30, (byte)0x99,
- (byte)0x2e, (byte)0xb0, (byte)0xf2, (byte)0x8f,
- (byte)0xf8, (byte)0x27, (byte)0x2d, (byte)0x24,
- (byte)0x78, (byte)0x28, (byte)0x84, (byte)0xf7,
- (byte)0x01, (byte)0xbf, (byte)0x8d, (byte)0x44,
- (byte)0x79, (byte)0xdd, (byte)0x3b, (byte)0xd2,
- (byte)0x55, (byte)0xf3, (byte)0xce, (byte)0x3c,
- (byte)0xb2, (byte)0x5b, (byte)0x21, (byte)0x7d,
- (byte)0xef, (byte)0xfd, (byte)0x33, (byte)0x4a,
- (byte)0xb1, (byte)0xa3, (byte)0xff, (byte)0xc6,
- (byte)0xc8, (byte)0x9b, (byte)0xb9, (byte)0x0f,
- (byte)0x7c, (byte)0x41, (byte)0x35, (byte)0x97,
- (byte)0xf9, (byte)0xdb, (byte)0x3a, (byte)0x05,
- (byte)0x60, (byte)0x05, (byte)0x15, (byte)0xaf,
- (byte)0x59, (byte)0x17, (byte)0x92, (byte)0xa3,
- (byte)0x10, (byte)0xad, (byte)0x16, (byte)0x1c,
- (byte)0xe4, (byte)0x07, (byte)0x53, (byte)0xaf,
- (byte)0xa8, (byte)0x76, (byte)0xa2, (byte)0x56,
- (byte)0x2a, (byte)0x92, (byte)0xd3, (byte)0xf9,
- (byte)0x28, (byte)0xe0, (byte)0x78, (byte)0xcf,
- (byte)0x5e, (byte)0x1f, (byte)0x48, (byte)0xab,
- (byte)0x5c, (byte)0x19, (byte)0xdd, (byte)0xe1,
- (byte)0x67, (byte)0x43, (byte)0xba, (byte)0x75,
- (byte)0x8d, (byte)0xf5, (byte)0x82, (byte)0xac,
- (byte)0x43, (byte)0x92, (byte)0x44, (byte)0x1b
+ (byte)0x00, (byte)0xcc, (byte)0xbf, (byte)0x92,
+ (byte)0x3c, (byte)0xa6, (byte)0x57, (byte)0x74,
+ (byte)0x1f, (byte)0x58, (byte)0xad, (byte)0xc7,
+ (byte)0x69, (byte)0x88, (byte)0x6f, (byte)0x59,
+ (byte)0x32, (byte)0x47, (byte)0x50, (byte)0x60,
+ (byte)0x22, (byte)0xe4, (byte)0x98, (byte)0x49,
+ (byte)0x0e, (byte)0x3e, (byte)0x1d, (byte)0xb8,
+ (byte)0xba, (byte)0xe2, (byte)0x3b, (byte)0xb6,
+ (byte)0x71, (byte)0x5b, (byte)0xfd, (byte)0x64,
+ (byte)0x02, (byte)0x6d, (byte)0x0d, (byte)0x50,
+ (byte)0x77, (byte)0x72, (byte)0x6e, (byte)0xa8,
+ (byte)0x3d, (byte)0x5d, (byte)0xd4, (byte)0xbd,
+ (byte)0x1f, (byte)0x76, (byte)0x51, (byte)0xdc,
+ (byte)0x9a, (byte)0xd0, (byte)0xd6, (byte)0x3e,
+ (byte)0xd0, (byte)0x31, (byte)0xa5, (byte)0x24,
+ (byte)0x5a, (byte)0x2c, (byte)0xbe, (byte)0x77,
+ (byte)0xfa, (byte)0x88, (byte)0xa1, (byte)0xfa,
+ (byte)0x06, (byte)0x41, (byte)0xc8, (byte)0x0f,
+ (byte)0x47, (byte)0x70, (byte)0x47, (byte)0x24,
+ (byte)0x99, (byte)0x50, (byte)0x52, (byte)0x44,
+ (byte)0x5b, (byte)0x30, (byte)0x62, (byte)0x5b,
+ (byte)0x65, (byte)0x35, (byte)0xc4, (byte)0x28,
+ (byte)0xb0, (byte)0x5c, (byte)0xee, (byte)0xd0,
+ (byte)0x1b, (byte)0xeb, (byte)0x39, (byte)0x2b,
+ (byte)0x0b, (byte)0xa1, (byte)0xac, (byte)0x96,
+ (byte)0x48, (byte)0xda, (byte)0x56, (byte)0x6c,
+ (byte)0xe0, (byte)0xe3, (byte)0xe6, (byte)0xe3,
+ (byte)0xdd, (byte)0x45, (byte)0xcb, (byte)0x51,
+ (byte)0x33, (byte)0x8d, (byte)0x40, (byte)0x43,
+ (byte)0xd7, (byte)0xf0, (byte)0xa4, (byte)0x31,
+ (byte)0xaa, (byte)0xb5, (byte)0xc0, (byte)0xdf,
+ (byte)0x4b, (byte)0xdf, (byte)0x2b, (byte)0x0a,
+ (byte)0xed, (byte)0x7e, (byte)0x10, (byte)0x0c,
+ (byte)0xae, (byte)0x1f, (byte)0x96, (byte)0xa2,
+ (byte)0x10, (byte)0x1e, (byte)0x6b, (byte)0xd0,
+ (byte)0xf9, (byte)0x37, (byte)0x8b, (byte)0xdf,
+ (byte)0x0d, (byte)0x0e, (byte)0x02, (byte)0x35,
+ (byte)0xf8, (byte)0x58, (byte)0xbc, (byte)0x6e,
+ (byte)0xb5, (byte)0x57, (byte)0x0e, (byte)0x2f,
+ (byte)0xea, (byte)0x20, (byte)0xe6, (byte)0x73,
+ (byte)0x9a, (byte)0xe5, (byte)0x6b, (byte)0x82,
+ (byte)0x70, (byte)0x25, (byte)0xbb, (byte)0x51,
+ (byte)0x9a, (byte)0x7c, (byte)0x9d, (byte)0xe2,
+ (byte)0x50, (byte)0x3d, (byte)0xcf, (byte)0x1e,
+ (byte)0x24, (byte)0x3e, (byte)0x92, (byte)0x55,
+ (byte)0xcf, (byte)0x2a, (byte)0xad, (byte)0x0d,
+ (byte)0x84, (byte)0x8f, (byte)0xa8, (byte)0x43,
+ (byte)0x24, (byte)0xcd, (byte)0xad, (byte)0x50,
+ (byte)0x64, (byte)0x74, (byte)0xc2, (byte)0x73,
+ (byte)0xb6, (byte)0xe1, (byte)0x92, (byte)0x1c,
+ (byte)0xb2, (byte)0x2b, (byte)0x8c, (byte)0x2d,
+ (byte)0x7b, (byte)0x96, (byte)0xa6, (byte)0x41,
+ (byte)0x61, (byte)0x5c, (byte)0x1b, (byte)0x8f,
+ (byte)0x78, (byte)0x28, (byte)0x51, (byte)0x40,
+ (byte)0xed, (byte)0x41, (byte)0x90, (byte)0xce,
+ (byte)0x1d, (byte)0xb8, (byte)0x26, (byte)0x81,
+ (byte)0x47, (byte)0x6b, (byte)0xe3, (byte)0x57,
+ (byte)0x41, (byte)0x74, (byte)0x4e, (byte)0x20,
+ (byte)0xf0, (byte)0x5a, (byte)0x1b, (byte)0x97,
+ (byte)0x37, (byte)0x91, (byte)0x86, (byte)0x19,
+ (byte)0xc5, (byte)0xf2, (byte)0x6d, (byte)0x04,
+ (byte)0xc9, (byte)0x78, (byte)0x2b, (byte)0x5a,
+ (byte)0x16, (byte)0xbc, (byte)0xfc, (byte)0x2b,
+ (byte)0x71, (byte)0x5b, (byte)0xd0, (byte)0x00,
+ (byte)0x4f
};
static char passphrase[] = "passphrase".toCharArray();
@@ -795,11 +1076,11 @@ private static SSLContext getSSLContext(String trusedCertStr,
volatile Exception clientException = null;
public static void main(String args[]) throws Exception {
- // MD5 is used in this test case, don't disable MD5 algorithm.
+ // SHA1 is used in this test case, don't disable SHA1 algorithm.
Security.setProperty("jdk.certpath.disabledAlgorithms",
- "MD2, RSA keySize < 1024");
+ "MD2, MD5, RSA keySize < 1024");
Security.setProperty("jdk.tls.disabledAlgorithms",
- "SSLv3, RC4, DH keySize < 768");
+ "SSLv3, RC4, MD5withRSA, DH keySize < 768");
if (debug)
System.setProperty("javax.net.debug", "all");
diff --git a/test/jdk/sun/security/tools/keytool/KeyToolTest.java b/test/jdk/sun/security/tools/keytool/KeyToolTest.java
index 8eda0dce712..4d3563978fe 100644
--- a/test/jdk/sun/security/tools/keytool/KeyToolTest.java
+++ b/test/jdk/sun/security/tools/keytool/KeyToolTest.java
@@ -68,6 +68,7 @@
import java.util.*;
import java.security.cert.X509Certificate;
import jdk.test.lib.util.FileUtils;
+import jdk.test.lib.security.SecurityUtils;
import sun.security.util.ObjectIdentifier;
@@ -103,6 +104,8 @@ public class KeyToolTest {
"-srcproviderName SunPKCS11-nzz " +
"-addprovider SunPKCS11 " +
"-providerArg p11-nzz.txt ";
+ private static final int KEY_LENGTH_DSA = SecurityUtils.getTestKeySize("DSA");
+ private static final int KEY_LENGTH_RSA = SecurityUtils.getTestKeySize("RSA");
String p11Arg, srcP11Arg;
@@ -192,7 +195,7 @@ void testOK(String input, String cmd) throws Exception {
// SunPKCS11-NSS does not support SHA256withDSA yet.
if (cmd.contains("p11-nss.txt") && cmd.contains("-genkey")
&& cmd.contains("DSA")) {
- cmd += " -sigalg SHA1withDSA -keysize 1024";
+ cmd += " -sigalg SHA256withDSA -keysize " + KEY_LENGTH_DSA;
}
test(input, cmd);
} catch(Exception e) {
@@ -955,6 +958,9 @@ void sqeSelfCertTest() throws Exception {
// sig not compatible
testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-keypass changeit -selfcert -sigalg MD5withRSA");
+ // sig not compatible
+ testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+ "-keypass changeit -selfcert -sigalg SHA256withRSA");
// bad pass
testFail("", "-keystore x.jks -storetype JKS -storepass wrong " +
"-keypass changeit -selfcert");
@@ -1062,10 +1068,10 @@ void sqeGenkeyTest() throws Exception {
"-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 999 " +
"-alias n5");
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
- "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 512 " +
+ "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 2048 " +
"-alias n6");
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
- "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 1024 " +
+ "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 3072 " +
"-alias n7");
testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-keypass changeit -genkeypair -keyalg DSA -dname CN=olala " +
@@ -1076,6 +1082,9 @@ void sqeGenkeyTest() throws Exception {
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " +
"-sigalg MD5withRSA -alias n10");
+ testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+ "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " +
+ "-sigalg SHA256withRSA -alias n10-1");
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " +
"-sigalg SHA1withRSA -alias n11");
@@ -1152,16 +1161,20 @@ void sqeCsrTest() throws Exception {
remove("csr1");
// PrivateKeyEntry can do certreq
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
- "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize 1024");
+ "-keypass changeit -genkeypair -keyalg DSA -dname CN=olala -keysize " +
+ KEY_LENGTH_DSA);
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-certreq -file csr1 -alias mykey");
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-certreq -file csr1");
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
- "-certreq -file csr1 -sigalg SHA1withDSA");
- // unmatched sigalg
+ "-certreq -file csr1 -sigalg SHA256withDSA");
+ // unmatched md5
testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-certreq -file csr1 -sigalg MD5withRSA");
+ // unmatched sha
+ testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+ "-certreq -file csr1 -sigalg SHA256withRSA");
// misc test
// bad storepass
testFail("", "-keystore x.jks -storetype JKS -storepass badstorepass " +
@@ -1192,9 +1205,9 @@ void sqeCsrTest() throws Exception {
"-certreq -file csr1");
// unmatched sigalg
testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
- "-certreq -file csr1 -sigalg SHA1withDSA");
+ "-certreq -file csr1 -sigalg SHA256withDSA");
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
- "-certreq -file csr1 -sigalg MD5withRSA");
+ "-certreq -file csr1 -sigalg SHA256withRSA");
// TrustedCertificateEntry cannot do certreq
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-exportcert -file x.jks.p1.cert");
@@ -1222,6 +1235,9 @@ void sqePrintcertTest() throws Exception {
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-keypass changeit -genkeypair -dname CN=weak -keyalg rsa " +
"-keysize 512 -sigalg MD5withRSA -alias myweakkey");
+ testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+ "-keypass changeit -genkeypair -dname CN=weak -keyalg rsa -keysize " +
+ KEY_LENGTH_RSA + " -sigalg SHA256withRSA -alias myweakkey-sha");
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
"-export -file myweakkey.cert -alias myweakkey");
testFail("", "-printcert -file badkeystore");
@@ -1673,31 +1689,32 @@ void i18nTest() throws Exception {
remove("x.jks");
testOK("", "-help");
- // 2. keytool -genkey -keyalg DSA -v -keysize 512 Enter "a" for the keystore
+ // 2. keytool -genkey -keyalg DSA -v -keysize Enter "a" for the keystore
// password. Check error (password too short). Enter "password" for
// the keystore password. Hit 'return' for "first and last name",
// "organizational unit", "City", "State", and "Country Code".
// Type "yes" when they ask you if everything is correct.
// Type 'return' for new key password.
testOK("a\npassword\npassword\nMe\nHere\nNow\nPlace\nPlace\nUS\nyes\n\n",
- "-genkey -keyalg DSA -v -keysize 512 -keystore x.jks -storetype JKS");
+ "-genkey -keyalg DSA -v -keysize " + KEY_LENGTH_DSA + " -keystore x.jks " +
+ "-storetype JKS");
// 3. keytool -list -v -storepass password
testOK("", "-list -v -storepass password -keystore x.jks -storetype JKS");
// 4. keytool -list -v Type "a" for the keystore password.
// Check error (wrong keystore password).
testFail("a\n", "-list -v -keystore x.jks -storetype JKS");
assertTrue(ex.indexOf("password was incorrect") != -1);
- // 5. keytool - -keyalg DSA -v -keysize 512 Enter "password" as the password.
+ // 5. keytool - -keyalg DSA -v -keysize Enter "password" as the password.
// Check error (alias 'mykey' already exists).
- testFail("password\n", "-genkey -keyalg DSA -v -keysize 512" +
+ testFail("password\n", "-genkey -keyalg DSA -v -keysize " + KEY_LENGTH_DSA +
" -keystore x.jks -storetype JKS");
assertTrue(ex.indexOf("alias already exists") != -1);
- // 6. keytool -genkey -keyalg DSA -v -keysize 512 -alias mykey2 -storepass password
+ // 6. keytool -genkey -keyalg DSA -v -keysize -alias mykey2 -storepass password
// Hit 'return' for "first and last name", "organizational unit", "City",
// "State", and "Country Code". Type "yes" when they ask you if
// everything is correct. Type 'return' for new key password.
- testOK("\n\n\n\n\n\nyes\n\n", "-genkey -keyalg DSA -v -keysize 512 -alias mykey2" +
- " -storepass password -keystore x.jks -storetype JKS");
+ testOK("\n\n\n\n\n\nyes\n\n", "-genkey -keyalg DSA -v -keysize " + KEY_LENGTH_DSA +
+ " -alias mykey2 -storepass password -keystore x.jks -storetype JKS");
// 7. keytool -list -v Type 'password' for the store password.
testOK("password\n", "-list -v -keystore x.jks -storetype JKS");
// 8. keytool -keypasswd -v -alias mykey2 -storepass password
@@ -1777,7 +1794,7 @@ void i18nPKCS11Test() throws Exception {
// 1. sccs edit cert8.db key3.db
//Runtime.getRuntime().exec("/usr/bin/sccs edit cert8.db key3.db");
testOK("", p11Arg + ("-storepass test12 -genkey -alias genkey" +
- " -dname cn=genkey -keysize 512 -keyalg rsa"));
+ " -dname cn=genkey -keysize " + KEY_LENGTH_RSA + " -keyalg rsa"));
testOK("", p11Arg + "-storepass test12 -list");
testOK("", p11Arg + "-storepass test12 -list -alias genkey");
testOK("", p11Arg +
diff --git a/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java b/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java
index 948cfa47064..81dc3639190 100644
--- a/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java
+++ b/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -24,6 +24,7 @@
/*
* @test
* @bug 7180907 8277224
+ * @library /test/lib
* @summary Jarsigner -verify fails if rsa file used sha-256 with authenticated attributes
* @modules java.base/sun.security.pkcs
* java.base/sun.security.tools.keytool
@@ -36,6 +37,7 @@
import java.security.MessageDigest;
import java.security.Signature;
import java.security.cert.X509Certificate;
+import jdk.test.lib.security.SecurityUtils;
import sun.security.pkcs.ContentInfo;
import sun.security.pkcs.PKCS7;
import sun.security.pkcs.PKCS9Attribute;
@@ -52,8 +54,9 @@ public static void main(String[] args) throws Exception {
byte[] data = "Hello".getBytes();
X500Name n = new X500Name("cn=Me");
- CertAndKeyGen cakg = new CertAndKeyGen("RSA", "SHA256withRSA");
- cakg.generate(1024);
+ String kpgAlgorithm = "RSA";
+ CertAndKeyGen cakg = new CertAndKeyGen(kpgAlgorithm, "SHA256withRSA");
+ cakg.generate(SecurityUtils.getTestKeySize(kpgAlgorithm));
X509Certificate cert = cakg.getSelfCertificate(n, 1000);
MessageDigest md = MessageDigest.getInstance("SHA-256");
diff --git a/test/jdk/sun/security/x509/X509CRLImpl/Verify.java b/test/jdk/sun/security/x509/X509CRLImpl/Verify.java
index ed92b6548ec..911f53f5120 100644
--- a/test/jdk/sun/security/x509/X509CRLImpl/Verify.java
+++ b/test/jdk/sun/security/x509/X509CRLImpl/Verify.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -35,45 +35,61 @@ public class Verify {
static String selfSignedCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICPjCCAaegAwIBAgIBADANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" +
- "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA0MjcwMjI0MzJaFw0zMDA0MDcwMjI0MzJa\n" +
- "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" +
- "AQUAA4GNADCBiQKBgQC4OTag24sTxL2tXTNuvpmUEtdxrYAZoFsslFQ60T+WD9wQ\n" +
- "Jeiw87FSPsR2vxRuv0j8DNm2a4h7LNNIFcLurfNldbz5pvgZ7VqdbbUMPE9qP85n\n" +
- "jgDl4woyRTSUeRI4A7O0CO6NpES21dtbdhroWQrEkHxpnrDPxsxrz5gf2m3gqwID\n" +
- "AQABo4GJMIGGMB0GA1UdDgQWBBSCJd0hpl5PdAD9IZS+Hzng4lXLGzBHBgNVHSME\n" +
- "QDA+gBSCJd0hpl5PdAD9IZS+Hzng4lXLG6EjpCEwHzELMAkGA1UEBhMCVVMxEDAO\n" +
- "BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAgQw\n" +
- "DQYJKoZIhvcNAQEEBQADgYEAluy6HIjWcq009lTLmhp+Np6dxU78pInBK8RZkza0\n" +
- "484qGaxFGD3UGyZkI5uWmsH2XuMbuox5khfIq6781gmkPBHXBIEtJN8eLusOHEye\n" +
- "iE8h7WI+N3qa6Pj56WionMrioqC/3X+b06o147bbhx8U0vkYv/HyPaITOFfMXTdz\n" +
- "Vjw=\n" +
+ "MIIDVzCCAj+gAwIBAgIUUM/RKxE2Rcc6zYLWLxNolpLnuiwwDQYJKoZIhvcNAQEL\n" +
+ "BQAwOzENMAsGA1UEAwwEUk9PVDEQMA4GA1UECgwHRXhhbXBsZTELMAkGA1UECAwC\n" +
+ "Q0ExCzAJBgNVBAYTAlVTMB4XDTI0MDYxOTA0NDc1N1oXDTM0MDYxOTA0NDc1N1ow\n" +
+ "OzENMAsGA1UEAwwEUk9PVDEQMA4GA1UECgwHRXhhbXBsZTELMAkGA1UECAwCQ0Ex\n" +
+ "CzAJBgNVBAYTAlVTMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAohRG\n" +
+ "eq8/CniUqWEtpm1gBp+PWENpYgeaALAUgFdBBa6ao7mESjxRG8teaNRcszmoL3Rl\n" +
+ "TH5hLycHA00G5qsALXo4Cj9wAGfR3LbA0HlTurdw3NNk76twQXZpuE19YNYQonbR\n" +
+ "Mm2sgTd2YcrNWmGpthgNiUaT837Yt7RCuurPo4zi1y6g/NJwyLtn775S86NrV5PT\n" +
+ "4vaBCsB5+eCm01CBgzBq3I0OY5oosopNUjmFL4LYccZZ2YAOUY0fvxfsMZD5EDcj\n" +
+ "KrgKBspjmolfn5g5lA5vdVthG2/TxTIdLss69+NsGS1RBkSKGiQNKnRnAB9/gHwc\n" +
+ "2ryHKJRMQrV+JGMjrQIDAQABo1MwUTAdBgNVHQ4EFgQUW6jZ+mcCEMAQTUzJH2F0\n" +
+ "TwMTOMswHwYDVR0jBBgwFoAUW6jZ+mcCEMAQTUzJH2F0TwMTOMswDwYDVR0TAQH/\n" +
+ "BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAB8T/EfVh602S1GJD2tJ1ck9TwutF\n" +
+ "2VSoSRKajMOabbwjzKEAeJ9rNcWiy60rSvDuL8i4IL52R7fHhlJaDg9FVjmkiWSO\n" +
+ "VPiIZuOyvUtsc9++AM741RK9OrEMETvAtbtEMU6du7LiFk2KcnDTHfcNihtM/TNZ\n" +
+ "1bzEKuSfQydBNPkO3Ftmveygj7QGX+Kgppp7RXXUFzySYxrlA1usgNhVXY/qhFiJ\n" +
+ "jhTU33iZgwiKxpY+zj/Gmk5sdOCEk7e1P06IB3eIopdRTMGJCeCBKyFyXND38kNC\n" +
+ "bTIPnuOdE73M2AW0LWuPv6UQZVBv5A82WMT9f8Hq9H2cHbuhgL/ozyFSWw==\n" +
"-----END CERTIFICATE-----";
static String crlIssuerCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICKzCCAZSgAwIBAgIBAjANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" +
- "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA0MjcwMjI0MzNaFw0yOTAxMTIwMjI0MzNa\n" +
- "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" +
- "AQUAA4GNADCBiQKBgQDMJeBMBybHykI/YpwUJ4O9euqDSLb1kpWpceBS8TVqvgBC\n" +
- "SgUJWtFZL0i6bdvF6mMdlbuBkGzhXqHiVAi96/zRLbUC9F8SMEJ6MuD+YhQ0ZFTQ\n" +
- "atKy8zf8O9XzztelLJ26Gqb7QPV133WY3haAqHtCXOhEKkCN16NOYNC37DTaJwID\n" +
- "AQABo3cwdTAdBgNVHQ4EFgQULXSWzXzUOIpOJpzbSCpW42IJUugwRwYDVR0jBEAw\n" +
- "PoAUgiXdIaZeT3QA/SGUvh854OJVyxuhI6QhMB8xCzAJBgNVBAYTAlVTMRAwDgYD\n" +
- "VQQKEwdFeGFtcGxlggEAMAsGA1UdDwQEAwIBAjANBgkqhkiG9w0BAQQFAAOBgQAY\n" +
- "eMnf5AHSNlyUlzXk8o2S0h4gCuvKX6C3kFfKuZcWvFAbx4yQOWLS2s15/nzR4+AP\n" +
- "FGX3lgJjROyAh7fGedTQK+NFWwkM2ag1g3hXktnlnT1qHohi0w31nVBJxXEDO/Ck\n" +
- "uJTpJGt8XxxbFaw5v7cHy7XuTAeU/sekvjEiNHW00Q==\n" +
+ "MIIDeTCCAmGgAwIBAgIBATANBgkqhkiG9w0BAQUFADA7MQ0wCwYDVQQDDARST09U\n" +
+ "MRAwDgYDVQQKDAdFeGFtcGxlMQswCQYDVQQIDAJDQTELMAkGA1UEBhMCVVMwHhcN\n" +
+ "MjQwNjE5MDQ0NzU3WhcNMjYwNjE4MDQ0NzU3WjA5MQswCQYDVQQDDAJDQTELMAkG\n" +
+ "A1UECAwCQ0ExCzAJBgNVBAYTAlVTMRAwDgYDVQQKDAdFeGFtcGxlMIIBIjANBgkq\n" +
+ "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn3wVMxoa3mgqk7fbg+UEj3vDfdR+o0dL\n" +
+ "UeDqtkM/KHQg2h16LTRsRM+bGcDAg8pz/8RNK+jiCq5lXylUtOYEIKzD2NTrycOH\n" +
+ "gAt92vt01cusZrnvdf+wKFNzDQea1q1fgNFbFdWZZ7Ia+BvR9dYdwbyX7LPKPth5\n" +
+ "aSmvwhKivETV6mTU17dMls/8OjQ+oUydBggVjhpjS+xYCBa09ie2dR+eGrluCaF5\n" +
+ "gspoTeQxAOOytBoL4+DECEPsAyr7/guMOdmWUbPDvfYL+97N6imXUh4XtQ7+xHTd\n" +
+ "OWWwAhS7JjqcalADSNUClU54VVGbZ9NmIjDiSPc1bvam4FxicuqrBQIDAQABo4GJ\n" +
+ "MIGGMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFMPkRHT0w2v7Nx2SN/i+2hJIj/5x\n" +
+ "MB8GA1UdIwQYMBaAFFuo2fpnAhDAEE1MyR9hdE8DEzjLMAsGA1UdDwQEAwIBAjAp\n" +
+ "BgNVHR8EIjAgMB6gHKAahhhodHRwOi8vdGVzdC5jb20vcm9vdC5jcmwwDQYJKoZI\n" +
+ "hvcNAQEFBQADggEBAIsREfhopvEGrbVjbaRsBmGlMAblqiTWF3DklU4BfXGQ7u+2\n" +
+ "z/Dvl5rehGkWIU5GmBY/DFWN/Tgt6yJU+d1ismKj+zhWI8IT7dLKJnSP0Sei0zqr\n" +
+ "qsIj/y5Xzmd2XpQ52V3KtDy4t7YQJ+nRKUrqLzSKHvOXOQgScK2RL4FZx0gah/bJ\n" +
+ "YCKq6zonC59lZ6ftJ2j9Ny9wNulHBlgS0p8q+Z42IfdfVgrLmbXoHNmKjVKdrs1Z\n" +
+ "HCva3WKMOkVFdejOuvPSnSw4Iob479nC3V12YtFAgeYMoBMPgZHcuWce4IC9Ts7z\n" +
+ "w8Xo1Fv3aNOygWdXdVDL79jkOJo2wO8yIe+J6Ig=\n" +
"-----END CERTIFICATE-----";
static String crlStr =
"-----BEGIN X509 CRL-----\n" +
- "MIIBGzCBhQIBATANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQMA4GA1UE\n" +
- "ChMHRXhhbXBsZRcNMDkwNDI3MDIzODA0WhcNMjgwNjI2MDIzODA0WjAiMCACAQUX\n" +
- "DTA5MDQyNzAyMzgwMFowDDAKBgNVHRUEAwoBBKAOMAwwCgYDVR0UBAMCAQIwDQYJ\n" +
- "KoZIhvcNAQEEBQADgYEAoarfzXEtw3ZDi4f9U8eSvRIipHSyxOrJC7HR/hM5VhmY\n" +
- "CErChny6x9lBVg9s57tfD/P9PSzBLusCcHwHMAbMOEcTltVVKUWZnnbumpywlYyg\n" +
- "oKLrE9+yCOkYUOpiRlz43/3vkEL5hjIKMcDSZnPKBZi1h16Yj2hPe9GMibNip54=\n" +
+ "MIIBtjCBnwIBATANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQDDAJDQTELMAkGA1UE\n" +
+ "CAwCQ0ExCzAJBgNVBAYTAlVTMRAwDgYDVQQKDAdFeGFtcGxlFw0yNDA2MTkwNDQ3\n" +
+ "NThaFw0yNjA2MTgwNDQ3NThaMCIwIAIBAhcNMjQwNjE5MDQ0NzU4WjAMMAoGA1Ud\n" +
+ "FQQDCgEEoA4wDDAKBgNVHRQEAwIBATANBgkqhkiG9w0BAQUFAAOCAQEAkN0owWtq\n" +
+ "We0SznF9rAAADLMfB/2GKBQpqsJXXwE9FnCm8emSDtHpud+NZL+PAy9g050et8nl\n" +
+ "CNey/FBMJJMN3b3SZKkHA2MR4qJmHfeFnlE5mHnUHg7gH0a1u7H7wf0Z/L6eZNWy\n" +
+ "dB905II7Ej0GBuPnLsKNMDBtGtDuSPXCvmaBsKDe8awaEA1VchZKVLzg+8hEC0vt\n" +
+ "60jz9HrDpFun99IKTTCxBT+9GrW38GbPMxj0rLAL4n75SrfPdeFPj0t5fksOC7a7\n" +
+ "SLO9t+UC89SMTsoIwVjHIFIUxw5FHpuUfgOQ7PtjhpLd2Pm5u5Pe2gv4Q41xVgVW\n" +
+ "hVMagRPmAQAniQ==\n" +
"-----END X509 CRL-----";
private static X509CRL crl;
@@ -87,7 +103,8 @@ public static void main(String[] args) throws Exception {
* Verify CRL with its own public key.
* Should pass.
*/
- verifyCRL(crlIssuerCertPubKey, "SunRsaSign");
+ verifyCRL(crlIssuerCertPubKey,
+ System.getProperty("test.provider.name", "SunRsaSign"));
/*
* Try to verify CRL with a provider that does not have a Signature
@@ -103,11 +120,12 @@ public static void main(String[] args) throws Exception {
/*
* Try to verify CRL with a provider that has a Signature implementation
- * but not of the right algorithm (MD5withRSA).
+ * but not of the right algorithm (SHA1withRSA).
* Should fail with NoSuchAlgorithmException.
*/
try {
- verifyCRL(crlIssuerCertPubKey, "SUN");
+ verifyCRL(crlIssuerCertPubKey,
+ System.getProperty("test.provider.name", "SUN"));
throw new RuntimeException("Didn't catch the exception properly");
} catch (NoSuchAlgorithmException e) {
System.out.println("Caught the correct exception.");
@@ -118,7 +136,8 @@ public static void main(String[] args) throws Exception {
* Should fail with SignatureException.
*/
try {
- verifyCRL(selfSignedCertPubKey, "SunRsaSign");
+ verifyCRL(selfSignedCertPubKey,
+ System.getProperty("test.provider.name","SunRsaSign"));
throw new RuntimeException("Didn't catch the exception properly");
} catch (SignatureException e) {
System.out.println("Caught the correct exception.");
@@ -148,6 +167,7 @@ private static void verifyCRL(PublicKey key, String providerName)
throws CRLException, NoSuchAlgorithmException, InvalidKeyException,
SignatureException {
Provider provider = Security.getProvider(providerName);
+ System.out.println("Provider = " + provider.getName());
if (provider == null) {
throw new RuntimeException("Provider " + providerName
+ " not found.");
diff --git a/test/jdk/sun/security/x509/X509CertImpl/Verify.java b/test/jdk/sun/security/x509/X509CertImpl/Verify.java
index cffee273e6f..0b98758ee4c 100644
--- a/test/jdk/sun/security/x509/X509CertImpl/Verify.java
+++ b/test/jdk/sun/security/x509/X509CertImpl/Verify.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2024, 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
@@ -36,35 +36,47 @@ public class Verify {
static String selfSignedCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICPjCCAaegAwIBAgIBADANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" +
- "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA0MjcwMjI0MzJaFw0zMDA0MDcwMjI0MzJa\n" +
- "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" +
- "AQUAA4GNADCBiQKBgQC4OTag24sTxL2tXTNuvpmUEtdxrYAZoFsslFQ60T+WD9wQ\n" +
- "Jeiw87FSPsR2vxRuv0j8DNm2a4h7LNNIFcLurfNldbz5pvgZ7VqdbbUMPE9qP85n\n" +
- "jgDl4woyRTSUeRI4A7O0CO6NpES21dtbdhroWQrEkHxpnrDPxsxrz5gf2m3gqwID\n" +
- "AQABo4GJMIGGMB0GA1UdDgQWBBSCJd0hpl5PdAD9IZS+Hzng4lXLGzBHBgNVHSME\n" +
- "QDA+gBSCJd0hpl5PdAD9IZS+Hzng4lXLG6EjpCEwHzELMAkGA1UEBhMCVVMxEDAO\n" +
- "BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAgQw\n" +
- "DQYJKoZIhvcNAQEEBQADgYEAluy6HIjWcq009lTLmhp+Np6dxU78pInBK8RZkza0\n" +
- "484qGaxFGD3UGyZkI5uWmsH2XuMbuox5khfIq6781gmkPBHXBIEtJN8eLusOHEye\n" +
- "iE8h7WI+N3qa6Pj56WionMrioqC/3X+b06o147bbhx8U0vkYv/HyPaITOFfMXTdz\n" +
- "Vjw=\n" +
+ "MIIDVzCCAj+gAwIBAgIUUM/RKxE2Rcc6zYLWLxNolpLnuiwwDQYJKoZIhvcNAQEL\n" +
+ "BQAwOzENMAsGA1UEAwwEUk9PVDEQMA4GA1UECgwHRXhhbXBsZTELMAkGA1UECAwC\n" +
+ "Q0ExCzAJBgNVBAYTAlVTMB4XDTI0MDYxOTA0NDc1N1oXDTM0MDYxOTA0NDc1N1ow\n" +
+ "OzENMAsGA1UEAwwEUk9PVDEQMA4GA1UECgwHRXhhbXBsZTELMAkGA1UECAwCQ0Ex\n" +
+ "CzAJBgNVBAYTAlVTMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAohRG\n" +
+ "eq8/CniUqWEtpm1gBp+PWENpYgeaALAUgFdBBa6ao7mESjxRG8teaNRcszmoL3Rl\n" +
+ "TH5hLycHA00G5qsALXo4Cj9wAGfR3LbA0HlTurdw3NNk76twQXZpuE19YNYQonbR\n" +
+ "Mm2sgTd2YcrNWmGpthgNiUaT837Yt7RCuurPo4zi1y6g/NJwyLtn775S86NrV5PT\n" +
+ "4vaBCsB5+eCm01CBgzBq3I0OY5oosopNUjmFL4LYccZZ2YAOUY0fvxfsMZD5EDcj\n" +
+ "KrgKBspjmolfn5g5lA5vdVthG2/TxTIdLss69+NsGS1RBkSKGiQNKnRnAB9/gHwc\n" +
+ "2ryHKJRMQrV+JGMjrQIDAQABo1MwUTAdBgNVHQ4EFgQUW6jZ+mcCEMAQTUzJH2F0\n" +
+ "TwMTOMswHwYDVR0jBBgwFoAUW6jZ+mcCEMAQTUzJH2F0TwMTOMswDwYDVR0TAQH/\n" +
+ "BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAB8T/EfVh602S1GJD2tJ1ck9TwutF\n" +
+ "2VSoSRKajMOabbwjzKEAeJ9rNcWiy60rSvDuL8i4IL52R7fHhlJaDg9FVjmkiWSO\n" +
+ "VPiIZuOyvUtsc9++AM741RK9OrEMETvAtbtEMU6du7LiFk2KcnDTHfcNihtM/TNZ\n" +
+ "1bzEKuSfQydBNPkO3Ftmveygj7QGX+Kgppp7RXXUFzySYxrlA1usgNhVXY/qhFiJ\n" +
+ "jhTU33iZgwiKxpY+zj/Gmk5sdOCEk7e1P06IB3eIopdRTMGJCeCBKyFyXND38kNC\n" +
+ "bTIPnuOdE73M2AW0LWuPv6UQZVBv5A82WMT9f8Hq9H2cHbuhgL/ozyFSWw==\n" +
"-----END CERTIFICATE-----";
static String crlIssuerCertStr =
"-----BEGIN CERTIFICATE-----\n" +
- "MIICKzCCAZSgAwIBAgIBAjANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" +
- "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA0MjcwMjI0MzNaFw0yOTAxMTIwMjI0MzNa\n" +
- "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" +
- "AQUAA4GNADCBiQKBgQDMJeBMBybHykI/YpwUJ4O9euqDSLb1kpWpceBS8TVqvgBC\n" +
- "SgUJWtFZL0i6bdvF6mMdlbuBkGzhXqHiVAi96/zRLbUC9F8SMEJ6MuD+YhQ0ZFTQ\n" +
- "atKy8zf8O9XzztelLJ26Gqb7QPV133WY3haAqHtCXOhEKkCN16NOYNC37DTaJwID\n" +
- "AQABo3cwdTAdBgNVHQ4EFgQULXSWzXzUOIpOJpzbSCpW42IJUugwRwYDVR0jBEAw\n" +
- "PoAUgiXdIaZeT3QA/SGUvh854OJVyxuhI6QhMB8xCzAJBgNVBAYTAlVTMRAwDgYD\n" +
- "VQQKEwdFeGFtcGxlggEAMAsGA1UdDwQEAwIBAjANBgkqhkiG9w0BAQQFAAOBgQAY\n" +
- "eMnf5AHSNlyUlzXk8o2S0h4gCuvKX6C3kFfKuZcWvFAbx4yQOWLS2s15/nzR4+AP\n" +
- "FGX3lgJjROyAh7fGedTQK+NFWwkM2ag1g3hXktnlnT1qHohi0w31nVBJxXEDO/Ck\n" +
- "uJTpJGt8XxxbFaw5v7cHy7XuTAeU/sekvjEiNHW00Q==\n" +
+ "MIIDeTCCAmGgAwIBAgIBATANBgkqhkiG9w0BAQUFADA7MQ0wCwYDVQQDDARST09U\n" +
+ "MRAwDgYDVQQKDAdFeGFtcGxlMQswCQYDVQQIDAJDQTELMAkGA1UEBhMCVVMwHhcN\n" +
+ "MjQwNjE5MDQ0NzU3WhcNMjYwNjE4MDQ0NzU3WjA5MQswCQYDVQQDDAJDQTELMAkG\n" +
+ "A1UECAwCQ0ExCzAJBgNVBAYTAlVTMRAwDgYDVQQKDAdFeGFtcGxlMIIBIjANBgkq\n" +
+ "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn3wVMxoa3mgqk7fbg+UEj3vDfdR+o0dL\n" +
+ "UeDqtkM/KHQg2h16LTRsRM+bGcDAg8pz/8RNK+jiCq5lXylUtOYEIKzD2NTrycOH\n" +
+ "gAt92vt01cusZrnvdf+wKFNzDQea1q1fgNFbFdWZZ7Ia+BvR9dYdwbyX7LPKPth5\n" +
+ "aSmvwhKivETV6mTU17dMls/8OjQ+oUydBggVjhpjS+xYCBa09ie2dR+eGrluCaF5\n" +
+ "gspoTeQxAOOytBoL4+DECEPsAyr7/guMOdmWUbPDvfYL+97N6imXUh4XtQ7+xHTd\n" +
+ "OWWwAhS7JjqcalADSNUClU54VVGbZ9NmIjDiSPc1bvam4FxicuqrBQIDAQABo4GJ\n" +
+ "MIGGMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFMPkRHT0w2v7Nx2SN/i+2hJIj/5x\n" +
+ "MB8GA1UdIwQYMBaAFFuo2fpnAhDAEE1MyR9hdE8DEzjLMAsGA1UdDwQEAwIBAjAp\n" +
+ "BgNVHR8EIjAgMB6gHKAahhhodHRwOi8vdGVzdC5jb20vcm9vdC5jcmwwDQYJKoZI\n" +
+ "hvcNAQEFBQADggEBAIsREfhopvEGrbVjbaRsBmGlMAblqiTWF3DklU4BfXGQ7u+2\n" +
+ "z/Dvl5rehGkWIU5GmBY/DFWN/Tgt6yJU+d1ismKj+zhWI8IT7dLKJnSP0Sei0zqr\n" +
+ "qsIj/y5Xzmd2XpQ52V3KtDy4t7YQJ+nRKUrqLzSKHvOXOQgScK2RL4FZx0gah/bJ\n" +
+ "YCKq6zonC59lZ6ftJ2j9Ny9wNulHBlgS0p8q+Z42IfdfVgrLmbXoHNmKjVKdrs1Z\n" +
+ "HCva3WKMOkVFdejOuvPSnSw4Iob479nC3V12YtFAgeYMoBMPgZHcuWce4IC9Ts7z\n" +
+ "w8Xo1Fv3aNOygWdXdVDL79jkOJo2wO8yIe+J6Ig=\n" +
"-----END CERTIFICATE-----";
private static X509Certificate cert;
@@ -78,7 +90,8 @@ public static void main(String[] args) throws Exception {
* Verify certificate with its own public key.
* Should pass.
*/
- verifyCert(selfSignedCertPubKey,"SunRsaSign");
+ verifyCert(selfSignedCertPubKey,
+ System.getProperty("test.provider.name", "SunRsaSign"));
/*
* Try to verify certificate with a provider that does not have a
@@ -86,7 +99,8 @@ public static void main(String[] args) throws Exception {
* Should fail with NoSuchAlgorithmException.
*/
try {
- verifyCert(selfSignedCertPubKey, "SunJCE");
+ verifyCert(selfSignedCertPubKey,
+ System.getProperty("test.provider.name", "SunJCE"));
throw new RuntimeException("Didn't catch the exception properly");
} catch (NoSuchAlgorithmException e) {
System.out.println("Caught the correct exception.");
@@ -94,11 +108,12 @@ public static void main(String[] args) throws Exception {
/*
* Try to verify certificate with a provider that has a Signature
- * implementation but not of the right algorithm (MD5withRSA).
+ * implementation but not of the right algorithm (SHA1withRSA).
* Should fail with NoSuchAlgorithmException.
*/
try {
- verifyCert(selfSignedCertPubKey, "SUN");
+ verifyCert(selfSignedCertPubKey,
+ System.getProperty("test.provider.name", "SUN"));
throw new RuntimeException("Didn't catch the exception properly");
} catch (NoSuchAlgorithmException e) {
System.out.println("Caught the correct exception.");
@@ -109,7 +124,8 @@ public static void main(String[] args) throws Exception {
* Should fail with SignatureException.
*/
try {
- verifyCert(crlIssuerCertPubKey, "SunRsaSign");
+ verifyCert(crlIssuerCertPubKey,
+ System.getProperty("test.provider.name", "SunRsaSign"));
throw new RuntimeException("Didn't catch the exception properly");
} catch (SignatureException e) {
System.out.println("Caught the correct exception.");
diff --git a/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java b/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java
index a7d14f1aa21..aaced7bbf58 100644
--- a/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java
+++ b/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java
@@ -50,7 +50,9 @@ public static void main(String[] args) throws Throwable {
"..", "..", "make", "data", "tzdata");
String tzfiles = "africa antarctica asia australasia europe northamerica southamerica backward etcetera gmt";
Path jdk_tzdir = Paths.get(System.getProperty("test.src"), "tzdata_jdk");
- String jdk_tzfiles = "jdk11_backward";
+ // tz2024b_overridden_zones file is created to preserve the behaviour of
+ // "EST", "MST", and "HST" when timezone 2024b changes are applied
+ String jdk_tzfiles = "jdk11_backward tz2024b_overridden_zones";
String zidir = TESTDIR + File.separator + "zi";
File fZidir = new File(zidir);
if (!fZidir.exists()) {
diff --git a/test/jdk/sun/util/calendar/zi/tzdata_jdk/tz2024b_overridden_zones b/test/jdk/sun/util/calendar/zi/tzdata_jdk/tz2024b_overridden_zones
new file mode 100644
index 00000000000..ab468100d1d
--- /dev/null
+++ b/test/jdk/sun/util/calendar/zi/tzdata_jdk/tz2024b_overridden_zones
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2024, 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+
+# TZdata2024b changes announced on 5th September 2024 includes changes to
+# "EST", "MST", and "HST", i.e., changing those time zones from distinct
+# time zones to links to other time zones. Previously
+# they were defined as fixed offset zones,
+# e.g., "EST" is "-05:00" without any DST transitions.
+# With 2024b, "EST" is now a link to "America/Panama."
+# This change has Java 8+ specification implications in java.time.ZoneId.SHORT_IDS field
+# Solution for jdk24+ to modify the mappings in ZoneId class which requires modification of the spec.
+# Update releases will not make the ZoneId changes due to current specification.
+
+# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
+Zone EST -5:00 - EST
+Zone MST -7:00 - MST
+Zone HST -10:00 - HST
\ No newline at end of file
diff --git a/test/jdk/tools/jpackage/apps/ChildProcessAppLauncher.java b/test/jdk/tools/jpackage/apps/ChildProcessAppLauncher.java
new file mode 100644
index 00000000000..b599488b563
--- /dev/null
+++ b/test/jdk/tools/jpackage/apps/ChildProcessAppLauncher.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2024, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
+
+public class ChildProcessAppLauncher {
+ public static void main(String[] args) throws IOException, InterruptedException {
+ if (args.length == 1 && "noexit".equals(args[0])) {
+ var lock = new Object();
+ synchronized (lock) {
+ lock.wait();
+ }
+ } else {
+ var childPath = System.getProperty("jpackage.app-path"); // get the path to the current jpackage app launcher
+ ProcessBuilder processBuilder = new ProcessBuilder(childPath, "noexit"); //ChildProcessAppLauncher acts as third party app
+ Process process = processBuilder.start();
+ System.out.println("Child id=" + process.pid());
+ }
+ }
+}
diff --git a/test/jdk/tools/jpackage/windows/WinChildProcessTest.java b/test/jdk/tools/jpackage/windows/WinChildProcessTest.java
new file mode 100644
index 00000000000..4fa7581d2b5
--- /dev/null
+++ b/test/jdk/tools/jpackage/windows/WinChildProcessTest.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2024, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8325203
+ * @summary Test that Jpackage windows executable application kills the launched 3rd party application
+ * when System.exit(0) is invoked along with terminating java program.
+ * @library ../helpers
+ * @library /test/lib
+ * @requires os.family == "windows"
+ * @build WinChildProcessTest
+ * @build jdk.jpackage.test.*
+ * @build WinChildProcessTest
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m jdk.jpackage.test.Main
+ * --jpt-run=WinChildProcessTest
+ *
+ */
+
+import java.util.List;
+import java.util.Optional;
+
+import java.nio.file.Path;
+
+import jdk.jpackage.test.JPackageCommand;
+import jdk.jpackage.test.Annotations.Test;
+import jdk.jpackage.test.Executor;
+import jdk.jpackage.test.TKit;
+
+public class WinChildProcessTest {
+ private static final Path TEST_APP_JAVA = TKit.TEST_SRC_ROOT
+ .resolve("apps/ChildProcessAppLauncher.java");
+
+ @Test
+ public static void test() throws Throwable {
+ long childPid = 0;
+ try {
+ JPackageCommand cmd = JPackageCommand
+ .helloAppImage(TEST_APP_JAVA + "*Hello");
+
+ // Create the image of the third party application launcher
+ cmd.executeAndAssertImageCreated();
+
+ // Start the third party application launcher and dump and save the
+ // output of the application
+ List output = new Executor().saveOutput().dumpOutput()
+ .setExecutable(cmd.appLauncherPath().toAbsolutePath())
+ .execute(0).getOutput();
+ String pidStr = output.get(0);
+
+ // parse child PID
+ childPid = Long.parseLong(pidStr.split("=", 2)[1]);
+
+ // Check whether the termination of third party application launcher
+ // also terminating the launched third party application
+ // If third party application is not terminated the test is
+ // successful else failure
+ Optional processHandle = ProcessHandle.of(childPid);
+ boolean isAlive = processHandle.isPresent()
+ && processHandle.get().isAlive();
+ TKit.assertTrue(isAlive, "Check is child process is alive");
+ } finally {
+ // Kill only a specific child instance
+ Runtime.getRuntime().exec("taskkill /F /PID " + childPid);
+ }
+ }
+}
diff --git a/test/lib/jdk/test/lib/Utils.java b/test/lib/jdk/test/lib/Utils.java
index f84ddab6d55..50146100677 100644
--- a/test/lib/jdk/test/lib/Utils.java
+++ b/test/lib/jdk/test/lib/Utils.java
@@ -23,7 +23,11 @@
package jdk.test.lib;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
@@ -35,11 +39,16 @@
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
+import java.nio.file.CopyOption;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.nio.file.attribute.AclEntry;
+import java.nio.file.attribute.AclEntryType;
+import java.nio.file.attribute.AclFileAttributeView;
import java.nio.file.attribute.FileAttribute;
import java.nio.channels.SocketChannel;
+import java.nio.file.attribute.PosixFilePermissions;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
@@ -53,12 +62,14 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
+import java.util.Set;
import java.util.function.BooleanSupplier;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import static jdk.test.lib.Asserts.assertTrue;
import jdk.test.lib.process.ProcessTools;
@@ -821,4 +832,220 @@ public static Path createTempDirectory(String prefix, FileAttribute>... attrs)
Path dir = Paths.get(System.getProperty("user.dir", "."));
return Files.createTempDirectory(dir, prefix, attrs);
}
+
+ /**
+ * Converts slashes in a pathname to backslashes
+ * if slashes is not the file separator.
+ */
+ public static String convertPath(String path) {
+ // No need to do the conversion if file separator is '/'
+ if (FILE_SEPARATOR.length() == 1 && FILE_SEPARATOR.charAt(0) == '/') {
+ return path;
+ }
+
+ char[] cs = path.toCharArray();
+ for (int i = 0; i < cs.length; i++) {
+ if (cs[i] == '/') {
+ cs[i] = '\\';
+ }
+ }
+ String newPath = new String(cs);
+ return newPath;
+ }
+
+ /**
+ * Return file directories that satisfy the specified filter.
+ *
+ * @param searchDirectory the base directory to search
+ * @param filter a filename filter
+ * @return file directories
+ */
+ public static List findFiles(Path searchDirectory,
+ FilenameFilter filter) {
+ return Arrays.stream(searchDirectory.toFile().listFiles(filter))
+ .map(f -> f.toPath())
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Copy files to the target path.
+ *
+ * @param source the paths to the files to copy
+ * @param target the path to the target files
+ * @param filenameMapper mapper function applied to filenames
+ * @param options options specifying how the copy should be done
+ * @return the paths to the target files
+ * @throws IOException if error occurs
+ */
+ public static List copyFiles(List source, Path target,
+ Function filenameMapper,
+ CopyOption... options) throws IOException {
+ List result = new ArrayList<>();
+
+ if (!target.toFile().exists()) {
+ Files.createDirectory(target);
+ }
+
+ for (Path file : source) {
+ if (!file.toFile().exists()) {
+ continue;
+ }
+
+ String baseName = file.getFileName().toString();
+
+ Path targetFile = target.resolve(filenameMapper.apply(baseName));
+ Files.copy(file, targetFile, options);
+ result.add(targetFile);
+ }
+ return result;
+ }
+
+ /**
+ * Copy files to the target path.
+ *
+ * @param source the paths to the files to copy
+ * @param target the path to the target files
+ * @param options options specifying how the copy should be done
+ * @return the paths to the target files
+ * @throws IOException if error occurs
+ */
+ public static List copyFiles(List source, Path target,
+ CopyOption... options) throws IOException {
+ return copyFiles(source, target, (s) -> s, options);
+ }
+
+ /**
+ * Replace file string by applying the given mapper function.
+ *
+ * @param source the file to read
+ * @param contentMapper the mapper function applied to file's content
+ * @throws IOException if an I/O error occurs
+ */
+ public static void replaceFileString(Path source,
+ Function contentMapper) throws IOException {
+ StringBuilder sb = new StringBuilder();
+ String lineSep = System.getProperty("line.separator");
+
+ try (BufferedReader reader =
+ new BufferedReader(new FileReader(source.toFile()))) {
+
+ String line;
+
+ // read all and replace all at once??
+ while ((line = reader.readLine()) != null) {
+ sb.append(contentMapper.apply(line))
+ .append(lineSep);
+ }
+ }
+
+ try (FileWriter writer = new FileWriter(source.toFile())) {
+ writer.write(sb.toString());
+ }
+ }
+
+ /**
+ * Replace files' string by applying the given mapper function.
+ *
+ * @param source the file to read
+ * @param contentMapper the mapper function applied to files' content
+ * @throws IOException if an I/O error occurs
+ */
+ public static void replaceFilesString(List source,
+ Function contentMapper) throws IOException {
+ for (Path file : source) {
+ replaceFileString(file, contentMapper);
+ }
+ }
+
+ /**
+ * Grant file user access or full access to everyone.
+ *
+ * @param file file to grant access
+ * @param userOnly true for user access, otherwise full access to everyone
+ * @throws IOException if error occurs
+ */
+ public static void grantFileAccess(Path file, boolean userOnly)
+ throws IOException {
+ Set attr = file.getFileSystem().supportedFileAttributeViews();
+ if (attr.contains("posix")) {
+ String perms = userOnly ? "rwx------" : "rwxrwxrwx";
+ Files.setPosixFilePermissions(file, PosixFilePermissions.fromString(perms));
+ } else if (attr.contains("acl")) {
+ AclFileAttributeView view =
+ Files.getFileAttributeView(file, AclFileAttributeView.class);
+ List acl = new ArrayList<>();
+ for (AclEntry thisEntry : view.getAcl()) {
+ if (userOnly) {
+ if (thisEntry.principal().getName()
+ .equals(view.getOwner().getName())) {
+ acl.add(allowAccess(thisEntry));
+ } else if (thisEntry.type() == AclEntryType.ALLOW) {
+ acl.add(revokeAccess(thisEntry));
+ } else {
+ acl.add(thisEntry);
+ }
+ } else {
+ if (thisEntry.type() != AclEntryType.ALLOW) {
+ acl.add(allowAccess(thisEntry));
+ } else {
+ acl.add(thisEntry);
+ }
+ }
+ }
+ view.setAcl(acl);
+ } else {
+ throw new RuntimeException("Unsupported file attributes: " + attr);
+ }
+ }
+
+ /**
+ * Return an ACL entry that revokes owner access.
+ *
+ * @param acl original ACL entry to build from
+ * @return an ACL entry that revokes all access
+ */
+ public static AclEntry revokeAccess(AclEntry acl) {
+ return buildAclEntry(acl, AclEntryType.DENY);
+ }
+
+ /**
+ * Return an ACL entry that allow owner access.
+ * @param acl original ACL entry to build from
+ * @return an ACL entry that allows all access
+ */
+ public static AclEntry allowAccess(AclEntry acl) {
+ return buildAclEntry(acl, AclEntryType.ALLOW);
+ }
+
+ /**
+ * Build an ACL entry with a given ACL entry type.
+ *
+ * @param acl original ACL entry to build from
+ * @return an ACL entry with a given ACL entry type
+ */
+ public static AclEntry buildAclEntry(AclEntry acl, AclEntryType type) {
+ return AclEntry.newBuilder(acl)
+ .setType(type)
+ .build();
+ }
+
+ /**
+ * Grant file user access.
+ *
+ * @param file file to grant access
+ * @throws IOException if error occurs
+ */
+ public static void userAccess(Path file) throws IOException {
+ grantFileAccess(file, true);
+ }
+
+ /**
+ * Grant file full access to everyone.
+ *
+ * @param file file to grant access
+ * @throws IOException if error occurs
+ */
+ public static void fullAccess(Path file) throws IOException {
+ grantFileAccess(file, false);
+ }
}
diff --git a/test/lib/jdk/test/lib/security/DiffieHellmanGroup.java b/test/lib/jdk/test/lib/security/DiffieHellmanGroup.java
new file mode 100644
index 00000000000..b8f7c0c34be
--- /dev/null
+++ b/test/lib/jdk/test/lib/security/DiffieHellmanGroup.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2024, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib.security;
+
+import java.math.BigInteger;
+
+/**
+ * An enumeration of DH groups for tests.
+ */
+public enum DiffieHellmanGroup {
+
+ /**
+ * RFC 7919 - ffdhe2048.
+ */
+ ffdhe2048(new BigInteger("FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" +
+ "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" +
+ "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" +
+ "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" +
+ "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" +
+ "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" +
+ "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" +
+ "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" +
+ "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" +
+ "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" +
+ "886B423861285C97FFFFFFFFFFFFFFFF", 16), 2),
+ /**
+ * RFC 7919 - ffdhe3072.
+ */
+ ffdhe3072(new BigInteger("FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" +
+ "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" +
+ "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" +
+ "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" +
+ "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" +
+ "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" +
+ "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" +
+ "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" +
+ "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" +
+ "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" +
+ "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" +
+ "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" +
+ "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" +
+ "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" +
+ "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" +
+ "3C1B20EE3FD59D7C25E41D2B66C62E37FFFFFFFFFFFFFFFF", 16), 2),
+ /**
+ * RFC 7919 - ffdhe4096.
+ */
+ ffdhe4096(new BigInteger("FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" +
+ "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" +
+ "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" +
+ "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" +
+ "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" +
+ "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" +
+ "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" +
+ "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" +
+ "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" +
+ "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" +
+ "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" +
+ "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" +
+ "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" +
+ "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" +
+ "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" +
+ "3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB" +
+ "7930E9E4E58857B6AC7D5F42D69F6D187763CF1D55034004" +
+ "87F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832" +
+ "A907600A918130C46DC778F971AD0038092999A333CB8B7A" +
+ "1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF" +
+ "8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E655F6A" +
+ "FFFFFFFFFFFFFFFF", 16), 2);
+
+
+ public BigInteger getPrime() {
+ return prime;
+ }
+
+ private final BigInteger prime;
+
+ public BigInteger getBase() {
+ return base;
+ }
+
+ private final BigInteger base;
+
+ DiffieHellmanGroup(BigInteger prime, int base) {
+ this.prime = prime;
+ this.base = BigInteger.valueOf(base);
+ }
+}
diff --git a/test/lib/jdk/test/lib/security/SecurityUtils.java b/test/lib/jdk/test/lib/security/SecurityUtils.java
index 319416a466c..2885440e2a2 100644
--- a/test/lib/jdk/test/lib/security/SecurityUtils.java
+++ b/test/lib/jdk/test/lib/security/SecurityUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2024, 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
@@ -30,12 +30,34 @@
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import jdk.test.lib.security.DiffieHellmanGroup;
/**
* Common library for various security test helper functions.
*/
public final class SecurityUtils {
+ /*
+ * Key Sizes for various algorithms.
+ */
+ private enum KeySize{
+ RSA(2048),
+ DSA(2048),
+ DH(2048);
+
+ private final int keySize;
+ KeySize(int keySize) {
+ this.keySize = keySize;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(keySize);
+ }
+ }
+
+ private final static int DEFAULT_SALTSIZE = 16;
+
private static String getCacerts() {
String sep = File.separator;
return System.getProperty("java.home") + sep
@@ -107,6 +129,44 @@ public static void removeAlgsFromDSigPolicy(String... algs) {
removeFromDSigPolicy("disallowAlg", List.of(algs));
}
+ /**
+ * Returns a salt size for tests
+ */
+ public static int getTestSaltSize() {
+ return DEFAULT_SALTSIZE;
+ }
+
+ /**
+ * Returns a key size in bits for tests, depending on the specified algorithm
+ */
+ public static int getTestKeySize(String algo) {
+ return switch (algo) {
+ case "RSA" -> KeySize.RSA.keySize;
+ case "DSA" -> KeySize.DSA.keySize;
+ case "DH", "DiffieHellman" -> KeySize.DH.keySize;
+ default -> throw new RuntimeException("Test key size not defined for " + algo);
+ };
+ }
+
+ /**
+ * Returns a DH predefined group for tests
+ */
+ public static DiffieHellmanGroup getTestDHGroup() {
+ return getTestDHGroup(2048);
+ }
+
+ /**
+ * Returns a DH predefined group for tests, depending on the specified prime size
+ */
+ public static DiffieHellmanGroup getTestDHGroup(int primeSize) {
+ return switch(primeSize) {
+ case 2048 -> DiffieHellmanGroup.ffdhe2048;
+ case 3072 -> DiffieHellmanGroup.ffdhe3072;
+ case 4096 -> DiffieHellmanGroup.ffdhe4096;
+ default -> throw new RuntimeException("Test DH group not defined for " + primeSize);
+ };
+ }
+
private static void removeFromDSigPolicy(String rule, List algs) {
String value = Security.getProperty("jdk.xml.dsig.secureValidationPolicy");
value = Arrays.stream(value.split(","))
diff --git a/test/micro/org/openjdk/bench/java/security/SSLHandshake.java b/test/micro/org/openjdk/bench/java/security/SSLHandshake.java
index 67e51e9532d..62c45045585 100644
--- a/test/micro/org/openjdk/bench/java/security/SSLHandshake.java
+++ b/test/micro/org/openjdk/bench/java/security/SSLHandshake.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2023, 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
@@ -80,11 +80,12 @@ public void init() throws Exception {
KeyStore ks = TestCertificates.getKeyStore();
KeyStore ts = TestCertificates.getTrustStore();
- KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance(
+ KeyManagerFactory.getDefaultAlgorithm());
kmf.init(ks, new char[0]);
- TrustManagerFactory tmf =
- TrustManagerFactory.getInstance("SunX509");
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance(
+ TrustManagerFactory.getDefaultAlgorithm());
tmf.init(ts);
SSLContext sslCtx = SSLContext.getInstance(tlsVersion);
diff --git a/test/micro/org/openjdk/bench/java/security/TestCertificates.java b/test/micro/org/openjdk/bench/java/security/TestCertificates.java
index 50d8401c070..752f0442a93 100644
--- a/test/micro/org/openjdk/bench/java/security/TestCertificates.java
+++ b/test/micro/org/openjdk/bench/java/security/TestCertificates.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2023, 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
@@ -115,12 +115,12 @@ class TestCertificates {
private TestCertificates() {}
public static KeyStore getKeyStore() throws GeneralSecurityException, IOException {
- KeyStore result = KeyStore.getInstance("JKS");
+ KeyStore result = KeyStore.getInstance(KeyStore.getDefaultType());
result.load(null, null);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
Certificate serverCert = cf.generateCertificate(
new ByteArrayInputStream(
- TestCertificates.SERVER_CERT.getBytes(StandardCharsets.ISO_8859_1)));
+ SERVER_CERT.getBytes(StandardCharsets.ISO_8859_1)));
Certificate caCert = cf.generateCertificate(
new ByteArrayInputStream(
CA_CERT.getBytes(StandardCharsets.ISO_8859_1)));
@@ -135,7 +135,7 @@ public static KeyStore getKeyStore() throws GeneralSecurityException, IOExceptio
}
public static KeyStore getTrustStore() throws GeneralSecurityException, IOException {
- KeyStore result = KeyStore.getInstance("JKS");
+ KeyStore result = KeyStore.getInstance(KeyStore.getDefaultType());
result.load(null, null);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
Certificate rootcaCert = cf.generateCertificate(