diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index 83a8c98a30d..b0a4e7b952e 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -277,7 +277,7 @@ jobs: run: > if cat test-results/testoutput/*/exitcode.txt | grep -q -v '^0$' || ! cat test-results/testoutput/*/Stats.txt | grep -q 'fail=0' ; then - cat test-results/testoutput/*/JTreport/text/newfailures.txt ; + cat test-results/testoutput/*/JTreport/text/{newfailures,other_errors}.txt ; exit 1 ; fi @@ -638,7 +638,7 @@ jobs: run: > if cat test-results/testoutput/*/exitcode.txt | grep -q -v '^0$' || ! cat test-results/testoutput/*/Stats.txt | grep -q 'fail=0' ; then - cat test-results/testoutput/*/JTreport/text/newfailures.txt ; + cat test-results/testoutput/*/JTreport/text/{newfailures,other_errors}.txt ; exit 1 ; fi @@ -1143,6 +1143,7 @@ jobs: run: > if ((Get-ChildItem -Path test-results\testoutput\*\exitcode.txt -Recurse | Select-String -Pattern '^0$' -NotMatch ).Count -gt 0) { Get-Content -Path test-results\testoutput\*\JTreport\text\newfailures.txt ; + Get-Content -Path test-results\testoutput\*\JTreport\text\other_errors.txt ; exit 1 } @@ -1299,6 +1300,7 @@ jobs: run: > if ((Get-ChildItem -Path test-results\testoutput\*\exitcode.txt -Recurse | Select-String -Pattern '^0$' -NotMatch ).Count -gt 0) { Get-Content -Path test-results\testoutput\*\JTreport\text\newfailures.txt ; + Get-Content -Path test-results\testoutput\*\JTreport\text\other_errors.txt ; exit 1 } @@ -1529,7 +1531,7 @@ jobs: run: > if cat test-results/testoutput/*/exitcode.txt | grep -q -v '^0$' || ! cat test-results/testoutput/*/Stats.txt | grep -q 'fail=0' ; then - cat test-results/testoutput/*/JTreport/text/newfailures.txt ; + cat test-results/testoutput/*/JTreport/text/{newfailures,other_errors}.txt ; exit 1 ; fi diff --git a/.jcheck/conf b/.jcheck/conf index 6b38c2b0c86..a8d23a3c35b 100644 --- a/.jcheck/conf +++ b/.jcheck/conf @@ -1,7 +1,7 @@ [general] project=jdk8u jbs=JDK -version=openjdk8u392 +version=openjdk8u402 [checks] error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace diff --git a/README b/README index 40c9fbc6a77..c93292bfbe4 100644 --- a/README +++ b/README @@ -1,40 +1,10 @@ -README: - This file should be located at the top of the OpenJDK Mercurial root - repository. A full OpenJDK repository set (forest) should also include - the following 6 nested repositories: - "jdk", "hotspot", "langtools", "corba", "jaxws" and "jaxp". +Welcome to OpenJDK! +=================== - The root repository can be obtained with something like: - hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8 - - You can run the get_source.sh script located in the root repository to get - the other needed repositories: - cd openjdk8 && sh ./get_source.sh +For information about building OpenJDK, including how to fully retrieve all +source code, please see either of these: - People unfamiliar with Mercurial should read the first few chapters of - the Mercurial book: http://hgbook.red-bean.com/read/ + * doc/building.html (html version) + * doc/building.md (markdown version) - See http://openjdk.java.net/ for more information about OpenJDK. - -Simple Build Instructions: - - 0. Get the necessary system software/packages installed on your system, see - http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html - - 1. If you don't have a jdk7u7 or newer jdk, download and install it from - http://java.sun.com/javase/downloads/index.jsp - Add the /bin directory of this installation to your PATH environment - variable. - - 2. Configure the build: - bash ./configure - - 3. Build the OpenJDK: - make all - The resulting JDK image should be found in build/*/images/j2sdk-image - -where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually -is 3.81 or newer. Note that on Solaris, GNU make is called "gmake". - -Complete details are available in the file: - http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html +See http://openjdk.java.net/ for more information about OpenJDK. diff --git a/README-builds.html b/README-builds.html deleted file mode 100644 index 2281650f9e6..00000000000 --- a/README-builds.html +++ /dev/null @@ -1,1389 +0,0 @@ - - - OpenJDK Build README - - -

OpenJDK

- -

OpenJDK Build README

- -
- -

- -

Introduction

- -

This README file contains build instructions for the -OpenJDK. Building the source code for the OpenJDK -requires a certain degree of technical expertise.

- -

!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!

- -

Some Headlines:

- - - -
- -

Contents

- - - -
- - - -
- -

- -

Use of Mercurial

- -

The OpenJDK sources are maintained with the revision control system -Mercurial. If you are new to -Mercurial, please see the Beginner Guides or refer to the Mercurial Book. -The first few chapters of the book provide an excellent overview of Mercurial, -what it is and how it works.

- -

For using Mercurial with the OpenJDK refer to the Developer Guide: Installing -and Configuring Mercurial section for more information.

- -

- -

Getting the Source

- -

To get the entire set of OpenJDK Mercurial repositories use the script -get_source.sh located in the root repository:

- -
  hg clone http://hg.openjdk.java.net/jdk8/jdk8 YourOpenJDK
-  cd YourOpenJDK
-  bash ./get_source.sh
-
- -

Once you have all the repositories, keep in mind that each repository is its -own independent repository. You can also re-run ./get_source.sh anytime to -pull over all the latest changesets in all the repositories. This set of -nested repositories has been given the term "forest" and there are various -ways to apply the same hg command to each of the repositories. For -example, the script make/scripts/hgforest.sh can be used to repeat the -same hg command on every repository, e.g.

- -
  cd YourOpenJDK
-  bash ./make/scripts/hgforest.sh status
-
- -

- -

Repositories

- -

The set of repositories and what they contain:

- - - -

Repository Source Guidelines

- -

There are some very basic guidelines:

- - - -
- -

- -

Building

- -

The very first step in building the OpenJDK is making sure the system itself -has everything it needs to do OpenJDK builds. Once a system is setup, it -generally doesn't need to be done again.

- -

Building the OpenJDK is now done with running a configure script which will -try and find and verify you have everything you need, followed by running -make, e.g.

- -
-

bash ./configure
- make all

-
- -

Where possible the configure script will attempt to located the various -components in the default locations or via component specific variable -settings. When the normal defaults fail or components cannot be found, -additional configure options may be necessary to help configure find the -necessary tools for the build, or you may need to re-visit the setup of your -system due to missing software packages.

- -

NOTE: The configure script file does not have execute permissions and -will need to be explicitly run with bash, see the source guidelines.

- -
- -

- -

System Setup

- -

Before even attempting to use a system to build the OpenJDK there are some very -basic system setups needed. For all systems:

- - - -

And for specific systems:

- - - -

- -

Linux

- -

With Linux, try and favor the system packages over building your own or getting -packages from other areas. Most Linux builds should be possible with the -system's available packages.

- -

Note that some Linux systems have a habit of pre-populating your environment -variables for you, for example JAVA_HOME might get pre-defined for you to -refer to the JDK installed on your Linux system. You will need to unset -JAVA_HOME. It's a good idea to run env and verify the environment variables -you are getting from the default system settings make sense for building the -OpenJDK.

- -

- -

Solaris

- -

- -
Studio Compilers
- -

At a minimum, the Studio 12 Update 1 Compilers (containing -version 5.10 of the C and C++ compilers) is required, including specific -patches.

- -

The Solaris SPARC patch list is:

- - - -

The Solaris X86 patch list is:

- - - -

Place the bin directory in PATH.

- -

The Oracle Solaris Studio Express compilers at: Oracle Solaris Studio Express -Download site are also an option, although these compilers -have not been extensively used yet.

- -

- -

Windows

- -
Windows Unix Toolkit
- -

Building on Windows requires a Unix-like environment, notably a Unix-like -shell. There are several such environments available of which -Cygwin and -MinGW/MSYS are currently supported for the -OpenJDK build. One of the differences of these systems from standard Windows -tools is the way they handle Windows path names, particularly path names which -contain spaces, backslashes as path separators and possibly drive letters. -Depending on the use case and the specifics of each environment these path -problems can be solved by a combination of quoting whole paths, translating -backslashes to forward slashes, escaping backslashes with additional -backslashes and translating the path names to their "8.3" -version.

- -

- -
CYGWIN
- -

CYGWIN is an open source, Linux-like environment which tries to emulate a -complete POSIX layer on Windows. It tries to be smart about path names and can -usually handle all kinds of paths if they are correctly quoted or escaped -although internally it maps drive letters <drive>: to a virtual directory -/cygdrive/<drive>.

- -

You can always use the cygpath utility to map pathnames with spaces or the -backslash character into the C:/ style of pathname (called 'mixed'), e.g. -cygpath -s -m "<path>".

- -

Note that the use of CYGWIN creates a unique problem with regards to setting -PATH. Normally on Windows the PATH variable contains directories -separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it -uses ":", but that means that paths like "C:/path" cannot be placed in the -CYGWIN version of PATH and instead CYGWIN uses something like -/cygdrive/c/path which CYGWIN understands, but only CYGWIN understands.

- -

The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about -CYGWIN can be obtained from the CYGWIN website at -www.cygwin.com.

- -

By default CYGWIN doesn't install all the tools required for building the -OpenJDK. Along with the default installation, you need to install the following -tools.

- -
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using 'magic' numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system

-
- -

Note that the CYGWIN software can conflict with other non-CYGWIN software on -your Windows system. CYGWIN provides a FAQ for known issues and problems, of particular interest is the -section on BLODA (applications that interfere with -CYGWIN).

- -

- -
MinGW/MSYS
- -

MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific -header files and import libraries combined with GNU toolsets that allow one to -produce native Windows programs that do not rely on any 3rd-party C runtime -DLLs. MSYS is a supplement to MinGW which allows building applications and -programs which rely on traditional UNIX tools to be present. Among others this -includes tools like bash and make. See MinGW/MSYS for more information.

- -

Like Cygwin, MinGW/MSYS can handle different types of path formats. They are -internally converted to paths with forward slashes and drive letters -<drive>: replaced by a virtual directory /<drive>. Additionally, MSYS -automatically detects binaries compiled for the MSYS environment and feeds them -with the internal, Unix-style path names. If native Windows applications are -called from within MSYS programs their path arguments are automatically -converted back to Windows style path names with drive letters and backslashes -as path separators. This may cause problems for Windows applications which use -forward slashes as parameter separator (e.g. cl /nologo /I) because MSYS may -wrongly replace such parameters by drive letters.

- -

In addition to the tools which will be installed by default, you have to -manually install the msys-zip and msys-unzip packages. This can be easily -done with the MinGW command line installer:

- -
  mingw-get.exe install msys-zip
-  mingw-get.exe install msys-unzip
-
- -

- -
Visual Studio 2010 Compilers
- -

The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio -C++ 2010 (VS2010) Professional Edition or Express compiler. The compiler and -other tools are expected to reside in the location defined by the variable -VS100COMNTOOLS which is set by the Microsoft Visual Studio installer.

- -

Only the C++ part of VS2010 is needed. Try to let the installation go to the -default install directory. Always reboot your system after installing VS2010. -The system environment variable VS100COMNTOOLS should be set in your -environment.

- -

Make sure that TMP and TEMP are also set in the environment and refer to -Windows paths that exist, like C:\temp, not /tmp, not /cygdrive/c/temp, -and not C:/temp. C:\temp is just an example, it is assumed that this area -is private to the user, so by default after installs you should see a unique -user path in these variables.

- -

- -

Mac OS X

- -

Make sure you get the right XCode version.

- -
- -

- -

Configure

- -

The basic invocation of the configure script looks like:

- -
-

bash ./configure [options]

-
- -

This will create an output directory containing the "configuration" and setup -an area for the build result. This directory typically looks like:

- -
-

build/linux-x64-normal-server-release

-
- -

configure will try to figure out what system you are running on and where all -necessary build components are. If you have all prerequisites for building -installed, it should find everything. If it fails to detect any component -automatically, it will exit and inform you about the problem. When this -happens, read more below in the configure options.

- -

Some examples:

- -
-

Windows 32bit build with freetype specified:
- bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target- -bits=32

- -

Debug 64bit Build:
- bash ./configure --enable-debug --with-target-bits=64

-
- -

- -

Configure Options

- -

Complete details on all the OpenJDK configure options can be seen with:

- -
-

bash ./configure --help=short

-
- -

Use -help to see all the configure options available. You can generate any -number of different configurations, e.g. debug, release, 32, 64, etc.

- -

Some of the more commonly used configure options are:

- -
-

--enable-debug
- set the debug level to fastdebug (this is a shorthand for --with-debug- - level=fastdebug)

-
- -

- -
-

--with-alsa=path
- select the location of the Advanced Linux Sound Architecture (ALSA)

- -

Version 0.9.1 or newer of the ALSA files are required for building the - OpenJDK on Linux. These Linux files are usually available from an "alsa" of - "libasound" development package, and it's highly recommended that you try - and use the package provided by the particular version of Linux that you are - using.

- -

--with-boot-jdk=path
- select the Bootstrap JDK

- -

--with-boot-jdk-jvmargs="args"
- provide the JVM options to be used to run the Bootstrap JDK

- -

--with-cacerts=path
- select the path to the cacerts file.

- -

See Certificate Authority on Wikipedia for a better understanding of the Certificate - Authority (CA). A certificates file named "cacerts" represents a system-wide - keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts" - file contains root CA certificates from several public CAs (e.g., VeriSign, - Thawte, and Baltimore). The source contain a cacerts file without CA root - certificates. Formal JDK builders will need to secure permission from each - public CA and include the certificates into their own custom cacerts file. - Failure to provide a populated cacerts file will result in verification - errors of a certificate chain during runtime. By default an empty cacerts - file is provided and that should be fine for most JDK developers.

-
- -

- -
-

--with-cups=path
- select the CUPS install location

- -

The Common UNIX Printing System (CUPS) Headers are required for building the - OpenJDK on Solaris and Linux. The Solaris header files can be obtained by - installing the package SFWcups from the Solaris Software Companion - CD/DVD, these often will be installed into the directory /opt/sfw/cups.

- -

The CUPS header files can always be downloaded from - www.cups.org.

- -

--with-cups-include=path
- select the CUPS include directory location

- -

--with-debug-level=level
- select the debug information level of release, fastdebug, or slowdebug

- -

--with-dev-kit=path
- select location of the compiler install or developer install location

-
- -

- -
-

--with-freetype=path
- select the freetype files to use.

- -

Expecting the freetype libraries under lib/ and the headers under - include/.

- -

Version 2.3 or newer of FreeType is required. On Unix systems required files - can be available as part of your distribution (while you still may need to - upgrade them). Note that you need development version of package that - includes both the FreeType library and header files.

- -

You can always download latest FreeType version from the FreeType - website. Building the freetype 2 libraries from - scratch is also possible, however on Windows refer to the Windows FreeType - DLL build instructions.

- -

Note that by default FreeType is built with byte code hinting support - disabled due to licensing restrictions. In this case, text appearance and - metrics are expected to differ from Sun's official JDK build. See the - SourceForge FreeType2 Home Page - for more information.

- -

--with-import-hotspot=path
- select the location to find hotspot binaries from a previous build to avoid - building hotspot

- -

--with-target-bits=arg
- select 32 or 64 bit build

- -

--with-jvm-variants=variants
- select the JVM variants to build from, comma separated list that can - include: server, client, kernel, zero and zeroshark

- -

--with-memory-size=size
- select the RAM size that GNU make will think this system has

- -

--with-msvcr-dll=path
- select the msvcr100.dll file to include in the Windows builds (C/C++ - runtime library for Visual Studio).

- -

This is usually picked up automatically from the redist directories of - Visual Studio 2010.

- -

--with-num-cores=cores
- select the number of cores to use (processor count or CPU count)

-
- -

- -
-

--with-x=path
- select the location of the X11 and xrender files.

- -

The XRender Extension Headers are required for building the OpenJDK on - Solaris and Linux. The Linux header files are usually available from a - "Xrender" development package, it's recommended that you try and use the - package provided by the particular distribution of Linux that you are using. - The Solaris XRender header files is included with the other X11 header files - in the package SFWxwinc on new enough versions of Solaris and will be - installed in /usr/X11/include/X11/extensions/Xrender.h or - /usr/openwin/share/include/X11/extensions/Xrender.h

-
- -
- -

- -

Make

- -

The basic invocation of the make utility looks like:

- -
-

make all

-
- -

This will start the build to the output directory containing the -"configuration" that was created by the configure script. Run make help for -more information on the available targets.

- -

There are some of the make targets that are of general interest:

- -
-

empty
- build everything but no images

- -

all
- build everything including images

- -

all-conf
- build all configurations

- -

images
- create complete j2sdk and j2re images

- -

install
- install the generated images locally, typically in /usr/local

- -

clean
- remove all files generated by make, but not those generated by configure

- -

dist-clean
- remove all files generated by both and configure (basically killing the - configuration)

- -

help
- give some help on using make, including some interesting make targets

-
- -
- -

- -

Testing

- -

When the build is completed, you should see the generated binaries and -associated files in the j2sdk-image directory in the output directory. In -particular, the build/*/images/j2sdk-image/bin directory should contain -executables for the OpenJDK tools and utilities for that configuration. The -testing tool jtreg will be needed and can be found at: the jtreg -site. The provided regression tests in the -repositories can be run with the command:

- -
-

cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all

-
- -
- -

- -

Appendix A: Hints and Tips

- -

- -

FAQ

- -

Q: The generated-configure.sh file looks horrible! How are you going to -edit it?
-A: The generated-configure.sh file is generated (think "compiled") by the -autoconf tools. The source code is in configure.ac and various .m4 files in -common/autoconf, which are much more readable.

- -

Q: Why is the generated-configure.sh file checked in, if it is -generated?
-A: If it was not generated, every user would need to have the autoconf -tools installed, and re-generate the configure file as the first step. Our -goal is to minimize the work needed to be done by the user to start building -OpenJDK, and to minimize the number of external dependencies required.

- -

Q: Do you require a specific version of autoconf for regenerating -generated-configure.sh?
-A: Yes, version 2.69 is required and should be easy enough to aquire on all -supported operating systems. The reason for this is to avoid large spurious -changes in generated-configure.sh.

- -

Q: How do you regenerate generated-configure.sh after making changes to -the input files?
-A: Regnerating generated-configure.sh should always be done using the -script common/autoconf/autogen.sh to ensure that the correct files get -updated. This script should also be run after mercurial tries to merge -generated-configure.sh as a merge of the generated file is not guaranteed to -be correct.

- -

Q: What are the files in common/makefiles/support/* for? They look like -gibberish.
-A: They are a somewhat ugly hack to compensate for command line length -limitations on certain platforms (Windows, Solaris). Due to a combination of -limitations in make and the shell, command lines containing too many files will -not work properly. These helper files are part of an elaborate hack that will -compress the command line in the makefile and then uncompress it safely. We're -not proud of it, but it does fix the problem. If you have any better -suggestions, we're all ears! :-)

- -

Q: I want to see the output of the commands that make runs, like in the old -build. How do I do that?
-A: You specify the LOG variable to make. There are several log levels:

- - - -

Q: When do I have to re-run configure?
-A: Normally you will run configure only once for creating a -configuration. You need to re-run configuration only if you want to change any -configuration options, or if you pull down changes to the configure script.

- -

Q: I have added a new source file. Do I need to modify the makefiles?
-A: Normally, no. If you want to create e.g. a new native library, you will -need to modify the makefiles. But for normal file additions or removals, no -changes are needed. There are certan exceptions for some native libraries where -the source files are spread over many directories which also contain sources -for other libraries. In these cases it was simply easier to create include -lists rather than excludes.

- -

Q: When I run configure --help, I see many strange options, like ---dvidir. What is this?
-A: Configure provides a slew of options by default, to all projects that -use autoconf. Most of them are not used in OpenJDK, so you can safely ignore -them. To list only OpenJDK specific features, use configure --help=short -instead.

- -

Q: configure provides OpenJDK-specific features such as --with- -builddeps-server that are not described in this document. What about those?
-A: Try them out if you like! But be aware that most of these are -experimental features. Many of them don't do anything at all at the moment; the -option is just a placeholder. Others depend on pieces of code or infrastructure -that is currently not ready for prime time.

- -

Q: How will you make sure you don't break anything?
-A: We have a script that compares the result of the new build system with -the result of the old. For most part, we aim for (and achieve) byte-by-byte -identical output. There are however technical issues with e.g. native binaries, -which might differ in a byte-by-byte comparison, even when building twice with -the old build system. For these, we compare relevant aspects (e.g. the symbol -table and file size). Note that we still don't have 100% equivalence, but we're -close.

- -

Q: I noticed this thing X in the build that looks very broken by design. -Why don't you fix it?
-A: Our goal is to produce a build output that is as close as technically -possible to the old build output. If things were weird in the old build, they -will be weird in the new build. Often, things were weird before due to -obscurity, but in the new build system the weird stuff comes up to the surface. -The plan is to attack these things at a later stage, after the new build system -is established.

- -

Q: The code in the new build system is not that well-structured. Will you -fix this?
-A: Yes! The new build system has grown bit by bit as we converted the old -system. When all of the old build system is converted, we can take a step back -and clean up the structure of the new build system. Some of this we plan to do -before replacing the old build system and some will need to wait until after.

- -

Q: Is anything able to use the results of the new build's default make -target?
-A: Yes, this is the minimal (or roughly minimal) set of compiled output -needed for a developer to actually execute the newly built JDK. The idea is -that in an incremental development fashion, when doing a normal make, you -should only spend time recompiling what's changed (making it purely -incremental) and only do the work that's needed to actually run and test your -code. The packaging stuff that is part of the images target is not needed for -a normal developer who wants to test his new code. Even if it's quite fast, -it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) -(Or, well, at least single-digit seconds...)

- -

Q: I usually set a specific environment variable when building, but I can't -find the equivalent in the new build. What should I do?
-A: It might very well be that we have neglected to add support for an -option that was actually used from outside the build system. Email us and we -will add support for it!

- -

- -

Build Performance Tips

- -

Building OpenJDK requires a lot of horsepower. Some of the build tools can be -adjusted to utilize more or less of resources such as parallel threads and -memory. The configure script analyzes your system and selects reasonable -values for such options based on your hardware. If you encounter resource -problems, such as out of memory conditions, you can modify the detected values -with:

- - - -

It might also be necessary to specify the JVM arguments passed to the Bootstrap -JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". Doing -this will override the default JVM arguments passed to the Bootstrap JDK.

- -

One of the top goals of the new build system is to improve the build -performance and decrease the time needed to build. This will soon also apply to -the java compilation when the Smart Javac wrapper is making its way into jdk8. -It can be tried in the build-infra repository already. You are likely to find -that the new build system is faster than the old one even without this feature.

- -

At the end of a successful execution of configure, you will get a performance -summary, indicating how well the build will perform. Here you will also get -performance hints. If you want to build fast, pay attention to those!

- -

Building with ccache

- -

A simple way to radically speed up compilation of native code -(typically hotspot and native libraries in JDK) is to install -ccache. This will cache and reuse prior compilation results, if the -source code is unchanged. However, ccache versions prior to 3.1.4 does -not work correctly with the precompiled headers used in OpenJDK. So if -your platform supports ccache at 3.1.4 or later, we highly recommend -installing it. This is currently only supported on linux.

- -

Building on local disk

- -

If you are using network shares, e.g. via NFS, for your source code, make sure -the build directory is situated on local disk. The performance penalty is -extremely high for building on a network share, close to unusable.

- -

Building only one JVM

- -

The old build builds multiple JVMs on 32-bit systems (client and server; and on -Windows kernel as well). In the new build we have changed this default to only -build server when it's available. This improves build times for those not -interested in multiple JVMs. To mimic the old behavior on platforms that -support it, use --with-jvm-variants=client,server.

- -

Selecting the number of cores to build on

- -

By default, configure will analyze your machine and run the make process in -parallel with as many threads as you have cores. This behavior can be -overridden, either "permanently" (on a configure basis) using ---with-num-cores=N or for a single build only (on a make basis), using -make JOBS=N.

- -

If you want to make a slower build just this time, to save some CPU power for -other processes, you can run e.g. make JOBS=2. This will force the makefiles -to only run 2 parallel processes, or even make JOBS=1 which will disable -parallelism.

- -

If you want to have it the other way round, namely having slow builds default -and override with fast if you're impatient, you should call configure with ---with-num-cores=2, making 2 the default. If you want to run with more cores, -run make JOBS=8

- -

- -

Troubleshooting

- -

Solving build problems

- -

If the build fails (and it's not due to a compilation error in a source file -you've changed), the first thing you should do is to re-run the build with more -verbosity. Do this by adding LOG=debug to your make command line.

- -

The build log (with both stdout and stderr intermingled, basically the same as -you see on your console) can be found as build.log in your build directory.

- -

You can ask for help on build problems with the new build system on either the -build-dev or the -build-infra-dev -mailing lists. Please include the relevant parts of the build log.

- -

A build can fail for any number of reasons. Most failures are a result of -trying to build in an environment in which all the pre-build requirements have -not been met. The first step in troubleshooting a build failure is to recheck -that you have satisfied all the pre-build requirements for your platform. -Scanning the configure log is a good first step, making sure that what it -found makes sense for your system. Look for strange error messages or any -difficulties that configure had in finding things.

- -

Some of the more common problems with builds are briefly described below, with -suggestions for remedies.

- - - -
- -

- -

Appendix B: GNU make

- -

The Makefiles in the OpenJDK are only valid when used with the GNU version of -the utility command make (usually called gmake on Solaris). A few notes -about using GNU make:

- - - -

Information on GNU make, and access to ftp download sites, are available on the -GNU make web site . The latest -source to GNU make is available at -ftp.gnu.org/pub/gnu/make/.

- -

- -

Building GNU make

- -

First step is to get the GNU make 3.81 or newer source from -ftp.gnu.org/pub/gnu/make/. Building is a -little different depending on the OS but is basically done with:

- -
  bash ./configure
-  make
-
- -
- -

- -

Appendix C: Build Environments

- -

Minimum Build Environments

- -

This file often describes specific requirements for what we call the "minimum -build environments" (MBE) for this specific release of the JDK. What is listed -below is what the Oracle Release Engineering Team will use to build the Oracle -JDK product. Building with the MBE will hopefully generate the most compatible -bits that install on, and run correctly on, the most variations of the same -base OS and hardware architecture. In some cases, these represent what is often -called the least common denominator, but each Operating System has different -aspects to it.

- -

In all cases, the Bootstrap JDK version minimum is critical, we cannot -guarantee builds will work with older Bootstrap JDK's. Also in all cases, more -RAM and more processors is better, the minimums listed below are simply -recommendations.

- -

With Solaris and Mac OS X, the version listed below is the oldest release we -can guarantee builds and works, and the specific version of the compilers used -could be critical.

- -

With Windows the critical aspect is the Visual Studio compiler used, which due -to it's runtime, generally dictates what Windows systems can do the builds and -where the resulting bits can be used.

- -

NOTE: We expect a change here off these older Windows OS releases and to a -'less older' one, probably Windows 2008R2 X64.

- -

With Linux, it was just a matter of picking a stable distribution that is a -good representative for Linux in general.

- -

NOTE: We expect a change here from Fedora 9 to something else, but it has not -been completely determined yet, possibly Ubuntu 12.04 X64, unbiased community -feedback would be welcome on what a good choice would be here.

- -

It is understood that most developers will NOT be using these specific -versions, and in fact creating these specific versions may be difficult due to -the age of some of this software. It is expected that developers are more often -using the more recent releases and distributions of these operating systems.

- -

Compilation problems with newer or different C/C++ compilers is a common -problem. Similarly, compilation problems related to changes to the -/usr/include or system header files is also a common problem with older, -newer, or unreleased OS versions. Please report these types of problems as bugs -so that they can be dealt with accordingly.

- -
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Base OS and ArchitectureOSC/C++ CompilerBootstrap JDKProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Fedora 9gcc 4.3 JDK 7u72 or more1 GB6 GB
Solaris SPARC (32-bit) and SPARCV9 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Solaris X86 (32-bit) and X64 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Windows X86 (32-bit)Windows XPMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2003 - Enterprise x64 EditionMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.7 "Lion"XCode 4.5.2 or newerJDK 7u72 or more4 GB6 GB

-
- -
- -

- -

Specific Developer Build Environments

- -

We won't be listing all the possible environments, but we will try to provide -what information we have available to us.

- -

NOTE: The community can help out by updating this part of the document.

- -

Fedora

- -

After installing the latest Fedora you need to -install several build dependencies. The simplest way to do it is to execute the -following commands as user root:

- -
  yum-builddep java-1.7.0-openjdk
-  yum install gcc gcc-c++
-
- -

In addition, it's necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
-
- -

CentOS 5.5

- -

After installing CentOS 5.5 you need to make sure you -have the following Development bundles installed:

- - - -

Plus the following packages:

- - - -

The freetype 2.3 packages don't seem to be available, but the freetype 2.3 -sources can be downloaded, built, and installed easily enough from the -freetype site. Build and install -with something like:

- -
  bash ./configure
-  make
-  sudo -u root make install
-
- -

Mercurial packages could not be found easily, but a Google search should find -ones, and they usually include Python if it's needed.

- -

Debian 5.0 (Lenny)

- -

After installing Debian 5 you need to install several -build dependencies. The simplest way to install the build dependencies is to -execute the following commands as user root:

- -
  aptitude build-dep openjdk-7
-  aptitude install openjdk-7-jdk libmotif-dev
-
- -

In addition, it's necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
- -

Ubuntu 12.04

- -

After installing Ubuntu 12.04 you need to install several -build dependencies. The simplest way to do it is to execute the following -commands:

- -
  sudo aptitude build-dep openjdk-7
-  sudo aptitude install openjdk-7-jdk
-
- -

In addition, it's necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
- -

OpenSUSE 11.1

- -

After installing OpenSUSE 11.1 you need to install -several build dependencies. The simplest way to install the build dependencies -is to execute the following commands:

- -
  sudo zypper source-install -d java-1_7_0-openjdk
-  sudo zypper install make
-
- -

In addition, it is necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
-
- -

Finally, you need to unset the JAVA_HOME environment variable:

- -
  export -n JAVA_HOME`
-
- -

Mandriva Linux One 2009 Spring

- -

After installing Mandriva Linux One 2009 Spring you need -to install several build dependencies. The simplest way to install the build -dependencies is to execute the following commands as user root:

- -
  urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
-    libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
-    libxtst6-devel libxi-devel
-
- -

In addition, it is necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
-
- -

OpenSolaris 2009.06

- -

After installing OpenSolaris 2009.06 you need to -install several build dependencies. The simplest way to install the build -dependencies is to execute the following commands:

- -
  pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
-    SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
-
- -

In addition, it is necessary to set a few environment variables for the build:

- -
  export LANG=C
-  export PATH="/opt/SunStudioExpress/bin:${PATH}"
-
- -
- -

End of the OpenJDK build README document.

- -

Please come again!

- - diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 692ef831abf..66e69ad5a8e 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -427,6 +427,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], BASIC_PATH_PROGS(DF, df) BASIC_PATH_PROGS(SETFILE, SetFile) BASIC_PATH_PROGS(CPIO, [cpio bsdcpio]) + BASIC_PATH_PROGS(PANDOC, pandoc) ]) # Setup basic configuration paths, and platform-specific stuff related to PATHs. diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index fa1989a2967..be1bfeca76e 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -949,6 +949,7 @@ build_os build_vendor build_cpu build +PANDOC CPIO SETFILE DF @@ -1017,7 +1018,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -1180,6 +1180,7 @@ READLINK DF SETFILE CPIO +PANDOC UNZIP ZIP LDD @@ -1263,7 +1264,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1516,15 +1516,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1662,7 +1653,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1815,7 +1806,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2078,6 +2068,7 @@ Some influential environment variables: DF Override default value for DF SETFILE Override default value for SETFILE CPIO Override default value for CPIO + PANDOC Override default value for PANDOC UNZIP Override default value for UNZIP ZIP Override default value for ZIP LDD Override default value for LDD @@ -4450,7 +4441,7 @@ VS_TOOLSET_SUPPORTED_2022=true #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1670219878 +DATE_WHEN_GENERATED=1694011184 ############################################################################### # @@ -13510,6 +13501,192 @@ $as_echo "$tool_specified" >&6; } + # Publish this variable in the help. + + + if test "x$PANDOC" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in pandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PANDOC" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !PANDOC! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PANDOC!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xPANDOC" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in pandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PANDOC" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if the provided tool contains a complete path. + tool_specified="$PANDOC" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PANDOC=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool PANDOC=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$PANDOC" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PANDOC=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool PANDOC=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5 +$as_echo_n "checking for PANDOC... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool PANDOC=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + + + # Now we can determine OpenJDK build and target platforms. This is required to # have early on. # Make sure we can run config.sub. diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index a9cea037ae5..f59a5f94d30 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -549,6 +549,7 @@ LN:=@LN@ MKDIR:=@MKDIR@ MV:=@MV@ NAWK:=@NAWK@ +PANDOC:=@PANDOC@ PRINTF:=@PRINTF@ PWD:=@THEPWDCMD@ RM:=@RM@ diff --git a/common/autoconf/version-numbers b/common/autoconf/version-numbers index e53f02edab2..fe08eae1440 100644 --- a/common/autoconf/version-numbers +++ b/common/autoconf/version-numbers @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 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 @@ -26,7 +26,7 @@ JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=8 JDK_MICRO_VERSION=0 -JDK_UPDATE_VERSION=392 +JDK_UPDATE_VERSION=402 LAUNCHER_NAME=openjdk PRODUCT_NAME=OpenJDK PRODUCT_SUFFIX="Runtime Environment" diff --git a/common/bin/update-build-readme.sh b/common/bin/update-build-readme.sh deleted file mode 100644 index f16e289b32a..00000000000 --- a/common/bin/update-build-readme.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# Get an absolute path to this script, since that determines the top-level -# directory. -this_script_dir=`dirname $0` -TOPDIR=`cd $this_script_dir/../.. > /dev/null && pwd` - -GREP=grep -MD_FILE=$TOPDIR/README-builds.md -HTML_FILE=$TOPDIR/README-builds.html - -# Locate the markdown processor tool and check that it is the correct version. -locate_markdown_processor() { - if [ -z "$MARKDOWN" ]; then - MARKDOWN=`which markdown 2> /dev/null` - if [ -z "$MARKDOWN" ]; then - echo "Error: Cannot locate markdown processor" 1>&2 - exit 1 - fi - fi - - # Test version - MARKDOWN_VERSION=`$MARKDOWN -version | $GREP version` - if [ "x$MARKDOWN_VERSION" != "xThis is Markdown, version 1.0.1." ]; then - echo "Error: Expected markdown version 1.0.1." 1>&2 - echo "Actual version found: $MARKDOWN_VERSION" 1>&2 - echo "Download markdown here: https://daringfireball.net/projects/markdown/" 1>&2 - exit 1 - fi - -} - -# Verify that the source markdown file looks sound. -verify_source_code() { - TOO_LONG_LINES=`$GREP -E -e '^.{80}.+$' $MD_FILE` - if [ "x$TOO_LONG_LINES" != x ]; then - echo "Warning: The following lines are longer than 80 characters:" - $GREP -E -e '^.{80}.+$' $MD_FILE - fi -} - -# Convert the markdown file to html format. -process_source() { - echo "Generating html file from markdown" - cat > $HTML_FILE << END - - - OpenJDK Build README - - -END - ${MARKDOWN} $MD_FILE >> $HTML_FILE - cat >> $HTML_FILE < - -END - echo "Done" -} - -locate_markdown_processor -verify_source_code -process_source diff --git a/corba/README b/corba/README deleted file mode 100644 index 56825f5ca08..00000000000 --- a/corba/README +++ /dev/null @@ -1,14 +0,0 @@ -README: - This file should be located at the top of the corba Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - - cd make && gnumake - - The files that will be imported into the jdk build will be in the "dist" - directory. - diff --git a/doc/building.html b/doc/building.html new file mode 100644 index 00000000000..84d2aa3ace2 --- /dev/null +++ b/doc/building.html @@ -0,0 +1,715 @@ + + + + + + + OpenJDK Build README + + + + +
+

OpenJDK Build README

+
+
+OpenJDK
OpenJDK
+
+
+

Introduction

+

This README file contains build instructions for the OpenJDK. Building the source code for the OpenJDK requires a certain degree of technical expertise.

+

!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!

+

Some Headlines:

+ +
+

Contents

+ +
+ +
+

Use of Mercurial

+

The OpenJDK sources are maintained with the revision control system Mercurial. If you are new to Mercurial, please see the Beginner Guides or refer to the Mercurial Book. The first few chapters of the book provide an excellent overview of Mercurial, what it is and how it works.

+

For using Mercurial with the OpenJDK refer to the Developer Guide: Installing and Configuring Mercurial section for more information.

+

Getting the Source

+

To get the entire set of OpenJDK Mercurial repositories use the script get_source.sh located in the root repository:

+
  hg clone http://hg.openjdk.java.net/jdk8/jdk8 YourOpenJDK
+  cd YourOpenJDK
+  bash ./get_source.sh
+

Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run ./get_source.sh anytime to pull over all the latest changesets in all the repositories. This set of nested repositories has been given the term “forest” and there are various ways to apply the same hg command to each of the repositories. For example, the script make/scripts/hgforest.sh can be used to repeat the same hg command on every repository, e.g.

+
  cd YourOpenJDK
+  bash ./make/scripts/hgforest.sh status
+

Repositories

+

The set of repositories and what they contain:

+ +

Repository Source Guidelines

+

There are some very basic guidelines:

+ +
+

Building

+

The very first step in building the OpenJDK is making sure the system itself has everything it needs to do OpenJDK builds. Once a system is setup, it generally doesn’t need to be done again.

+

Building the OpenJDK is now done with running a configure script which will try and find and verify you have everything you need, followed by running make, e.g.

+
+

bash ./configure
+make all

+
+

Where possible the configure script will attempt to located the various components in the default locations or via component specific variable settings. When the normal defaults fail or components cannot be found, additional configure options may be necessary to help configure find the necessary tools for the build, or you may need to re-visit the setup of your system due to missing software packages.

+

NOTE: The configure script file does not have execute permissions and will need to be explicitly run with bash, see the source guidelines.

+
+

System Setup

+

Before even attempting to use a system to build the OpenJDK there are some very basic system setups needed. For all systems:

+ +

And for specific systems:

+ +

Linux

+

With Linux, try and favor the system packages over building your own or getting packages from other areas. Most Linux builds should be possible with the system’s available packages.

+

Note that some Linux systems have a habit of pre-populating your environment variables for you, for example JAVA_HOME might get pre-defined for you to refer to the JDK installed on your Linux system. You will need to unset JAVA_HOME. It’s a good idea to run env and verify the environment variables you are getting from the default system settings make sense for building the OpenJDK.

+

Solaris

+
Studio Compilers
+

At a minimum, the Studio 12 Update 1 Compilers (containing version 5.10 of the C and C++ compilers) is required, including specific patches.

+

The Solaris SPARC patch list is:

+ +

The Solaris X86 patch list is:

+ +

Place the bin directory in PATH.

+

The Oracle Solaris Studio Express compilers at: Oracle Solaris Studio Express Download site are also an option, although these compilers have not been extensively used yet.

+

Windows

+
Windows Unix Toolkit
+

Building on Windows requires a Unix-like environment, notably a Unix-like shell. There are several such environments available of which Cygwin and MinGW/MSYS are currently supported for the OpenJDK build. One of the differences of these systems from standard Windows tools is the way they handle Windows path names, particularly path names which contain spaces, backslashes as path separators and possibly drive letters. Depending on the use case and the specifics of each environment these path problems can be solved by a combination of quoting whole paths, translating backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their “8.3” version.

+
CYGWIN
+

CYGWIN is an open source, Linux-like environment which tries to emulate a complete POSIX layer on Windows. It tries to be smart about path names and can usually handle all kinds of paths if they are correctly quoted or escaped although internally it maps drive letters <drive>: to a virtual directory /cygdrive/<drive>.

+

You can always use the cygpath utility to map pathnames with spaces or the backslash character into the C:/ style of pathname (called ‘mixed’), e.g. cygpath -s -m "<path>".

+

Note that the use of CYGWIN creates a unique problem with regards to setting PATH. Normally on Windows the PATH variable contains directories separated with the “;” character (Solaris and Linux use “:”). With CYGWIN, it uses “:”, but that means that paths like “C:/path” cannot be placed in the CYGWIN version of PATH and instead CYGWIN uses something like /cygdrive/c/path which CYGWIN understands, but only CYGWIN understands.

+

The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about CYGWIN can be obtained from the CYGWIN website at www.cygwin.com.

+

By default CYGWIN doesn’t install all the tools required for building the OpenJDK. Along with the default installation, you need to install the following tools.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the ‘make’ utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using ‘magic’ numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system
+

Note that the CYGWIN software can conflict with other non-CYGWIN software on your Windows system. CYGWIN provides a FAQ for known issues and problems, of particular interest is the section on BLODA (applications that interfere with CYGWIN).

+
MinGW/MSYS
+

MinGW (“Minimalist GNU for Windows”) is a collection of free Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this includes tools like bash and make. See MinGW/MSYS for more information.

+

Like Cygwin, MinGW/MSYS can handle different types of path formats. They are internally converted to paths with forward slashes and drive letters <drive>: replaced by a virtual directory /<drive>. Additionally, MSYS automatically detects binaries compiled for the MSYS environment and feeds them with the internal, Unix-style path names. If native Windows applications are called from within MSYS programs their path arguments are automatically converted back to Windows style path names with drive letters and backslashes as path separators. This may cause problems for Windows applications which use forward slashes as parameter separator (e.g. cl /nologo /I) because MSYS may wrongly replace such parameters by drive letters.

+

In addition to the tools which will be installed by default, you have to manually install the msys-zip and msys-unzip packages. This can be easily done with the MinGW command line installer:

+
  mingw-get.exe install msys-zip
+  mingw-get.exe install msys-unzip
+
Visual Studio 2010 Compilers
+

The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio C++ 2010 (VS2010) Professional Edition or Express compiler. The compiler and other tools are expected to reside in the location defined by the variable VS100COMNTOOLS which is set by the Microsoft Visual Studio installer.

+

Only the C++ part of VS2010 is needed. Try to let the installation go to the default install directory. Always reboot your system after installing VS2010. The system environment variable VS100COMNTOOLS should be set in your environment.

+

Make sure that TMP and TEMP are also set in the environment and refer to Windows paths that exist, like C:\temp, not /tmp, not /cygdrive/c/temp, and not C:/temp. C:\temp is just an example, it is assumed that this area is private to the user, so by default after installs you should see a unique user path in these variables.

+

Mac OS X

+

Make sure you get the right XCode version.

+
+

Configure

+

The basic invocation of the configure script looks like:

+
+

bash ./configure [options]

+
+

This will create an output directory containing the “configuration” and setup an area for the build result. This directory typically looks like:

+
+

build/linux-x64-normal-server-release

+
+

configure will try to figure out what system you are running on and where all necessary build components are. If you have all prerequisites for building installed, it should find everything. If it fails to detect any component automatically, it will exit and inform you about the problem. When this happens, read more below in the configure options.

+

Some examples:

+
+

Windows 32bit build with freetype specified:
+bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32

+
+
+

Debug 64bit Build:
+bash ./configure --enable-debug --with-target-bits=64

+
+

Configure Options

+

Complete details on all the OpenJDK configure options can be seen with:

+
+

bash ./configure --help=short

+
+

Use -help to see all the configure options available. You can generate any number of different configurations, e.g. debug, release, 32, 64, etc.

+

Some of the more commonly used configure options are:

+
+

--enable-debug
+set the debug level to fastdebug (this is a shorthand for --with-debug-level=fastdebug)

+
+

+
+

--with-alsa=_path_
+select the location of the Advanced Linux Sound Architecture (ALSA)

+
+
+

Version 0.9.1 or newer of the ALSA files are required for building the OpenJDK on Linux. These Linux files are usually available from an “alsa” of “libasound” development package, and it’s highly recommended that you try and use the package provided by the particular version of Linux that you are using.

+
+
+

--with-boot-jdk=_path_
+select the Bootstrap JDK

+
+
+

--with-boot-jdk-jvmargs=args
+provide the JVM options to be used to run the Bootstrap JDK

+
+
+

--with-cacerts=_path_
+select the path to the cacerts file.

+
+
+

See Certificate Authority on Wikipedia for a better understanding of the Certificate Authority (CA). A certificates file named “cacerts” represents a system-wide keystore with CA certificates. In JDK and JRE binary bundles, the “cacerts” file contains root CA certificates from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source contain a cacerts file without CA root certificates. Formal JDK builders will need to secure permission from each public CA and include the certificates into their own custom cacerts file. Failure to provide a populated cacerts file will result in verification errors of a certificate chain during runtime. By default an empty cacerts file is provided and that should be fine for most JDK developers.

+
+

+
+

--with-cups=_path_
+select the CUPS install location

+
+
+

The Common UNIX Printing System (CUPS) Headers are required for building the OpenJDK on Solaris and Linux. The Solaris header files can be obtained by installing the package SFWcups from the Solaris Software Companion CD/DVD, these often will be installed into the directory /opt/sfw/cups.

+
+
+

The CUPS header files can always be downloaded from www.cups.org.

+
+
+

--with-cups-include=_path_
+select the CUPS include directory location

+
+
+

--with-debug-level=_level_
+select the debug information level of release, fastdebug, or slowdebug

+
+
+

--with-dev-kit=_path_
+select location of the compiler install or developer install location

+
+

+
+

--with-freetype=_path_
+select the freetype files to use.

+
+
+

Expecting the freetype libraries under lib/ and the headers under include/.

+
+
+

Version 2.3 or newer of FreeType is required. On Unix systems required files can be available as part of your distribution (while you still may need to upgrade them). Note that you need development version of package that includes both the FreeType library and header files.

+
+
+

You can always download latest FreeType version from the FreeType website. Building the freetype 2 libraries from scratch is also possible, however on Windows refer to the Windows FreeType DLL build instructions.

+
+
+

Note that by default FreeType is built with byte code hinting support disabled due to licensing restrictions. In this case, text appearance and metrics are expected to differ from Sun’s official JDK build. See the SourceForge FreeType2 Home Page for more information.

+
+
+

--with-import-hotspot=_path_
+select the location to find hotspot binaries from a previous build to avoid building hotspot

+
+
+

--with-target-bits=_arg_
+select 32 or 64 bit build

+
+
+

--with-jvm-variants=_variants_
+select the JVM variants to build from, comma separated list that can include: server, client, kernel, zero and zeroshark

+
+
+

--with-memory-size=_size_
+select the RAM size that GNU make will think this system has

+
+
+

--with-msvcr-dll=_path_
+select the msvcr100.dll file to include in the Windows builds (C/C++ runtime library for Visual Studio).

+
+
+

This is usually picked up automatically from the redist directories of Visual Studio 2010.

+
+
+

--with-num-cores=_cores_
+select the number of cores to use (processor count or CPU count)

+
+

+
+

--with-x=_path_
+select the location of the X11 and xrender files.

+
+
+

The XRender Extension Headers are required for building the OpenJDK on Solaris and Linux. The Linux header files are usually available from a “Xrender” development package, it’s recommended that you try and use the package provided by the particular distribution of Linux that you are using. The Solaris XRender header files is included with the other X11 header files in the package SFWxwinc on new enough versions of Solaris and will be installed in /usr/X11/include/X11/extensions/Xrender.h or /usr/openwin/share/include/X11/extensions/Xrender.h

+
+
+

Make

+

The basic invocation of the make utility looks like:

+
+

make all

+
+

This will start the build to the output directory containing the “configuration” that was created by the configure script. Run make help for more information on the available targets.

+

There are some of the make targets that are of general interest:

+
+

empty
+build everything but no images

+
+
+

all
+build everything including images

+
+
+

all-conf
+build all configurations

+
+
+

images
+create complete j2sdk and j2re images

+
+
+

install
+install the generated images locally, typically in /usr/local

+
+
+

clean
+remove all files generated by make, but not those generated by configure

+
+
+

dist-clean
+remove all files generated by both and configure (basically killing the configuration)

+
+
+

help
+give some help on using make, including some interesting make targets

+
+
+

Testing

+

When the build is completed, you should see the generated binaries and associated files in the j2sdk-image directory in the output directory. In particular, the build/*/images/j2sdk-image/bin directory should contain executables for the OpenJDK tools and utilities for that configuration. The testing tool jtreg will be needed and can be found at: the jtreg site. The provided regression tests in the repositories can be run with the command:

+
+

cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all

+
+
+

Appendix A: Hints and Tips

+

FAQ

+

Q: The generated-configure.sh file looks horrible! How are you going to edit it?
+A: The generated-configure.sh file is generated (think “compiled”) by the autoconf tools. The source code is in configure.ac and various .m4 files in common/autoconf, which are much more readable.

+

Q: Why is the generated-configure.sh file checked in, if it is generated?
+A: If it was not generated, every user would need to have the autoconf tools installed, and re-generate the configure file as the first step. Our goal is to minimize the work needed to be done by the user to start building OpenJDK, and to minimize the number of external dependencies required.

+

Q: Do you require a specific version of autoconf for regenerating generated-configure.sh?
+A: Yes, version 2.69 is required and should be easy enough to aquire on all supported operating systems. The reason for this is to avoid large spurious changes in generated-configure.sh.

+

Q: How do you regenerate generated-configure.sh after making changes to the input files?
+A: Regnerating generated-configure.sh should always be done using the script common/autoconf/autogen.sh to ensure that the correct files get updated. This script should also be run after mercurial tries to merge generated-configure.sh as a merge of the generated file is not guaranteed to be correct.

+

Q: What are the files in common/makefiles/support/* for? They look like gibberish.
+A: They are a somewhat ugly hack to compensate for command line length limitations on certain platforms (Windows, Solaris). Due to a combination of limitations in make and the shell, command lines containing too many files will not work properly. These helper files are part of an elaborate hack that will compress the command line in the makefile and then uncompress it safely. We’re not proud of it, but it does fix the problem. If you have any better suggestions, we’re all ears! :-)

+

Q: I want to see the output of the commands that make runs, like in the old build. How do I do that?
+A: You specify the LOG variable to make. There are several log levels:

+ +

Q: When do I have to re-run configure?
+A: Normally you will run configure only once for creating a configuration. You need to re-run configuration only if you want to change any configuration options, or if you pull down changes to the configure script.

+

Q: I have added a new source file. Do I need to modify the makefiles?
+A: Normally, no. If you want to create e.g. a new native library, you will need to modify the makefiles. But for normal file additions or removals, no changes are needed. There are certan exceptions for some native libraries where the source files are spread over many directories which also contain sources for other libraries. In these cases it was simply easier to create include lists rather than excludes.

+

Q: When I run configure --help, I see many strange options, like --dvidir. What is this?
+A: Configure provides a slew of options by default, to all projects that use autoconf. Most of them are not used in OpenJDK, so you can safely ignore them. To list only OpenJDK specific features, use configure --help=short instead.

+

Q: configure provides OpenJDK-specific features such as --with-builddeps-server that are not described in this document. What about those?
+A: Try them out if you like! But be aware that most of these are experimental features. Many of them don’t do anything at all at the moment; the option is just a placeholder. Others depend on pieces of code or infrastructure that is currently not ready for prime time.

+

Q: How will you make sure you don’t break anything?
+A: We have a script that compares the result of the new build system with the result of the old. For most part, we aim for (and achieve) byte-by-byte identical output. There are however technical issues with e.g. native binaries, which might differ in a byte-by-byte comparison, even when building twice with the old build system. For these, we compare relevant aspects (e.g. the symbol table and file size). Note that we still don’t have 100% equivalence, but we’re close.

+

Q: I noticed this thing X in the build that looks very broken by design. Why don’t you fix it?
+A: Our goal is to produce a build output that is as close as technically possible to the old build output. If things were weird in the old build, they will be weird in the new build. Often, things were weird before due to obscurity, but in the new build system the weird stuff comes up to the surface. The plan is to attack these things at a later stage, after the new build system is established.

+

Q: The code in the new build system is not that well-structured. Will you fix this?
+A: Yes! The new build system has grown bit by bit as we converted the old system. When all of the old build system is converted, we can take a step back and clean up the structure of the new build system. Some of this we plan to do before replacing the old build system and some will need to wait until after.

+

Q: Is anything able to use the results of the new build’s default make target?
+A: Yes, this is the minimal (or roughly minimal) set of compiled output needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you should only spend time recompiling what’s changed (making it purely incremental) and only do the work that’s needed to actually run and test your code. The packaging stuff that is part of the images target is not needed for a normal developer who wants to test his new code. Even if it’s quite fast, it’s still unnecessary. We’re targeting sub-second incremental rebuilds! ;-) (Or, well, at least single-digit seconds…)

+

Q: I usually set a specific environment variable when building, but I can’t find the equivalent in the new build. What should I do?
+A: It might very well be that we have neglected to add support for an option that was actually used from outside the build system. Email us and we will add support for it!

+

Build Performance Tips

+

Building OpenJDK requires a lot of horsepower. Some of the build tools can be adjusted to utilize more or less of resources such as parallel threads and memory. The configure script analyzes your system and selects reasonable values for such options based on your hardware. If you encounter resource problems, such as out of memory conditions, you can modify the detected values with:

+ +

It might also be necessary to specify the JVM arguments passed to the Bootstrap JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". Doing this will override the default JVM arguments passed to the Bootstrap JDK.

+

One of the top goals of the new build system is to improve the build performance and decrease the time needed to build. This will soon also apply to the java compilation when the Smart Javac wrapper is making its way into jdk8. It can be tried in the build-infra repository already. You are likely to find that the new build system is faster than the old one even without this feature.

+

At the end of a successful execution of configure, you will get a performance summary, indicating how well the build will perform. Here you will also get performance hints. If you want to build fast, pay attention to those!

+

Building with ccache

+

A simple way to radically speed up compilation of native code (typically hotspot and native libraries in JDK) is to install ccache. This will cache and reuse prior compilation results, if the source code is unchanged. However, ccache versions prior to 3.1.4 does not work correctly with the precompiled headers used in OpenJDK. So if your platform supports ccache at 3.1.4 or later, we highly recommend installing it. This is currently only supported on linux.

+

Building on local disk

+

If you are using network shares, e.g. via NFS, for your source code, make sure the build directory is situated on local disk. The performance penalty is extremely high for building on a network share, close to unusable.

+

Building only one JVM

+

The old build builds multiple JVMs on 32-bit systems (client and server; and on Windows kernel as well). In the new build we have changed this default to only build server when it’s available. This improves build times for those not interested in multiple JVMs. To mimic the old behavior on platforms that support it, use --with-jvm-variants=client,server.

+

Selecting the number of cores to build on

+

By default, configure will analyze your machine and run the make process in parallel with as many threads as you have cores. This behavior can be overridden, either “permanently” (on a configure basis) using --with-num-cores=N or for a single build only (on a make basis), using make JOBS=N.

+

If you want to make a slower build just this time, to save some CPU power for other processes, you can run e.g. make JOBS=2. This will force the makefiles to only run 2 parallel processes, or even make JOBS=1 which will disable parallelism.

+

If you want to have it the other way round, namely having slow builds default and override with fast if you’re impatient, you should call configure with --with-num-cores=2, making 2 the default. If you want to run with more cores, run make JOBS=8

+

Troubleshooting

+

Solving build problems

+

If the build fails (and it’s not due to a compilation error in a source file you’ve changed), the first thing you should do is to re-run the build with more verbosity. Do this by adding LOG=debug to your make command line.

+

The build log (with both stdout and stderr intermingled, basically the same as you see on your console) can be found as build.log in your build directory.

+

You can ask for help on build problems with the new build system on either the build-dev or the build-infra-dev mailing lists. Please include the relevant parts of the build log.

+

A build can fail for any number of reasons. Most failures are a result of trying to build in an environment in which all the pre-build requirements have not been met. The first step in troubleshooting a build failure is to recheck that you have satisfied all the pre-build requirements for your platform. Scanning the configure log is a good first step, making sure that what it found makes sense for your system. Look for strange error messages or any difficulties that configure had in finding things.

+

Some of the more common problems with builds are briefly described below, with suggestions for remedies.

+ +
+

Appendix B: GNU make

+

The Makefiles in the OpenJDK are only valid when used with the GNU version of the utility command make (usually called gmake on Solaris). A few notes about using GNU make:

+ +

Information on GNU make, and access to ftp download sites, are available on the GNU make web site. The latest source to GNU make is available at ftp.gnu.org/pub/gnu/make/.

+

Building GNU make

+

First step is to get the GNU make 3.81 or newer source from ftp.gnu.org/pub/gnu/make/. Building is a little different depending on the OS but is basically done with:

+
  bash ./configure
+  make
+
+

Appendix C: Build Environments

+

Minimum Build Environments

+

This file often describes specific requirements for what we call the “minimum build environments” (MBE) for this specific release of the JDK. What is listed below is what the Oracle Release Engineering Team will use to build the Oracle JDK product. Building with the MBE will hopefully generate the most compatible bits that install on, and run correctly on, the most variations of the same base OS and hardware architecture. In some cases, these represent what is often called the least common denominator, but each Operating System has different aspects to it.

+

In all cases, the Bootstrap JDK version minimum is critical, we cannot guarantee builds will work with older Bootstrap JDK’s. Also in all cases, more RAM and more processors is better, the minimums listed below are simply recommendations.

+

With Solaris and Mac OS X, the version listed below is the oldest release we can guarantee builds and works, and the specific version of the compilers used could be critical.

+

With Windows the critical aspect is the Visual Studio compiler used, which due to it’s runtime, generally dictates what Windows systems can do the builds and where the resulting bits can be used.

+

NOTE: We expect a change here off these older Windows OS releases and to a ‘less older’ one, probably Windows 2008R2 X64.

+

With Linux, it was just a matter of picking a stable distribution that is a good representative for Linux in general.

+

NOTE: We expect a change here from Fedora 9 to something else, but it has not been completely determined yet, possibly Ubuntu 12.04 X64, unbiased community feedback would be welcome on what a good choice would be here.

+

It is understood that most developers will NOT be using these specific versions, and in fact creating these specific versions may be difficult due to the age of some of this software. It is expected that developers are more often using the more recent releases and distributions of these operating systems.

+

Compilation problems with newer or different C/C++ compilers is a common problem. Similarly, compilation problems related to changes to the /usr/include or system header files is also a common problem with older, newer, or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly.

+

Bootstrap JDK: JDK 7u7

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Base OS and ArchitectureOSC/C++ CompilerProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Fedora 9gcc 4.32 or more1 GB6 GB
Solaris SPARC (32-bit) and SPARCV9 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patches4 or more4 GB8 GB
Solaris X86 (32-bit) and X64 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patches4 or more4 GB8 GB
Windows X86 (32-bit)Windows XPMicrosoft Visual Studio C++ 2010 Professional Edition2 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2003 - Enterprise x64 EditionMicrosoft Visual Studio C++ 2010 Professional Edition2 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.7 “Lion”XCode 4.5.2 or newer2 or more4 GB6 GB
+
+

Specific Developer Build Environments

+

We won’t be listing all the possible environments, but we will try to provide what information we have available to us.

+

NOTE: The community can help out by updating this part of the document.

+

Fedora

+

After installing the latest Fedora you need to install several build dependencies. The simplest way to do it is to execute the following commands as user root:

+
  yum-builddep java-1.7.0-openjdk
+  yum install gcc gcc-c++
+

In addition, it’s necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
+

CentOS 5.5

+

After installing CentOS 5.5 you need to make sure you have the following Development bundles installed:

+ +

Plus the following packages:

+ +

The freetype 2.3 packages don’t seem to be available, but the freetype 2.3 sources can be downloaded, built, and installed easily enough from the freetype site. Build and install with something like:

+
  bash ./configure
+  make
+  sudo -u root make install
+

Mercurial packages could not be found easily, but a Google search should find ones, and they usually include Python if it’s needed.

+

Debian 5.0 (Lenny)

+

After installing Debian 5 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user root:

+
  aptitude build-dep openjdk-7
+  aptitude install openjdk-7-jdk libmotif-dev
+

In addition, it’s necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+

Ubuntu 12.04

+

After installing Ubuntu 12.04 you need to install several build dependencies. The simplest way to do it is to execute the following commands:

+
  sudo aptitude build-dep openjdk-7
+  sudo aptitude install openjdk-7-jdk
+

In addition, it’s necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+

OpenSUSE 11.1

+

After installing OpenSUSE 11.1 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands:

+
  sudo zypper source-install -d java-1_7_0-openjdk
+  sudo zypper install make
+

In addition, it is necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
+

Finally, you need to unset the JAVA_HOME environment variable:

+
  export -n JAVA_HOME`
+

Mandriva Linux One 2009 Spring

+

After installing Mandriva Linux One 2009 Spring you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user root:

+
  urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
+    libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
+    libxtst6-devel libxi-devel
+

In addition, it is necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
+

OpenSolaris 2009.06

+

After installing OpenSolaris 2009.06 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands:

+
  pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
+    SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
+

In addition, it is necessary to set a few environment variables for the build:

+
  export LANG=C
+  export PATH="/opt/SunStudioExpress/bin:${PATH}"
+
+

End of the OpenJDK build README document.

+

Please come again!

+ + diff --git a/README-builds.md b/doc/building.md similarity index 80% rename from README-builds.md rename to doc/building.md index 364fd661e3c..460e4d12668 100644 --- a/README-builds.md +++ b/doc/building.md @@ -1,9 +1,9 @@ +% OpenJDK Build README + ![OpenJDK](http://openjdk.java.net/images/openjdk.png) -# OpenJDK Build README -***** +-------------------------------------------------------------------------------- - ## Introduction This README file contains build instructions for the @@ -18,34 +18,34 @@ Some Headlines: * Any GNU make 3.81 or newer should work * The build should scale, i.e. more processors should cause the build to be done in less wall-clock time - * Nested or recursive make invocations have been significantly reduced, - as has the total fork/exec or spawning of sub processes during the build + * Nested or recursive make invocations have been significantly reduced, as + has the total fork/exec or spawning of sub processes during the build * Windows MKS usage is no longer supported * Windows Visual Studio `vsvars*.bat` and `vcvars*.bat` files are run automatically * Ant is no longer used when building the OpenJDK - * Use of ALT_* environment variables for configuring the build is no longer + * Use of ALT\_\* environment variables for configuring the build is no longer supported -***** +------------------------------------------------------------------------------- ## Contents * [Introduction](#introduction) * [Use of Mercurial](#hg) - * [Getting the Source](#get_source) - * [Repositories](#repositories) + * [Getting the Source](#get_source) + * [Repositories](#repositories) * [Building](#building) - * [System Setup](#setup) - * [Linux](#linux) - * [Solaris](#solaris) - * [Mac OS X](#macosx) - * [Windows](#windows) - * [Configure](#configure) - * [Make](#make) + * [System Setup](#setup) + * [Linux](#linux) + * [Solaris](#solaris) + * [Mac OS X](#macosx) + * [Windows](#windows) + * [Configure](#configure) + * [Make](#make) * [Testing](#testing) -***** +------------------------------------------------------------------------------- * [Appendix A: Hints and Tips](#hints) * [FAQ](#faq) @@ -54,23 +54,22 @@ Some Headlines: * [Appendix B: GNU Make Information](#gmake) * [Appendix C: Build Environments](#buildenvironments) -***** +------------------------------------------------------------------------------- - ## Use of Mercurial The OpenJDK sources are maintained with the revision control system [Mercurial](http://mercurial.selenic.com/wiki/Mercurial). If you are new to -Mercurial, please see the [Beginner Guides](http://mercurial.selenic.com/wiki/ -BeginnersGuides) or refer to the [Mercurial Book](http://hgbook.red-bean.com/). -The first few chapters of the book provide an excellent overview of Mercurial, -what it is and how it works. +Mercurial, please see the [Beginner +Guides](http://mercurial.selenic.com/wiki/BeginnersGuides) or refer to the +[Mercurial Book](http://hgbook.red-bean.com/). The first few chapters of the +book provide an excellent overview of Mercurial, what it is and how it works. For using Mercurial with the OpenJDK refer to the [Developer Guide: Installing -and Configuring Mercurial](http://openjdk.java.net/guide/ -repositories.html#installConfig) section for more information. +and Configuring +Mercurial](http://openjdk.java.net/guide/repositories.html#installConfig) +section for more information. - ### Getting the Source To get the entire set of OpenJDK Mercurial repositories use the script @@ -82,16 +81,15 @@ To get the entire set of OpenJDK Mercurial repositories use the script Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run `./get_source.sh` anytime to -pull over all the latest changesets in all the repositories. This set of -nested repositories has been given the term "forest" and there are various -ways to apply the same `hg` command to each of the repositories. For -example, the script `make/scripts/hgforest.sh` can be used to repeat the -same `hg` command on every repository, e.g. +pull over all the latest changesets in all the repositories. This set of nested +repositories has been given the term "forest" and there are various ways to +apply the same `hg` command to each of the repositories. For example, the +script `make/scripts/hgforest.sh` can be used to repeat the same `hg` command +on every repository, e.g. cd YourOpenJDK bash ./make/scripts/hgforest.sh status - ### Repositories The set of repositories and what they contain: @@ -134,9 +132,8 @@ There are some very basic guidelines: * Files not needed for typical building or testing of the repository should not be added to the repository. -***** +------------------------------------------------------------------------------- - ## Building The very first step in building the OpenJDK is making sure the system itself @@ -147,7 +144,7 @@ Building the OpenJDK is now done with running a `configure` script which will try and find and verify you have everything you need, followed by running `make`, e.g. -> **`bash ./configure`** +> **`bash ./configure`** \ > **`make all`** Where possible the `configure` script will attempt to located the various @@ -160,9 +157,8 @@ system due to missing software packages. **NOTE:** The `configure` script file does not have execute permissions and will need to be explicitly run with `bash`, see the source guidelines. -***** +------------------------------------------------------------------------------- - ### System Setup Before even attempting to use a system to build the OpenJDK there are some very @@ -173,15 +169,15 @@ basic system setups needed. For all systems: * Install a Bootstrap JDK. All OpenJDK builds require access to a previously - released JDK called the _bootstrap JDK_ or _boot JDK._ The general rule is + released JDK called the *bootstrap JDK* or *boot JDK.* The general rule is that the bootstrap JDK must be an instance of the previous major release of the JDK. In addition, there may be a requirement to use a release at or beyond a particular update level. - **_Building JDK 8 requires use of a version of JDK 7 this is at Update 7 + ***Building JDK 8 requires use of a version of JDK 7 this is at Update 7 or newer. JDK 8 developers should not use JDK 8 as the boot JDK, to ensure that JDK 8 dependencies are not introduced into the parts of the system - that are built with JDK 7._** + that are built with JDK 7.*** The JDK 7 binaries can be downloaded from Oracle's [JDK 7 download site](http://www.oracle.com/technetwork/java/javase/downloads/index.html). @@ -219,7 +215,6 @@ And for specific systems: install the "Command line tools" found under the preferences pane "Downloads" - #### Linux With Linux, try and favor the system packages over building your own or getting @@ -233,16 +228,14 @@ refer to the JDK installed on your Linux system. You will need to unset you are getting from the default system settings make sense for building the OpenJDK. - #### Solaris - ##### Studio Compilers -At a minimum, the [Studio 12 Update 1 Compilers](http://www.oracle.com/ -technetwork/server-storage/solarisstudio/downloads/index.htm) (containing -version 5.10 of the C and C++ compilers) is required, including specific -patches. +At a minimum, the [Studio 12 Update 1 +Compilers](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm) +(containing version 5.10 of the C and C++ compilers) is required, including +specific patches. The Solaris SPARC patch list is: @@ -273,11 +266,11 @@ The Solaris X86 patch list is: Place the `bin` directory in `PATH`. The Oracle Solaris Studio Express compilers at: [Oracle Solaris Studio Express -Download site](http://www.oracle.com/technetwork/server-storage/solarisstudio/ -downloads/index-jsp-142582.html) are also an option, although these compilers -have not been extensively used yet. +Download +site](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-142582.html) +are also an option, although these compilers have not been extensively used +yet. - #### Windows ##### Windows Unix Toolkit @@ -295,7 +288,6 @@ backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their ["8.3" version](http://en.wikipedia.org/wiki/8.3_filename). - ###### CYGWIN CYGWIN is an open source, Linux-like environment which tries to emulate a @@ -323,80 +315,24 @@ By default CYGWIN doesn't install all the tools required for building the OpenJDK. Along with the default installation, you need to install the following tools. -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using 'magic' numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system
+ Binary Name Category Package Description + ------------- -------------- ---------- ------------------------------------------------------------ + ar.exe Devel binutils The GNU assembler, linker and binary utilities + make.exe Devel make The GNU version of the 'make' utility built for CYGWIN + m4.exe Interpreters m4 GNU implementation of the traditional Unix macro processor + cpio.exe Utils cpio A program to manage archives of files + gawk.exe Utils awk Pattern-directed scanning and processing language + file.exe Utils file Determines file type using 'magic' numbers + zip.exe Archive zip Package and compress (archive) files + unzip.exe Archive unzip Extract compressed files in a ZIP archive + free.exe System procps Display amount of free and used memory in the system Note that the CYGWIN software can conflict with other non-CYGWIN software on -your Windows system. CYGWIN provides a [FAQ](http://cygwin.com/faq/ -faq.using.html) for known issues and problems, of particular interest is the -section on [BLODA (applications that interfere with -CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). +your Windows system. CYGWIN provides a +[FAQ](http://cygwin.com/faq/faq.using.html) for known issues and problems, +of particular interest is the section on [BLODA (applications that interfere +with CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). - ###### MinGW/MSYS MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific @@ -404,20 +340,20 @@ header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this -includes tools like `bash` and `make`. See [MinGW/MSYS](http://www.mingw.org/ -wiki/MSYS) for more information. +includes tools like `bash` and `make`. See +[MinGW/MSYS](http://www.mingw.org/wiki/MSYS) for more information. Like Cygwin, MinGW/MSYS can handle different types of path formats. They are -internally converted to paths with forward slashes and drive letters -`:` replaced by a virtual directory `/`. Additionally, MSYS -automatically detects binaries compiled for the MSYS environment and feeds them -with the internal, Unix-style path names. If native Windows applications are -called from within MSYS programs their path arguments are automatically -converted back to Windows style path names with drive letters and backslashes -as path separators. This may cause problems for Windows applications which use -forward slashes as parameter separator (e.g. `cl /nologo /I`) because MSYS may -wrongly [replace such parameters by drive letters](http://mingw.org/wiki/ -Posix_path_conversion). +internally converted to paths with forward slashes and drive letters `:` +replaced by a virtual directory `/`. Additionally, MSYS automatically +detects binaries compiled for the MSYS environment and feeds them with the +internal, Unix-style path names. If native Windows applications are called from +within MSYS programs their path arguments are automatically converted back to +Windows style path names with drive letters and backslashes as path separators. +This may cause problems for Windows applications which use forward slashes as +parameter separator (e.g. `cl /nologo /I`) because MSYS may wrongly [replace +such parameters by drive +letters](http://mingw.org/wiki/Posix_path_conversion). In addition to the tools which will be installed by default, you have to manually install the `msys-zip` and `msys-unzip` packages. This can be easily @@ -426,7 +362,6 @@ done with the MinGW command line installer: mingw-get.exe install msys-zip mingw-get.exe install msys-unzip - ##### Visual Studio 2010 Compilers The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio @@ -445,14 +380,12 @@ and not `C:/temp`. `C:\temp` is just an example, it is assumed that this area is private to the user, so by default after installs you should see a unique user path in these variables. - #### Mac OS X Make sure you get the right XCode version. -***** +------------------------------------------------------------------------------- - ### Configure The basic invocation of the `configure` script looks like: @@ -472,14 +405,12 @@ happens, read more below in [the `configure` options](#configureoptions). Some examples: -> **Windows 32bit build with freetype specified:** -> `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target- -bits=32` +> **Windows 32bit build with freetype specified:** \ +> `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32` -> **Debug 64bit Build:** +> **Debug 64bit Build:** \ > `bash ./configure --enable-debug --with-target-bits=64` - #### Configure Options Complete details on all the OpenJDK `configure` options can be seen with: @@ -491,12 +422,13 @@ number of different configurations, e.g. debug, release, 32, 64, etc. Some of the more commonly used `configure` options are: -> **`--enable-debug`** -> set the debug level to fastdebug (this is a shorthand for `--with-debug- - level=fastdebug`) +> **`--enable-debug`** \ +> set the debug level to fastdebug (this is a shorthand for +> `--with-debug-level=fastdebug`) -> **`--with-alsa=`**_path_ + +> **`--with-alsa=`**_path_ \ > select the location of the Advanced Linux Sound Architecture (ALSA) > Version 0.9.1 or newer of the ALSA files are required for building the @@ -505,29 +437,31 @@ Some of the more commonly used `configure` options are: and use the package provided by the particular version of Linux that you are using. -> **`--with-boot-jdk=`**_path_ +> **`--with-boot-jdk=`**_path_ \ > select the [Bootstrap JDK](#bootjdk) -> **`--with-boot-jdk-jvmargs=`**"_args_" +> **`--with-boot-jdk-jvmargs=`**"_args_" \ > provide the JVM options to be used to run the [Bootstrap JDK](#bootjdk) -> **`--with-cacerts=`**_path_ +> **`--with-cacerts=`**_path_ \ > select the path to the cacerts file. -> See [Certificate Authority on Wikipedia](http://en.wikipedia.org/wiki/ - Certificate_Authority) for a better understanding of the Certificate - Authority (CA). A certificates file named "cacerts" represents a system-wide - keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts" - file contains root CA certificates from several public CAs (e.g., VeriSign, - Thawte, and Baltimore). The source contain a cacerts file without CA root - certificates. Formal JDK builders will need to secure permission from each - public CA and include the certificates into their own custom cacerts file. - Failure to provide a populated cacerts file will result in verification - errors of a certificate chain during runtime. By default an empty cacerts - file is provided and that should be fine for most JDK developers. +> See [Certificate Authority on + Wikipedia](http://en.wikipedia.org/wiki/Certificate_Authority) for a + better understanding of the Certificate Authority (CA). A certificates file + named "cacerts" represents a system-wide keystore with CA certificates. In + JDK and JRE binary bundles, the "cacerts" file contains root CA certificates + from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source + contain a cacerts file without CA root certificates. Formal JDK builders will + need to secure permission from each public CA and include the certificates + into their own custom cacerts file. Failure to provide a populated cacerts + file will result in verification errors of a certificate chain during + runtime. By default an empty cacerts file is provided and that should be fine + for most JDK developers. -> **`--with-cups=`**_path_ + +> **`--with-cups=`**_path_ \ > select the CUPS install location > The Common UNIX Printing System (CUPS) Headers are required for building the @@ -538,17 +472,18 @@ Some of the more commonly used `configure` options are: > The CUPS header files can always be downloaded from [www.cups.org](http://www.cups.org). -> **`--with-cups-include=`**_path_ +> **`--with-cups-include=`**_path_ \ > select the CUPS include directory location -> **`--with-debug-level=`**_level_ +> **`--with-debug-level=`**_level_ \ > select the debug information level of release, fastdebug, or slowdebug -> **`--with-dev-kit=`**_path_ +> **`--with-dev-kit=`**_path_ \ > select location of the compiler install or developer install location -> **`--with-freetype=`**_path_ + +> **`--with-freetype=`**_path_ \ > select the freetype files to use. > Expecting the freetype libraries under `lib/` and the headers under @@ -570,32 +505,33 @@ Some of the more commonly used `configure` options are: [SourceForge FreeType2 Home Page](http://freetype.sourceforge.net/freetype2) for more information. -> **`--with-import-hotspot=`**_path_ +> **`--with-import-hotspot=`**_path_ \ > select the location to find hotspot binaries from a previous build to avoid building hotspot -> **`--with-target-bits=`**_arg_ +> **`--with-target-bits=`**_arg_ \ > select 32 or 64 bit build -> **`--with-jvm-variants=`**_variants_ +> **`--with-jvm-variants=`**_variants_ \ > select the JVM variants to build from, comma separated list that can include: server, client, kernel, zero and zeroshark -> **`--with-memory-size=`**_size_ +> **`--with-memory-size=`**_size_ \ > select the RAM size that GNU make will think this system has -> **`--with-msvcr-dll=`**_path_ +> **`--with-msvcr-dll=`**_path_ \ > select the `msvcr100.dll` file to include in the Windows builds (C/C++ runtime library for Visual Studio). > This is usually picked up automatically from the redist directories of Visual Studio 2010. -> **`--with-num-cores=`**_cores_ +> **`--with-num-cores=`**_cores_ \ > select the number of cores to use (processor count or CPU count) -> **`--with-x=`**_path_ + +> **`--with-x=`**_path_ \ > select the location of the X11 and xrender files. > The XRender Extension Headers are required for building the OpenJDK on @@ -607,9 +543,8 @@ Some of the more commonly used `configure` options are: installed in `/usr/X11/include/X11/extensions/Xrender.h` or `/usr/openwin/share/include/X11/extensions/Xrender.h` -***** +------------------------------------------------------------------------------- - ### Make The basic invocation of the `make` utility looks like: @@ -622,34 +557,33 @@ more information on the available targets. There are some of the make targets that are of general interest: -> _empty_ +> _empty_ \ > build everything but no images -> **`all`** +> **`all`** \ > build everything including images -> **`all-conf`** +> **`all-conf`** \ > build all configurations -> **`images`** +> **`images`** \ > create complete j2sdk and j2re images -> **`install`** +> **`install`** \ > install the generated images locally, typically in `/usr/local` -> **`clean`** +> **`clean`** \ > remove all files generated by make, but not those generated by `configure` -> **`dist-clean`** +> **`dist-clean`** \ > remove all files generated by both and `configure` (basically killing the configuration) -> **`help`** +> **`help`** \ > give some help on using `make`, including some interesting make targets -***** +------------------------------------------------------------------------------- - ## Testing When the build is completed, you should see the generated binaries and @@ -662,35 +596,33 @@ repositories can be run with the command: > **``cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all``** -***** +------------------------------------------------------------------------------- - ## Appendix A: Hints and Tips - ### FAQ **Q:** The `generated-configure.sh` file looks horrible! How are you going to -edit it? +edit it? \ **A:** The `generated-configure.sh` file is generated (think "compiled") by the autoconf tools. The source code is in `configure.ac` and various .m4 files in common/autoconf, which are much more readable. -**Q:** Why is the `generated-configure.sh` file checked in, if it is -generated? +**Q:** Why is the `generated-configure.sh` file checked in, if it is +generated? \ **A:** If it was not generated, every user would need to have the autoconf tools installed, and re-generate the `configure` file as the first step. Our goal is to minimize the work needed to be done by the user to start building OpenJDK, and to minimize the number of external dependencies required. **Q:** Do you require a specific version of autoconf for regenerating -`generated-configure.sh`? +`generated-configure.sh`? \ **A:** Yes, version 2.69 is required and should be easy enough to aquire on all supported operating systems. The reason for this is to avoid large spurious changes in `generated-configure.sh`. **Q:** How do you regenerate `generated-configure.sh` after making changes to -the input files? +the input files? \ **A:** Regnerating `generated-configure.sh` should always be done using the script `common/autoconf/autogen.sh` to ensure that the correct files get updated. This script should also be run after mercurial tries to merge @@ -698,7 +630,7 @@ updated. This script should also be run after mercurial tries to merge be correct. **Q:** What are the files in `common/makefiles/support/*` for? They look like -gibberish. +gibberish. \ **A:** They are a somewhat ugly hack to compensate for command line length limitations on certain platforms (Windows, Solaris). Due to a combination of limitations in make and the shell, command lines containing too many files will @@ -708,21 +640,21 @@ not proud of it, but it does fix the problem. If you have any better suggestions, we're all ears! :-) **Q:** I want to see the output of the commands that make runs, like in the old -build. How do I do that? +build. How do I do that? \ **A:** You specify the `LOG` variable to make. There are several log levels: * **`warn`** -- Default and very quiet. * **`info`** -- Shows more progress information than warn. * **`debug`** -- Echos all command lines and prints all macro calls for compilation definitions. - * **`trace`** -- Echos all $(shell) command lines as well. + * **`trace`** -- Echos all \$(shell) command lines as well. -**Q:** When do I have to re-run `configure`? +**Q:** When do I have to re-run `configure`? \ **A:** Normally you will run `configure` only once for creating a configuration. You need to re-run configuration only if you want to change any configuration options, or if you pull down changes to the `configure` script. -**Q:** I have added a new source file. Do I need to modify the makefiles? +**Q:** I have added a new source file. Do I need to modify the makefiles? \ **A:** Normally, no. If you want to create e.g. a new native library, you will need to modify the makefiles. But for normal file additions or removals, no changes are needed. There are certan exceptions for some native libraries where @@ -731,20 +663,21 @@ for other libraries. In these cases it was simply easier to create include lists rather than excludes. **Q:** When I run `configure --help`, I see many strange options, like -`--dvidir`. What is this? +`--dvidir`. What is this? \ **A:** Configure provides a slew of options by default, to all projects that use autoconf. Most of them are not used in OpenJDK, so you can safely ignore them. To list only OpenJDK specific features, use `configure --help=short` instead. -**Q:** `configure` provides OpenJDK-specific features such as `--with- -builddeps-server` that are not described in this document. What about those? +**Q:** `configure` provides OpenJDK-specific features such as +`--with-builddeps-server` that are not described in this document. What about +those? \ **A:** Try them out if you like! But be aware that most of these are experimental features. Many of them don't do anything at all at the moment; the option is just a placeholder. Others depend on pieces of code or infrastructure that is currently not ready for prime time. -**Q:** How will you make sure you don't break anything? +**Q:** How will you make sure you don't break anything? \ **A:** We have a script that compares the result of the new build system with the result of the old. For most part, we aim for (and achieve) byte-by-byte identical output. There are however technical issues with e.g. native binaries, @@ -754,7 +687,7 @@ table and file size). Note that we still don't have 100% equivalence, but we're close. **Q:** I noticed this thing X in the build that looks very broken by design. -Why don't you fix it? +Why don't you fix it? \ **A:** Our goal is to produce a build output that is as close as technically possible to the old build output. If things were weird in the old build, they will be weird in the new build. Often, things were weird before due to @@ -763,14 +696,14 @@ The plan is to attack these things at a later stage, after the new build system is established. **Q:** The code in the new build system is not that well-structured. Will you -fix this? +fix this? \ **A:** Yes! The new build system has grown bit by bit as we converted the old system. When all of the old build system is converted, we can take a step back and clean up the structure of the new build system. Some of this we plan to do before replacing the old build system and some will need to wait until after. **Q:** Is anything able to use the results of the new build's default make -target? +target? \ **A:** Yes, this is the minimal (or roughly minimal) set of compiled output needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you @@ -782,12 +715,11 @@ it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) (Or, well, at least single-digit seconds...) **Q:** I usually set a specific environment variable when building, but I can't -find the equivalent in the new build. What should I do? +find the equivalent in the new build. What should I do? \ **A:** It might very well be that we have neglected to add support for an option that was actually used from outside the build system. Email us and we will add support for it! - ### Build Performance Tips Building OpenJDK requires a lot of horsepower. Some of the build tools can be @@ -858,7 +790,6 @@ and override with fast if you're impatient, you should call `configure` with `--with-num-cores=2`, making 2 the default. If you want to run with more cores, run `make JOBS=8` - ### Troubleshooting #### Solving build problems @@ -886,7 +817,7 @@ difficulties that `configure` had in finding things. Some of the more common problems with builds are briefly described below, with suggestions for remedies. - * **Corrupted Bundles on Windows:** + * **Corrupted Bundles on Windows:** \ Some virus scanning software has been known to corrupt the downloading of zip bundles. It may be necessary to disable the 'on access' or 'real time' virus scanning features to prevent this corruption. This type of 'real time' @@ -894,7 +825,7 @@ suggestions for remedies. Temporarily disabling the feature, or excluding the build output directory may be necessary to get correct and faster builds. - * **Slow Builds:** + * **Slow Builds:** \ If your build machine seems to be overloaded from too many simultaneous C++ compiles, try setting the `JOBS=1` on the `make` command line. Then try increasing the count slowly to an acceptable level for your system. Also: @@ -909,10 +840,10 @@ suggestions for remedies. Faster compiles are possible using a tool called [ccache](http://ccache.samba.org/). - * **File time issues:** + * **File time issues:** \ If you see warnings that refer to file time stamps, e.g. - > _Warning message:_ ` File 'xxx' has modification time in the future.` + > _Warning message:_ ` File 'xxx' has modification time in the future.` \ > _Warning message:_ ` Clock skew detected. Your build may be incomplete.` These warnings can occur when the clock on the build machine is out of sync @@ -925,7 +856,7 @@ suggestions for remedies. "`gmake clobber`" or delete the directory containing the build output, and restart the build from the beginning. - * **Error message: `Trouble writing out table to disk`** + * **Error message: `Trouble writing out table to disk`** \ Increase the amount of swap space on your build machine. This could be caused by overloading the system and it may be necessary to use: @@ -933,7 +864,7 @@ suggestions for remedies. to reduce the load on the system. - * **Error Message: `libstdc++ not found`:** + * **Error Message: `libstdc++ not found`:** \ This is caused by a missing libstdc++.a library. This is installed as part of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit Linux versions (e.g. Fedora) only install the 64-bit version of the @@ -941,7 +872,7 @@ suggestions for remedies. the C++ runtime libraries to allow for maximum portability of the built images. - * **Linux Error Message: `cannot restore segment prot after reloc`** + * **Linux Error Message: `cannot restore segment prot after reloc`** \ This is probably an issue with SELinux (See [SELinux on Wikipedia](http://en.wikipedia.org/wiki/SELinux)). Parts of the VM is built without the `-fPIC` for performance reasons. @@ -956,31 +887,30 @@ suggestions for remedies. Alternatively, instead of completely disabling it you could disable just this one check. - 1. Select System->Administration->SELinux Management + 1. Select System->Administration->SELinux Management 2. In the SELinux Management Tool which appears, select "Boolean" from the menu on the left 3. Expand the "Memory Protection" group 4. Check the first item, labeled "Allow all unconfined executables to use libraries requiring text relocation ..." - * **Windows Error Messages:** - `*** fatal error - couldn't allocate heap, ... ` - `rm fails with "Directory not empty"` - `unzip fails with "cannot create ... Permission denied"` + * **Windows Error Messages:** \ + `*** fatal error - couldn't allocate heap, ... ` \ + `rm fails with "Directory not empty"` \ + `unzip fails with "cannot create ... Permission denied"` \ `unzip fails with "cannot create ... Error 50"` The CYGWIN software can conflict with other non-CYGWIN software. See the CYGWIN FAQ section on [BLODA (applications that interfere with CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). - * **Windows Error Message: `spawn failed`** + * **Windows Error Message: `spawn failed`** \ Try rebooting the system, or there could be some kind of issue with the disk or disk partition being used. Sometimes it comes with a "Permission Denied" message. -***** +------------------------------------------------------------------------------- - ## Appendix B: GNU make The Makefiles in the OpenJDK are only valid when used with the GNU version of @@ -998,11 +928,10 @@ about using GNU make: * **Mac OS X:** The XCode "command line tools" must be installed on your Mac. Information on GNU make, and access to ftp download sites, are available on the -[GNU make web site ](http://www.gnu.org/software/make/make.html). The latest +[GNU make web site](http://www.gnu.org/software/make/make.html). The latest source to GNU make is available at [ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/). - ### Building GNU make First step is to get the GNU make 3.81 or newer source from @@ -1012,9 +941,8 @@ little different depending on the OS but is basically done with: bash ./configure make -***** +------------------------------------------------------------------------------- - ## Appendix C: Build Environments ### Minimum Build Environments @@ -1062,79 +990,19 @@ problem. Similarly, compilation problems related to changes to the newer, or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly. -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Base OS and ArchitectureOSC/C++ CompilerBootstrap JDKProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Fedora 9gcc 4.3 JDK 7u72 or more1 GB6 GB
Solaris SPARC (32-bit) and SPARCV9 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Solaris X86 (32-bit) and X64 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Windows X86 (32-bit)Windows XPMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2003 - Enterprise x64 EditionMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.7 "Lion"XCode 4.5.2 or newerJDK 7u72 or more4 GB6 GB
- -***** - - +Bootstrap JDK: JDK 7u7 + + Base OS and Architecture OS C/C++ Compiler Processors RAM Minimum DISK Needs + --------------------------------------------- ---------------------------------------------- ------------------------------------------------------- ------------ ------------- ------------ + Linux X86 (32-bit) and X64 (64-bit) Fedora 9 gcc 4.3 2 or more 1 GB 6 GB + Solaris SPARC (32-bit) and SPARCV9 (64-bit) Solaris 10 Update 6 Studio 12 Update 1 + patches 4 or more 4 GB 8 GB + Solaris X86 (32-bit) and X64 (64-bit) Solaris 10 Update 6 Studio 12 Update 1 + patches 4 or more 4 GB 8 GB + Windows X86 (32-bit) Windows XP Microsoft Visual Studio C++ 2010 Professional Edition 2 or more 2 GB 6 GB + Windows X64 (64-bit) Windows Server 2003 - Enterprise x64 Edition Microsoft Visual Studio C++ 2010 Professional Edition 2 or more 2 GB 6 GB + Mac OS X X64 (64-bit) Mac OS X 10.7 "Lion" XCode 4.5.2 or newer 2 or more 4 GB 6 GB + +------------------------------------------------------------------------------- + ### Specific Developer Build Environments We won't be listing all the possible environments, but we will try to provide @@ -1259,7 +1127,7 @@ In addition, it is necessary to set a few environment variables for the build: export LANG=C export PATH="/opt/SunStudioExpress/bin:${PATH}" -***** +------------------------------------------------------------------------------- End of the OpenJDK build README document. diff --git a/hotspot/README b/hotspot/README deleted file mode 100644 index 19afb261fc3..00000000000 --- a/hotspot/README +++ /dev/null @@ -1,14 +0,0 @@ -README: - This file should be located at the top of the hotspot Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - - cd make && gnumake - - The files that will be imported into the jdk build will be in the "build" - directory. - diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index b73e39a8528..8b4b8834035 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -79,6 +79,7 @@ void PhiResolverState::reset(int max_vregs) { PhiResolver::PhiResolver(LIRGenerator* gen, int max_vregs) : _gen(gen) , _state(gen->resolver_state()) + , _loop(NULL) , _temp(LIR_OprFact::illegalOpr) { // reinitialize the shared state arrays diff --git a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp index d17814e2af9..397b88a08fe 100644 --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp @@ -379,8 +379,11 @@ void RangeCheckEliminator::add_access_indexed_info(InstructionList &indices, int aii->_max = idx; aii->_list = new AccessIndexedList(); } else if (idx >= aii->_min && idx <= aii->_max) { - remove_range_check(ai); - return; + // Guard against underflow/overflow (see 'range_cond' check in RangeCheckEliminator::in_block_motion) + if (aii->_max < 0 || (aii->_max + min_jint) <= aii->_min) { + remove_range_check(ai); + return; + } } aii->_min = MIN2(aii->_min, idx); aii->_max = MAX2(aii->_max, idx); @@ -423,9 +426,9 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList } } } else { - int last_integer = 0; + jint last_integer = 0; Instruction *last_instruction = index; - int base = 0; + jint base = 0; ArithmeticOp *ao = index->as_ArithmeticOp(); while (ao != NULL && (ao->x()->as_Constant() || ao->y()->as_Constant()) && (ao->op() == Bytecodes::_iadd || ao->op() == Bytecodes::_isub)) { @@ -437,12 +440,12 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList } if (c) { - int value = c->type()->as_IntConstant()->value(); + jint value = c->type()->as_IntConstant()->value(); if (value != min_jint) { if (ao->op() == Bytecodes::_isub) { value = -value; } - base += value; + base = java_add(base, value); last_integer = base; last_instruction = other; } @@ -464,12 +467,12 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList assert(info != NULL, "Info must not be null"); // if idx < 0, max > 0, max + idx may fall between 0 and - // length-1 and if min < 0, min + idx may overflow and be >= + // length-1 and if min < 0, min + idx may underflow/overflow and be >= // 0. The predicate wouldn't trigger but some accesses could // be with a negative index. This test guarantees that for the // min and max value that are kept the predicate can't let // some incorrect accesses happen. - bool range_cond = (info->_max < 0 || info->_max + min_jint <= info->_min); + bool range_cond = (info->_max < 0 || (info->_max + min_jint) <= info->_min); // Generate code only if more than 2 range checks can be eliminated because of that. // 2 because at least 2 comparisons are done @@ -809,7 +812,7 @@ void RangeCheckEliminator::process_access_indexed(BlockBegin *loop_header, Block ); remove_range_check(ai); - } else if (_optimistic && loop_header) { + } else if (false && _optimistic && loop_header) { assert(ai->array(), "Array must not be null!"); assert(ai->index(), "Index must not be null!"); diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index c653e2b5a9e..2dddd1fdedc 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -2081,11 +2081,12 @@ void ClassVerifier::verify_switch( "low must be less than or equal to high in tableswitch"); return; } - keys = high - low + 1; - if (keys < 0) { + int64_t keys64 = ((int64_t)high - low) + 1; + if (keys64 > 65535) { // Max code length verify_error(ErrorContext::bad_code(bci), "too many keys in tableswitch"); return; } + keys = (int)keys64; delta = 1; } else { keys = (int)Bytes::get_Java_u4(aligned_bcp + jintSize); diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 7c239703610..49d9b28d42e 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -371,8 +371,8 @@ class nmethod : public CodeBlob { // type info bool is_nmethod() const { return true; } - bool is_java_method() const { return !method()->is_native(); } - bool is_native_method() const { return method()->is_native(); } + bool is_java_method() const { return _method != NULL && !method()->is_native(); } + bool is_native_method() const { return _method != NULL && method()->is_native(); } bool is_osr_method() const { return _entry_bci != InvocationEntryBci; } bool is_compiled_by_c1() const; diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp index 5fce86681da..d06e5e499e5 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -114,12 +114,18 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) if (end != NULL && aligned_bcp + 3*jintSize >= end) { return -1; // don't read past end of code buffer } + // Promote calculation to signed 64 bits to do range checks, used by the verifier. jlong lo = (jint)Bytes::get_Java_u4(aligned_bcp + 1*jintSize); jlong hi = (jint)Bytes::get_Java_u4(aligned_bcp + 2*jintSize); jlong len = (aligned_bcp - bcp) + (3 + hi - lo + 1)*jintSize; - // only return len if it can be represented as a positive int; - // return -1 otherwise - return (len > 0 && len == (int)len) ? len : -1; + // Only return len if it can be represented as a positive int and lo <= hi. + // The caller checks for bytecode stream overflow. + if (lo <= hi && len == (int)len) { + assert(len > 0, "must be"); + return (int)len; + } else { + return -1; + } } case _lookupswitch: // fall through @@ -131,9 +137,13 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) } jlong npairs = (jint)Bytes::get_Java_u4(aligned_bcp + jintSize); jlong len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize; - // only return len if it can be represented as a positive int; - // return -1 otherwise - return (len > 0 && len == (int)len) ? len : -1; + // Only return len if it can be represented as a positive int and npairs >= 0. + if (npairs >= 0 && len == (int)len) { + assert(len > 0, "must be"); + return (int)len; + } else { + return -1; + } } } // Note: Length functions must return <=0 for invalid bytecodes. diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index 68f068d06e9..51579032e35 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -882,6 +882,46 @@ Node *IfNode::Ideal(PhaseGVN *phase, bool can_reshape) { // then we are guaranteed to fail, so just start interpreting there. // We 'expand' the top 3 range checks to include all post-dominating // checks. + // + // Example: + // a[i+x] // (1) 1 < x < 6 + // a[i+3] // (2) + // a[i+4] // (3) + // a[i+6] // max = max of all constants + // a[i+2] + // a[i+1] // min = min of all constants + // + // If x < 3: + // (1) a[i+x]: Leave unchanged + // (2) a[i+3]: Replace with a[i+max] = a[i+6]: i+x < i+3 <= i+6 -> (2) is covered + // (3) a[i+4]: Replace with a[i+min] = a[i+1]: i+1 < i+4 <= i+6 -> (3) and all following checks are covered + // Remove all other a[i+c] checks + // + // If x >= 3: + // (1) a[i+x]: Leave unchanged + // (2) a[i+3]: Replace with a[i+min] = a[i+1]: i+1 < i+3 <= i+x -> (2) is covered + // (3) a[i+4]: Replace with a[i+max] = a[i+6]: i+1 < i+4 <= i+6 -> (3) and all following checks are covered + // Remove all other a[i+c] checks + // + // We only need the top 2 range checks if x is the min or max of all constants. + // + // This, however, only works if the interval [i+min,i+max] is not larger than max_int (i.e. abs(max - min) < max_int): + // The theoretical max size of an array is max_int with: + // - Valid index space: [0,max_int-1] + // - Invalid index space: [max_int,-1] // max_int, min_int, min_int - 1 ..., -1 + // + // The size of the consecutive valid index space is smaller than the size of the consecutive invalid index space. + // If we choose min and max in such a way that: + // - abs(max - min) < max_int + // - i+max and i+min are inside the valid index space + // then all indices [i+min,i+max] must be in the valid index space. Otherwise, the invalid index space must be + // smaller than the valid index space which is never the case for any array size. + // + // Choosing a smaller array size only makes the valid index space smaller and the invalid index space larger and + // the argument above still holds. + // + // Note that the same optimization with the same maximal accepted interval size can also be found in C1. + const jlong maximum_number_of_min_max_interval_indices = (jlong)max_jint; // The top 3 range checks seen const int NRC =3; @@ -915,13 +955,18 @@ Node *IfNode::Ideal(PhaseGVN *phase, bool can_reshape) { found_immediate_dominator = true; break; } - // Gather expanded bounds - off_lo = MIN2(off_lo,offset2); - off_hi = MAX2(off_hi,offset2); - // Record top NRC range checks - prev_checks[nb_checks%NRC].ctl = prev_dom; - prev_checks[nb_checks%NRC].off = offset2; - nb_checks++; + + // "x - y" -> must add one to the difference for number of elements in [x,y] + const jlong diff = (jlong)MIN2(offset2, off_lo) - (jlong)MAX2(offset2, off_hi); + if (ABS(diff) < maximum_number_of_min_max_interval_indices) { + // Gather expanded bounds + off_lo = MIN2(off_lo, offset2); + off_hi = MAX2(off_hi, offset2); + // Record top NRC range checks + prev_checks[nb_checks % NRC].ctl = prev_dom; + prev_checks[nb_checks % NRC].off = offset2; + nb_checks++; + } } } prev_dom = dom; diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index 957929e5dfb..8103d5cd92c 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -260,6 +260,49 @@ void PhaseIdealLoop::set_subtree_ctrl( Node *n ) { set_early_ctrl( n ); } +void PhaseIdealLoop::insert_loop_limit_check(ProjNode* limit_check_proj, Node* cmp_limit, Node* bol) { + Node* new_predicate_proj = create_new_if_for_predicate(limit_check_proj, NULL, + Deoptimization::Reason_loop_limit_check); + Node* iff = new_predicate_proj->in(0); + assert(iff->Opcode() == Op_If, "bad graph shape"); + Node* conv = iff->in(1); + assert(conv->Opcode() == Op_Conv2B, "bad graph shape"); + Node* opaq = conv->in(1); + assert(opaq->Opcode() == Op_Opaque1, "bad graph shape"); + cmp_limit = _igvn.register_new_node_with_optimizer(cmp_limit); + bol = _igvn.register_new_node_with_optimizer(bol); + set_subtree_ctrl(bol); + _igvn.replace_input_of(iff, 1, bol); + +#ifndef PRODUCT + // report that the loop predication has been actually performed + // for this loop + if (TraceLoopLimitCheck) { + tty->print_cr("Counted Loop Limit Check generated:"); + debug_only( bol->dump(2); ) + } +#endif +} + +static int check_stride_overflow(jlong final_correction, const TypeInt* limit_t) { + if (final_correction > 0) { + if (limit_t->_lo > (max_jint - final_correction)) { + return -1; + } + if (limit_t->_hi > (max_jint - final_correction)) { + return 1; + } + } else { + if (limit_t->_hi < (min_jint - final_correction)) { + return -1; + } + if (limit_t->_lo < (min_jint - final_correction)) { + return 1; + } + } + return 0; +} + //------------------------------is_counted_loop-------------------------------- bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { PhaseGVN *gvn = &_igvn; @@ -463,51 +506,256 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { assert(x->Opcode() == Op_Loop, "regular loops only"); C->print_method(PHASE_BEFORE_CLOOPS, 3); - Node *hook = new (C) Node(6); + Node* adjusted_limit = limit; if (LoopLimitCheck) { // =================================================== - // Generate loop limit check to avoid integer overflow - // in cases like next (cyclic loops): + // We can only convert this loop to a counted loop if we can guarantee that the iv phi will never overflow at runtime. + // This is an implicit assumption taken by some loop optimizations. We therefore must ensure this property at all cost. + // At this point, we've already excluded some trivial cases where an overflow could have been proven statically. + // But even though we cannot prove that an overflow will *not* happen, we still want to speculatively convert this loop + // to a counted loop. This can be achieved by adding additional iv phi overflow checks before the loop. If they fail, + // we trap and resume execution before the loop without having executed any iteration of the loop, yet. // - // for (i=0; i <= max_jint; i++) {} - // for (i=0; i < max_jint; i+=2) {} + // These additional iv phi overflow checks can be inserted as Loop Limit Check Predicates above the Loop Limit Check + // Parse Predicate which captures a JVM state just before the entry of the loop. If there is no such Parse Predicate, + // we cannot generate a Loop Limit Check Predicate and thus cannot speculatively convert the loop to a counted loop. // + // In the following, we only focus on int loops with stride > 0 to keep things simple. The argumentation and proof + // for stride < 0 is analogously. For long loops, we would replace max_int with max_long. // - // Limit check predicate depends on the loop test: // - // for(;i != limit; i++) --> limit <= (max_jint) - // for(;i < limit; i+=stride) --> limit <= (max_jint - stride + 1) - // for(;i <= limit; i+=stride) --> limit <= (max_jint - stride ) + // The loop to be converted does not always need to have the often used shape: // + // i = init + // i = init loop: + // do { ... + // // ... equivalent i+=stride + // i+=stride <==> if (i < limit) + // } while (i < limit); goto loop + // exit: + // ... + // + // where the loop exit check uses the post-incremented iv phi and a '<'-operator. + // + // We could also have '<='-operator (or '>='-operator for negative strides) or use the pre-incremented iv phi value + // in the loop exit check: + // + // i = init + // loop: + // ... + // if (i <= limit) + // i+=stride + // goto loop + // exit: + // ... + // + // Let's define the following terms: + // - iv_pre_i: The pre-incremented iv phi before the i-th iteration. + // - iv_post_i: The post-incremented iv phi after the i-th iteration. + // + // The iv_pre_i and iv_post_i have the following relation: + // iv_pre_i + stride = iv_post_i + // + // When converting a loop to a counted loop, we want to have a canonicalized loop exit check of the form: + // iv_post_i < adjusted_limit + // + // If that is not the case, we need to canonicalize the loop exit check by using different values for adjusted_limit: + // (LE1) iv_post_i < limit: Already canonicalized. We can directly use limit as adjusted_limit. + // -> adjusted_limit = limit. + // (LE2) iv_post_i <= limit: + // iv_post_i < limit + 1 + // -> adjusted limit = limit + 1 + // (LE3) iv_pre_i < limit: + // iv_pre_i + stride < limit + stride + // iv_post_i < limit + stride + // -> adjusted_limit = limit + stride + // (LE4) iv_pre_i <= limit: + // iv_pre_i < limit + 1 + // iv_pre_i + stride < limit + stride + 1 + // iv_post_i < limit + stride + 1 + // -> adjusted_limit = limit + stride + 1 + // + // Note that: + // (AL) limit <= adjusted_limit. + // + // The following loop invariant has to hold for counted loops with n iterations (i.e. loop exit check true after n-th + // loop iteration) and a canonicalized loop exit check to guarantee that no iv_post_i over- or underflows: + // (INV) For i = 1..n, min_int <= iv_post_i <= max_int + // + // To prove (INV), we require the following two conditions/assumptions: + // (i): adjusted_limit - 1 + stride <= max_int + // (ii): init < limit + // + // If we can prove (INV), we know that there can be no over- or underflow of any iv phi value. We prove (INV) by + // induction by assuming (i) and (ii). + // + // Proof by Induction + // ------------------ + // > Base case (i = 1): We show that (INV) holds after the first iteration: + // min_int <= iv_post_1 = init + stride <= max_int + // Proof: + // First, we note that (ii) implies + // (iii) init <= limit - 1 + // max_int >= adjusted_limit - 1 + stride [using (i)] + // >= limit - 1 + stride [using (AL)] + // >= init + stride [using (iii)] + // >= min_int [using stride > 0, no underflow] + // Thus, no overflow happens after the first iteration and (INV) holds for i = 1. + // + // Note that to prove the base case we need (i) and (ii). + // + // > Induction Hypothesis (i = j, j > 1): Assume that (INV) holds after the j-th iteration: + // min_int <= iv_post_j <= max_int + // > Step case (i = j + 1): We show that (INV) also holds after the j+1-th iteration: + // min_int <= iv_post_{j+1} = iv_post_j + stride <= max_int + // Proof: + // If iv_post_j >= adjusted_limit: + // We exit the loop after the j-th iteration, and we don't execute the j+1-th iteration anymore. Thus, there is + // also no iv_{j+1}. Since (INV) holds for iv_j, there is nothing left to prove. + // If iv_post_j < adjusted_limit: + // First, we note that: + // (iv) iv_post_j <= adjusted_limit - 1 + // max_int >= adjusted_limit - 1 + stride [using (i)] + // >= iv_post_j + stride [using (iv)] + // >= min_int [using stride > 0, no underflow] + // + // Note that to prove the step case we only need (i). + // + // Thus, by assuming (i) and (ii), we proved (INV). + // + // + // It is therefore enough to add the following two Loop Limit Check Predicates to check assumptions (i) and (ii): + // + // (1) Loop Limit Check Predicate for (i): + // Using (i): adjusted_limit - 1 + stride <= max_int + // + // This condition is now restated to use limit instead of adjusted_limit: + // + // To prevent an overflow of adjusted_limit -1 + stride itself, we rewrite this check to + // max_int - stride + 1 >= adjusted_limit + // We can merge the two constants into + // canonicalized_correction = stride - 1 + // which gives us + // max_int - canonicalized_correction >= adjusted_limit + // + // To directly use limit instead of adjusted_limit in the predicate condition, we split adjusted_limit into: + // adjusted_limit = limit + limit_correction + // Since stride > 0 and limit_correction <= stride + 1, we can restate this with no over- or underflow into: + // max_int - canonicalized_correction - limit_correction >= limit + // Since canonicalized_correction and limit_correction are both constants, we can replace them with a new constant: + // final_correction = canonicalized_correction + limit_correction + // which gives us: + // + // Final predicate condition: + // max_int - final_correction >= limit + // + // (2) Loop Limit Check Predicate for (ii): + // Using (ii): init < limit + // + // This Loop Limit Check Predicate is not required if we can prove at compile time that either: + // (2.1) type(init) < type(limit) + // In this case, we know: + // all possible values of init < all possible values of limit + // and we can skip the predicate. + // + // (2.2) init < limit is already checked before (i.e. found as a dominating check) + // In this case, we do not need to re-check the condition and can skip the predicate. + // This is often found for while- and for-loops which have the following shape: + // + // if (init < limit) { // Dominating test. Do not need the Loop Limit Check Predicate below. + // i = init; + // if (init >= limit) { trap(); } // Here we would insert the Loop Limit Check Predicate + // do { + // i += stride; + // } while (i < limit); + // } + // + // (2.3) init + stride <= max_int + // In this case, there is no overflow of the iv phi after the first loop iteration. + // In the proof of the base case above we showed that init + stride <= max_int by using assumption (ii): + // init < limit + // In the proof of the step case above, we did not need (ii) anymore. Therefore, if we already know at + // compile time that init + stride <= max_int then we have trivially proven the base case and that + // there is no overflow of the iv phi after the first iteration. In this case, we don't need to check (ii) + // again and can skip the predicate. + + + // Accounting for (LE3) and (LE4) where we use pre-incremented phis in the loop exit check. + const jlong limit_correction_for_pre_iv_exit_check = (phi_incr != NULL) ? stride_con : 0; + + // Accounting for (LE2) and (LE4) where we use <= or >= in the loop exit check. + const bool includes_limit = (bt == BoolTest::le || bt == BoolTest::ge); + const jlong limit_correction_for_le_ge_exit_check = (includes_limit ? (stride_con > 0 ? 1 : -1) : 0); + + const jlong limit_correction = limit_correction_for_pre_iv_exit_check + limit_correction_for_le_ge_exit_check; + const jlong canonicalized_correction = stride_con + (stride_con > 0 ? -1 : 1); + const jlong final_correction = canonicalized_correction + limit_correction; + + int sov = check_stride_overflow(final_correction, limit_t); + + // If sov==0, limit's type always satisfies the condition, for + // example, when it is an array length. + if (sov != 0) { + if (sov < 0) { + return false; // Bailout: integer overflow is certain. + } + // (1) Loop Limit Check Predicate is required because we could not statically prove that + // limit + final_correction = adjusted_limit - 1 + stride <= max_int + ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); + if (!limit_check_proj) { + // The Loop Limit Check Parse Predicate is not generated if this method trapped here before. +#ifdef ASSERT + if (TraceLoopLimitCheck) { + tty->print("missing loop limit check:"); + loop->dump_head(); + x->dump(1); + } +#endif + return false; + } - // Check if limit is excluded to do more precise int overflow check. - bool incl_limit = (bt == BoolTest::le || bt == BoolTest::ge); - int stride_m = stride_con - (incl_limit ? 0 : (stride_con > 0 ? 1 : -1)); - - // If compare points directly to the phi we need to adjust - // the compare so that it points to the incr. Limit have - // to be adjusted to keep trip count the same and the - // adjusted limit should be checked for int overflow. - if (phi_incr != NULL) { - stride_m += stride_con; - } + IfNode* check_iff = limit_check_proj->in(0)->as_If(); - if (limit->is_Con()) { - int limit_con = limit->get_int(); - if ((stride_con > 0 && limit_con > (max_jint - stride_m)) || - (stride_con < 0 && limit_con < (min_jint - stride_m))) { - // Bailout: it could be integer overflow. + if (!is_dominator(get_ctrl(limit), check_iff->in(0))) { return false; } - } else if ((stride_con > 0 && limit_t->_hi <= (max_jint - stride_m)) || - (stride_con < 0 && limit_t->_lo >= (min_jint - stride_m))) { - // Limit's type may satisfy the condition, for example, - // when it is an array length. - } else { - // Generate loop's limit check. - // Loop limit check predicate should be near the loop. + + Node* cmp_limit; + Node* bol; + + if (stride_con > 0) { + cmp_limit = new (C) CmpINode(limit, _igvn.intcon(max_jint - final_correction)); + bol = new (C) BoolNode(cmp_limit, BoolTest::le); + } else { + cmp_limit = new (C) CmpINode(limit, _igvn.intcon(min_jint - final_correction)); + bol = new (C) BoolNode(cmp_limit, BoolTest::ge); + } + + insert_loop_limit_check(limit_check_proj, cmp_limit, bol); + } + + // (2.3) + const bool init_plus_stride_could_overflow = + (stride_con > 0 && init_t->_hi > max_jint - stride_con) || + (stride_con < 0 && init_t->_lo < min_jint - stride_con); + // (2.1) + const bool init_gte_limit = (stride_con > 0 && init_t->_hi >= limit_t->_lo) || + (stride_con < 0 && init_t->_lo <= limit_t->_hi); + + if (init_gte_limit && // (2.1) + ((bt == BoolTest::ne || init_plus_stride_could_overflow) && // (2.3) + !has_dominating_loop_limit_check(init_trip, limit, stride_con, init_control))) { // (2.2) + // (2) Iteration Loop Limit Check Predicate is required because neither (2.1), (2.2), nor (2.3) holds. + // We use the following condition: + // - stride > 0: init < limit + // - stride < 0: init > limit + // + // This predicate is always required if we have a non-equal-operator in the loop exit check (where stride = 1 is + // a requirement). We transform the loop exit check by using a less-than-operator. By doing so, we must always + // check that init < limit. Otherwise, we could have a different number of iterations at runtime. + ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); if (!limit_check_proj) { // The limit check predicate is not generated if this method trapped here before. @@ -520,41 +768,38 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { #endif return false; } - IfNode* check_iff = limit_check_proj->in(0)->as_If(); + + if (!is_dominator(get_ctrl(limit), check_iff->in(0)) || + !is_dominator(get_ctrl(init_trip), check_iff->in(0))) { + return false; + } + Node* cmp_limit; Node* bol; if (stride_con > 0) { - cmp_limit = new (C) CmpINode(limit, _igvn.intcon(max_jint - stride_m)); - bol = new (C) BoolNode(cmp_limit, BoolTest::le); + cmp_limit = new (C) CmpINode(init_trip, limit); + bol = new (C) BoolNode(cmp_limit, BoolTest::lt); } else { - cmp_limit = new (C) CmpINode(limit, _igvn.intcon(min_jint - stride_m)); - bol = new (C) BoolNode(cmp_limit, BoolTest::ge); + cmp_limit = new (C) CmpINode(init_trip, limit); + bol = new (C) BoolNode(cmp_limit, BoolTest::gt); } - cmp_limit = _igvn.register_new_node_with_optimizer(cmp_limit); - bol = _igvn.register_new_node_with_optimizer(bol); - set_subtree_ctrl(bol); - - // Replace condition in original predicate but preserve Opaque node - // so that previous predicates could be found. - assert(check_iff->in(1)->Opcode() == Op_Conv2B && - check_iff->in(1)->in(1)->Opcode() == Op_Opaque1, ""); - Node* opq = check_iff->in(1)->in(1); - _igvn.hash_delete(opq); - opq->set_req(1, bol); - // Update ctrl. - set_ctrl(opq, check_iff->in(0)); - set_ctrl(check_iff->in(1), check_iff->in(0)); -#ifndef PRODUCT - // report that the loop predication has been actually performed - // for this loop - if (TraceLoopLimitCheck) { - tty->print_cr("Counted Loop Limit Check generated:"); - debug_only( bol->dump(2); ) + insert_loop_limit_check(limit_check_proj, cmp_limit, bol); + } + + if (bt == BoolTest::ne) { + // Now we need to canonicalize the loop condition if it is 'ne'. + assert(stride_con == 1 || stride_con == -1, "simple increment only - checked before"); + if (stride_con > 0) { + // 'ne' can be replaced with 'lt' only when init < limit. This is ensured by the inserted predicate above. + bt = BoolTest::lt; + } else { + assert(stride_con < 0, "must be"); + // 'ne' can be replaced with 'gt' only when init > limit. This is ensured by the inserted predicate above. + bt = BoolTest::gt; } -#endif } if (phi_incr != NULL) { @@ -567,26 +812,15 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { // is converted to // i = init; do {} while(++i < limit+1); // - limit = gvn->transform(new (C) AddINode(limit, stride)); - } - - // Now we need to canonicalize loop condition. - if (bt == BoolTest::ne) { - assert(stride_con == 1 || stride_con == -1, "simple increment only"); - // 'ne' can be replaced with 'lt' only when init < limit. - if (stride_con > 0 && init_t->_hi < limit_t->_lo) - bt = BoolTest::lt; - // 'ne' can be replaced with 'gt' only when init > limit. - if (stride_con < 0 && init_t->_lo > limit_t->_hi) - bt = BoolTest::gt; + adjusted_limit = gvn->transform(new (C) AddINode(limit, stride)); } - if (incl_limit) { + if (includes_limit) { // The limit check guaranties that 'limit <= (max_jint - stride)' so // we can convert 'i <= limit' to 'i < limit+1' since stride != 0. // Node* one = (stride_con > 0) ? gvn->intcon( 1) : gvn->intcon(-1); - limit = gvn->transform(new (C) AddINode(limit, one)); + adjusted_limit = gvn->transform(new (C) AddINode(adjusted_limit, one)); if (bt == BoolTest::le) bt = BoolTest::lt; else if (bt == BoolTest::ge) @@ -594,10 +828,11 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { else ShouldNotReachHere(); } - set_subtree_ctrl( limit ); + set_subtree_ctrl(adjusted_limit); } else { // LoopLimitCheck + Node *hook = new (C) Node(6); // If compare points to incr, we are ok. Otherwise the compare // can directly point to the phi; in this case adjust the compare so that // it points to the incr by adjusting the limit. @@ -691,6 +926,11 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { limit = gvn->transform(new (C) AddINode(span,init_trip)); set_subtree_ctrl( limit ); + adjusted_limit = limit; + + // Free up intermediate goo + _igvn.remove_dead_node(hook); + } // LoopLimitCheck if (!UseCountedLoopSafepoints) { @@ -728,7 +968,7 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { } cmp = cmp->clone(); cmp->set_req(1,incr); - cmp->set_req(2,limit); + cmp->set_req(2, adjusted_limit); cmp = _igvn.register_new_node_with_optimizer(cmp); set_ctrl(cmp, iff->in(0)); @@ -802,9 +1042,6 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { } } - // Free up intermediate goo - _igvn.remove_dead_node(hook); - #ifdef ASSERT assert(l->is_valid_counted_loop(), "counted loop shape is messed up"); assert(l == loop->_head && l->phi() == phi && l->loopexit() == lex, "" ); @@ -821,6 +1058,37 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { return true; } +// Check if there is a dominating loop limit check of the form 'init < limit' starting at the loop entry. +// If there is one, then we do not need to create an additional Loop Limit Check Predicate. +bool PhaseIdealLoop::has_dominating_loop_limit_check(Node* init_trip, Node* limit, const int stride_con, + Node* loop_entry) { + // Eagerly call transform() on the Cmp and Bool node to common them up if possible. This is required in order to + // successfully find a dominated test with the If node below. + Node* cmp_limit; + Node* bol; + if (stride_con > 0) { + cmp_limit = _igvn.transform(new (C) CmpINode(init_trip, limit)); + bol = _igvn.transform(new (C) BoolNode(cmp_limit, BoolTest::lt)); + } else { + cmp_limit = _igvn.transform(new (C) CmpINode(init_trip, limit)); + bol = _igvn.transform(new (C) BoolNode(cmp_limit, BoolTest::gt)); + } + + // Check if there is already a dominating init < limit check. If so, we do not need a Loop Limit Check Predicate. + IfNode* iff = new (C) IfNode(loop_entry, bol, PROB_MIN, COUNT_UNKNOWN); + // Also add fake IfProj nodes in order to call transform() on the newly created IfNode. + IfFalseNode* if_false = new (C) IfFalseNode(iff); + IfTrueNode* if_true = new (C) IfTrueNode(iff); + Node* dominated_iff = _igvn.transform(iff); + // ConI node? Found dominating test (IfNode::dominated_by() returns a ConI node). + const bool found_dominating_test = dominated_iff != NULL && dominated_iff->Opcode() == Op_ConI; + + // Kill the If with its projections again in the next IGVN round by cutting it off from the graph. + _igvn.replace_input_of(iff, 0, C->top()); + _igvn.replace_input_of(iff, 1, C->top()); + return found_dominating_test; +} + //----------------------exact_limit------------------------------------------- Node* PhaseIdealLoop::exact_limit( IdealLoopTree *loop ) { assert(loop->_head->is_CountedLoop(), ""); diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index fa874a4c194..10f9694fe50 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -896,6 +896,10 @@ class PhaseIdealLoop : public PhaseTransform { // Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted ProjNode* create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, Deoptimization::DeoptReason reason); + void insert_loop_limit_check(ProjNode* limit_check_proj, Node* cmp_limit, Node* bol); + bool has_dominating_loop_limit_check(Node* init_trip, Node* limit, int stride_con, + Node* loop_entry); + void register_control(Node* n, IdealLoopTree *loop, Node* pred); // Clone loop predicates to cloned loops (peeled, unswitched) diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp index 332b1175d1e..25f9edd1b70 100644 --- a/hotspot/src/share/vm/opto/phaseX.hpp +++ b/hotspot/src/share/vm/opto/phaseX.hpp @@ -433,9 +433,6 @@ class PhaseIterGVN : public PhaseGVN { protected: - // Idealize new Node 'n' with respect to its inputs and its value - virtual Node *transform( Node *a_node ); - // Warm up hash table, type table and initial worklist void init_worklist( Node *a_root ); @@ -449,6 +446,9 @@ class PhaseIterGVN : public PhaseGVN { PhaseIterGVN( PhaseGVN *gvn ); // Used after Parser PhaseIterGVN( PhaseIterGVN *igvn, const char *dummy ); // Used after +VerifyOpto + // Idealize new Node 'n' with respect to its inputs and its value + virtual Node *transform( Node *a_node ); + virtual PhaseIterGVN *is_IterGVN() { return this; } Unique_Node_List _worklist; // Iterative worklist diff --git a/hotspot/test/TEST.ROOT b/hotspot/test/TEST.ROOT index c88dcf29558..55ec2d61184 100644 --- a/hotspot/test/TEST.ROOT +++ b/hotspot/test/TEST.ROOT @@ -37,3 +37,7 @@ requires.extraPropDefns = ../../test/jtreg-ext/requires/VMProps.java requires.properties=sun.arch.data.model \ vm.flavor \ vm.bits + +# Path to libraries in the topmost test directory. This is needed so @library +# does not need ../../ notation to reach them +external.lib.roots = ../../ diff --git a/hotspot/test/runtime/memory/ReserveMemory.java b/hotspot/test/runtime/memory/ReserveMemory.java index 9e37d52ccda..abb5a8193a7 100644 --- a/hotspot/test/runtime/memory/ReserveMemory.java +++ b/hotspot/test/runtime/memory/ReserveMemory.java @@ -21,10 +21,12 @@ * questions. */ +// Aix commits on touch, so this test won't work. /* * @test * @key regression * @bug 8012015 + * @requires !(os.family == "aix") * @summary Make sure reserved (but uncommitted) memory is not accessible * @library /testlibrary /testlibrary/whitebox * @build ReserveMemory @@ -37,14 +39,6 @@ import sun.hotspot.WhiteBox; public class ReserveMemory { - private static boolean isWindows() { - return System.getProperty("os.name").toLowerCase().startsWith("win"); - } - - private static boolean isOsx() { - return System.getProperty("os.name").toLowerCase().startsWith("mac"); - } - public static void main(String args[]) throws Exception { if (args.length > 0) { WhiteBox.getWhiteBox().readReservedMemory(); @@ -61,9 +55,9 @@ public static void main(String args[]) throws Exception { "test"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - if (isWindows()) { + if (Platform.isWindows()) { output.shouldContain("EXCEPTION_ACCESS_VIOLATION"); - } else if (isOsx()) { + } else if (Platform.isOSX()) { output.shouldContain("SIGBUS"); } else { output.shouldContain("SIGSEGV"); diff --git a/jaxp/README b/jaxp/README deleted file mode 100644 index 4d65125b34c..00000000000 --- a/jaxp/README +++ /dev/null @@ -1,19 +0,0 @@ -README: - - This file should be located at the top of the Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - This repository can be loaded as a NetBeans project, built with ant, or - built with GNU make, e.g. - ant - -OR- - cd make && gnumake - - The built files that will be imported into the jdk build will be in the - "dist" directory. - Help information is available by running "ant -projecthelp" or "make help". - diff --git a/jaxws/README b/jaxws/README deleted file mode 100644 index 4d65125b34c..00000000000 --- a/jaxws/README +++ /dev/null @@ -1,19 +0,0 @@ -README: - - This file should be located at the top of the Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - This repository can be loaded as a NetBeans project, built with ant, or - built with GNU make, e.g. - ant - -OR- - cd make && gnumake - - The built files that will be imported into the jdk build will be in the - "dist" directory. - Help information is available by running "ant -projecthelp" or "make help". - diff --git a/jdk/README b/jdk/README deleted file mode 100644 index fec16f9520d..00000000000 --- a/jdk/README +++ /dev/null @@ -1,29 +0,0 @@ -README: - This file should be located at the top of the jdk Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - -Simple Build Instructions: - - 1. Download and install a JDK 6 from - http://java.sun.com/javase/downloads/index.jsp - Set the environment variable ALT_BOOTDIR to the location of this JDK 6. - - 2. Either download and install the latest JDK7 from - http://download.java.net/openjdk/jdk7/, or build your own complete - OpenJDK7 by using the top level Makefile in the OpenJDK Mercurial forest. - Set the environment variable ALT_JDK_IMPORT_PATH to the location of - this latest JDK7 or OpenJDK7 build. - - 3. Check the sanity of doing a build with the current machine: - cd make && gnumake sanity - See README-builds.html if you run into problems. - - 4. Do a partial build of the jdk: - cd make && gnumake all - - 5. Construct the images: - cd make && gnumake images - The resulting JDK image should be found in build/*/j2sdk-image - - diff --git a/jdk/make/CompileLaunchers.gmk b/jdk/make/CompileLaunchers.gmk index 1f414e2e05d..61973b3bd61 100644 --- a/jdk/make/CompileLaunchers.gmk +++ b/jdk/make/CompileLaunchers.gmk @@ -281,10 +281,17 @@ $(eval $(call SetupLauncher,jar, \ $(eval $(call SetupLauncher,jarsigner, \ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }')) +# On s390 zero, run javac with larger stack +ifeq ($(OPENJDK_TARGET_CPU), s390x) +JAVAC_ARGS := '{ "-J-ms8m"$(COMMA) "-J-Xss3m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }' +else +JAVAC_ARGS := '{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }' +endif + $(eval $(call SetupLauncher,javac, \ -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \ - -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }')) + -DJAVA_ARGS=$(JAVAC_ARGS))) ifeq ($(ENABLE_SJAVAC), yes) $(eval $(call SetupLauncher,sjavac, \ diff --git a/jdk/make/data/cacerts/digicertcseccrootg5 b/jdk/make/data/cacerts/digicertcseccrootg5 new file mode 100644 index 00000000000..f77c81756c4 --- /dev/null +++ b/jdk/make/data/cacerts/digicertcseccrootg5 @@ -0,0 +1,21 @@ +Owner: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Serial number: 3698fe712d519f3ced0fdb7b1643011 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICFjCCAZ2gAwIBAgIQA2mP5xLVGfPO0P23sWQwETAKBggqhkjOPQQDAzBNMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMTHERp +Z2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwHhcNMjEwMTE1MDAwMDAwWhcNNDYw +MTE0MjM1OTU5WjBNMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIElu +Yy4xJTAjBgNVBAMTHERpZ2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAAR/FK2Ftpf9AiE1TWDoOJOTmz0FEG2v0/7v+rv7c5nz +7DISjcdouIveiaKIVHeNuyF+M5VWlgno1YyhBLibbhkAYuhCKKZYN4QZVSZ7Mzdn +8ppyraGurgBCPBx+uHqeIZyjQjBAMB0GA1UdDgQWBBTwjJhxOThlwjobphdmHcjt +Zd6SNjAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQD +AwNnADBkAjAjb+EAGSZQ5EYgZYs3p8/rBuHMMskqoewyDXOiHgIcNWEqTmmrOXft +l4jAfWvqid0CMEPx0VijdT6Gm7ZVEYsX9z3+CmnFf07GdRtalMvqERHGCCKI3tB6 +oqV56OMhp80Tsw== +-----END CERTIFICATE----- diff --git a/jdk/make/data/cacerts/digicertcsrsarootg5 b/jdk/make/data/cacerts/digicertcsrsarootg5 new file mode 100644 index 00000000000..06b3975c13e --- /dev/null +++ b/jdk/make/data/cacerts/digicertcsrsarootg5 @@ -0,0 +1,38 @@ +Owner: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Serial number: 6cee131be6d55c807f7c0c7fb44e620 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFZDCCA0ygAwIBAgIQBs7hMb5tVcgH98DH+0TmIDANBgkqhkiG9w0BAQwFADBM +MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJDAiBgNVBAMT +G0RpZ2lDZXJ0IENTIFJTQTQwOTYgUm9vdCBHNTAeFw0yMTAxMTUwMDAwMDBaFw00 +NjAxMTQyMzU5NTlaMEwxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwg +SW5jLjEkMCIGA1UEAxMbRGlnaUNlcnQgQ1MgUlNBNDA5NiBSb290IEc1MIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtjNzgNhiA3AULBEcOV58rnyDhh3+ +Ji9MJK2L6oNfqbw9W/wLmEwCRzDs4v7s6DRbZl6/O9cspiX/jF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89KHKqGX8RfWpbn5XnX7eUT/E+oVr/Lcyd3yd3jzJzHGcKdvP6XLG/ +vB29DCibsscXZwszD8O9Ntz7ukILq+2Ew2LWhBapsQdrqW7uxs/msEQpwvCzYYAq +i2/SFFwlh1Rk86RMwaH4p2vq/uo6/HnbDo/cxvPJ1Gze6YOhjh0i7Mk6sgB73Dun +Qhp/3IupET2Op8Agb10JXUNE5o9mzKlbB/Hvm3oOs1ThlP0OLMaT11X9cZg1uAlK +/8YpKCz2Ui3bFBiSJ+IWfozK1GG+goeR65g3P79fXXc/NKwbOEOraHKZMh46Ghml +ozhMI9ej58zVKpIXkAtaS70WvfuGauKJmezkoFUYyaMIHxPgMghy0A== +-----END CERTIFICATE----- diff --git a/jdk/make/data/cacerts/digicerttlseccrootg5 b/jdk/make/data/cacerts/digicerttlseccrootg5 new file mode 100644 index 00000000000..c47b1a61228 --- /dev/null +++ b/jdk/make/data/cacerts/digicerttlseccrootg5 @@ -0,0 +1,21 @@ +Owner: CN=DigiCert TLS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert TLS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Serial number: 9e09365acf7d9c8b93e1c0b042a2ef3 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICGTCCAZ+gAwIBAgIQCeCTZaz32ci5PhwLBCou8zAKBggqhkjOPQQDAzBOMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJjAkBgNVBAMTHURp +Z2lDZXJ0IFRMUyBFQ0MgUDM4NCBSb290IEc1MB4XDTIxMDExNTAwMDAwMFoXDTQ2 +MDExNDIzNTk1OVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJ +bmMuMSYwJAYDVQQDEx1EaWdpQ2VydCBUTFMgRUNDIFAzODQgUm9vdCBHNTB2MBAG +ByqGSM49AgEGBSuBBAAiA2IABMFEoc8Rl1Ca3iOCNQfN0MsYndLxf3c1TzvdlHJS +7cI7+Oz6e2tYIOyZrsn8aLN1udsJ7MgT9U7GCh1mMEy7H0cKPGEQQil8pQgO4CLp +0zVozptjn4S1mU1YoI71VOeVyaNCMEAwHQYDVR0OBBYEFMFRRVBZqz7nLFr6ICIS +B4CIfBFqMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49 +BAMDA2gAMGUCMQCJao1H5+z8blUD2WdsJk6Dxv3J+ysTvLd6jLRl0mlpYxNjOyZQ +LgGheQaRnUi/wr4CMEfDFXuxoJGZSZOoPHzoRgaLLPIxAJSdYsiJvRmEFOml+wG4 +DXZDjC5Ty3zfDBeWUA== +-----END CERTIFICATE----- diff --git a/jdk/make/data/cacerts/digicerttlsrsarootg5 b/jdk/make/data/cacerts/digicerttlsrsarootg5 new file mode 100644 index 00000000000..e8f3adb0d0f --- /dev/null +++ b/jdk/make/data/cacerts/digicerttlsrsarootg5 @@ -0,0 +1,38 @@ +Owner: CN=DigiCert TLS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert TLS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Serial number: 8f9b478a8fa7eda6a333789de7ccf8a +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCPm0eKj6ftpqMzeJ3nzPijANBgkqhkiG9w0BAQwFADBN +MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMT +HERpZ2lDZXJ0IFRMUyBSU0E0MDk2IFJvb3QgRzUwHhcNMjEwMTE1MDAwMDAwWh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fGBg7sg7zNOok992vIGCukihfNudd5N7H +PNtQOa27PShNlnx2xlv0wdsUpasZYgcYQF+Xkdycx6u1UQ3maVNVzDl92sURVXLF +O4uJ+DQtpBflF+aZfTCIITfNMBc9uPK8qHWgQ9w+iUuQrm0D4ByjoJYJu32jtyoQ +REtGBzRj7TG5BO6jm5qu5jF49OokYTurWGT/u4cnYiWB39yhL/btp/96j1EuMPik +AdKFOV8BmZZvWltwGUb+hmA+rYAQCd05JS9Yf7vSdPD3Rh9GOUrYU9DzLjtxpdRv +/PNn5AeP3SYZ4Y1b+qOTEZvpyDrDVWiakuFSdjjo4bq9+0/V77PnSIMx8IIh47a+ +p6tv75/fTM8BuGJqIz3nCU2AG3swpMPdB380vqQmsvZB6Akd4yCYqjdP//fx4ilw +MUc/dNAUFvohigLVigmUdy7yWSiLfFCSCmZ4OIN1xLVaqBHG5cGdZlXPU8Sv13WF +qUITVuwhd4GTWgzqltlJyqEI8pc7bZsEGCREjnwB8twl2F6GmrE52/WRMmrRpnCK +ovfepEWFJqgejF0pW8hL2JpqA15w8oVPbEtoL8pU9ozaMv7Da4M/OMZ+ +-----END CERTIFICATE----- diff --git a/jdk/make/data/cacerts/emsigneccrootcag3 b/jdk/make/data/cacerts/emsigneccrootcag3 new file mode 100644 index 00000000000..06adad468be --- /dev/null +++ b/jdk/make/data/cacerts/emsigneccrootcag3 @@ -0,0 +1,22 @@ +Owner: CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Issuer: CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Serial number: 3cf607a968700eda8b84 +Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQG +EwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNo +bm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g +RzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBrMQswCQYDVQQGEwJJ +TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s +b2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMw +djAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0 +WXTsuwYc58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xyS +fvalY8L1X44uT6EYGQIrMgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuB +zhccLikenEhjQjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggq +hkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+DCBeQyh+KTOgNG3qxrdWB +CUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7jHvrZQnD ++JbNR6iC8hZVdyR+EhCVBCyj +-----END CERTIFICATE----- diff --git a/jdk/make/data/cacerts/emsignrootcag1 b/jdk/make/data/cacerts/emsignrootcag1 new file mode 100644 index 00000000000..6e6e73cd622 --- /dev/null +++ b/jdk/make/data/cacerts/emsignrootcag1 @@ -0,0 +1,29 @@ +Owner: CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Issuer: CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Serial number: 31f5e4620c6c58edd6d8 +Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043 +Signature algorithm name: SHA256withRSA +Subject Public Key Algorithm: 2048-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYD +VQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBU +ZWNobm9sb2dpZXMgTGltaXRlZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBH +MTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgxODMwMDBaMGcxCzAJBgNVBAYTAklO +MRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVkaHJhIFRlY2hub2xv +Z2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQz +f2N4aLTNLnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO +8oG0x5ZOrRkVUkr+PHB1cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aq +d7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHWDV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhM +tTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ6DqS0hdW5TUaQBw+jSzt +Od9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrHhQIDAQAB +o0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31x +PaOfG1vR2vjTnGs2vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjM +wiI/aTvFthUvozXGaCocV685743QNcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6d +GNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q+Mri/Tm3R7nrft8EI6/6nAYH +6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeihU80Bv2noWgby +RQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx +iN66zB+Afko= +-----END CERTIFICATE----- diff --git a/jdk/make/data/cacerts/emsignrootcag2 b/jdk/make/data/cacerts/emsignrootcag2 new file mode 100644 index 00000000000..aaea7ee051a --- /dev/null +++ b/jdk/make/data/cacerts/emsignrootcag2 @@ -0,0 +1,39 @@ +Owner: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Issuer: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN +Serial number: 864dbf0fe35ed77d8ed8 +Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFlTCCA32gAwIBAgILAIZNvw/jXtd9jtgwDQYJKoZIhvcNAQEMBQAwZzELMAkG +A1UEBhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0kxJTAjBgNVBAoTHGVNdWRocmEg +VGVjaG5vbG9naWVzIExpbWl0ZWQxHDAaBgNVBAMTE2VtU2lnbiBSb290IENBIC0g +RzIwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBnMQswCQYDVQQGEwJJ +TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s +b2dpZXMgTGltaXRlZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBHMjCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCA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QzF93yHuIXACPTL +pQHhg2zMv5C7BAbuDHfbj1Cu294Z832yhSfBcziWGskOvl3es2EcHytbS9c9P+0z +Mpka7zGC1FHrvLb/FoduH86TeZt0QjZ6pcplNzoaxDnDvzTJ6CC2Eny+qH/APFCu +VUv5/wjwF+HPm8Pup2ARj9cEp92+0qcerfHacNq5hMeGZdbA/dzdUR/5z5zXdxAk +nl8mcfGb0eMNSTXQmmB/i4AecNnr72uYjzlaXUGYN7Nrb6XouG0pnh0/BBtWWp0U +ShIPpWEAqs7RJBj6+1ZUYXZ4ObrCw962DxhN2p19Hxw9LtuUUcLqqTPrFXYvwO4t +ouj7KJnAkaTUfXGdEaFVtFig1EA30WzJY2X1vAQ7hVnniCjgaXAGqjsU6sklNM9n +xDx5rFCCCEtj9Kh8UHjGK2QqgP5kwgttjOApQMaCoezMfK4KD7WpOXU= +-----END CERTIFICATE----- diff --git a/jdk/make/data/cacerts/letsencryptisrgx2 b/jdk/make/data/cacerts/letsencryptisrgx2 new file mode 100644 index 00000000000..054104adbe2 --- /dev/null +++ b/jdk/make/data/cacerts/letsencryptisrgx2 @@ -0,0 +1,21 @@ +Owner: CN=ISRG Root X2, O=Internet Security Research Group, C=US +Issuer: CN=ISRG Root X2, O=Internet Security Research Group, C=US +Serial number: 41d29dd172eaeea780c12c6ce92f8752 +Valid from: Fri Sep 04 00:00:00 GMT 2020 until: Mon Sep 17 16:00:00 GMT 2040 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICGzCCAaGgAwIBAgIQQdKd0XLq7qeAwSxs6S+HUjAKBggqhkjOPQQDAzBPMQsw +CQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2gg +R3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw00 +MDA5MTcxNjAwMDBaME8xCzAJBgNVBAYTAlVTMSkwJwYDVQQKEyBJbnRlcm5ldCBT +ZWN1cml0eSBSZXNlYXJjaCBHcm91cDEVMBMGA1UEAxMMSVNSRyBSb290IFgyMHYw +EAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0HttwW ++1qLFNvicWDEukWVEYmO6gbf9yoWHKS5xcUy4APgHoIYOIvXRdgKam7mAHf7AlF9 +ItgKbppbd9/w+kHsOdx1ymgHDB/qo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zAdBgNVHQ4EFgQUfEKWrt5LSDv6kviejM9ti6lyN5UwCgYIKoZI +zj0EAwMDaAAwZQIwe3lORlCEwkSHRhtFcP9Ymd70/aTSVaYgLXTWNLxBo1BfASdW +tL4ndQavEi51mI38AjEAi/V3bNTIZargCyzuFJ0nN6T5U6VR5CmD1/iQMVtCnwr1 +/q4AaOeMSQ+2b1tbFfLn +-----END CERTIFICATE----- diff --git a/jdk/make/data/cacerts/teliarootcav2 b/jdk/make/data/cacerts/teliarootcav2 new file mode 100644 index 00000000000..2e913fe85f7 --- /dev/null +++ b/jdk/make/data/cacerts/teliarootcav2 @@ -0,0 +1,39 @@ +Owner: CN=Telia Root CA v2, O=Telia Finland Oyj, C=FI +Issuer: CN=Telia Root CA v2, O=Telia Finland Oyj, C=FI +Serial number: 1675f27d6fe7ae3e4acbe095b059e +Valid from: Thu Nov 29 11:55:54 GMT 2018 until: Sun Nov 29 11:55:54 GMT 2043 +Signature algorithm name: SHA256withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIPAWdfJ9b+euPkrL4JWwWeMA0GCSqGSIb3DQEBCwUAMEQx +CzAJBgNVBAYTAkZJMRowGAYDVQQKDBFUZWxpYSBGaW5sYW5kIE95ajEZMBcGA1UE +AwwQVGVsaWEgUm9vdCBDQSB2MjAeFw0xODExMjkxMTU1N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rKJhGdEr7nv7ZbsnGTbMjBvZ5qsfl+yqwE2foH65IRe0qw24GtixX1LDoJt0nZi +0f6X+J8wfBj5tFJ3gh1229MdqfDBmgC9bXXYfef6xzijnHDoRnkDry5023X4blMM +A8iZGok1GTzTyVR8qPAs5m4HeW9q4ebqkYJpCh3DflminmtGFZhb069GHWLIzoBS +SRE/yQQSwxN8PzuKlts8oB4KtItUsiRnDe+Cy748fdHif64W1lZYudogsYMVoe+K +TTJvQS8TUoKU1xrBeKJR3Stwbbca+few4GeXVtt8YVMJAygCQMez2P2ccGrGKMOF +6eLtGpOg3kuYooQ+BXcBlj37tCAPnHICehIv1aO6UXivKitEZU61/Qrowc15h2Er +3oBXRb9n8ZuRXqWk7FlIEA04x7D6w0RtBPV4UBySllva9bguulvP5fBqnUsvWHMt +Ty3EHD70sz+rFQ47GUGKpMFXEmZxTPpT41frYpUJnlTd0cI8Vzy9OK2YZLe4A5pT +VmBds9hCG1xLEooc6+t9xnppxyd/pPiL8uSUZodL6ZQHCRJ5irLrdATczvREWeAW +ysUsWNc8e89ihmpQfTU2Zqf7N+cox9jQraVplI/owd8k+BsHMYeB2F326CjYSlKA +rBPuUBQemMc= +-----END CERTIFICATE----- diff --git a/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java b/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java index 9c57bb0c06d..c90f7efcbdf 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -98,6 +98,7 @@ public final class RSACipher extends CipherSpi { // cipher parameter for OAEP padding and TLS RSA premaster secret private AlgorithmParameterSpec spec = null; + private boolean forTlsPremasterSecret = false; // buffer for the data private byte[] buffer; @@ -290,6 +291,7 @@ private void init(int opmode, Key key, SecureRandom random, } spec = params; + forTlsPremasterSecret = true; this.random = random; // for TLS RSA premaster secret } int blockType = (mode <= MODE_DECRYPT) ? RSAPadding.PAD_BLOCKTYPE_2 @@ -353,21 +355,38 @@ private byte[] doFinal() throws BadPaddingException, switch (mode) { case MODE_SIGN: paddingCopy = padding.pad(buffer, 0, bufOfs); - result = RSACore.rsa(paddingCopy, privateKey, true); + if (paddingCopy != null) { + result = RSACore.rsa(paddingCopy, privateKey, true); + } else { + throw new BadPaddingException("Padding error in signing"); + } break; case MODE_VERIFY: byte[] verifyBuffer = RSACore.convert(buffer, 0, bufOfs); paddingCopy = RSACore.rsa(verifyBuffer, publicKey); result = padding.unpad(paddingCopy); + if (result == null) { + throw new BadPaddingException + ("Padding error in verification"); + } break; case MODE_ENCRYPT: paddingCopy = padding.pad(buffer, 0, bufOfs); - result = RSACore.rsa(paddingCopy, publicKey); + if (paddingCopy != null) { + result = RSACore.rsa(paddingCopy, publicKey); + } else { + throw new BadPaddingException + ("Padding error in encryption"); + } break; case MODE_DECRYPT: byte[] decryptBuffer = RSACore.convert(buffer, 0, bufOfs); paddingCopy = RSACore.rsa(decryptBuffer, privateKey, false); result = padding.unpad(paddingCopy); + if (result == null && !forTlsPremasterSecret) { + throw new BadPaddingException + ("Padding error in decryption"); + } break; default: throw new AssertionError("Internal error"); @@ -376,9 +395,9 @@ private byte[] doFinal() throws BadPaddingException, } finally { Arrays.fill(buffer, 0, bufOfs, (byte)0); bufOfs = 0; - if (paddingCopy != null // will not happen + if (paddingCopy != null && paddingCopy != buffer // already cleaned - && paddingCopy != result) { // DO NOT CLEAN, THIS IS RESULT! + && paddingCopy != result) { // DO NOT CLEAN, THIS IS RESULT Arrays.fill(paddingCopy, (byte)0); } } @@ -452,26 +471,22 @@ protected Key engineUnwrap(byte[] wrappedKey, String algorithm, boolean isTlsRsaPremasterSecret = algorithm.equals("TlsRsaPremasterSecret"); - Exception failover = null; byte[] encoded = null; update(wrappedKey, 0, wrappedKey.length); try { encoded = doFinal(); - } catch (BadPaddingException e) { - if (isTlsRsaPremasterSecret) { - failover = e; - } else { - throw new InvalidKeyException("Unwrapping failed", e); - } - } catch (IllegalBlockSizeException e) { - // should not occur, handled with length check above + } catch (BadPaddingException | IllegalBlockSizeException e) { + // BadPaddingException cannot happen for TLS RSA unwrap. + // In that case, padding error is indicated by returning null. + // IllegalBlockSizeException cannot happen in any case, + // because of the length check above. throw new InvalidKeyException("Unwrapping failed", e); } try { if (isTlsRsaPremasterSecret) { - if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) { + if (!forTlsPremasterSecret) { throw new IllegalStateException( "No TlsRsaPremasterSecretParameterSpec specified"); } @@ -480,7 +495,7 @@ protected Key engineUnwrap(byte[] wrappedKey, String algorithm, encoded = KeyUtil.checkTlsPreMasterSecretKey( ((TlsRsaPremasterSecretParameterSpec) spec).getClientVersion(), ((TlsRsaPremasterSecretParameterSpec) spec).getServerVersion(), - random, encoded, (failover != null)); + random, encoded, encoded == null); } return ConstructKeys.constructKey(encoded, algorithm, type); diff --git a/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java b/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java index a196ddcd76e..7bc1664f9c2 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -31,6 +31,7 @@ import java.io.InputStreamReader; import java.net.URL; import java.net.URLClassLoader; +import java.security.AccessController; import java.util.ArrayList; import java.util.Objects; import javax.sound.midi.InvalidMidiDataException; @@ -38,6 +39,7 @@ import javax.sound.midi.spi.SoundbankReader; import sun.reflect.misc.ReflectUtil; +import sun.security.action.GetBooleanAction; /** * JarSoundbankReader is used to read soundbank object from jar files. @@ -46,12 +48,15 @@ */ public final class JARSoundbankReader extends SoundbankReader { - /* - * Name of the system property that enables the Jar soundbank loading - * true if jar sound bank is allowed to be loaded - * default is false + /** + * Value of the system property that enables the Jar soundbank loading + * {@code true} if jar sound bank is allowed to be loaded default is + * {@code false}. */ - private final static String JAR_SOUNDBANK_ENABLED = "jdk.sound.jarsoundbank"; + @SuppressWarnings("removal") + private static final boolean JAR_SOUNDBANK_ENABLED = + AccessController.doPrivileged( + new GetBooleanAction("jdk.sound.jarsoundbank")); private static boolean isZIP(URL url) { boolean ok = false; @@ -77,7 +82,7 @@ private static boolean isZIP(URL url) { public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { Objects.requireNonNull(url); - if (!Boolean.getBoolean(JAR_SOUNDBANK_ENABLED) || !isZIP(url)) + if (!JAR_SOUNDBANK_ENABLED || !isZIP(url)) return null; ArrayList soundbanks = new ArrayList(); diff --git a/jdk/src/share/classes/java/util/jar/JarFile.java b/jdk/src/share/classes/java/util/jar/JarFile.java index a26dcc4a1c7..ac2e1c9d6a8 100644 --- a/jdk/src/share/classes/java/util/jar/JarFile.java +++ b/jdk/src/share/classes/java/util/jar/JarFile.java @@ -436,7 +436,9 @@ private byte[] getBytes(ZipEntry ze) throws IOException { throw new IOException("Unsupported size: " + uncompressedSize + " for JarEntry " + ze.getName() + ". Allowed max size: " + - SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes"); + SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes. " + + "You can use the jdk.jar.maxSignatureFileSize " + + "system property to increase the default value."); } int len = (int)uncompressedSize; byte[] b = IOUtils.readAllBytes(is); diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java b/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java index 293745479d8..0853663a1f2 100644 --- a/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java +++ b/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java @@ -48,6 +48,12 @@ * {@code /lib/security} and failing that, in an OS-specific * location.

* + * The {@code krb5.conf} file is formatted in the Windows INI file style, + * which contains a series of relations grouped into different sections. + * Each relation contains a key and a value, the value can be an arbitrary + * string or a boolean value. A boolean value can be one of "true", "false", + * "yes", or "no", case-insensitive.

+ * * @since JDK1.4 */ package javax.security.auth.kerberos; diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java index b3da7acaad2..4bb7b278f2c 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java @@ -312,7 +312,6 @@ byte[] sign(Key key, SignedInfo si, XMLSignContext context) } signature.initSign((PrivateKey)key); LOG.debug("Signature provider: {}", signature.getProvider()); - LOG.debug("Signing with key: {}", key); LOG.debug("JCA Algorithm: {}", getJCAAlgorithm()); try (SignerOutputStream outputStream = new SignerOutputStream(signature)) { diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java index 117acb840c8..3b4a52b5f3c 100644 --- a/jdk/src/share/classes/sun/security/krb5/Config.java +++ b/jdk/src/share/classes/sun/security/krb5/Config.java @@ -449,23 +449,6 @@ public int getIntValue(String... keys) { return value; } - /** - * Gets the boolean value for the specified keys. - * @param keys the keys - * @return the boolean value, false is returned if it cannot be - * found or the value is not "true" (case insensitive). - * @throw IllegalArgumentException if any of the keys is illegal - * @see #get(java.lang.String[]) - */ - public boolean getBooleanValue(String... keys) { - String val = get(keys); - if (val != null && val.equalsIgnoreCase("true")) { - return true; - } else { - return false; - } - } - /** * Parses a string to an integer. The convertible strings include the * string representations of positive integers, negative integers, and @@ -474,7 +457,7 @@ public boolean getBooleanValue(String... keys) { * * @param input the String to be converted to an Integer. * @return an numeric value represented by the string - * @exception NumberFormationException if the String does not contain a + * @exception NumberFormatException if the String does not contain a * parsable integer. */ private int parseIntValue(String input) throws NumberFormatException { @@ -1060,20 +1043,13 @@ public void resetDefaultRealm(String realm) { * use addresses if "no_addresses" or "noaddresses" is set to false */ public boolean useAddresses() { - boolean useAddr = false; - // use addresses if "no_addresses" is set to false - String value = get("libdefaults", "no_addresses"); - useAddr = (value != null && value.equalsIgnoreCase("false")); - if (useAddr == false) { - // use addresses if "noaddresses" is set to false - value = get("libdefaults", "noaddresses"); - useAddr = (value != null && value.equalsIgnoreCase("false")); - } - return useAddr; + return getBooleanObject("libdefaults", "no_addresses") == Boolean.FALSE || + getBooleanObject("libdefaults", "noaddresses") == Boolean.FALSE; } /** - * Check if need to use DNS to locate Kerberos services + * Check if need to use DNS to locate Kerberos services for name. If not + * defined, check dns_fallback, whose default value is true. */ private boolean useDNS(String name, boolean defaultValue) { Boolean value = getBooleanObject("libdefaults", name); diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java b/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java index d9fdf43d616..76a71cb603c 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KDCOptions.java @@ -301,14 +301,14 @@ private void setDefault() { if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) { set(RENEWABLE_OK, true); } else { - if (config.getBooleanValue("libdefaults", "renewable")) { + if (config.getBooleanObject("libdefaults", "renewable") == Boolean.TRUE) { set(RENEWABLE_OK, true); } } if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) { set(PROXIABLE, true); } else { - if (config.getBooleanValue("libdefaults", "proxiable")) { + if (config.getBooleanObject("libdefaults", "proxiable") == Boolean.TRUE) { set(PROXIABLE, true); } } @@ -316,7 +316,7 @@ private void setDefault() { if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) { set(FORWARDABLE, true); } else { - if (config.getBooleanValue("libdefaults", "forwardable")) { + if (config.getBooleanObject("libdefaults", "forwardable") == Boolean.TRUE) { set(FORWARDABLE, true); } } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java index abccce82415..2f314c9c09e 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java @@ -58,8 +58,8 @@ public static void initStatic() { boolean allowed = false; try { Config cfg = Config.getInstance(); - String temp = cfg.get("libdefaults", "allow_weak_crypto"); - if (temp != null && temp.equals("true")) allowed = true; + allowed = cfg.getBooleanObject("libdefaults", "allow_weak_crypto") + == Boolean.TRUE; } catch (Exception exc) { if (DEBUG) { System.out.println ("Exception in getting allow_weak_crypto, " + diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java b/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java index 2841ae82eb2..7260c0bebfc 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -728,9 +728,12 @@ private byte[] pkcs1Pad(byte[] data) { int len = (p11Key.length() + 7) >> 3; RSAPadding padding = RSAPadding.getInstance (RSAPadding.PAD_BLOCKTYPE_1, len); - byte[] padded = padding.pad(data); - return padded; - } catch (GeneralSecurityException e) { + byte[] result = padding.pad(data); + if (result == null) { + throw new ProviderException("Error padding data"); + } + return result; + } catch (InvalidKeyException | InvalidAlgorithmParameterException e) { throw new ProviderException(e); } } diff --git a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java index 00351647349..83f61823ed0 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java @@ -336,8 +336,11 @@ private void getMatchingCACerts(ForwardState currentState, } } + // Thread-local gate to prevent recursive provider lookups + private static ThreadLocal gate = new ThreadLocal<>(); + /** - * Download Certificates from the given AIA and add them to the + * Download certificates from the given AIA and add them to the * specified Collection. */ // cs.getCertificates(caSelector) returns a collection of X509Certificate's @@ -349,32 +352,47 @@ private boolean getCerts(AuthorityInfoAccessExtension aiaExt, if (Builder.USE_AIA == false) { return false; } + List adList = aiaExt.getAccessDescriptions(); if (adList == null || adList.isEmpty()) { return false; } - boolean add = false; - for (AccessDescription ad : adList) { - CertStore cs = URICertStore.getInstance(ad); - if (cs != null) { - try { - if (certs.addAll((Collection) - cs.getCertificates(caSelector))) { - add = true; - if (!searchAllCertStores) { - return true; + if (gate.get() != null) { + // Avoid recursive fetching of certificates + if (debug != null) { + debug.println("Recursive fetching of certs via the AIA " + + "extension detected"); + } + return false; + } + + gate.set(gate); + try { + boolean add = false; + for (AccessDescription ad : adList) { + CertStore cs = URICertStore.getInstance(ad); + if (cs != null) { + try { + if (certs.addAll((Collection) + cs.getCertificates(caSelector))) { + add = true; + if (!searchAllCertStores) { + return true; + } + } + } catch (CertStoreException cse) { + if (debug != null) { + debug.println("exception getting certs from CertStore:"); + cse.printStackTrace(); } - } - } catch (CertStoreException cse) { - if (debug != null) { - debug.println("exception getting certs from CertStore:"); - cse.printStackTrace(); } } } + return add; + } finally { + gate.set(null); } - return add; } /** diff --git a/jdk/src/share/classes/sun/security/rsa/RSAPadding.java b/jdk/src/share/classes/sun/security/rsa/RSAPadding.java index 908cefadec8..d0a00c5a907 100644 --- a/jdk/src/share/classes/sun/security/rsa/RSAPadding.java +++ b/jdk/src/share/classes/sun/security/rsa/RSAPadding.java @@ -30,7 +30,6 @@ import java.security.*; import java.security.spec.*; -import javax.crypto.BadPaddingException; import javax.crypto.spec.PSource; import javax.crypto.spec.OAEPParameterSpec; @@ -236,24 +235,22 @@ public int getMaxDataSize() { } /** - * Pad the data and return the padded block. + * Pad the data and return the result or null if error occurred. */ - public byte[] pad(byte[] data) throws BadPaddingException { + public byte[] pad(byte[] data) { return pad(data, 0, data.length); } /** - * Pad the data and return the padded block. + * Pad the data and return the result or null if error occurred. */ - public byte[] pad(byte[] data, int ofs, int len) - throws BadPaddingException { + public byte[] pad(byte[] data, int ofs, int len) { if (len > maxDataSize) { - throw new BadPaddingException("Data must be shorter than " - + (maxDataSize + 1) + " bytes but received " - + len + " bytes."); + return null; } switch (type) { case PAD_NONE: + // assert len == paddedSize and data.length - ofs > len? return RSACore.convert(data, ofs, len); case PAD_BLOCKTYPE_1: case PAD_BLOCKTYPE_2: @@ -266,31 +263,30 @@ public byte[] pad(byte[] data, int ofs, int len) } /** - * Unpad the padded block and return the data. + * Unpad the padded block and return the result or null if error occurred. */ - public byte[] unpad(byte[] padded) throws BadPaddingException { - if (padded.length != paddedSize) { - throw new BadPaddingException("Decryption error." + - "The padded array length (" + padded.length + - ") is not the specified padded size (" + paddedSize + ")"); - } - switch (type) { - case PAD_NONE: - return padded; - case PAD_BLOCKTYPE_1: - case PAD_BLOCKTYPE_2: - return unpadV15(padded); - case PAD_OAEP_MGF1: - return unpadOAEP(padded); - default: - throw new AssertionError(); + public byte[] unpad(byte[] padded) { + if (padded.length == paddedSize) { + switch (type) { + case PAD_NONE: + return padded; + case PAD_BLOCKTYPE_1: + case PAD_BLOCKTYPE_2: + return unpadV15(padded); + case PAD_OAEP_MGF1: + return unpadOAEP(padded); + default: + throw new AssertionError(); + } + } else { + return null; } } /** * PKCS#1 v1.5 padding (blocktype 1 and 2). */ - private byte[] padV15(byte[] data, int ofs, int len) throws BadPaddingException { + private byte[] padV15(byte[] data, int ofs, int len) { byte[] padded = new byte[paddedSize]; System.arraycopy(data, ofs, padded, paddedSize - len, len); int psSize = paddedSize - 3 - len; @@ -328,10 +324,10 @@ private byte[] padV15(byte[] data, int ofs, int len) throws BadPaddingException /** * PKCS#1 v1.5 unpadding (blocktype 1 (signature) and 2 (encryption)). - * + * Return the result or null if error occurred. * Note that we want to make it a constant-time operation */ - private byte[] unpadV15(byte[] padded) throws BadPaddingException { + private byte[] unpadV15(byte[] padded) { int k = 0; boolean bp = false; @@ -367,10 +363,8 @@ private byte[] unpadV15(byte[] padded) throws BadPaddingException { byte[] data = new byte[n]; System.arraycopy(padded, p, data, 0, n); - BadPaddingException bpe = new BadPaddingException("Decryption error"); - if (bp) { - throw bpe; + return null; } else { return data; } @@ -379,8 +373,9 @@ private byte[] unpadV15(byte[] padded) throws BadPaddingException { /** * PKCS#1 v2.0 OAEP padding (MGF1). * Paragraph references refer to PKCS#1 v2.1 (June 14, 2002) + * Return the result or null if error occurred. */ - private byte[] padOAEP(byte[] M, int ofs, int len) throws BadPaddingException { + private byte[] padOAEP(byte[] M, int ofs, int len) { if (random == null) { random = JCAUtil.getSecureRandom(); } @@ -429,8 +424,9 @@ private byte[] padOAEP(byte[] M, int ofs, int len) throws BadPaddingException { /** * PKCS#1 v2.1 OAEP unpadding (MGF1). + * Return the result or null if error occurred. */ - private byte[] unpadOAEP(byte[] padded) throws BadPaddingException { + private byte[] unpadOAEP(byte[] padded) { byte[] EM = padded; boolean bp = false; int hLen = lHash.length; @@ -486,12 +482,6 @@ private byte[] unpadOAEP(byte[] padded) throws BadPaddingException { byte [] m = new byte[EM.length - mStart]; System.arraycopy(EM, mStart, m, 0, m.length); - BadPaddingException bpe = new BadPaddingException("Decryption error"); - - if (bp) { - throw bpe; - } else { - return m; - } + return (bp? null : m); } } diff --git a/jdk/src/share/classes/sun/security/rsa/RSASignature.java b/jdk/src/share/classes/sun/security/rsa/RSASignature.java index 0e719e806e9..43e150073e7 100644 --- a/jdk/src/share/classes/sun/security/rsa/RSASignature.java +++ b/jdk/src/share/classes/sun/security/rsa/RSASignature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -189,13 +189,15 @@ protected byte[] engineSign() throws SignatureException { try { byte[] encoded = encodeSignature(digestOID, digest); byte[] padded = padding.pad(encoded); - byte[] encrypted = RSACore.rsa(padded, privateKey, true); - return encrypted; + if (padded != null) { + return RSACore.rsa(padded, privateKey, true); + } } catch (GeneralSecurityException e) { throw new SignatureException("Could not sign data", e); } catch (IOException e) { throw new SignatureException("Could not encode data", e); } + throw new SignatureException("Could not sign data"); } // verify the data and return the result. See JCA doc @@ -206,21 +208,30 @@ protected boolean engineVerify(byte[] sigBytes) throws SignatureException { } if (sigBytes.length != RSACore.getByteLength(publicKey)) { - throw new SignatureException("Signature length not correct: got " + + throw new SignatureException("Bad signature length: got " + sigBytes.length + " but was expecting " + RSACore.getByteLength(publicKey)); } - byte[] digest = getDigestValue(); + try { + // https://www.rfc-editor.org/rfc/rfc8017.html#section-8.2.2 + // Step 4 suggests comparing the encoded message byte[] decrypted = RSACore.rsa(sigBytes, publicKey); - byte[] unpadded = padding.unpad(decrypted); - byte[] decodedDigest = decodeSignature(digestOID, unpadded); - return MessageDigest.isEqual(digest, decodedDigest); + + byte[] digest = getDigestValue(); + + byte[] encoded = encodeSignature(digestOID, digest); + byte[] padded = padding.pad(encoded); + if (MessageDigest.isEqual(padded, decrypted)) { + return true; + } + + // Some vendors might omit the NULL params in digest algorithm + // identifier. Try again. + encoded = encodeSignatureWithoutNULL(digestOID, digest); + padded = padding.pad(encoded); + return MessageDigest.isEqual(padded, decrypted); } catch (javax.crypto.BadPaddingException e) { - // occurs if the app has used the wrong RSA public key - // or if sigBytes is invalid - // return false rather than propagating the exception for - // compatibility/ease of use return false; } catch (IOException e) { throw new SignatureException("Signature encoding error", e); @@ -242,27 +253,19 @@ public static byte[] encodeSignature(ObjectIdentifier oid, byte[] digest) } /** - * Decode the signature data. Verify that the object identifier matches - * and return the message digest. + * Encode the digest without the NULL params, return the to-be-signed data. + * This is only used by SunRsaSign. */ - public static byte[] decodeSignature(ObjectIdentifier oid, byte[] sig) + static byte[] encodeSignatureWithoutNULL(ObjectIdentifier oid, byte[] digest) throws IOException { - // Enforce strict DER checking for signatures - DerInputStream in = new DerInputStream(sig, 0, sig.length, false); - DerValue[] values = in.getSequence(2); - if ((values.length != 2) || (in.available() != 0)) { - throw new IOException("SEQUENCE length error"); - } - AlgorithmId algId = AlgorithmId.parse(values[0]); - if (algId.getOID().equals((Object)oid) == false) { - throw new IOException("ObjectIdentifier mismatch: " - + algId.getOID()); - } - if (algId.getEncodedParams() != null) { - throw new IOException("Unexpected AlgorithmId parameters"); - } - byte[] digest = values[1].getOctetString(); - return digest; + DerOutputStream out = new DerOutputStream(); + DerOutputStream oidout = new DerOutputStream(); + oidout.putOID(oid); + out.write(DerValue.tag_Sequence, oidout); + out.putOctetString(digest); + DerValue result = + new DerValue(DerValue.tag_Sequence, out.toByteArray()); + return result.toByteArray(); } // set parameter, not supported. See JCA doc diff --git a/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java index 1adc6b966cf..ce3c97120ce 100644 --- a/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java +++ b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java @@ -27,6 +27,7 @@ import sun.security.validator.Validator; +import java.lang.ref.SoftReference; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.security.AlgorithmParameters; @@ -55,6 +56,7 @@ import java.util.Collection; import java.util.Collections; import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; import java.util.regex.Matcher; @@ -99,6 +101,8 @@ private static class JarHolder { private final List disabledAlgorithms; private final Constraints algorithmConstraints; + private volatile SoftReference> cacheRef = + new SoftReference<>(null); public static DisabledAlgorithmConstraints certPathConstraints() { return CertPathHolder.CONSTRAINTS; @@ -158,7 +162,10 @@ public DisabledAlgorithmConstraints(String propertyName, @Override public final boolean permits(Set primitives, String algorithm, AlgorithmParameters parameters) { - if (!checkAlgorithm(disabledAlgorithms, algorithm, decomposer)) { + if (algorithm == null || algorithm.isEmpty()) { + throw new IllegalArgumentException("No algorithm name specified"); + } + if (!cachedCheckAlgorithm(algorithm)) { return false; } @@ -242,7 +249,7 @@ public final void permits(String algorithm, ConstraintsParameters cp, // Check if named curves in the key are disabled. for (Key key : cp.getKeys()) { for (String curve : getNamedCurveFromKey(key)) { - if (!checkAlgorithm(disabledAlgorithms, curve, decomposer)) { + if (!cachedCheckAlgorithm(curve)) { throw new CertPathValidatorException( "Algorithm constraints check failed on disabled " + "algorithm: " + curve, @@ -950,6 +957,25 @@ private boolean permitsImpl(Key key) { } } + private boolean cachedCheckAlgorithm(String algorithm) { + Map cache; + if ((cache = cacheRef.get()) == null) { + synchronized (this) { + if ((cache = cacheRef.get()) == null) { + cache = new ConcurrentHashMap<>(); + cacheRef = new SoftReference<>(cache); + } + } + } + Boolean result = cache.get(algorithm); + if (result != null) { + return result; + } + result = checkAlgorithm(disabledAlgorithms, algorithm, decomposer); + cache.put(algorithm, result); + return result; + } + /* * This constraint is used for the complete disabling of the algorithm. */ diff --git a/jdk/src/share/classes/sun/security/util/KeyUtil.java b/jdk/src/share/classes/sun/security/util/KeyUtil.java index 79361dc6b5b..e4099b301fc 100644 --- a/jdk/src/share/classes/sun/security/util/KeyUtil.java +++ b/jdk/src/share/classes/sun/security/util/KeyUtil.java @@ -253,13 +253,14 @@ public static final boolean isOracleJCEProvider(String providerName) { * contains the lower of that suggested by the client in the client * hello and the highest supported by the server. * @param encoded the encoded key in its "RAW" encoding format - * @param isFailover whether or not the previous decryption of the - * encrypted PreMasterSecret message run into problem + * @param failure true if encoded is incorrect according to previous checks * @return the polished PreMasterSecret key in its "RAW" encoding format */ public static byte[] checkTlsPreMasterSecretKey( int clientVersion, int serverVersion, SecureRandom random, - byte[] encoded, boolean isFailOver) { + byte[] encoded, boolean failure) { + + byte[] tmp; if (random == null) { random = JCAUtil.getSecureRandom(); @@ -267,30 +268,38 @@ public static byte[] checkTlsPreMasterSecretKey( byte[] replacer = new byte[48]; random.nextBytes(replacer); - if (!isFailOver && (encoded != null)) { - // check the length - if (encoded.length != 48) { - // private, don't need to clone the byte array. - return replacer; - } - - int encodedVersion = - ((encoded[0] & 0xFF) << 8) | (encoded[1] & 0xFF); - if (clientVersion != encodedVersion) { - if (clientVersion > 0x0301 || // 0x0301: TLSv1 - serverVersion != encodedVersion) { - encoded = replacer; - } // Otherwise, For compatibility, we maintain the behavior - // that the version in pre_master_secret can be the - // negotiated version for TLS v1.0 and SSL v3.0. - } + if (failure) { + tmp = replacer; + } else { + tmp = encoded; + } + if (tmp == null) { + encoded = replacer; + } else { + encoded = tmp; + } + // check the length + if (encoded.length != 48) { // private, don't need to clone the byte array. - return encoded; + tmp = replacer; + } else { + tmp = encoded; } - // private, don't need to clone the byte array. - return replacer; + int encodedVersion = + ((tmp[0] & 0xFF) << 8) | (tmp[1] & 0xFF); + int check1 = 0; + int check2 = 0; + int check3 = 0; + if (clientVersion != encodedVersion) check1 = 1; + if (clientVersion > 0x0301) check2 = 1; + if (serverVersion != encodedVersion) check3 = 1; + if ((check1 & (check2 | check3)) == 1) { + return replacer; + } else { + return tmp; + } } /** diff --git a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java index c335e964f63..afdfa406b92 100644 --- a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java +++ b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java @@ -855,16 +855,16 @@ private static int initializeMaxSigFileSize() { * the maximum allowed number of bytes for the signature-related files * in a JAR file. */ - Integer tmp = AccessController.doPrivileged(new GetIntegerAction( - "jdk.jar.maxSignatureFileSize", 8000000)); + int tmp = AccessController.doPrivileged(new GetIntegerAction( + "jdk.jar.maxSignatureFileSize", 16000000)); if (tmp < 0 || tmp > MAX_ARRAY_SIZE) { if (debug != null) { - debug.println("Default signature file size 8000000 bytes " + - "is used as the specified size for the " + - "jdk.jar.maxSignatureFileSize system property " + + debug.println("The default signature file size of 16000000 bytes " + + "will be used for the jdk.jar.maxSignatureFileSize " + + "system property since the specified value " + "is out of range: " + tmp); } - tmp = 8000000; + tmp = 16000000; } return tmp; } diff --git a/jdk/src/share/native/common/check_code.c b/jdk/src/share/native/common/check_code.c index 96091720772..491b95cd217 100644 --- a/jdk/src/share/native/common/check_code.c +++ b/jdk/src/share/native/common/check_code.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 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 @@ -84,6 +84,7 @@ #include #include #include +#include #include "jni.h" #include "jvm.h" @@ -1202,7 +1203,7 @@ verify_opcode_operands(context_type *context, unsigned int inumber, int offset) } } if (opcode == JVM_OPC_tableswitch) { - keys = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]) + 1; + keys = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]) + 1; delta = 1; } else { keys = _ck_ntohl(lpc[1]); /* number of pairs */ @@ -1682,11 +1683,13 @@ static int instruction_length(unsigned char *iptr, unsigned char *end) switch (instruction) { case JVM_OPC_tableswitch: { int *lpc = (int *)UCALIGN(iptr + 1); - int index; if (lpc + 2 >= (int *)end) { return -1; /* do not read pass the end */ } - index = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]); + int64_t low = _ck_ntohl(lpc[1]); + int64_t high = _ck_ntohl(lpc[2]); + int64_t index = high - low; + // The value of low must be less than or equal to high - i.e. index >= 0 if ((index < 0) || (index > 65535)) { return -1; /* illegal */ } else { diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c index 1a20b404ad0..94f0228191b 100644 --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c +++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c @@ -205,6 +205,8 @@ findWithTemplate(XVisualInfo *vinfo, visualList = XGetVisualInfo(awt_display, mask, vinfo, &visualsMatched); if (visualList) { + int id = -1; + VisualID defaultVisual = XVisualIDFromVisual(DefaultVisual(awt_display, vinfo->screen)); defaultConfig = ZALLOC(_AwtGraphicsConfigData); for (i = 0; i < visualsMatched; i++) { memcpy(&defaultConfig->awt_visInfo, &visualList[i], sizeof(XVisualInfo)); @@ -213,20 +215,31 @@ findWithTemplate(XVisualInfo *vinfo, /* we can't use awtJNI_CreateColorData here, because it'll pull, SystemColor, which in turn will cause toolkit to be reinitialized */ if (awtCreateX11Colormap(defaultConfig)) { - /* Allocate white and black pixels for this visual */ - color.flags = DoRed | DoGreen | DoBlue; - color.red = color.green = color.blue = 0x0000; - XAllocColor(awt_display, defaultConfig->awt_cmap, &color); - x11Screens[visualList[i].screen].blackpixel = color.pixel; - color.flags = DoRed | DoGreen | DoBlue; - color.red = color.green = color.blue = 0xffff; - XAllocColor(awt_display, defaultConfig->awt_cmap, &color); - x11Screens[visualList[i].screen].whitepixel = color.pixel; - - XFree(visualList); - return defaultConfig; + if (visualList[i].visualid == defaultVisual) { + id = i; + break; + } else if (-1 == id) { + // Keep 1st match for fallback + id = i; + } } } + if (-1 != id) { + memcpy(&defaultConfig->awt_visInfo, &visualList[id], sizeof(XVisualInfo)); + defaultConfig->awt_depth = visualList[id].depth; + /* Allocate white and black pixels for this visual */ + color.flags = DoRed | DoGreen | DoBlue; + color.red = color.green = color.blue = 0x0000; + XAllocColor(awt_display, defaultConfig->awt_cmap, &color); + x11Screens[visualList[id].screen].blackpixel = color.pixel; + color.flags = DoRed | DoGreen | DoBlue; + color.red = color.green = color.blue = 0xffff; + XAllocColor(awt_display, defaultConfig->awt_cmap, &color); + x11Screens[visualList[id].screen].whitepixel = color.pixel; + + XFree(visualList); + return defaultConfig; + } XFree(visualList); free((void *)defaultConfig); } diff --git a/jdk/src/solaris/native/sun/awt/awt_InputMethod.c b/jdk/src/solaris/native/sun/awt/awt_InputMethod.c index 30b197719e5..f4a828279c3 100644 --- a/jdk/src/solaris/native/sun/awt/awt_InputMethod.c +++ b/jdk/src/solaris/native/sun/awt/awt_InputMethod.c @@ -676,9 +676,10 @@ static StatusWindow *createStatusWindow( return NULL; } statusWindow->w = status; - //12-point font + //12, 13-point fonts statusWindow->fontset = XCreateFontSet(dpy, - "-*-*-medium-r-normal-*-*-120-*-*-*-*", + "-*-*-medium-r-normal-*-*-120-*-*-*-*," \ + "-*-*-medium-r-normal-*-*-130-*-*-*-*", &mclr, &mccr, &dsr); /* In case we didn't find the font set, release the list of missing characters */ if (mccr > 0) { diff --git a/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c b/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c index bd836bfcd6b..e70a8a58813 100644 --- a/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c +++ b/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c @@ -29,6 +29,7 @@ #include "jlong.h" #include +#include #include #include #include diff --git a/jdk/src/windows/classes/sun/security/mscapi/CRSACipher.java b/jdk/src/windows/classes/sun/security/mscapi/CRSACipher.java index 95f6cbf80ea..d68fd6861a4 100644 --- a/jdk/src/windows/classes/sun/security/mscapi/CRSACipher.java +++ b/jdk/src/windows/classes/sun/security/mscapi/CRSACipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -30,6 +30,7 @@ import java.security.Key; import java.security.interfaces.*; import java.security.spec.*; +import java.util.Arrays; import javax.crypto.*; import javax.crypto.spec.*; @@ -61,6 +62,9 @@ */ public final class CRSACipher extends CipherSpi { + private static final int ERROR_INVALID_PARAMETER = 0x57; + private static final int NTE_INVALID_PARAMETER = 0x80090027; + // constant for an empty byte array private final static byte[] B0 = new byte[0]; @@ -101,6 +105,8 @@ public final class CRSACipher extends CipherSpi { // cipher parameter for TLS RSA premaster secret private AlgorithmParameterSpec spec = null; + private boolean forTlsPremasterSecret = false; + // the source of randomness private SecureRandom random; @@ -171,6 +177,9 @@ protected void engineInit(int opmode, Key key, } spec = params; this.random = random; // for TLS RSA premaster secret + this.forTlsPremasterSecret = true; + } else { + this.forTlsPremasterSecret = false; } init(opmode, key); } @@ -277,8 +286,7 @@ private void update(byte[] in, int inOfs, int inLen) { } // internal doFinal() method. Here we perform the actual RSA operation - private byte[] doFinal() throws BadPaddingException, - IllegalBlockSizeException { + private byte[] doFinal() throws IllegalBlockSizeException { if (bufOfs > buffer.length) { throw new IllegalBlockSizeException("Data must not be longer " + "than " + (buffer.length - paddingLength) + " bytes"); @@ -307,7 +315,7 @@ private byte[] doFinal() throws BadPaddingException, throw new AssertionError("Internal error"); } - } catch (KeyException e) { + } catch (KeyException | BadPaddingException e) { throw new ProviderException(e); } finally { @@ -330,14 +338,14 @@ protected int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out, // see JCE spec protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen) - throws BadPaddingException, IllegalBlockSizeException { + throws IllegalBlockSizeException { update(in, inOfs, inLen); return doFinal(); } // see JCE spec protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out, - int outOfs) throws ShortBufferException, BadPaddingException, + int outOfs) throws ShortBufferException, IllegalBlockSizeException { if (outputSize > out.length - outOfs) { throw new ShortBufferException @@ -353,6 +361,7 @@ protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out, // see JCE spec protected byte[] engineWrap(Key key) throws InvalidKeyException, IllegalBlockSizeException { + byte[] encoded = key.getEncoded(); // TODO - unextractable key if ((encoded == null) || (encoded.length == 0)) { throw new InvalidKeyException("Could not obtain encoded key"); @@ -361,12 +370,7 @@ protected byte[] engineWrap(Key key) throws InvalidKeyException, throw new InvalidKeyException("Key is too long for wrapping"); } update(encoded, 0, encoded.length); - try { - return doFinal(); - } catch (BadPaddingException e) { - // should not occur - throw new InvalidKeyException("Wrapping failed", e); - } + return doFinal(); } // see JCE spec @@ -387,31 +391,31 @@ protected java.security.Key engineUnwrap(byte[] wrappedKey, update(wrappedKey, 0, wrappedKey.length); try { encoded = doFinal(); - } catch (BadPaddingException e) { - if (isTlsRsaPremasterSecret) { - failover = e; - } else { - throw new InvalidKeyException("Unwrapping failed", e); - } } catch (IllegalBlockSizeException e) { // should not occur, handled with length check above throw new InvalidKeyException("Unwrapping failed", e); } - if (isTlsRsaPremasterSecret) { - if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) { - throw new IllegalStateException( - "No TlsRsaPremasterSecretParameterSpec specified"); + try { + if (isTlsRsaPremasterSecret) { + if (!forTlsPremasterSecret) { + throw new IllegalStateException( + "No TlsRsaPremasterSecretParameterSpec specified"); + } + + // polish the TLS premaster secret + encoded = KeyUtil.checkTlsPreMasterSecretKey( + ((TlsRsaPremasterSecretParameterSpec) spec).getClientVersion(), + ((TlsRsaPremasterSecretParameterSpec) spec).getServerVersion(), + random, encoded, encoded == null); } - // polish the TLS premaster secret - encoded = KeyUtil.checkTlsPreMasterSecretKey( - ((TlsRsaPremasterSecretParameterSpec)spec).getClientVersion(), - ((TlsRsaPremasterSecretParameterSpec)spec).getServerVersion(), - random, encoded, (failover != null)); + return constructKey(encoded, algorithm, type); + } finally { + if (encoded != null) { + Arrays.fill(encoded, (byte) 0); + } } - - return constructKey(encoded, algorithm, type); } // see JCE spec @@ -495,7 +499,23 @@ private static Key constructKey(byte[] encodedKey, * Encrypt/decrypt a data buffer using Microsoft Crypto API with HCRYPTKEY. * It expects and returns ciphertext data in big-endian form. */ - private native static byte[] encryptDecrypt(byte[] data, int dataSize, - long hCryptKey, boolean doEncrypt) throws KeyException; + private byte[] encryptDecrypt(byte[] data, int dataSize, + long hCryptKey, boolean doEncrypt) throws KeyException, BadPaddingException { + int[] returnStatus = new int[1]; + byte[] result= encryptDecrypt(returnStatus, data, dataSize, hCryptKey, doEncrypt); + if ((returnStatus[0] == ERROR_INVALID_PARAMETER) || (returnStatus[0] == NTE_INVALID_PARAMETER)) { + if (forTlsPremasterSecret) { + result = null; + } else { + throw new BadPaddingException("Error " + returnStatus[0] + " returned by MSCAPI"); + } + } else if (returnStatus[0] != 0) { + throw new KeyException("Error " + returnStatus[0] + " returned by MSCAPI"); + } + + return result; + } + private static native byte[] encryptDecrypt(int[] returnStatus, byte[] data, int dataSize, + long key, boolean doEncrypt) throws KeyException; } diff --git a/jdk/src/windows/native/sun/security/mscapi/security.cpp b/jdk/src/windows/native/sun/security/mscapi/security.cpp index 8ba36f5c02f..73488cbcc3c 100644 --- a/jdk/src/windows/native/sun/security/mscapi/security.cpp +++ b/jdk/src/windows/native/sun/security/mscapi/security.cpp @@ -1832,18 +1832,25 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_destroyKeyContainer /* * Class: sun_security_mscapi_CRSACipher * Method: encryptDecrypt - * Signature: ([BIJZ)[B + * Signature: ([I[BIJZ)[B */ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_encryptDecrypt - (JNIEnv *env, jclass clazz, jbyteArray jData, jint jDataSize, jlong hKey, + (JNIEnv *env, jclass clazz, jintArray jResultStatus, jbyteArray jData, jint jDataSize, jlong hKey, jboolean doEncrypt) { jbyteArray result = NULL; jbyte* pData = NULL; + jbyte* resultData = NULL; DWORD dwDataLen = jDataSize; DWORD dwBufLen = env->GetArrayLength(jData); DWORD i; BYTE tmp; + BOOL success; + DWORD ss = ERROR_SUCCESS; + DWORD lastError = ERROR_SUCCESS; + DWORD resultLen = 0; + DWORD pmsLen = 48; + jbyte pmsArr[48] = {0}; __try { @@ -1870,6 +1877,8 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_encryptDecrypt pData[i] = pData[dwBufLen - i -1]; pData[dwBufLen - i - 1] = tmp; } + resultData = pData; + resultLen = dwBufLen; } else { // convert to little-endian for (i = 0; i < dwBufLen / 2; i++) { @@ -1879,21 +1888,28 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_encryptDecrypt } // decrypt - if (! ::CryptDecrypt((HCRYPTKEY) hKey, 0, TRUE, 0, (BYTE *)pData, //deprecated - &dwBufLen)) { - - ThrowException(env, KEY_EXCEPTION, GetLastError()); - __leave; + success = ::CryptDecrypt((HCRYPTKEY) hKey, 0, TRUE, 0, (BYTE *)pData, //deprecated + &dwBufLen); + lastError = GetLastError(); + if (success) { + ss = ERROR_SUCCESS; + resultData = pData; + resultLen = dwBufLen; + } else { + ss = lastError; + resultData = pmsArr; + resultLen = pmsLen; } + env->SetIntArrayRegion(jResultStatus, 0, 1, (jint*) &ss); } - // Create new byte array - if ((result = env->NewByteArray(dwBufLen)) == NULL) { + // Create new byte array + if ((result = env->NewByteArray(resultLen)) == NULL) { __leave; } // Copy data from native buffer to Java buffer - env->SetByteArrayRegion(result, 0, dwBufLen, (jbyte*) pData); + env->SetByteArrayRegion(result, 0, resultLen, (jbyte*) resultData); } __finally { diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 355b251e66c..b2d2ba1bcc3 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -25,3 +25,7 @@ requires.properties=sun.arch.data.model # Group definitions groups=TEST.groups [closed/TEST.groups] + +# Path to libraries in the topmost test directory. This is needed so @library +# does not need ../../ notation to reach them +external.lib.roots = ../../ diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java index 880a72e13f9..aee5cafecd5 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, 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,8 +56,7 @@ public class GetCommittedVirtualMemorySize { // Careful with these values. private static final long MIN_SIZE_FOR_PASS = 1; - // Max size for pass dynamically determined below - private static long max_size_for_pass = Long.MAX_VALUE; + private static long MAX_SIZE_FOR_PASS = Long.MAX_VALUE; private static boolean trace = false; @@ -66,16 +65,6 @@ public static void main(String args[]) throws Exception { trace = true; } - // 4934082: On Linux, VM size *can* be larger than total swap - // size. Linux might not reserve swap memory immediately when - // a page is mmaped. This means that the reported committed - // memory size can grow beyond the swap limit. - long max_size = mbean.getTotalSwapSpaceSize() + - mbean.getTotalPhysicalMemorySize(); - - if (max_size > 0) { - max_size_for_pass = max_size; - } long size = mbean.getCommittedVirtualMemorySize(); if (size == -1) { System.out.println("getCommittedVirtualMemorySize() is not supported"); @@ -87,11 +76,11 @@ public static void main(String args[]) throws Exception { size); } - if (size < MIN_SIZE_FOR_PASS || size > max_size_for_pass) { + if (size < MIN_SIZE_FOR_PASS || size > MAX_SIZE_FOR_PASS) { throw new RuntimeException("Committed virtual memory size " + "illegal value: " + size + " bytes " + "(MIN = " + MIN_SIZE_FOR_PASS + "; " + - "MAX = " + max_size_for_pass + ")"); + "MAX = " + MAX_SIZE_FOR_PASS + ")"); } System.out.println("Test passed."); diff --git a/jdk/test/java/awt/color/ICC_ColorSpace/SimpleSRGBConversionQualityTest.java b/jdk/test/java/awt/color/ICC_ColorSpace/SimpleSRGBConversionQualityTest.java new file mode 100644 index 00000000000..57239dd41e7 --- /dev/null +++ b/jdk/test/java/awt/color/ICC_ColorSpace/SimpleSRGBConversionQualityTest.java @@ -0,0 +1,51 @@ +/* + * Copyright Amazon.com Inc. 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.Color; +import java.awt.color.ColorSpace; + +/** + * @test + * @bug 6528710 + * @summary Verifies sRGB-ColorSpace to sRGB-ColorSpace conversion quality + */ +public final class SimpleSRGBConversionQualityTest { + + public static void main(String[] args) { + ColorSpace cspace = ColorSpace.getInstance(ColorSpace.CS_sRGB); + float fvalue[] = {1.0f, 1.0f, 1.0f}; + + Color c = new Color(cspace, fvalue, 1.0f); + if (c.getRed() != 255 || c.getGreen() != 255 || c.getBlue() != 255) { + throw new RuntimeException("Wrong color: " + c); + } + + float frgbvalue[] = cspace.toRGB(fvalue); + for (int i = 0; i < 3; ++i) { + if (frgbvalue[i] != 1.0f) { + System.err.println(fvalue[i] + " -> " + frgbvalue[i]); + throw new RuntimeException("Wrong value"); + } + } + } +} diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java index a1c64309422..223b011e7dd 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -62,6 +62,10 @@ public class Basic { /* used for AIX only */ static final String libpath = System.getenv("LIBPATH"); + /* Used for regex String matching for long error messages */ + static final String PERMISSION_DENIED_ERROR_MSG = "(Permission denied|error=13)"; + static final String NO_SUCH_FILE_ERROR_MSG = "(No such file|error=2)"; + /** * Returns the number of milliseconds since time given by * startNanoTime, which must have been previously returned from a @@ -295,7 +299,7 @@ static void checkPermissionDenied(ProcessBuilder pb) { } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "Permission denied")) + ! matches(m, PERMISSION_DENIED_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } } @@ -403,7 +407,7 @@ public static void main(String args[]) throws Throwable { } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file")) + ! matches(m, NO_SUCH_FILE_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -416,7 +420,7 @@ public static void main(String args[]) throws Throwable { } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file")) + ! matches(m, NO_SUCH_FILE_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -1854,7 +1858,7 @@ public void doIt(Map environ) { } catch (IOException e) { String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "No such file or directory")) + ! matches(m, NO_SUCH_FILE_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -1871,7 +1875,7 @@ public void doIt(Map environ) { Pattern p = Pattern.compile(programName); if (! matches(m, programName) || (EnglishUnix.is() - && ! matches(m, "No such file or directory"))) + && ! matches(m, NO_SUCH_FILE_ERROR_MSG))) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -1887,7 +1891,7 @@ public void doIt(Map environ) { String m = e.getMessage(); if (! matches(m, "in directory") || (EnglishUnix.is() && - ! matches(m, "No such file or directory"))) + ! matches(m, NO_SUCH_FILE_ERROR_MSG))) unexpected(e); } catch (Throwable t) { unexpected(t); } @@ -2122,7 +2126,7 @@ public void run() { new File("./emptyCommand").delete(); String m = e.getMessage(); if (EnglishUnix.is() && - ! matches(m, "Permission denied")) + ! matches(m, PERMISSION_DENIED_ERROR_MSG)) unexpected(e); } catch (Throwable t) { unexpected(t); } diff --git a/jdk/test/java/net/MulticastSocket/JoinLeave.java b/jdk/test/java/net/MulticastSocket/JoinLeave.java index 93dd93930b6..a3e714eecb1 100644 --- a/jdk/test/java/net/MulticastSocket/JoinLeave.java +++ b/jdk/test/java/net/MulticastSocket/JoinLeave.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, 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,13 +21,15 @@ * questions. */ -/* +/** * @test * @bug 4091811 4148753 4102731 * @summary Test java.net.MulticastSocket joinGroup and leaveGroup - * @library /lib/testlibrary - * @build jdk.testlibrary.NetworkConfiguration + * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main JoinLeave + * @run main/othervm -Djava.net.preferIPv4Stack=true JoinLeave */ import java.io.IOException; @@ -35,11 +37,11 @@ import java.net.InetAddress; import java.net.MulticastSocket; import java.net.NetworkInterface; -import jdk.testlibrary.NetworkConfiguration; +import jdk.test.lib.NetworkConfiguration; public class JoinLeave { - public static void main(String args[]) throws IOException { + public static void main(String args[]) throws IOException { InetAddress ip4Group = InetAddress.getByName("224.80.80.80"); InetAddress ip6Group = InetAddress.getByName("ff02::a"); @@ -48,8 +50,7 @@ public static void main(String args[]) throws IOException { nc.ip6MulticastInterfaces().forEach(nic -> joinLeave(ip6Group, nic)); } - static void joinLeave(InetAddress group, NetworkInterface nif) - { + static void joinLeave(InetAddress group, NetworkInterface nif) { System.out.println("Joining:" + group + " on " + nif); try (MulticastSocket soc = new MulticastSocket()) { soc.setNetworkInterface(nif); diff --git a/jdk/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java b/jdk/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java index b46bdbedbce..7e888d31d22 100644 --- a/jdk/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java +++ b/jdk/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, 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,105 +21,50 @@ * questions. */ - -/* - * @test - * @bug 6458027 - * @summary Disabling IPv6 on a specific network interface causes problems. - * - */ - import java.io.IOException; -import java.net.InetAddress; +import java.io.UncheckedIOException; import java.net.MulticastSocket; import java.net.NetworkInterface; -import java.net.SocketException; -import java.util.Arrays; -import java.util.Enumeration; +import jdk.test.lib.NetworkConfiguration; -public class SetGetNetworkInterfaceTest { +/** + * @test + * @bug 6458027 + * @summary Disabling IPv6 on a specific network interface causes problems. + * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform + * @run main SetGetNetworkInterfaceTest + * @run main/othervm -Djava.net.preferIPv4Stack=true SetGetNetworkInterfaceTest +*/ +public class SetGetNetworkInterfaceTest { public static void main(String[] args) throws Exception { - - boolean passed = true; - try { - MulticastSocket ms = new MulticastSocket(); - Enumeration networkInterfaces = NetworkInterface - .getNetworkInterfaces(); - while (networkInterfaces.hasMoreElements()) { - NetworkInterface netIf = networkInterfaces.nextElement(); - if (isNetworkInterfaceTestable(netIf)) { - printNetIfDetails(netIf); - ms.setNetworkInterface(netIf); - NetworkInterface msNetIf = ms.getNetworkInterface(); - if (netIf.equals(msNetIf)) { - System.out.println(" OK"); - } else { - System.out.println("FAILED!!!"); - printNetIfDetails(msNetIf); - passed = false; - } - System.out.println("------------------"); - } - } + NetworkConfiguration nc = NetworkConfiguration.probe(); + try (MulticastSocket ms = new MulticastSocket()) { + nc.multicastInterfaces(true).forEach(nif -> setGetNetworkInterface(ms, nif)); } catch (IOException e) { e.printStackTrace(); - passed = false; } - if (!passed) { - throw new RuntimeException("Test Fail"); - } - System.out.println("Test passed "); - } - - private static boolean isNetworkInterfaceTestable(NetworkInterface netIf) throws Exception { - System.out.println("checking netif == " + netIf.getName()); - return (netIf.isUp() && netIf.supportsMulticast() && isIpAddrAvailable(netIf)); + System.out.println("Test passed."); } - private static boolean isIpAddrAvailable (NetworkInterface netIf) { - boolean ipAddrAvailable = false; - byte[] nullIpAddr = {'0', '0', '0', '0'}; - byte[] testIpAddr = null; - - Enumeration ipAddresses = netIf.getInetAddresses(); - while (ipAddresses.hasMoreElements()) { - InetAddress testAddr = ipAddresses.nextElement(); - testIpAddr = testAddr.getAddress(); - if ((testIpAddr != null) && (!Arrays.equals(testIpAddr, nullIpAddr))) { - ipAddrAvailable = true; - break; + static void setGetNetworkInterface(MulticastSocket ms, NetworkInterface nif) { + try { + System.out.println(NetworkConfiguration.interfaceInformation(nif)); + ms.setNetworkInterface(nif); + NetworkInterface msNetIf = ms.getNetworkInterface(); + if (nif.equals(msNetIf)) { + System.out.println(" OK"); } else { - System.out.println("ignore netif " + netIf.getName()); - } - } - return ipAddrAvailable; - } - - private static void printNetIfDetails(NetworkInterface ni) - throws SocketException { - System.out.println("Name " + ni.getName() + " index " + ni.getIndex()); - Enumeration en = ni.getInetAddresses(); - while (en.hasMoreElements()) { - System.out.println(" InetAdress: " + en.nextElement()); - } - System.out.println("HardwareAddress: " + createMacAddrString(ni)); - System.out.println("loopback: " + ni.isLoopback() + "; pointToPoint: " - + ni.isPointToPoint() + "; virtual: " + ni.isVirtual() - + "; MTU: " + ni.getMTU()); - } - - private static String createMacAddrString(NetworkInterface netIf) - throws SocketException { - byte[] macAddr = netIf.getHardwareAddress(); - StringBuilder sb = new StringBuilder(); - if (macAddr != null) { - for (int i = 0; i < macAddr.length; i++) { - sb.append(String.format("%02X%s", macAddr[i], - (i < macAddr.length - 1) ? "-" : "")); + System.out.println("FAILED!!!"); + System.out.println(NetworkConfiguration.interfaceInformation(msNetIf)); + throw new RuntimeException("Test Fail"); } + System.out.println("------------------"); + } catch (IOException e) { + throw new UncheckedIOException(e); } - return sb.toString(); } } diff --git a/jdk/test/java/net/MulticastSocket/Test.java b/jdk/test/java/net/MulticastSocket/Test.java index 53fa961d2d4..df72cdae1f9 100644 --- a/jdk/test/java/net/MulticastSocket/Test.java +++ b/jdk/test/java/net/MulticastSocket/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, 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,21 +21,31 @@ * questions. */ -/* +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.MulticastSocket; +import java.net.SocketTimeoutException; + +import jdk.test.lib.NetworkConfiguration; + +/** * @test * @bug 4488458 * @summary IPv4 and IPv6 multicasting broken on Linux + * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform + * @run main Test + * @run main/othervm -Djava.net.preferIPv4Stack=true Test */ -import java.net.*; -import java.io.IOException; -import java.util.Enumeration; - public class Test { static int count = 0; static int failures = 0; - void doTest(String address) throws Exception { + void doTest(String address) throws IOException { boolean failed = false; InetAddress ia = InetAddress.getByName(address); @@ -61,7 +71,7 @@ void doTest(String address) throws Exception { /* packets should be received */ - for (int j=0; j<2; j++) { + for (int j = 0; j < 2; j++) { p.setAddress(ia); p.setPort(port); @@ -123,59 +133,26 @@ void doTest(String address) throws Exception { } } - void allTests() throws Exception { + void allTests() throws IOException { + NetworkConfiguration nc = NetworkConfiguration.probe(); - /* - * Assume machine has IPv4 address - */ + // unconditionally test IPv4 address doTest("224.80.80.80"); - /* - * Check if IPv6 is enabled and the scope of the addresses - */ - boolean has_ipv6 = false; - boolean has_siteaddress = false; - boolean has_linklocaladdress = false; - boolean has_globaladdress = false; - - Enumeration nifs = NetworkInterface.getNetworkInterfaces(); - while (nifs.hasMoreElements()) { - NetworkInterface ni = (NetworkInterface)nifs.nextElement(); - Enumeration addrs = ni.getInetAddresses(); - - while (addrs.hasMoreElements()) { - InetAddress ia = (InetAddress)addrs.nextElement(); - - if (ia instanceof Inet6Address) { - has_ipv6 = true; - if (ia.isLinkLocalAddress()) has_linklocaladdress = true; - if (ia.isSiteLocalAddress()) has_siteaddress = true; - - if (!ia.isLinkLocalAddress() && - !ia.isSiteLocalAddress() && - !ia.isLoopbackAddress()) { - has_globaladdress = true; - } - } - } - } - - /* - * If IPv6 is enabled perform multicast tests with various scopes - */ - if (has_ipv6) { + // If IPv6 is enabled perform multicast tests with various scopes + if (nc.hasTestableIPv6Address()) { doTest("ff01::a"); } - if (has_linklocaladdress) { + if (nc.hasLinkLocalAddress()) { doTest("ff02::a"); } - if (has_siteaddress) { + if (nc.hasSiteLocalAddress()) { doTest("ff05::a"); } - if (has_globaladdress) { + if (nc.has_globaladdress()) { doTest("ff0e::a"); } } @@ -186,7 +163,7 @@ public static void main(String args[]) throws Exception { if (args.length == 0) { t.allTests(); } else { - for (int i=0; i= 8) - * @library /lib / + * @library /test/lib / * @key jfr * @run main/othervm/timeout=30 -XX:+FlightRecorder -XX:StartFlightRecording JFRSecurityTestSuite * @author Martin Balao (mbalao@redhat.com) diff --git a/jdk/test/jdk/jfr/startupargs/TestBadOptionValues.java b/jdk/test/jdk/jfr/startupargs/TestBadOptionValues.java index 4744178499e..b457e9d7c3b 100644 --- a/jdk/test/jdk/jfr/startupargs/TestBadOptionValues.java +++ b/jdk/test/jdk/jfr/startupargs/TestBadOptionValues.java @@ -35,7 +35,7 @@ * @key jfr * * - * @library /lib / + * @library /test/lib / * * diff --git a/jdk/test/jdk/jfr/startupargs/TestDumpOnExit.java b/jdk/test/jdk/jfr/startupargs/TestDumpOnExit.java index 312c70d41eb..85fde363fef 100644 --- a/jdk/test/jdk/jfr/startupargs/TestDumpOnExit.java +++ b/jdk/test/jdk/jfr/startupargs/TestDumpOnExit.java @@ -43,7 +43,7 @@ * @summary Start a FlightRecording with dumponexit. Verify dump exists. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.startupargs.TestDumpOnExit */ public class TestDumpOnExit { diff --git a/jdk/test/jdk/jfr/startupargs/TestMemoryOptions.java b/jdk/test/jdk/jfr/startupargs/TestMemoryOptions.java index 934a0b97538..31725449749 100644 --- a/jdk/test/jdk/jfr/startupargs/TestMemoryOptions.java +++ b/jdk/test/jdk/jfr/startupargs/TestMemoryOptions.java @@ -38,7 +38,7 @@ * @test * @key jfr * - * @library /lib / + * @library /test/lib / * * @run main/timeout=900 jdk.jfr.startupargs.TestMemoryOptions */ diff --git a/jdk/test/jdk/jfr/startupargs/TestMultipleStartupRecordings.java b/jdk/test/jdk/jfr/startupargs/TestMultipleStartupRecordings.java index 4c156c8cfcf..174794ab298 100644 --- a/jdk/test/jdk/jfr/startupargs/TestMultipleStartupRecordings.java +++ b/jdk/test/jdk/jfr/startupargs/TestMultipleStartupRecordings.java @@ -34,7 +34,7 @@ * @key jfr * * - * @library /lib / + * @library /test/lib / * * @run main jdk.jfr.startupargs.TestMultipleStartupRecordings */ diff --git a/jdk/test/jdk/jfr/startupargs/TestOldObjectQueueSize.java b/jdk/test/jdk/jfr/startupargs/TestOldObjectQueueSize.java index 6af49232a53..1c6ed4cece6 100644 --- a/jdk/test/jdk/jfr/startupargs/TestOldObjectQueueSize.java +++ b/jdk/test/jdk/jfr/startupargs/TestOldObjectQueueSize.java @@ -39,7 +39,7 @@ * @summary Test -XX:FlightRecorderOptions=old-object-queue-size * * - * @library /lib / + * @library /test/lib / * @key jfr * * @run main/othervm -XX:TLABSize=2k -XX:-FastTLABRefill -XX:FlightRecorderOptions=old-object-queue-size=0 jdk.jfr.startupargs.TestOldObjectQueueSize off diff --git a/jdk/test/jdk/jfr/startupargs/TestRepositoryPath.java b/jdk/test/jdk/jfr/startupargs/TestRepositoryPath.java index 56deefc611f..3df0a36d91a 100644 --- a/jdk/test/jdk/jfr/startupargs/TestRepositoryPath.java +++ b/jdk/test/jdk/jfr/startupargs/TestRepositoryPath.java @@ -36,7 +36,7 @@ * @summary Set repository path. Verify recording created in repo. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartRecording,settings=profile -XX:FlightRecorderOptions=repository=./repo jdk.jfr.startupargs.TestRepositoryPath */ public class TestRepositoryPath { diff --git a/jdk/test/jdk/jfr/startupargs/TestRepositoryPathLong.java b/jdk/test/jdk/jfr/startupargs/TestRepositoryPathLong.java index 5a5176c56e3..72bb60ed90d 100644 --- a/jdk/test/jdk/jfr/startupargs/TestRepositoryPathLong.java +++ b/jdk/test/jdk/jfr/startupargs/TestRepositoryPathLong.java @@ -36,7 +36,7 @@ * @summary Set repository path. Verify recording created in repo. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=myrec,settings=profile -XX:FlightRecorderOptions=repository=./subdirectory/subdirectory1/subdirectory2/subdirectory3/subdirectory4/subdirectory5/subdirectory6/subdirectory7/subdirectory8/subdirectory9/subdirectory10/subdirectory11/subdirectory12/subdirectory13/subdirectory14/subdirectory15 jdk.jfr.startupargs.TestRepositoryPathLong */ public class TestRepositoryPathLong { diff --git a/jdk/test/jdk/jfr/startupargs/TestRetransform.java b/jdk/test/jdk/jfr/startupargs/TestRetransform.java index 3703f276efa..af8f3083684 100644 --- a/jdk/test/jdk/jfr/startupargs/TestRetransform.java +++ b/jdk/test/jdk/jfr/startupargs/TestRetransform.java @@ -36,7 +36,7 @@ * @test * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:FlightRecorderOptions=retransform=false jdk.jfr.startupargs.TestRetransform * @run main/othervm -XX:FlightRecorderOptions=retransform=true jdk.jfr.startupargs.TestRetransform */ diff --git a/jdk/test/jdk/jfr/startupargs/TestRetransformUsingLog.java b/jdk/test/jdk/jfr/startupargs/TestRetransformUsingLog.java index c7aefbb9405..65e788c07de 100644 --- a/jdk/test/jdk/jfr/startupargs/TestRetransformUsingLog.java +++ b/jdk/test/jdk/jfr/startupargs/TestRetransformUsingLog.java @@ -38,7 +38,7 @@ * @test * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.startupargs.TestRetransformUsingLog */ public class TestRetransformUsingLog { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartDelay.java b/jdk/test/jdk/jfr/startupargs/TestStartDelay.java index bd00da2e978..5fe8c26765e 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartDelay.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartDelay.java @@ -38,7 +38,7 @@ * @summary Start a recording with delay. Verify recording starts later. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartDelay,delay=5000s jdk.jfr.startupargs.TestStartDelay */ public class TestStartDelay { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartDelayRunning.java b/jdk/test/jdk/jfr/startupargs/TestStartDelayRunning.java index 97af7fb211a..5e649514759 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartDelayRunning.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartDelayRunning.java @@ -37,7 +37,7 @@ * @summary Verify that a recopding with a delay is started. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartDelay,delay=1s jdk.jfr.startupargs.TestStartDelayRunning */ public class TestStartDelayRunning { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartDuration.java b/jdk/test/jdk/jfr/startupargs/TestStartDuration.java index 8173a4d9839..b84f00fffb0 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartDuration.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartDuration.java @@ -39,7 +39,7 @@ * @summary Start a recording with duration. Verify recording stops. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main jdk.jfr.startupargs.TestStartDuration */ public class TestStartDuration { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartMaxAgeSize.java b/jdk/test/jdk/jfr/startupargs/TestStartMaxAgeSize.java index d1b0971b231..6897c2c0056 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartMaxAgeSize.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartMaxAgeSize.java @@ -37,7 +37,7 @@ * @summary Start a recording with delay. Verify recording starts later. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartMaxAgeSize,maxage=10s,maxsize=1000000 jdk.jfr.startupargs.TestStartMaxAgeSize */ public class TestStartMaxAgeSize { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartName.java b/jdk/test/jdk/jfr/startupargs/TestStartName.java index 1c0e38d5f0f..6d376c7633f 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartName.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartName.java @@ -34,7 +34,7 @@ * @test * @key jfr * - * @library /lib / + * @library /test/lib / * @run main jdk.jfr.startupargs.TestStartName */ public class TestStartName { diff --git a/jdk/test/jdk/jfr/startupargs/TestStartNoSettings.java b/jdk/test/jdk/jfr/startupargs/TestStartNoSettings.java index 9b452c93325..ce32ccac635 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartNoSettings.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartNoSettings.java @@ -35,7 +35,7 @@ * @test * @summary Start a FlightRecording without any settings (not even default). * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.startupargs.TestStartNoSettings * -XX:StartFlightRecording=settings=none */ diff --git a/jdk/test/jdk/jfr/startupargs/TestStartRecording.java b/jdk/test/jdk/jfr/startupargs/TestStartRecording.java index 104905c23d2..16abb088fde 100644 --- a/jdk/test/jdk/jfr/startupargs/TestStartRecording.java +++ b/jdk/test/jdk/jfr/startupargs/TestStartRecording.java @@ -37,7 +37,7 @@ * @summary Start a recording with -XX:StartFlightRecording. Dump recording with jcmd. * @key jfr * - * @library /lib / + * @library /test/lib / * @run main/othervm -XX:StartFlightRecording=name=TestStartRecording,settings=profile jdk.jfr.startupargs.TestStartRecording */ public class TestStartRecording { diff --git a/jdk/test/jdk/jfr/tool/TestAssemble.java b/jdk/test/jdk/jfr/tool/TestAssemble.java index e1188c4b212..b2a6c2758b7 100644 --- a/jdk/test/jdk/jfr/tool/TestAssemble.java +++ b/jdk/test/jdk/jfr/tool/TestAssemble.java @@ -45,7 +45,7 @@ * @test * @summary Test jfr reconstruct * @key jfr - * @library /lib / + * @library /test/lib / * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.tool.TestAssemble */ diff --git a/jdk/test/jdk/jfr/tool/TestDisassemble.java b/jdk/test/jdk/jfr/tool/TestDisassemble.java index f749cd5f9cf..d73a4f50ea4 100644 --- a/jdk/test/jdk/jfr/tool/TestDisassemble.java +++ b/jdk/test/jdk/jfr/tool/TestDisassemble.java @@ -42,7 +42,7 @@ * @test * @summary Test jfr split * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestDisassemble */ public class TestDisassemble { diff --git a/jdk/test/jdk/jfr/tool/TestHelp.java b/jdk/test/jdk/jfr/tool/TestHelp.java index ee5361ab11a..cc7122280eb 100644 --- a/jdk/test/jdk/jfr/tool/TestHelp.java +++ b/jdk/test/jdk/jfr/tool/TestHelp.java @@ -31,7 +31,7 @@ * @test * @summary Test help * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestHelp */ public class TestHelp { diff --git a/jdk/test/jdk/jfr/tool/TestMetadata.java b/jdk/test/jdk/jfr/tool/TestMetadata.java index ee953e7738f..151095b245e 100644 --- a/jdk/test/jdk/jfr/tool/TestMetadata.java +++ b/jdk/test/jdk/jfr/tool/TestMetadata.java @@ -35,7 +35,7 @@ * @test * @summary Test jfr info * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestMetadata */ public class TestMetadata { diff --git a/jdk/test/jdk/jfr/tool/TestPrint.java b/jdk/test/jdk/jfr/tool/TestPrint.java index 70401c5a392..f1fc42b0e2a 100644 --- a/jdk/test/jdk/jfr/tool/TestPrint.java +++ b/jdk/test/jdk/jfr/tool/TestPrint.java @@ -36,7 +36,7 @@ * @test * @summary Test jfr print * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestPrint */ public class TestPrint { diff --git a/jdk/test/jdk/jfr/tool/TestPrintDefault.java b/jdk/test/jdk/jfr/tool/TestPrintDefault.java index 98f6484c87f..a366d563830 100644 --- a/jdk/test/jdk/jfr/tool/TestPrintDefault.java +++ b/jdk/test/jdk/jfr/tool/TestPrintDefault.java @@ -34,7 +34,7 @@ * @key jfr * @summary Tests print --json * - * @library /lib / + * @library /test/lib / * @modules java.scripting * jdk.jfr * diff --git a/jdk/test/jdk/jfr/tool/TestPrintJSON.java b/jdk/test/jdk/jfr/tool/TestPrintJSON.java index 26f5e199af6..4cef144a81c 100644 --- a/jdk/test/jdk/jfr/tool/TestPrintJSON.java +++ b/jdk/test/jdk/jfr/tool/TestPrintJSON.java @@ -49,7 +49,7 @@ * @key jfr * @summary Tests print --json * - * @library /lib / + * @library /test/lib / * @modules jdk.scripting.nashorn * jdk.jfr * diff --git a/jdk/test/jdk/jfr/tool/TestPrintXML.java b/jdk/test/jdk/jfr/tool/TestPrintXML.java index 589c8f4d62b..5e745c95cdd 100644 --- a/jdk/test/jdk/jfr/tool/TestPrintXML.java +++ b/jdk/test/jdk/jfr/tool/TestPrintXML.java @@ -64,7 +64,7 @@ * @key jfr * @summary Tests print --xml * - * @library /lib / + * @library /test/lib / * @modules java.scripting java.xml jdk.jfr * * @run main/othervm jdk.jfr.tool.TestPrintXML diff --git a/jdk/test/jdk/jfr/tool/TestSummary.java b/jdk/test/jdk/jfr/tool/TestSummary.java index b9dc94f178d..505c58f2d9e 100644 --- a/jdk/test/jdk/jfr/tool/TestSummary.java +++ b/jdk/test/jdk/jfr/tool/TestSummary.java @@ -35,7 +35,7 @@ * @test * @summary Test jfr info * @key jfr - * @library /lib / + * @library /test/lib / * @run main/othervm jdk.jfr.tool.TestSummary */ public class TestSummary { diff --git a/jdk/test/jdk/tools/launcher/JliLaunchTest.sh b/jdk/test/jdk/tools/launcher/JliLaunchTest.sh index 8a149ee628e..667ad778fef 100644 --- a/jdk/test/jdk/tools/launcher/JliLaunchTest.sh +++ b/jdk/test/jdk/tools/launcher/JliLaunchTest.sh @@ -2,7 +2,7 @@ # @test JliLaunchTest.sh # @bug 8238225 -# @library /lib +# @library /test/lib # @build JliLaunchTest # @run shell JliLaunchTest.sh diff --git a/jdk/test/lib/RedefineClassHelper.java b/jdk/test/lib/RedefineClassHelper.java deleted file mode 100644 index 2c236907a7a..00000000000 --- a/jdk/test/lib/RedefineClassHelper.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, 2016, 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.PrintWriter; -import java.lang.instrument.*; -import jdk.test.lib.compiler.InMemoryJavaCompiler; - -/* - * Helper class to write tests that redefine classes. - * When main method is run, it will create a redefineagent.jar that can be used - * with the -javaagent option to support redefining classes in jtreg tests. - * - * See sample test in test/testlibrary_tests/RedefineClassTest.java - */ -public class RedefineClassHelper { - - public static Instrumentation instrumentation; - public static void premain(String agentArgs, Instrumentation inst) { - instrumentation = inst; - } - - /** - * Redefine a class - * - * @param clazz Class to redefine - * @param javacode String with the new java code for the class to be redefined - */ - public static void redefineClass(Class clazz, String javacode) throws Exception { - byte[] bytecode = InMemoryJavaCompiler.compile(clazz.getName(), javacode); - redefineClass(clazz, bytecode); - } - - /** - * Redefine a class - * - * @param clazz Class to redefine - * @param bytecode byte[] with the new class - */ - public static void redefineClass(Class clazz, byte[] bytecode) throws Exception { - instrumentation.redefineClasses(new ClassDefinition(clazz, bytecode)); - } - - /** - * Main method to be invoked before test to create the redefineagent.jar - */ - public static void main(String[] args) throws Exception { - ClassFileInstaller.main("RedefineClassHelper"); - - PrintWriter pw = new PrintWriter("MANIFEST.MF"); - pw.println("Premain-Class: RedefineClassHelper"); - pw.println("Can-Redefine-Classes: true"); - pw.close(); - - sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar"); - if (!jarTool.run(new String[] { "-cmf", "MANIFEST.MF", "redefineagent.jar", "RedefineClassHelper.class" })) { - throw new Exception("jar operation failed"); - } - } -} diff --git a/jdk/test/lib/jdk/test/lib/SecurityTools.java b/jdk/test/lib/jdk/test/lib/SecurityTools.java deleted file mode 100644 index 240801fb87f..00000000000 --- a/jdk/test/lib/jdk/test/lib/SecurityTools.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; - -public class SecurityTools { - - public static final String RESPONSE_FILE = "security_tools_response.txt"; - - private static ProcessBuilder getProcessBuilder(String tool, List args) { - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK(tool) - .addVMArg("-Duser.language=en") - .addVMArg("-Duser.country=US"); - if (!Platform.isWindows()) { - launcher.addVMArg("-Djava.security.egd=file:/dev/./urandom"); - } - for (String arg : args) { - if (arg.startsWith("-J")) { - launcher.addVMArg(arg.substring(2)); - } else { - launcher.addToolArg(arg); - } - } - return new ProcessBuilder(launcher.getCommand()); - } - - // keytool - - public static OutputAnalyzer keytool(List args) - throws Exception { - - ProcessBuilder pb = getProcessBuilder("keytool", args); - - Path p = Paths.get(RESPONSE_FILE); - if (!Files.exists(p)) { - Files.createFile(p); - } - pb.redirectInput(ProcessBuilder.Redirect.from(new File(RESPONSE_FILE))); - - try { - return execute(pb); - } finally { - Files.delete(p); - } - } - - // Only call this if there is no white space in every argument - public static OutputAnalyzer keytool(String args) throws Exception { - return keytool(args.split("\\s+")); - } - - public static OutputAnalyzer keytool(String... args) throws Exception { - return keytool(List.of(args)); - } - - public static void setResponse(String... responses) throws IOException { - String text; - if (responses.length > 0) { - text = Stream.of(responses).collect( - Collectors.joining("\n", "", "\n")); - } else { - text = ""; - } - Files.write(Paths.get(RESPONSE_FILE), text.getBytes()); - } - - // jarsigner - - public static OutputAnalyzer jarsigner(List args) - throws Exception { - return execute(getProcessBuilder("jarsigner", args)); - } - - private static OutputAnalyzer execute(ProcessBuilder pb) throws Exception { - try { - OutputAnalyzer oa = ProcessTools.executeCommand(pb); - System.out.println("Exit value: " + oa.getExitValue()); - return oa; - } catch (Throwable t) { - if (t instanceof Exception) { - throw (Exception) t; - } else { - throw new Exception(t); - } - } - } - - // Only call this if there is no white space in every argument - public static OutputAnalyzer jarsigner(String args) throws Exception { - - return jarsigner(args.split("\\s+")); - } - - public static OutputAnalyzer jarsigner(String... args) throws Exception { - return jarsigner(List.of(args)); - } -} - diff --git a/jdk/test/lib/jdk/test/lib/apps/LingeredApp.java b/jdk/test/lib/jdk/test/lib/apps/LingeredApp.java deleted file mode 100644 index 0070dcfd717..00000000000 --- a/jdk/test/lib/jdk/test/lib/apps/LingeredApp.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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.apps; - -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.StringReader; -import java.nio.file.Files; -import java.nio.file.NoSuchFileException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.FileTime; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; -import java.util.UUID; - -import jdk.test.lib.Utils; -import jdk.test.lib.process.OutputBuffer; -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.StreamPumper; - -/** - * This is a framework to launch an app that could be synchronized with caller - * to make further attach actions reliable across supported platforms - - * Caller example: - * SmartTestApp a = SmartTestApp.startApp(cmd); - * // do something - * a.stopApp(); - * - * or fine grained control - * - * a = new SmartTestApp("MyLock.lck"); - * a.createLock(); - * a.runApp(); - * a.waitAppReady(); - * // do something - * a.deleteLock(); - * a.waitAppTerminate(); - * - * Then you can work with app output and process object - * - * output = a.getAppOutput(); - * process = a.getProcess(); - * - */ -public class LingeredApp { - - private static final long spinDelay = 1000; - - private long lockCreationTime; - private ByteArrayOutputStream stderrBuffer; - private ByteArrayOutputStream stdoutBuffer; - private Thread outPumperThread; - private Thread errPumperThread; - - protected Process appProcess; - protected OutputBuffer output; - protected static final int appWaitTime = 100; - protected final String lockFileName; - - /** - * Create LingeredApp object on caller side. Lock file have be a valid filename - * at writable location - * - * @param lockFileName - the name of lock file - */ - public LingeredApp(String lockFileName) { - this.lockFileName = lockFileName; - } - - public LingeredApp() { - final String lockName = UUID.randomUUID().toString() + ".lck"; - this.lockFileName = lockName; - } - - /** - * - * @return name of lock file - */ - public String getLockFileName() { - return this.lockFileName; - } - - /** - * - * @return name of testapp - */ - public String getAppName() { - return this.getClass().getName(); - } - - /** - * - * @return pid of java process running testapp - */ - public long getPid() { - if (appProcess == null) { - throw new RuntimeException("Process is not alive"); - } - return appProcess.pid(); - } - - /** - * - * @return process object - */ - public Process getProcess() { - return appProcess; - } - - /** - * - * @return OutputBuffer object for the LingeredApp's output. Can only be called - * after LingeredApp has exited. - */ - public OutputBuffer getOutput() { - if (appProcess.isAlive()) { - throw new RuntimeException("Process is still alive. Can't get its output."); - } - if (output == null) { - output = new OutputBuffer(stdoutBuffer.toString(), stderrBuffer.toString()); - } - return output; - } - - /* - * Capture all stdout and stderr output from the LingeredApp so it can be returned - * to the driver app later. This code is modeled after ProcessTools.getOutput(). - */ - private void startOutputPumpers() { - stderrBuffer = new ByteArrayOutputStream(); - stdoutBuffer = new ByteArrayOutputStream(); - StreamPumper outPumper = new StreamPumper(appProcess.getInputStream(), stdoutBuffer); - StreamPumper errPumper = new StreamPumper(appProcess.getErrorStream(), stderrBuffer); - outPumperThread = new Thread(outPumper); - errPumperThread = new Thread(errPumper); - - outPumperThread.setDaemon(true); - errPumperThread.setDaemon(true); - - outPumperThread.start(); - errPumperThread.start(); - } - - /** - * - * @return application output as List. Empty List if application produced no output - */ - public List getAppOutput() { - if (appProcess.isAlive()) { - throw new RuntimeException("Process is still alive. Can't get its output."); - } - BufferedReader bufReader = new BufferedReader(new StringReader(output.getStdout())); - return bufReader.lines().collect(Collectors.toList()); - } - - /* Make sure all part of the app use the same method to get dates, - as different methods could produce different results - */ - private static long epoch() { - return new Date().getTime(); - } - - private static long lastModified(String fileName) throws IOException { - Path path = Paths.get(fileName); - BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class); - return attr.lastModifiedTime().toMillis(); - } - - private static void setLastModified(String fileName, long newTime) throws IOException { - Path path = Paths.get(fileName); - FileTime fileTime = FileTime.fromMillis(newTime); - Files.setLastModifiedTime(path, fileTime); - } - - /** - * create lock - * - * @throws IOException - */ - public void createLock() throws IOException { - Path path = Paths.get(lockFileName); - // Files.deleteIfExists(path); - Files.createFile(path); - lockCreationTime = lastModified(lockFileName); - } - - /** - * Delete lock - * - * @throws IOException - */ - public void deleteLock() throws IOException { - try { - Path path = Paths.get(lockFileName); - Files.delete(path); - } catch (NoSuchFileException ex) { - // Lock already deleted. Ignore error - } - } - - public void waitAppTerminate() { - // This code is modeled after tail end of ProcessTools.getOutput(). - try { - // If the app hangs, we don't want to wait for the to test timeout. - if (!appProcess.waitFor(Utils.adjustTimeout(appWaitTime), TimeUnit.SECONDS)) { - appProcess.destroy(); - appProcess.waitFor(); - } - outPumperThread.join(); - errPumperThread.join(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - // pass - } - } - - /** - * The app touches the lock file when it's started - * wait while it happens. Caller have to delete lock on wait error. - * - * @param timeout - * @throws java.io.IOException - */ - public void waitAppReady(long timeout) throws IOException { - long here = epoch(); - while (true) { - long epoch = epoch(); - if (epoch - here > (timeout * 1000)) { - throw new IOException("App waiting timeout"); - } - - // Live process should touch lock file every second - long lm = lastModified(lockFileName); - if (lm > lockCreationTime) { - break; - } - - // Make sure process didn't already exit - if (!appProcess.isAlive()) { - throw new IOException("App exited unexpectedly with " + appProcess.exitValue()); - } - - try { - Thread.sleep(spinDelay); - } catch (InterruptedException ex) { - // pass - } - } - } - - /** - * Analyze an environment and prepare a command line to - * run the app, app name should be added explicitly - */ - public List runAppPrepare(List vmArguments) { - // We should always use testjava or throw an exception, - // so we can't use JDKToolFinder.getJDKTool("java"); - // that falls back to compile java on error - String jdkPath = System.getProperty("test.jdk"); - if (jdkPath == null) { - // we are not under jtreg, try env - Map env = System.getenv(); - jdkPath = env.get("TESTJAVA"); - } - - if (jdkPath == null) { - throw new RuntimeException("Can't determine jdk path neither test.jdk property no TESTJAVA env are set"); - } - - String osname = System.getProperty("os.name"); - String javapath = jdkPath + ((osname.startsWith("window")) ? "/bin/java.exe" : "/bin/java"); - - List cmd = new ArrayList(); - cmd.add(javapath); - - if (vmArguments == null) { - // Propagate test.vm.options to LingeredApp, filter out possible empty options - String testVmOpts[] = System.getProperty("test.vm.opts","").split("\\s+"); - for (String s : testVmOpts) { - if (!s.equals("")) { - cmd.add(s); - } - } - } else { - // Lets user manage LingeredApp options - cmd.addAll(vmArguments); - } - - // Make sure we set correct classpath to run the app - cmd.add("-cp"); - String classpath = System.getProperty("test.class.path"); - cmd.add((classpath == null) ? "." : classpath); - - return cmd; - } - - /** - * Assemble command line to a printable string - */ - public void printCommandLine(List cmd) { - // A bit of verbosity - StringBuilder cmdLine = new StringBuilder(); - for (String strCmd : cmd) { - cmdLine.append("'").append(strCmd).append("' "); - } - - System.err.println("Command line: [" + cmdLine.toString() + "]"); - } - - /** - * Run the app. - * - * @param vmArguments - * @throws IOException - */ - public void runApp(List vmArguments) - throws IOException { - - List cmd = runAppPrepare(vmArguments); - - cmd.add(this.getAppName()); - cmd.add(lockFileName); - - printCommandLine(cmd); - - ProcessBuilder pb = new ProcessBuilder(cmd); - // ProcessBuilder.start can throw IOException - appProcess = pb.start(); - - startOutputPumpers(); - } - - private void finishApp() { - OutputBuffer output = getOutput(); - String msg = - " LingeredApp stdout: [" + output.getStdout() + "];\n" + - " LingeredApp stderr: [" + output.getStderr() + "]\n" + - " LingeredApp exitValue = " + appProcess.exitValue(); - - System.err.println(msg); - } - - /** - * Delete lock file that signals app to terminate, then - * wait until app is actually terminated. - * @throws IOException - */ - public void stopApp() throws IOException { - deleteLock(); - // The startApp() of the derived app can throw - // an exception before the LA actually starts - if (appProcess != null) { - waitAppTerminate(); - int exitcode = appProcess.exitValue(); - if (exitcode != 0) { - throw new IOException("LingeredApp terminated with non-zero exit code " + exitcode); - } - } - finishApp(); - } - - /** - * High level interface for test writers - */ - /** - * Factory method that creates LingeredApp object with ready to use application - * lock name is autogenerated - * @param cmd - vm options, could be null to auto add testvm.options - * @return LingeredApp object - * @throws IOException - */ - public static LingeredApp startApp(List cmd) throws IOException { - LingeredApp a = new LingeredApp(); - a.createLock(); - try { - a.runApp(cmd); - a.waitAppReady(appWaitTime); - } catch (Exception ex) { - a.deleteLock(); - System.err.println("LingeredApp failed to start: " + ex); - a.finishApp(); - throw ex; - } - - return a; - } - - /** - * Factory method that starts pre-created LingeredApp - * lock name is autogenerated - * @param cmd - vm options, could be null to auto add testvm.options - * @param theApp - app to start - * @return LingeredApp object - * @throws IOException - */ - - public static void startApp(List cmd, LingeredApp theApp) throws IOException { - theApp.createLock(); - try { - theApp.runApp(cmd); - theApp.waitAppReady(appWaitTime); - } catch (Exception ex) { - theApp.deleteLock(); - throw ex; - } - } - - public static LingeredApp startApp() throws IOException { - return startApp(null); - } - - public static void stopApp(LingeredApp app) throws IOException { - if (app != null) { - // LingeredApp can throw an exception during the intialization, - // make sure we don't have cascade NPE - app.stopApp(); - } - } - - /** - * LastModified time might not work correctly in some cases it might - * cause later failures - */ - - public static boolean isLastModifiedWorking() { - boolean sane = true; - try { - long lm = lastModified("."); - if (lm == 0) { - System.err.println("SANITY Warning! The lastModifiedTime() doesn't work on this system, it returns 0"); - sane = false; - } - - long now = epoch(); - if (lm > now) { - System.err.println("SANITY Warning! The Clock is wrong on this system lastModifiedTime() > getTime()"); - sane = false; - } - - setLastModified(".", epoch()); - long lm1 = lastModified("."); - if (lm1 <= lm) { - System.err.println("SANITY Warning! The setLastModified doesn't work on this system"); - sane = false; - } - } - catch(IOException e) { - System.err.println("SANITY Warning! IOException during sanity check " + e); - sane = false; - } - - return sane; - } - - /** - * This part is the application it self - */ - public static void main(String args[]) { - - if (args.length != 1) { - System.err.println("Lock file name is not specified"); - System.exit(7); - } - - String theLockFileName = args[0]; - - try { - Path path = Paths.get(theLockFileName); - - while (Files.exists(path)) { - // Touch the lock to indicate our readiness - setLastModified(theLockFileName, epoch()); - Thread.sleep(spinDelay); - } - } catch (NoSuchFileException ex) { - // Lock deleted while we are setting last modified time. - // Ignore error and lets the app exits - } catch (Exception ex) { - System.err.println("LingeredApp ERROR: " + ex); - // Leave exit_code = 1 to Java launcher - System.exit(3); - } - - System.exit(0); - } -} diff --git a/jdk/test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java b/jdk/test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java deleted file mode 100644 index 2b52c1523db..00000000000 --- a/jdk/test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2005, 2016, 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.apps; - -import java.util.concurrent.Phaser; - -public class LingeredAppWithDeadlock extends LingeredApp { - - private static final Object Lock1 = new Object(); - private static final Object Lock2 = new Object(); - - private static volatile int reachCount = 0; - - private static final Phaser p = new Phaser(2); - - private static class ThreadOne extends Thread { - public void run() { - // wait Lock2 is locked - p.arriveAndAwaitAdvance(); - synchronized (Lock1) { - // signal Lock1 is locked - p.arriveAndAwaitAdvance(); - synchronized (Lock2) { - reachCount += 1; - } - } - } - } - - private static class ThreadTwo extends Thread { - public void run() { - synchronized (Lock2) { - // signal Lock2 is locked - p.arriveAndAwaitAdvance(); - // wait Lock1 is locked - p.arriveAndAwaitAdvance(); - synchronized (Lock1) { - reachCount += 1; - } - } - } - } - - public static void main(String args[]) { - if (args.length != 1) { - System.err.println("Lock file name is not specified"); - System.exit(7); - } - - // Run two theads that should come to deadlock - new ThreadOne().start(); - new ThreadTwo().start(); - - if (reachCount > 0) { - // Not able to deadlock, exiting - System.exit(3); - } - - LingeredApp.main(args); - } - } diff --git a/jdk/test/lib/jdk/test/lib/compiler/CompilerUtils.java b/jdk/test/lib/jdk/test/lib/compiler/CompilerUtils.java deleted file mode 100644 index 138ad84da41..00000000000 --- a/jdk/test/lib/jdk/test/lib/compiler/CompilerUtils.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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.compiler; - -import javax.tools.JavaCompiler; -import javax.tools.StandardJavaFileManager; -import javax.tools.StandardLocation; -import javax.tools.ToolProvider; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -/** - * This class consists exclusively of static utility methods for invoking the - * java compiler. - */ -public final class CompilerUtils { - private CompilerUtils() { } - - /** - * Compile all the java sources in {@code /**} to - * {@code /**}. The destination directory will be created if - * it doesn't exist. - * - * Equivalent to calling {@code compile(source, destination, true, options);}. - * - * All warnings/errors emitted by the compiler are output to System.out/err. - * - * @param source Path to the source directory - * @param destination Path to the destination directory - * @param options Any options to pass to the compiler - * - * @return true if the compilation is successful - * - * @throws IOException - * if there is an I/O error scanning the source tree or - * creating the destination directory - * @throws UnsupportedOperationException - * if there is no system java compiler - */ - public static boolean compile(Path source, Path destination, String... options) - throws IOException - { - return compile(source, destination, true, options); - } - - /** - * Compile all the java sources in {@code } and optionally its - * subdirectories, to - * {@code }. The destination directory will be created if - * it doesn't exist. - * - * All warnings/errors emitted by the compiler are output to System.out/err. - * - * @param source Path to the source directory - * @param destination Path to the destination directory - * @param recurse If {@code true} recurse into any {@code source} subdirectories - * to compile all java source files; else only compile those directly in - * {@code source}. - * @param options Any options to pass to the compiler - * - * @return true if the compilation is successful - * - * @throws IOException - * if there is an I/O error scanning the source tree or - * creating the destination directory - * @throws UnsupportedOperationException - * if there is no system java compiler - */ - - public static boolean compile(Path source, Path destination, boolean recurse, String... options) - throws IOException - { - JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); - if (compiler == null) { - // no compiler available - throw new UnsupportedOperationException("Unable to get system java compiler. " - + "Perhaps, jdk.compiler module is not available."); - } - StandardJavaFileManager jfm = compiler.getStandardFileManager(null, null, null); - - List sources - = Files.find(source, (recurse ? Integer.MAX_VALUE : 1), - (file, attrs) -> (file.toString().endsWith(".java"))) - .collect(Collectors.toList()); - - Files.createDirectories(destination); - jfm.setLocation(StandardLocation.CLASS_PATH, Collections.emptyList()); - jfm.setLocationFromPaths(StandardLocation.CLASS_OUTPUT, - Collections.singletonList(destination)); - - List opts = Arrays.asList(options); - JavaCompiler.CompilationTask task - = compiler.getTask(null, jfm, null, opts, null, - jfm.getJavaFileObjectsFromPaths(sources)); - - return task.call(); - } -} diff --git a/jdk/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java b/jdk/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java deleted file mode 100644 index 9444e4cc97b..00000000000 --- a/jdk/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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.compiler; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.tools.ForwardingJavaFileManager; -import javax.tools.FileObject; -import javax.tools.JavaCompiler; -import javax.tools.JavaCompiler.CompilationTask; -import javax.tools.JavaFileObject; -import javax.tools.JavaFileObject.Kind; -import javax.tools.SimpleJavaFileObject; -import javax.tools.StandardLocation; -import javax.tools.ToolProvider; - -/** - * {@code InMemoryJavaCompiler} can be used for compiling a {@link - * CharSequence} to a {@code byte[]}. - * - * The compiler will not use the file system at all, instead using a {@link - * ByteArrayOutputStream} for storing the byte code. For the source code, any - * kind of {@link CharSequence} can be used, e.g. {@link String}, {@link - * StringBuffer} or {@link StringBuilder}. - * - * The {@code InMemoryCompiler} can easily be used together with a {@code - * ByteClassLoader} to easily compile and load source code in a {@link String}: - * - *
- * {@code
- * import jdk.test.lib.compiler.InMemoryJavaCompiler;
- * import jdk.test.lib.ByteClassLoader;
- *
- * class Example {
- *     public static void main(String[] args) {
- *         String className = "Foo";
- *         String sourceCode = "public class " + className + " {" +
- *                             "    public void bar() {" +
- *                             "        System.out.println("Hello from bar!");" +
- *                             "    }" +
- *                             "}";
- *         byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode);
- *         Class fooClass = ByteClassLoader.load(className, byteCode);
- *     }
- * }
- * }
- * 
- */ -public class InMemoryJavaCompiler { - private static class MemoryJavaFileObject extends SimpleJavaFileObject { - private final String className; - private final CharSequence sourceCode; - private final ByteArrayOutputStream byteCode; - - public MemoryJavaFileObject(String className, CharSequence sourceCode) { - super(URI.create("string:///" + className.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE); - this.className = className; - this.sourceCode = sourceCode; - this.byteCode = new ByteArrayOutputStream(); - } - - @Override - public CharSequence getCharContent(boolean ignoreEncodingErrors) { - return sourceCode; - } - - @Override - public OutputStream openOutputStream() throws IOException { - return byteCode; - } - - public byte[] getByteCode() { - return byteCode.toByteArray(); - } - - public String getClassName() { - return className; - } - } - - private static class FileManagerWrapper extends ForwardingJavaFileManager { - private static final Location PATCH_LOCATION = new Location() { - @Override - public String getName() { - return "patch module location"; - } - - @Override - public boolean isOutputLocation() { - return false; - } - }; - private final MemoryJavaFileObject file; - private final String moduleOverride; - - public FileManagerWrapper(MemoryJavaFileObject file, String moduleOverride) { - super(getCompiler().getStandardFileManager(null, null, null)); - this.file = file; - this.moduleOverride = moduleOverride; - } - - @Override - public JavaFileObject getJavaFileForOutput(Location location, String className, - Kind kind, FileObject sibling) - throws IOException { - if (!file.getClassName().equals(className)) { - throw new IOException("Expected class with name " + file.getClassName() + - ", but got " + className); - } - return file; - } - - @Override - public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException { - if (fo == file && moduleOverride != null) { - return PATCH_LOCATION; - } - return super.getLocationForModule(location, fo); - } - - @Override - public String inferModuleName(Location location) throws IOException { - if (location == PATCH_LOCATION) { - return moduleOverride; - } - return super.inferModuleName(location); - } - - @Override - public boolean hasLocation(Location location) { - return super.hasLocation(location) || location == StandardLocation.PATCH_MODULE_PATH; - } - - } - - /** - * Compiles the class with the given name and source code. - * - * @param className The name of the class - * @param sourceCode The source code for the class with name {@code className} - * @param options additional command line options - * @throws RuntimeException if the compilation did not succeed - * @return The resulting byte code from the compilation - */ - public static byte[] compile(String className, CharSequence sourceCode, String... options) { - MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode); - CompilationTask task = getCompilationTask(file, options); - - if(!task.call()) { - throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode); - } - - return file.getByteCode(); - } - - private static JavaCompiler getCompiler() { - return ToolProvider.getSystemJavaCompiler(); - } - - private static CompilationTask getCompilationTask(MemoryJavaFileObject file, String... options) { - List opts = new ArrayList<>(); - String moduleOverride = null; - for (String opt : options) { - if (opt.startsWith("--patch-module=")) { - moduleOverride = opt.substring("--patch-module=".length()); - } else { - opts.add(opt); - } - } - return getCompiler().getTask(null, new FileManagerWrapper(file, moduleOverride), null, opts, null, Arrays.asList(file)); - } -} diff --git a/jdk/test/lib/jdk/test/lib/compiler/ModuleInfoMaker.java b/jdk/test/lib/jdk/test/lib/compiler/ModuleInfoMaker.java deleted file mode 100644 index f6438a678ca..00000000000 --- a/jdk/test/lib/jdk/test/lib/compiler/ModuleInfoMaker.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2016, 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.compiler; - -import java.io.BufferedWriter; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Stream; - -/** - * Utility class for creating test modules. - */ -public class ModuleInfoMaker { - private static final String MODULE_INFO_JAVA = "module-info.java"; - private static final Pattern MODULE_PATTERN = - Pattern.compile("module\\s+((?:\\w+\\.)*)"); - private static final Pattern PACKAGE_PATTERN = - Pattern.compile("package\\s+(((?:\\w+\\.)*)(?:\\w+))"); - private static final Pattern CLASS_PATTERN = - Pattern.compile("(?:public\\s+)?(?:class|enum|interface)\\s+(\\w+)"); - - private final Path dir; - - public ModuleInfoMaker(Path dir) { - this.dir = dir; - } - - /** - * Create java source files of the given module - */ - public void writeJavaFiles(String module, String moduleInfoJava, String... contents) - throws IOException - { - Path msrc = dir.resolve(module); - new JavaSource(moduleInfoJava).write(msrc); - for (String c : contents) { - new JavaSource(c).write(msrc); - } - } - - /** - * Compile the module to the given destination. - */ - public void compile(String module, Path dest, String... options) - throws IOException - { - Path msrc = dir.resolve(module); - String[] args = - Stream.concat(Arrays.stream(options), - Stream.of("--module-source-path", - dir.toString())).toArray(String[]::new); - if (!CompilerUtils.compile(msrc, dest, args)) { - throw new Error("Fail to compile " + module); - } - } - - static class JavaSource { - final String source; - JavaSource(String source) { - this.source = source; - } - - /** - * Writes the source code to a file in a specified directory. - * @param dir the directory - * @throws IOException if there is a problem writing the file - */ - public void write(Path dir) throws IOException { - Path file = dir.resolve(getJavaFileNameFromSource(source)); - Files.createDirectories(file.getParent()); - try (BufferedWriter out = Files.newBufferedWriter(file)) { - out.write(source.replace("\n", System.lineSeparator())); - } - } - - /** - * Extracts the Java file name from the class declaration. - * This method is intended for simple files and uses regular expressions, - * so comments matching the pattern can make the method fail. - */ - static String getJavaFileNameFromSource(String source) { - String packageName = null; - - Matcher matcher = MODULE_PATTERN.matcher(source); - if (matcher.find()) - return MODULE_INFO_JAVA; - - matcher = PACKAGE_PATTERN.matcher(source); - if (matcher.find()) - packageName = matcher.group(1).replace(".", "/"); - - matcher = CLASS_PATTERN.matcher(source); - if (matcher.find()) { - String className = matcher.group(1) + ".java"; - return (packageName == null) ? className : packageName + "/" + className; - } else if (packageName != null) { - return packageName + "/package-info.java"; - } else { - throw new Error("Could not extract the java class " + - "name from the provided source"); - } - } - } -} diff --git a/jdk/test/lib/jdk/test/lib/util/JarUtils.java b/jdk/test/lib/jdk/test/lib/util/JarUtils.java deleted file mode 100644 index bc752d96a91..00000000000 --- a/jdk/test/lib/jdk/test/lib/util/JarUtils.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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.util; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.InvalidPathException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.jar.JarOutputStream; -import java.util.jar.Manifest; - -/** - * Common library for various test jar file utility functions. - */ -public final class JarUtils { - - /** - * Create jar file with specified files. If a specified file does not exist, - * a new jar entry will be created with the file name itself as the content. - */ - public static void createJar(String dest, String... files) - throws IOException { - try (JarOutputStream jos = new JarOutputStream( - new FileOutputStream(dest), new Manifest())) { - for (String file : files) { - System.out.println(String.format("Adding %s to %s", - file, dest)); - - // add an archive entry, and write a file - jos.putNextEntry(new JarEntry(file)); - try (FileInputStream fis = new FileInputStream(file)) { - fis.transferTo(jos); - } catch (FileNotFoundException e) { - jos.write(file.getBytes()); - } - } - } - System.out.println(); - } - - /** - * Add or remove specified files to existing jar file. If a specified file - * to be updated or added does not exist, the jar entry will be created - * with the file name itself as the content. - * - * @param src the original jar file name - * @param dest the new jar file name - * @param files the files to update. The list is broken into 2 groups - * by a "-" string. The files before in the 1st group will - * be either updated or added. The files in the 2nd group - * will be removed. If no "-" exists, all files belong to - * the 1st group. - */ - public static void updateJar(String src, String dest, String... files) - throws IOException { - Map changes = new HashMap<>(); - boolean update = true; - for (String file : files) { - if (file.equals("-")) { - update = false; - } else if (update) { - try { - Path p = Paths.get(file); - if (Files.exists(p)) { - changes.put(file, p); - } else { - changes.put(file, file); - } - } catch (InvalidPathException e) { - // Fallback if file not a valid Path. - changes.put(file, file); - } - } else { - changes.put(file, Boolean.FALSE); - } - } - updateJar(src, dest, changes); - } - - /** - * Update content of a jar file. - * - * @param src the original jar file name - * @param dest the new jar file name - * @param changes a map of changes, key is jar entry name, value is content. - * Value can be Path, byte[] or String. If key exists in - * src but value is Boolean FALSE. The entry is removed. - * Existing entries in src not a key is unmodified. - * @throws IOException - */ - public static void updateJar(String src, String dest, - Map changes) - throws IOException { - - // What if input changes is immutable? - changes = new HashMap<>(changes); - - System.out.printf("Creating %s from %s...\n", dest, src); - try (JarOutputStream jos = new JarOutputStream( - new FileOutputStream(dest))) { - - try (JarFile srcJarFile = new JarFile(src)) { - Enumeration entries = srcJarFile.entries(); - while (entries.hasMoreElements()) { - JarEntry entry = entries.nextElement(); - String name = entry.getName(); - if (changes.containsKey(name)) { - System.out.println(String.format("- Update %s", name)); - updateEntry(jos, name, changes.get(name)); - changes.remove(name); - } else { - System.out.println(String.format("- Copy %s", name)); - jos.putNextEntry(entry); - srcJarFile.getInputStream(entry).transferTo(jos); - } - } - } - for (Map.Entry e : changes.entrySet()) { - System.out.println(String.format("- Add %s", e.getKey())); - updateEntry(jos, e.getKey(), e.getValue()); - } - } - System.out.println(); - } - - private static void updateEntry(JarOutputStream jos, String name, Object content) - throws IOException { - if (content instanceof Boolean) { - if (((Boolean) content).booleanValue()) { - throw new RuntimeException("Boolean value must be FALSE"); - } - } else { - jos.putNextEntry(new JarEntry(name)); - if (content instanceof Path) { - Files.newInputStream((Path) content).transferTo(jos); - } else if (content instanceof byte[]) { - jos.write((byte[]) content); - } else if (content instanceof String) { - jos.write(((String) content).getBytes()); - } else { - throw new RuntimeException("Unknown type " + content.getClass()); - } - } - } -} diff --git a/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java b/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java index 6cb50066b6d..dec0ff8872a 100644 --- a/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java +++ b/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -51,291 +51,325 @@ public class AmazonCA { public static void main(String[] args) throws Exception { ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = false; if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { pathValidator.enableCRLCheck(); } else { // OCSP check by default pathValidator.enableOCSPCheck(); - ocspEnabled = true; } - new AmazonCA_1().runTest(pathValidator, ocspEnabled); - new AmazonCA_2().runTest(pathValidator, ocspEnabled); - new AmazonCA_3().runTest(pathValidator, ocspEnabled); - new AmazonCA_4().runTest(pathValidator, ocspEnabled); + new AmazonCA_1().runTest(pathValidator); + new AmazonCA_2().runTest(pathValidator); + new AmazonCA_3().runTest(pathValidator); + new AmazonCA_4().runTest(pathValidator); } } class AmazonCA_1 { - // Owner: CN=Amazon, OU=Server CA 1A, O=Amazon, C=US + // Owner: CN=Amazon RSA 2048 M02, O=Amazon, C=US // Issuer: CN=Amazon Root CA 1, O=Amazon, C=US - // Serial number: 67f9457508c648c09ca652e71791830e72592 - // Valid from: Wed Oct 21 17:00:00 PDT 2015 until: Sat Oct 18 17:00:00 PDT 2025 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIERzCCAy+gAwIBAgITBn+UV1CMZIwJymUucXkYMOclkjANBgkqhkiG9w0BAQsF\n" + + // Serial number: 773124a4bcbd44ec7b53beaf194842d3a0fa1 + // Valid from: Tue Aug 23 15:25:30 PDT 2022 until: Fri Aug 23 15:25:30 PDT 2030 + private static final String INT_VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIEXjCCA0agAwIBAgITB3MSSkvL1E7HtTvq8ZSELToPoTANBgkqhkiG9w0BAQsF\n" + + "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + + "b24gUm9vdCBDQSAxMB4XDTIyMDgyMzIyMjUzMFoXDTMwMDgyMzIyMjUzMFowPDEL\n" + + "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEcMBoGA1UEAxMTQW1hem9uIFJT\n" + + "QSAyMDQ4IE0wMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALtDGMZa\n" + + "qHneKei1by6+pUPPLljTB143Si6VpEWPc6mSkFhZb/6qrkZyoHlQLbDYnI2D7hD0\n" + + "sdzEqfnuAjIsuXQLG3A8TvX6V3oFNBFVe8NlLJHvBseKY88saLwufxkZVwk74g4n\n" + + "WlNMXzla9Y5F3wwRHwMVH443xGz6UtGSZSqQ94eFx5X7Tlqt8whi8qCaKdZ5rNak\n" + + "+r9nUThOeClqFd4oXych//Rc7Y0eX1KNWHYSI1Nk31mYgiK3JvH063g+K9tHA63Z\n" + + "eTgKgndlh+WI+zv7i44HepRZjA1FYwYZ9Vv/9UkC5Yz8/yU65fgjaE+wVHM4e/Yy\n" + + "C2osrPWE7gJ+dXMCAwEAAaOCAVowggFWMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD\n" + + "VR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAdBgNV\n" + + "HQ4EFgQUwDFSzVpQw4J8dHHOy+mc+XrrguIwHwYDVR0jBBgwFoAUhBjMhTTsvAyU\n" + + "lC4IWZzHshBOCggwewYIKwYBBQUHAQEEbzBtMC8GCCsGAQUFBzABhiNodHRwOi8v\n" + + "b2NzcC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbTA6BggrBgEFBQcwAoYuaHR0cDov\n" + + "L2NydC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbS9yb290Y2ExLmNlcjA/BgNVHR8E\n" + + "ODA2MDSgMqAwhi5odHRwOi8vY3JsLnJvb3RjYTEuYW1hem9udHJ1c3QuY29tL3Jv\n" + + "b3RjYTEuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMA0GCSqGSIb3DQEBCwUAA4IB\n" + + "AQAtTi6Fs0Azfi+iwm7jrz+CSxHH+uHl7Law3MQSXVtR8RV53PtR6r/6gNpqlzdo\n" + + "Zq4FKbADi1v9Bun8RY8D51uedRfjsbeodizeBB8nXmeyD33Ep7VATj4ozcd31YFV\n" + + "fgRhvTSxNrrTlNpWkUk0m3BMPv8sg381HhA6uEYokE5q9uws/3YkKqRiEz3TsaWm\n" + + "JqIRZhMbgAfp7O7FUwFIb7UIspogZSKxPIWJpxiPo3TcBambbVtQOcNRWz5qCQdD\n" + + "slI2yayq0n2TXoHyNCLEH8rpsJRVILFsg0jc7BaFrMnF462+ajSehgj12IidNeRN\n" + + "4zl+EoNaWdpnWndvSpAEkq2P\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=Amazon RSA 2048 M01, O=Amazon, C=US + // Issuer: CN=Amazon Root CA 1, O=Amazon, C=US + // Serial number: 77312380b9d6688a33b1ed9bf9ccda68e0e0f + // Valid from: Tue Aug 23 15:21:28 PDT 2022 until: Fri Aug 23 15:21:28 PDT 2030 + private static final String INT_REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIEXjCCA0agAwIBAgITB3MSOAudZoijOx7Zv5zNpo4ODzANBgkqhkiG9w0BAQsF\n" + "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAxMB4XDTE1MTAyMjAwMDAwMFoXDTI1MTAxOTAwMDAwMFowRjEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEVMBMGA1UECxMMU2VydmVyIENB\n" + - "IDFBMQ8wDQYDVQQDEwZBbWF6b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + - "AoIBAQCeQM3XCsIZunv8bSJxOqkc/ed87uL76FDB7teBNThDRB+1J7aITuadbNfH\n" + - "5ZfZykrdZ1qQLKxP6DwHOmJr9u2b4IxjUX9qUMuq4B02ghD2g6yU3YivEosZ7fpo\n" + - "srD2TBN29JpgPGrOrpOE+ArZuIpBjdKFinemu6fTDD0NCeQlfyHXd1NOYyfYRLTa\n" + - "xlpDqr/2M41BgSkWQfSPHHyRWNQgWBiGsIQaS8TK0g8OWi1ov78+2K9DWT+AHgXW\n" + - "AanjZK91GfygPXJYSlAGxSiBAwH/KhAMifhaoFYAbH0Yuohmd85B45G2xVsop4TM\n" + - "Dsl007U7qnS7sdJ4jYGzEvva/a95AgMBAAGjggE5MIIBNTASBgNVHRMBAf8ECDAG\n" + - "AQH/AgEAMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUYtRCXoZwdWqQvMa40k1g\n" + - "wjS6UTowHwYDVR0jBBgwFoAUhBjMhTTsvAyUlC4IWZzH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iybcrswBy8OFsd34XOW3rjSUtsuafd9AWySa3h\n" + + "xRRrwszrzX/WWGm6wyB+f7C4\n" + "-----END CERTIFICATE-----"; - // Owner: CN=good.sca1a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 1A, O=Amazon, C=US - // Serial number: 703e4e4bbd78e2b6db5634f36c4ee944cb1a4 - // Valid from: Mon Jul 29 16:53:36 PDT 2019 until: Sat Aug 29 16:53:36 PDT 2020 + // Owner: CN=valid.rootca1.demo.amazontrust.com + // Issuer: CN=Amazon RSA 2048 M02, O=Amazon, C=US + // Serial number: 60c6e837b2e7586d8464eb34f4a85fe + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFEzCCA/ugAwIBAgITBwPk5LvXjitttWNPNsTulEyxpDANBgkqhkiG9w0BAQsF\n" + - "ADBGMQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2\n" + - "ZXIgQ0EgMUExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTA3MjkyMzUzMzZaFw0yMDA4\n" + - "MjkyMzUzMzZaMIHaMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwC\n" + - "AQITCERlbGF3YXJlMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEQMA4G\n" + - "A1UEBRMHNTg0Njc0MzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x\n" + - "EDAOBgNVBAcTB1NlYXR0bGUxHjAcBgNVBAoTFUFtYXpvbiBUcnVzdCBTZXJ2aWNl\n" + - "czEjMCEGA1UEAxMaZ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6hStafd9AK9gHiTCggBpj6KgnF\n" + - "UsGMDeX879jP675fH6SEk710QPDhIrfAzwE0pF/eUNsd7pLwne32zHX0ouCoAt4d\n" + - "KwBCZkKNUkdj4U+bpOJzvtcTP9JlzziLp9IFRjjQh3xKgfblx57CmRJbqH3fT5JJ\n" + - "IAIDVTz3ZUcqhPTFAnNsO1oNBEyrO5X9rwCiSy7aRijY/11R75mIIvyA9zyd9ss1\n" + - "kvrrER0GWMTDvC84FZD2vhkXgPTFrB1Dn9f3QgO5APT9GCFY5hdpqqPEXOSdRzQo\n" + - "h9j4OQAqtA==\n" + + "MIIGKDCCBRCgAwIBAgIQBgxug3sudYbYRk6zT0qF/jANBgkqhkiG9w0BAQsFADA8\n" + + "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + + "UlNBIDIwNDggTTAyMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLTEr\n" + + "MCkGA1UEAxMidmFsaWQucm9vdGNhMS5kZW1vLmFtYXpvbnRydXN0LmNvbTCCASIw\n" + + "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3hA+omhUcO8nYO8/+dkpbYz8WI\n" + + "1ms7Y7JA2pPFfp2N/aWcf6m5ORm1BkyGLOttjTu318Qpa9eahQ1Pi3RNe3BtqjD9\n" + + "jcHncpwAFMsXy1beZA7sZ7AA4vKltA3t6yrU5ruTLUGQwUndeIBBSTW5QpdT9I/p\n" + + "EM7d+Miwre63kofbJ1lVPAJvN/udMVqGWNF8V5qscklUUHoSKA3FWWsiCyIgnthg\n" + + "G3u6R1KH66Qionp0ho/ttvrBCI0C/bdrdH+wybFv8oFFvAW2U9xn2Azt47/2kHHm\n" + + "tTRjrgufhDbcz/MLR6hwBXAJuwVvJZmSqe7B4IILFexu6wjxZfyqVm2FMr8CAwEA\n" + + "AaOCAzMwggMvMB8GA1UdIwQYMBaAFMAxUs1aUMOCfHRxzsvpn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"gMa8b38oXouXUT66X2gOiJ0SoRyQAiEAjDMu2vEll5tRpUvU8cD4gR2xV4hqoDxx\n" + + "Q+QGW+PvJxcwDQYJKoZIhvcNAQELBQADggEBACtxC3LlQvULeI3lt7ZYFSWndEhm\n" + + "tNUotoeKSXJXdoIpqSr10bzMPX9SHvemgOUtzP3JNqWPHw1uW9YFyeDE6yWj/B13\n" + + "Xj1hv1cqYIwyaOZBerU/9PT5PaCn20AC9DHbc7iBv+zs+DYiqlAFJ1GVaprwLul4\n" + + "8wp3gnC3Hjb8NykydCo6vw0AJ2UzjpjiTyVZ93jITzLOiboOUa1gQGnojzWlYaet\n" + + "sXe+RDylBp/Wuj1ZS7v/etltzYm5GanPi4y/p7Ta3Uky6std/GM6XbPRdBEFboFR\n" + + "B2IP0divd9c74Q+tLgpsAz5yXm9LtYPMcEPC2YRN2PgBg67c5+A7eIOluuw=\n" + "-----END CERTIFICATE-----"; - // Owner: CN=revoked.sca1a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=PrivateOrganization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 1A, O=Amazon, C=US - // Serial number: 6f1d774ad5e7b6d251d217661782bbdb6f37d - // Valid from: Mon Jan 28 15:34:38 PST 2019 until: Thu Apr 28 16:34:38 PDT 2022 + // Owner: CN=revoked.rootca1.demo.amazontrust.com + // Issuer: CN=Amazon RSA 2048 M01, O=Amazon, C=US + // Serial number: e1023665b1268d788cc25bf69a9d05e + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIE2zCCA8OgAwIBAgITBvHXdK1ee20lHSF2YXgrvbbzfTANBgkqhkiG9w0BAQsF\n" + - "ADBGMQswCQYDVQQGEwJVUzEPMA0GA1UE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rE304GSuWX/79MU/e+SSlr0cNJ0kNNaAIhAPnz9HayL4txhkTEZiMs\n" + + "nttNnNqD17I0J17JLVOF4i/4AHYASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/\n" + + "qznYhHMAAAGIB72TmwAABAMARzBFAiEAgEqT7CYGQ/u36/3YcxBH78QfknI9kgcY\n" + + "sgJLkurUF6cCIFZZ/b803+ek6o+bmdV/uVx2UlskAyyolZ2okBAb6IscAHYA2ra/\n" + + "az+1tiKfm8K7XGvocJFxbLtRhIU0vaQ9MEjX+6sAAAGIB72TbQAABAMARzBFAiEA\n" + + "6z2RSoK263hvYF71rj1d0TpC70/6zagSRR4glHOT6IACICYvaMAnrCNSTSiZ20Wz\n" + + "Ju5roTippO3BWKhQYrTKZuu4MA0GCSqGSIb3DQEBCwUAA4IBAQB4S1JGulFpMIaP\n" + + "NtLUJmjWz8eexQdWLDVF+H8dd6xpZgpiYtig/Ynphzuk1IIF8DkT3CeK/9vrezgI\n" + + "igNjneN9B4eIuzi/rJzIKeUwpZ2k5D+36Ab4esseoc+TopmNerw8hidt2g818jER\n" + + "D71ppSMakeQFPGe/Hs2/cVa/G1DNVcU2XAut45yRZ/+xsZ0/mcBDVsG9P5uGCN5O\n" + + "7SAp4J959WnKDqgVuU9WowPE5IjmS9BAv2gjniFYdDV2yksyf7+8edHd1KfSVX06\n" + + "pLx6CuCVZGJFG4Q2Aa1YAh1Wvt9hqWeXXpNRO2/wChL5rhT4GajsrGepsk4bjxYX\n" + + "Wf2iZ8mX\n" + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // EE certificates don't have CRLDP extension - if (!ocspEnabled){ - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid - pathValidator.validate(new String[]{VALID, INT}, + pathValidator.validate(new String[]{VALID, INT_VALID}, ValidatePathWithParams.Status.GOOD, null, System.out); // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, + pathValidator.validate(new String[]{REVOKED, INT_REVOKED}, ValidatePathWithParams.Status.REVOKED, - "Mon Jan 28 15:35:56 PST 2019", System.out); + "Mon May 15 13:36:57 PDT 2023", System.out); } } class AmazonCA_2 { - // Owner: CN=Amazon, OU=Server CA 2A, O=Amazon, C=US + // Owner: CN=Amazon RSA 4096 M02, O=Amazon, C=US // Issuer: CN=Amazon Root CA 2, O=Amazon, C=US - // Serial number: 67f945755f187a91f8163f3e624620177ff38 - // Valid from: Wed Oct 21 17:00:00 PDT 2015 until: Sat Oct 18 17:00:00 PDT 2025 + // Serial number: 773125b0c34c3c940299a9f04a39e5a52ccd9 + // Valid from: Tue Aug 23 15:29:13 PDT 2022 until: Fri Aug 23 15:29:13 PDT 2030 private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGRzCCBC+gAwIBAgITBn+UV1Xxh6kfgWPz5iRiAXf/ODANBgkqhkiG9w0BAQwF\n" + + "MIIGXjCCBEagAwIBAgITB3MSWww0w8lAKZqfBKOeWlLM2TANBgkqhkiG9w0BAQwF\n" + "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAyMB4XDTE1MTAyMjAwMDAwMFoXDTI1MTAxOTAwMDAwMFowRjEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEVMBMGA1UECxMMU2VydmVyIENB\n" + - "IDJBMQ8wDQYDVQQDEwZBbWF6b24wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK\n" + - "AoICAQC0P8hSLewmrZ41CCPBQytZs5NBFMq5ztbnMf+kZUp9S25LPfjNW3zgC/6E\n" + - "qCTWNVMMHhq7ez9IQJk48qbfBTLlZkuKnUWbA9vowrDfcxUN0mRE4B/TJbveXyTf\n" + - "vE91iDlqDrERecE9D8sdjzURrtHTp27lZdR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L2NybC5yb290Y2EyLmFt\n" + + "YXpvbnRydXN0LmNvbS9yb290Y2EyLmNybDATBgNVHSAEDDAKMAgGBmeBDAECATAN\n" + + "BgkqhkiG9w0BAQwFAAOCAgEAl1GgKXOn0j1MWT1KJVSewQ28SGbie3UwZj1dMsjJ\n" + + "amCrQPn2ngSNbLm9+ulFiBDU8xKR9Zx3tZps55IUKWLUPkfMC+vkV7asDBqqzzE0\n" + + "F/MkekgPfOjx1V9S6Wfg3sSg+9KcluurXFElruqKfOm4cqmkV776X1G+AaaQ7mlU\n" + + "giCYi6NqRQSyhn8zrKkNnbO6QL5a9ICC47kiZYRAR/hRvZOt11QUK5tCMXJXo0iO\n" + + "4XKkMu+jdnehP1kh4xuZhYznIgKK6MJIITFI/Jj89U4SOPncyuS94sUuE2EqvvO/\n" + + "t81qeoey6wThz5iRbU/0CvDFnTMgebWGUZ2UZJ+az/rb3KYXGfVWasLIonkvYT7z\n" + + "vHOGNAA9oQ8TTgPOmPfSVyfpplKtO/aybWp5QSH2csIwuvw5dkmpkc42iD57XHob\n" + + "5LbMJg99z3vQBmod/ipmOpND95/BeA2mllBZgZ53S0nvDXDzbzR9Fd81PAz9Qruo\n" + + "dOJKcD6plKQjZjkLzNh1v/RoCFO8kiJGE4UBMTM8FUk0DXH4bALII4wwmDelrSUu\n" + + "lKvDTDxZvPF4dbEXICNPd51EMGPgETxwboOV+bzWFVI0IWQ8PhZ2VuMPDk2taOMp\n" + + "NsuLtlYc2twPb9r/Hvgv7G6+ItpBHZwOVt1oI3pHbjMp7P3pOZSPr6G1WkNy9mX8\n" + + "rVc=\n" + "-----END CERTIFICATE-----"; - // Owner: CN=good.sca2a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 2A, O=Amazon, C=US - // Serial number: 703e4e70616c90d611fd04a5ecc635665184e - // Valid from: Mon Jul 29 16:54:06 PDT 2019 until: Sat Aug 29 16:54:06 PDT 2020 + // Owner: CN=valid.rootca2.demo.amazontrust.com + // Issuer: CN=Amazon RSA 4096 M02, O=Amazon, C=US + // Serial number: 662f7646d76193cbb76946d111e49fa + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHEzCCBPugAwIBAgITBwPk5wYWyQ1hH9BKXsxjVmUYTjANBgkqhkiG9w0BAQwF\n" + - "ADBGMQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2\n" + - "ZXIgQ0EgMkExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTA3MjkyMzU0MDZaFw0yMDA4\n" + - "MjkyMzU0MDZaMIHaMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwC\n" + - "AQITCERlbGF3YXJlMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEQMA4G\n" + - "A1UEBRMHNTg0Njc0MzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x\n" + - "EDAOBgNVBAcTB1NlYXR0bGUxHjAcBgNVBAoTFUFtYXpvbiBUcnVzdCBTZXJ2aWNl\n" + - "czEjMCEGA1UEAxMaZ29vZC5zY2EyYS5hbWF6b250cnVzdC5jb20wggIiMA0GCSqG\n" + - "SIb3DQEBAQUAA4ICDwAwggIKAoICAQC+XjOB3ZCFX+b9y9reP+e6EAQz4ytiMSqU\n" + - "O4s5MyYLkY6n4BIZHmgWeQ2IgW1VrH8ho+Iu3UsTiuhd3/L/q/w+T0OJfcrWngTs\n" + - "uVcIuvUr32ObPeeWbg/m/lkN7hqH1jY62iybYVrFXiLo1+0G92PUazcyNvyA20+G\n" + - "HsvGG5jlArWNgRLdc8KUX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nvbxq7XKO9/FGUaUaU8Xlsd\n" + + "V6Fo8VmNwFc88VCqOp8eI/IicHxMDLl8TKXMvr3CYh8A9nCeFGcV+4CL+7JF2t5K\n" + + "YvV5r074Wyk0QMlRVYMNDl0t+VAEoDJ7RRE+kEvplWcsX9S2wvr4HhkA4iChpwFm\n" + + "2UDTppHskSWyLsuNQvipn0zTzZ8RIxXd/ei0qCdhKmkV7x9cgbTiyXgaI7iJEtdo\n" + + "RvYNcXc2RmitWjY5Av8yJGOk0eYpCwRrBv6ughbtJe3NMrqUeTyrKidIEo9KnRSA\n" + + "rMokRbHunkroS97VkoK/9j9pNJki+qAH9XTLYWcm/5+cTSGRsN+escRgZwV6KWg/\n" + + "JQQe5LbwU2HHzNqWuk63GC/ngVlWXjaVFfbNVmYEKZFFazcZchesN1YyDu+WndOx\n" + + "+rTcuke2feOvQ4EnVviM0k85JZNiqPDH2iafAWyqZFUYTnb7XK3HhJflAniv/SLq\n" + + "DQfbJmtQtNHdJYgVmC1u2RT9gbJDIAj0ZI4vU2WVB5Hmd9F31un6jundEuG4+S4=\n" + "-----END CERTIFICATE-----"; - // Owner: CN=revoked.sca2a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=PrivateOrganization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - //Issuer: CN=Amazon, OU=Server CA 2A, O=Amazon, C=US - //Serial number: 6f1d782c0aa2f4866b7b522c279b939b92369 - //Valid from: Mon Jan 28 15:37:45 PST 2019 until: Thu Apr 28 16:37:45 PDT 2022 + // Owner: CN=revoked.rootca2.demo.amazontrust.com + // Issuer: CN=Amazon RSA 4096 M02, O=Amazon, C=US + // Serial number: 788baa8f47bc5b1c624424216240fd3 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" +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1nkCBAIEggFtBIIBaQFnAHYA7s3QZNXbGs7FXLedtM0TojKH\n" + + "Rny87N7DUUhZRnEftZsAAAGIB72CzgAABAMARzBFAiEA2vPYIPfGJeynPaZHq/c0\n" + + "GGvyT6MpvFGMW0s0woLRT28CIEFbZbFSCnKugaqw9QDNi7vYmIF3Gyi3s6G2cCxY\n" + + "4RJXAHYASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/qznYhHMAAAGIB72DDgAA\n" + + "BAMARzBFAiAvfNcgtFEwk5C9dvMUYANbIAv0IOdF1new8Umn3cM+JwIhALbs/3L9\n" + + "0ndF7sRKDZmfronNruptFlrI528P5Qi2P528AHUA2ra/az+1tiKfm8K7XGvocJFx\n" + + "bLtRhIU0vaQ9MEjX+6sAAAGIB72CxQAABAMARjBEAiBKUns2FPbs0cThb6e7SnyL\n" + + "y4/qP3V1Q/ASt/ZDRTeEQQIgWSQO4Gsz32srtqYuTM9AsFd92WA44kJHincdcGVX\n" + + "XbIwDQYJKoZIhvcNAQEMBQADggIBAAnaNbn2wXylTCS7dtgB3rWdUf6hja1UDuvB\n" + + "uZEL2dUOvyXfVFLNxKdeWBPzqpwEBNNwPQXhoI97TXlyu2x60jLzQamoGoRQ3s0P\n" + + "NLhasLGEIQH/oYdMV/yp8EI8fUuRVE3xyw39FRqOrmsUFAnxNQmBO/09JM7sLcvS\n" + + "wwh14p9dFTTolJHgnL4ZEtmZxSddFG+GBSTJ/A7dVSmwIudwzd+goA6173BI6yeT\n" + + "hhQumLctQiOM7y1MzFeV8rL+oIpd2xuzyhKKT1EgvU6/wyt0Ib8QqsFsrXPnUOKk\n" + + "HAq3SeZyq35QUaTKoaH9L1iZMbSCG9Jm6FMb12SdAz53653tYvAiUS76oD8Jot13\n" + + "RZu5NUlWAVLLq0OaEtuGp0bh+cVtzVnCC9m1qa46YpY0SojpvSbakgQMMGIgDlT3\n" + + "wFE7tST4WlsDC1f/m+H9V5qz/j0U8D3eNNdowxPqx/JZq/sk9ZK5KyMFARrvM+fh\n" + + "YrVYjKt91mu7JaS4pPOyZmJ8OQ14EvrN7BXc7IkNrI1reeaRFe49k5DAETB8VmP5\n" + + "2F0SWou2KkgtJvU4Z7YjlZ2HNHnpjTK5KdPNpRSt7EUy2zn9NCNoyQhnws70FyXv\n" + + "oPFyG92lnUQOKaAUhVRwTr9fvnkdMOzSKg/spxi2Ogdzym5Jw68eguwi0dVqX2+9\n" + + "3zViP2aH\n" + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // EE certificates don't have CRLDP extension - if (!ocspEnabled){ - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid pathValidator.validate(new String[]{VALID, INT}, @@ -344,201 +378,228 @@ public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) t // Validate Revoked pathValidator.validate(new String[]{REVOKED, INT}, ValidatePathWithParams.Status.REVOKED, - "Mon Jan 28 15:38:57 PST 2019", System.out); + "Mon May 15 13:38:54 PDT 2023", System.out); } } class AmazonCA_3 { - // Owner: CN=Amazon, OU=Server CA 3A, O=Amazon, C=US + // Owner: CN=Amazon ECDSA 256 M02, O=Amazon, C=US // Issuer: CN=Amazon Root CA 3, O=Amazon, C=US - // Serial number: 67f945758fe55b9ee3f75831d47f07d226c8a - // Valid from: Wed Oct 21 17:00:00 PDT 2015 until: Sat Oct 18 17:00:00 PDT 2025 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIICuzCCAmGgAwIBAgITBn+UV1j+VbnuP3WDHUfwfSJsijAKBggqhkjOPQQDAjA5\n" + + // Serial number: 773126de2c2fafd2c47ad88b1566e0182046d + // Valid from: Tue Aug 23 15:33:24 PDT 2022 until: Fri Aug 23 15:33:24 PDT 2030 + private static final String INT_VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIC1DCCAnmgAwIBAgITB3MSbeLC+v0sR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+ + // Owner: CN=Amazon ECDSA 256 M01, O=Amazon, C=US + // Issuer: CN=Amazon Root CA 3, O=Amazon, C=US + // Serial number: 773126684d577c0fcf8d3a342bea86f94fc8f + // Valid from: Tue Aug 23 15:31:46 PDT 2022 until: Fri Aug 23 15:31:46 PDT 2030 + private static final String INT_REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIC0zCCAnmgAwIBAgITB3MSZoTVd8D8+NOjQr6ob5T8jzAKBggqhkjOPQQDAjA5\n" + "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSAzMB4XDTE1MTAyMjAwMDAwMFoXDTI1MTAxOTAwMDAwMFowRjELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEVMBMGA1UECxMMU2VydmVyIENBIDNB\n" + - "MQ8wDQYDVQQDEwZBbWF6b24wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATYcYsK\n" + - "mYdR0Gj8Xz45E/lfcTTnXhg2EtAIYBIHyXv/ZQyyyCas1aptX/I5T1coT6XK181g\n" + - "nB8hADuKfWlNoIYRo4IBOTCCATUwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8B\n" + - "Af8EBAMCAYYwHQYDVR0OBBYEFATc4JXl6LlrlKHvjFsxHhN+VZfaMB8GA1UdIwQY\n" + - "MBaAFKu229cGnjesMIYHkXDHnMQZsXjAMHsGCCsGAQUFBwEBBG8wbTAvBggrBgEF\n" + - "BQcwAYYjaHR0cDovL29jc3Aucm9vdGNhMy5hbWF6b250cnVzdC5jb20wOgYIKwYB\n" + - "BQUHMAKGLmh0dHA6Ly9jcnQucm9vdGNhMy5hbWF6b250cnVzdC5jb20vcm9vdGNh\n" + - "My5jZXIwPwYDVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NybC5yb290Y2EzLmFtYXpv\n" + - "bnRydXN0LmNvbS9yb290Y2EzLmNybDARBgNVHS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n" + + "EH3Ty27f1Q==\n" + "-----END CERTIFICATE-----"; - // Owner: CN=good.sca3a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 3A, O=Amazon, C=US - // Serial number: 703e4e9bbc2605f37967a0e95f31f4789a677 - // Valid from: Mon Jul 29 16:54:43 PDT 2019 until: Sat Aug 29 16:54:43 PDT 2020 + // Owner: CN=valid.rootca3.demo.amazontrust.com + // Issuer: CN=Amazon ECDSA 256 M02, O=Amazon, C=US + // Serial number: 8e2f14864fb28e4a1da0f15a5118cc8 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIDhzCCAy2gAwIBAgITBwPk6bvCYF83lnoOlfMfR4mmdzAKBggqhkjOPQQDAjBG\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\n" + - "Q0EgM0ExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTA3MjkyMzU0NDNaFw0yMDA4Mjky\n" + - "MzU0NDNaMIHaMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQIT\n" + - "CERlbGF3YXJlMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEQMA4GA1UE\n" + - "BRMHNTg0Njc0MzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAO\n" + - "BgNVBAcTB1NlYXR0bGUxHjAcBgNVBAoTFUFtYXpvbiBUcnVzdCBTZXJ2aWNlczEj\n" + - "MCEGA1UEAxMaZ29vZC5zY2EzYS5hbWF6b250cnVzdC5jb20wWTATBgcqhkjOPQIB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ZLiS9XSSMxpQNhUerqC/YFoAdQDatr9rP7W2\n" + + "Ip+bwrtca+hwkXFsu1GEhTS9pD0wSNf7qwAAAYgHvXKvAAAEAwBGMEQCIFLskZDs\n" + + "UG4+/88D/5/QbD9zT6ZmZlwXiPZ6H2YR/KiJAiBvi4vvNsb9KNAhJMgI2T2iCg9U\n" + + "CIru+US6y3ua7dKKDTAKBggqhkjOPQQDAgNHADBEAiAzvgzKV/kvBbKWCT1NNUBD\n" + + "AF9okIEcJx/ukFgzmYMwUQIgXeJeVf3izkxsgiEUSknwHsErLFs/cEme2PSRj2AW\n" + + "dYA=\n" + "-----END CERTIFICATE-----"; - // Owner: CN=revoked.sca3a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=PrivateOrganization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 3A, O=Amazon, C=US - // Serial number: 6f1d78cf0ca64ce7f551a6f2a0715cc0e8b50 - // Valid from: Mon Jan 28 15:40:01 PST 2019 until: Thu Apr 28 16:40:01 PDT 2022 + // Owner: CN=revoked.rootca3.demo.amazontrust.com + // Issuer: CN=Amazon ECDSA 256 M01, O=Amazon, C=US + // Serial number: c458bfaeedae16a5e61fe64773fc898 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIDTzCCAvWgAwIBAgITBvHXjPDKZM5/VRpvKgcVzA6LUDAKBggqhkjOPQQDAjBG\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\n" + - "Q0EgM0ExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTAxMjgyMzQwMDFaFw0yMjA0Mjgy\n" + - "MzQwMDFaMIHcMRMwEQYLKwYB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RQIgZVFAX5WPZRBpEOqk620v4Rbzxh/3wrJ5QBMBJ0Mb8B0CIQC0oxFVLfs+PAv7\n" + + "25wawOu2VgDXG9lJAJtCwk3gN8BshQB2AEiw42vapkc0D+VqAvqdMOscUgHLVt0s\n" + + "gdm7v6s52IRzAAABiAe9lQ4AAAQDAEcwRQIhAIPVMj6IfjAUKeGYbpG9s0DRdWbc\n" + + "b8OzsOf+kRqk03NMAiB777hfoFCUMPrN0g8o5v6zp3T3qOhRnYY0TZN4q4NnMgB1\n" + + "ANq2v2s/tbYin5vCu1xr6HCRcWy7UYSFNL2kPTBI1/urAAABiAe9lN4AAAQDAEYw\n" + + "RAIgL0qoVbKLFD+Y3f/V6Rw+euZrPO6d1HEVPQGo7wLzkl8CIGHp3PQmmrEofl76\n" + + "4da7bY0L+csFW0sB8clN0KziMfe6MAoGCCqGSM49BAMCA0gAMEUCIQC+6VdX9X5g\n" + + "x3NSUmJ7py01Zxf26TNBv1ildxqesvZ/7wIgIrefriRzPiIFDHCUbdjk0VlmMwZR\n" + + "VzXXHINsGCiCKOs=\n" + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // EE certificates don't have CRLDP extension - if (!ocspEnabled){ - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid - pathValidator.validate(new String[]{VALID, INT}, + pathValidator.validate(new String[]{VALID, INT_VALID}, ValidatePathWithParams.Status.GOOD, null, System.out); // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, + pathValidator.validate(new String[]{REVOKED, INT_REVOKED}, ValidatePathWithParams.Status.REVOKED, - "Mon Jan 28 15:40:35 PST 2019", System.out); + "Mon May 15 13:41:22 PDT 2023", System.out); } } class AmazonCA_4 { - // Owner: CN=Amazon, OU=Server CA 4A, O=Amazon, C=US + // Owner: CN=Amazon ECDSA 384 M02, O=Amazon, C=US // Issuer: CN=Amazon Root CA 4, O=Amazon, C=US - // Serial number: 67f94575a8862a9072e3239c37ceba1274e18 - // Valid from: Wed Oct 21 17:00:00 PDT 2015 until: Sat Oct 18 17:00:00 PDT 2025 + // Serial number: 773127dfaa6b9e2b95538aa76dde4307f17c4 + // Valid from: Tue Aug 23 15:36:58 PDT 2022 until: Fri Aug 23 15:36:58 PDT 2030 private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIC+TCCAn6gAwIBAgITBn+UV1qIYqkHLjI5w3zroSdOGDAKBggqhkjOPQQDAzA5\n" + + "MIIDETCCApagAwIBAgITB3MSffqmueK5VTiqdt3kMH8XxDAKBggqhkjOPQQDAzA5\n" + "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSA0MB4XDTE1MTAyMjAwMDAwMFoXDTI1MTAxOTAwMDAwMFowRjELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEVMBMGA1UECxMMU2VydmVyIENBIDRB\n" + - "MQ8wDQYDVQQDEwZBbWF6b24wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASRP0kIW0Ha\n" + - "7+ORvEVhIS5gIgkH66X5W9vBRTX14oG/1elIyI6LbFZ+E5KAufL0XoWJGI1WbPRm\n" + - "HW246FKSzF0wOEZZyxEROz6tuaVsnXRHRE76roS/Wr064uJpKH+Lv+SjggE5MIIB\n" + - "NTASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQU\n" + - "pSHN2+tTIZmqytlnQpQlsnv0wuMwHwYDVR0jBBgwFoAU0+zHOmVuzOHadppW+5zz\n" + - "hm1X5YEwewYIKwYBBQUHAQEEbzBtMC8GCCsGAQUFBzABhiNodHRwOi8vb2NzcC5y\n" + - "b290Y2E0LmFtYXpvbnRydXN0LmNvbTA6BggrBgEFBQcwAoYuaHR0cDovL2NydC5y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ZXIwPwYDVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NybC5yb290Y2E0LmFt\n" + + "YXpvbnRydXN0LmNvbS9yb290Y2E0LmNybDATBgNVHSAEDDAKMAgGBmeBDAECATAK\n" + + "BggqhkjOPQQDAwNpADBmAjEA2zCG6x0xMlgSXWEGLN8+1XN+OCYF5vj0Z1jtVy+A\n" + + "pdLlzuxNt9HBWn3hvqvO2W8KAjEApNdsZOCmk5uZBYiuCSBnDH3jyKhN6dWyuuHW\n" + + "9Wj7SxKnOU5+wYWZA0BQAv1KT62i\n" + "-----END CERTIFICATE-----"; - // Owner: CN=good.sca4a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 4A, O=Amazon, C=US - // Serial number: 703e4ec57c72d5669efbc98875c3f6bc3f934 - // Valid from: Mon Jul 29 16:55:17 PDT 2019 until: Sat Aug 29 16:55:17 PDT 2020 + // Owner: CN=valid.rootca4.demo.amazontrust.com + // Issuer: CN=Amazon ECDSA 384 M02, O=Amazon, C=US + // Serial number: f579bed3369f1a147ea5d0e8e6532d3 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIDxTCCA0qgAwIBAgITBwPk7FfHLVZp77yYh1w/a8P5NDAKBggqhkjOPQQDAzBG\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\n" + - "Q0EgNEExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTA3MjkyMzU1MTdaFw0yMDA4Mjky\n" + - "MzU1MTdaMIHaMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQI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TNt\n" + + "MDIuYW1hem9udHJ1c3QuY29tL2UzbTAyLmNlcjAMBgNVHRMBAf8EAjAAMIIBfgYK\n" + + "KwYBBAHWeQIEAgSCAW4EggFqAWgAdgDuzdBk1dsazsVct520zROiModGfLzs3sNR\n" + + "SFlGcR+1mwAAAYgHvZA9AAAEAwBHMEUCIQCmzmQOzunsuAg1GpIcNx0isG6ylbhP\n" + + "y9JP4UFclL2hdwIgBtTM89mE7QJDj7h7xr2eRPio1ehgmeYH1PHXxCqHIGYAdgBI\n" + + "sONr2qZHNA/lagL6nTDrHFIBy1bdLIHZu7+rOdiEcwAAAYgHvZB1AAAEAwBHMEUC\n" + + "IF9hbi82CLU5umfRze4NpX6u4jlT+N8KSaBe6UbhqjBZAiEAi2Y6PTt2+107LxtM\n" + + "oBpHprph7hQvGfjPE+p+rfM/X+EAdgDatr9rP7W2Ip+bwrtca+hwkXFsu1GEhTS9\n" + + "pD0wSNf7qwAAAYgHvZBeAAAEAwBHMEUCIAI+m4mVE3HtZOEMC5VI7m0nEPdPPJUq\n" + + "fxUKPpeIVmk5AiEA0scVJy7g3Fv+2nTVhbcwWCwn/Gvc+0txQrc529juflcwCgYI\n" + + "KoZIzj0EAwMDaAAwZQIxAKV837BpqlNHg35EsCCtrJPoQ6RuY9UoHm1O2CdsCXGR\n" + + "Z3kAnlgIV8A/waI6wQqfsQIwdCqaC+qN60JCnX09YKRD15eQjq1rN3w+llI+lEbS\n" + + "FSMsnoHJcqMZLo9s+4Rf0zS3\n" + "-----END CERTIFICATE-----"; - // Owner: CN=revoked.sca4a.amazontrust.com, O=Amazon Trust Services, L=Seattle, ST=Washington, C=US, \ - // SERIALNUMBER=5846743, OID.2.5.4.15=PrivateOrganization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, \ - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=Amazon, OU=Server CA 4A, O=Amazon, C=US - // Serial number: 6f1d79295c384a699d51c2d756bd46213b5b3 - // Valid from: Mon Jan 28 15:41:16 PST 2019 until: Thu Apr 28 16:41:16 PDT 2022 + // Owner: CN=revoked.rootca4.demo.amazontrust.com + // Issuer: CN=Amazon ECDSA 384 M02, O=Amazon, C=US + // Serial number: 4a5d392936b4decb818b7fb106ebbd8 + // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIDjTCCAxKgAwIBAgITBvHXkpXDhKaZ1RwtdWvUYhO1szAKBggqhkjOPQQDAzBG\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg\n" + - "Q0EgNEExDzANBgNVBAMTBkFtYXpvbjAeFw0xOTAxMjgyMzQxMTZaFw0yMjA0Mjgy\n" + - "MzQxMTZaMIHcMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQIT\n" + - "CERlbGF3YXJlMRwwGgYDVQQPExNQcml2YXRlT3JnYW5pemF0aW9uMRAwDgYDVQQF\n" + - "Ewc1ODQ2NzQzMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G\n" + - "A1UEBxMHU2VhdHRsZTEeMBwGA1UEChMVQW1hem9uIFRydXN0IFNlcnZpY2VzMSYw\n" + - "JAYDVQQDEx1yZXZva2VkLnNjYTRhLmFtYXpvbnRydXN0LmNvbTB2MBAGByqGSM49\n" + - "AgEGBSuBBAAiA2IABLuNpZTcNU3FElNP3Y/OeXIZcIMXkFTBi/n92fNwHfqUbEhH\n" + - "H+PovJ26eAGvb5a8bGc275MBFcVnWL0rCVgM+j9KAtBDCRJX3f7mo0D2VKcmtZKu\n" + - "jPxwGPy2kuqM505dGqOCASkwggElMA4GA1UdDwEB/wQEAwIHgDAdBgNVHQ4EFgQU\n" + - "zUFIhn+hphzCKA2qgAdLztSBzJgwHwYDVR0jBBgwFoAUpSHN2+tTIZmqytlnQp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NoADBlAjEA1PLdsrko3tDs50aAeEU9Gn+0CG8QKy7R\n" + + "fQaXBTjGETDgGJk/7zGNpGelKPr/UYV9AjASwdA32S8jIADxA8HrqiMsVYDFMnbU\n" + + "jLLwR6CTLtAcWtwVmoQ2x0usvTvN8YJBPoA=\n" + "-----END CERTIFICATE-----"; - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // EE certificates don't have CRLDP extension - if (!ocspEnabled){ - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } + public void runTest(ValidatePathWithParams pathValidator) throws Exception { // Validate valid pathValidator.validate(new String[]{VALID, INT}, @@ -547,6 +608,6 @@ public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) t // Validate Revoked pathValidator.validate(new String[]{REVOKED, INT}, ValidatePathWithParams.Status.REVOKED, - "Mon Jan 28 15:41:53 PST 2019", System.out); + "Mon May 15 13:42:48 PDT 2023", System.out); } } diff --git a/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java b/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java new file mode 100644 index 00000000000..30ad81b1755 --- /dev/null +++ b/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java @@ -0,0 +1,303 @@ +/* + * 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 + * @bug 8318759 + * @summary Interoperability tests with Digicert CS Root G5 certificates + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=ocsp,certpath DigicertCSRootG5 OCSP + * @run main/othervm -Djava.security.debug=certpath DigicertCSRootG5 CRL + */ + +public class DigicertCSRootG5 { + + public static void main(String[] args) throws Exception { + + ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); + + if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { + pathValidator.enableCRLCheck(); + } else { + // OCSP check by default + pathValidator.enableOCSPCheck(); + } + + new Digicert_CS_ECC().runTest(pathValidator); + new Digicert_CS_RSA().runTest(pathValidator); + } +} + +class Digicert_CS_ECC { + + // Owner: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Issuer: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US + // Serial number: d926818addd3c47758f0ace9379b2e7 + // Valid from: Wed Feb 10 16:00:00 PST 2021 until: Sun Feb 10 15:59:59 PST 2036 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIDOTCCAsCgAwIBAgIQDZJoGK3dPEd1jwrOk3my5zAKBggqhkjOPQQDAzBNMQsw\n" + + "CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMTHERp\n" + + "Z2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwHhcNMjEwMjExMDAwMDAwWhcNMzYw\n" + + "MjEwMjM1OTU5WjBTMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIElu\n" + + "Yy4xKzApBgNVBAMTIkRpZ2lDZXJ0IEc1IENTIEVDQyBTSEEzODQgMjAyMSBDQTEw\n" + + "djAQBgcqhkjOPQIBBgUrgQQAIgNiAAS/zvKH4sLLu/zze3/+vHyfRE5OcO77TNw3\n" + + "MCMAlad2Y/ja50KTooGSmXhfwMXpbBTob7hsoxpvIU92W6DhFn9lg4pcKf5UHLEi\n" + + "0iDdHQ9w0hpFJiMABwK60nk+OwsGTZSjggFdMIIBWTASBgNVHRMBAf8ECDAGAQH/\n" + + "AgEAMB0GA1UdDgQWBBTXHcf6xvqCdCBFcTQSL1XVmEGSXjAfBgNVHSMEGDAWgBTw\n" + + "jJhxOThlwjobphdmHcjtZd6SNjAOBgNVHQ8BAf8EBAMCAYYwEwYDVR0lBAwwCgYI\n" + + "KwYBBQUHAwMweQYIKwYBBQUHAQEEbTBrMCQGCCsGAQUFBzABhhhodHRwOi8vb2Nz\n" + + "cC5kaWdpY2VydC5jb20wQwYIKwYBBQUHMAKGN2h0dHA6Ly9jYWNlcnRzLmRpZ2lj\n" + + "ZXJ0LmNvbS9EaWdpQ2VydENTRUNDUDM4NFJvb3RHNS5jcnQwRQYDVR0fBD4wPDA6\n" + + "oDigNoY0aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0Q1NFQ0NQMzg0\n" + + "Um9vdEc1LmNybDAcBgNVHSAEFTATMAcGBWeBDAEDMAgGBmeBDAEEATAKBggqhkjO\n" + + "PQQDAwNnADBkAjByCWijRCnJogZf94U5HG/5S4QFMxEOBSAyxECbFxgrXMKXh5qa\n" + + "7oS2F+hT2DPzxTwCMCIthK0X/14bxZvrNNiNSWzer2TDUyRw6HNIfnkHgqaGFQVA\n" + + "KyS5I77prv53stK0XQ==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN="Win The Customer, LLC", O="Win The Customer, LLC", L=Saratoga + // Springs, ST=Utah, C=US, SERIALNUMBER=9637546-0160, OID.2.5.4.15=Private + // Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Utah, OID.1.3.6.1.4.1.311.60.2.1.3=US + // Issuer: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: b13737c3caf58eecb4359f441522133 + // Valid from: Wed Jan 25 16:00:00 PST 2023 until: Tue Jan 28 15:59:59 PST 2025 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIEEjCCA5mgAwIBAgIQCxNzfDyvWO7LQ1n0QVIhMzAKBggqhkjOPQQDAzBTMQsw\n" + + "CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xKzApBgNVBAMTIkRp\n" + + "Z2lDZXJ0IEc1IENTIEVDQyBTSEEzODQgMjAyMSBDQTEwHhcNMjMwMTI2MDAwMDAw\n" + + "WhcNMjUwMTI4MjM1OTU5WjCB2TETMBEGCysGAQQBgjc8AgEDEwJVUzEVMBMGCysG\n" + + "AQQBgjc8AgECEwRVdGFoMR0wGwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjEV\n" + + "MBMGA1UEBRMMOTYzNzU0Ni0wMTYwMQswCQYDVQQGEwJVUzENMAsGA1UECBMEVXRh\n" + + "aDEZMBcGA1UEBxMQU2FyYXRvZ2EgU3ByaW5nczEeMBwGA1UEChMVV2luIFRoZSBD\n" + + "dXN0b21lciwgTExDMR4wHAYDVQQDExVXaW4gVGhlIEN1c3RvbWVyLCBMTEMwWTAT\n" + + "BgcqhkjOPQIBBggqhkjOPQMBBwNCAASyShgaH44RcHazlEEMpwRKY4YebnygI9hG\n" + + "wTMQE/VFG40k3tR8lnyjgxTzZbC0aCVavdv1eglDGejQ+6iD8nzgo4IBxjCCAcIw\n" + + "HwYDVR0jBBgwFoAU1x3H+sb6gnQgRXE0Ei9V1ZhBkl4wHQYDVR0OBBYEFLGgEWb9\n" + + "GF89JoXyan/FD/auNIVVMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUEDDAKBggrBgEF\n" + + "BQcDAzCBjQYDVR0fBIGFMIGCMD+gPaA7hjlodHRwOi8vY3JsMy5kaWdpY2VydC5j\n" + + "b20vRGlnaUNlcnRHNUNTRUNDU0hBMzg0MjAyMUNBMS5jcmwwP6A9oDuGOWh0dHA6\n" + + "Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEc1Q1NFQ0NTSEEzODQyMDIxQ0Ex\n" + + "LmNybDA9BgNVHSAENjA0MDIGBWeBDAEDMCkwJwYIKwYBBQUHAgEWG2h0dHA6Ly93\n" + + "d3cuZGlnaWNlcnQuY29tL0NQUzB+BggrBgEFBQcBAQRyMHAwJAYIKwYBBQUHMAGG\n" + + "GGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBIBggrBgEFBQcwAoY8aHR0cDovL2Nh\n" + + "Y2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0RzVDU0VDQ1NIQTM4NDIwMjFDQTEu\n" + + "Y3J0MAwGA1UdEwEB/wQCMAAwCgYIKoZIzj0EAwMDZwAwZAIwLkWJc/eLxftorFCv\n" + + "ocOA1dfUFx7Al18d5Xsgpkx47kj2DWgQU+/bQEbbyPrKzYgCAjAP5ErLauJRC2to\n" + + "pPk/yXZYXsusmWVH7ozl9O5WR7+a3gVQ1zwVFWuqdjbq3zWWqJM=\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=Win the Customer LLC, O=Win the Customer LLC, L=Saratoga Springs, ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: 201e51cb1ec8a56a1e8438c95adf024 + // Valid from: Sun Oct 22 17:00:00 PDT 2023 until: Tue Oct 22 16:59:59 PDT 2024 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIFdjCCBP2gAwIBAgIQAgHlHLHsilah6EOMla3wJDAKBggqhkjOPQQDAzBTMQsw\n" + + "CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xKzApBgNVBAMTIkRp\n" + + "Z2lDZXJ0IEc1IENTIEVDQyBTSEEzODQgMjAyMSBDQTEwHhcNMjMxMDIzMDAwMDAw\n" + + "WhcNMjQxMDIyMjM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wO6N9Rn2TA+BgNVHSAENzA1\n" + + "MDMGBmeBDAEEATApMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2ljZXJ0LmNv\n" + + "bS9DUFMwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMIGNBgNV\n" + + "HR8EgYUwgYIwP6A9oDuGOWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2Vy\n" + + "dEc1Q1NFQ0NTSEEzODQyMDIxQ0ExLmNybDA/oD2gO4Y5aHR0cDovL2NybDQuZGln\n" + + "aWNlcnQuY29tL0RpZ2lDZXJ0RzVDU0VDQ1NIQTM4NDIwMjFDQTEuY3JsMH4GCCsG\n" + + "AQUFBwEBBHIwcDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29t\n" + + "MEgGCCsGAQUFBzAChjxodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNl\n" + + "cnRHNUNTRUNDU0hBMzg0MjAyMUNBMS5jcnQwCQYDVR0TBAIwADAKBggqhkjOPQQD\n" + + "AwNnADBkAjA9aX3CSzCOZiHdC6JBF0nQwPLGNipPdHFMSbINmfpuHCC3Go4prf8M\n" + + "WCsWEQr2gQYCMErfcrU8zfxnQ9SxsmGJ8jkM3MDGvAr0CtzDwmWis32V60jAUFBQ\n" + + "lGm/Mdb5/EqKpw==\n" + + "-----END CERTIFICATE-----"; + + public void runTest(ValidatePathWithParams pathValidator) throws Exception { + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Mon Oct 23 14:48:38 PDT 2023", System.out); + } +} + +class Digicert_CS_RSA { + + // Owner: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Issuer: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US + // Serial number: 10262e16224ca6dfef584f8c63048db + // Valid from: Wed Feb 10 16:00:00 PST 2021 until: Sun Feb 10 15:59:59 PST 2036 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGjDCCBHSgAwIBAgIQAQJi4WIkym3+9YT4xjBI2zANBgkqhkiG9w0BAQwFADBM\n" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJDAiBgNVBAMT\n" + + "G0RpZ2lDZXJ0IENTIFJTQTQwOTYgUm9vdCBHNTAeFw0yMTAyMTEwMDAwMDBaFw0z\n" + + "NjAyMTAyMzU5NTlaMFcxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwg\n" + + "SW5jLjEvMC0GA1UEAxMmRGlnaUNlcnQgRzUgQ1MgUlNBNDA5NiBTSEEzODQgMjAy\n" + + "MSBDQTEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC1GOMV0tdTLLBk\n" + + "Ylmccgb6bFa9By5zkuLg9NfFMl4y9P9f21C7N+mMA4fWgfjEs+7/3ByGLaB+7/Pi\n" + + "TT3qXpvBz4uVWob9xv3lkAsIpwh/TMJulijy3GdpAQBMdvW/+HFrbRJGaJ3MM9d1\n" + + "pC3CRPmFWyXUpxqhb0FbMPA8OlsZNjg9fd/zCLevSJlL6ZdjfZ/4FiF26OfO60V6\n" + + "bOuTnd8JbDuwPfMWLP6qEinlFr7V9mjcZc4dfUWH70y7M6av7R1Tc68YQjrtPwIA\n" + + "5pdEcG/VeBVplpne1uxuc61ucVgTpjwOTV6E2KrCe+OCG8/m4voN7T4GC1RfPH3n\n" + + "PlCNV6MeiCVwExPhJFxZ+eTvhVJe0W7mriYpEo2kNR4pnSUhiS92vF4lI3ToAdnH\n" + + "LV+yx0VdsPVwEO344rsVNQvP/hrCHefKm3HsirlazTKpiI9OgZlkXohHanp8IgMx\n" + + "2HvBE/6HcCq/5P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7V7m0sBrBYhpdM0pmxlqn6mpvWIHA2tC4rsTY2TXn\n" + + "ZlXbyJaMd5mvjRjvK0DF/2yoKC+us/1li2blLZKS9k0Z36/m4D7z5nVXkmUvRvE2\n" + + "70BhJ0NnM5lHtytTR+OgiaPapeiDy6AA+VbdnV7hhINGEhP7tF3IZPPfmKZN7/bN\n" + + "Qr7wuKZx/jO5sTBtblBaOU2+xric+MlTt2k3ilDnO3EzkZOp1JMWnNjAZciRa8Gy\n" + + "bYAXrsxY4vQnxgA7dj1/3KDB+pCRT7CTMOJJQu27OOv0MuNkb1E+8chPx/eFwfrN\n" + + "rft1Eiqp3Te0w4njDkzukP6EMhebcTp3POm0YhMZl8s1fTI6DCcHFwcMVywXiWwv\n" + + "QG+Td+dHlFT0P8jq/ecaMj6s8j69q36MER+QMyrxGAl3MHyEA7BBut1WCh9dsOnY\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN="Win The Customer, LLC", O="Win The Customer, LLC", L=Saratoga + // Springs, ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: bfec2fd49eeacb347ddbea5c1576083 + // Valid from: Fri Jun 23 17:00:00 PDT 2023 until: Wed Jun 26 16:59:59 PDT 2024 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIGqzCCBJOgAwIBAgIQC/7C/UnurLNH3b6lwVdggzANBgkqhkiG9w0BAQsFADBX" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xLzAtBgNVBAMT" + + "JkRpZ2lDZXJ0IEc1IENTIFJTQTQwOTYgU0hBMzg0IDIwMjEgQ0ExMB4XDTIzMDYy" + + "NDAwMDAwMFoXDTI0MDYyNjIzNTk1OVowdzELMAkGA1UEBhMCVVMxDTALBgNVBAgT" + + "BFV0YWgxGTAXBgNVBAcTEFNhcmF0b2dhIFNwcmluZ3MxHjAcBgNVBAoTFVdpbiBU" + + "aGU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N=Win the Customer LLC, O=Win the Customer LLC, L=Saratoga Springs, + // ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: f409d101094769abaf06f085f11ca4f + // Valid from: Sun Oct 22 17:00:00 PDT 2023 until: Tue Oct 22 16:59:59 PDT 2024 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIHKTCCBRGgAwIBAgIQD0CdEBCUdpq68G8IXxHKTzANBgkqhkiG9w0BAQsFADBX\n" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xLzAtBgNVBAMT\n" + + "JkRpZ2lDZXJ0IEc1IENTIFJTQTQwOTYgU0hBMzg0IDIwMjEgQ0ExMB4XDTIzMTAy\n" + + "MzAwMDAwMFoXDTI0MTAyMjIzNTk1OVowdTELMAkGA1UEBhMCVVMxDTALBgNVBAgT\n" + + "BFV0YWgxGTAXBgNVBAcTEFNhcmF0b2dhIFNwcmluZ3MxHTAbBgNVBAoTFFdpbiB0\n" + + "aGUgQ3VzdG9tZXIgTExDMR0wGwYDVQQDExRXaW4gdGhlIEN1c3RvbWVyIExMQzCC\n" + + "AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANKPhVjUn2MyZs/l4AO0kQCE\n" + + "HdR9aWJ86nT8jSSbHdRv56n3h5P3sxMfFne4jCY3DzrykndeLp4gAt2sot1ziinh\n" + + "ahMOYOZtvyUzt5/McvQyuQjdXLaSuWcvlKaTl67U3QWQe+P6kmkRDsrCH0S51UeH\n" + + "8Tct/bq7ZUyX9Jb80VPVegUN80YzDgkJ2OrLngD6EKVYKQlV5K+KGyQpCOWq5CEB\n" + + "1aX63EnGiSMy0OOsS/J8aFz3BoYpEcrLSSnW84P6AhbevMfO7kr4mTLZKkx0Ic0Q\n" + + "s6TuaXcf84OuF2T/HwM0qzP7iQhE18TJmsyumVZID7t1+Br43037pb3CXcWTTJvO\n" + + "+zT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MEAjAAMA0GCSqGSIb3DQEBCwUAA4ICAQAKCH6ri6f507/j2ifF7VQbavWE\n" + + "Wn4T63PzJveL6/kedV7avhrQ/B6uHrez1xy/RH/MlL/B+TF6YTg+ILqtKR/PyJrg\n" + + "N+1RON0Eg3AEWWDtGl3KBYFlklz8Szo+xmXf5GYiqueejbxscH1BA0PU/5CgGkr6\n" + + "1Kk4OXqKqmpuPeQCxca1ARDD749E/2IFsDGC8kBCWepV62l0/xcDKWD5Zn+y4Tkh\n" + + "5+YJJ21D746sNDOsDNJ4DuqEYrXWUH6BlT5EDYelGqRCOdyTYUdDg+QcSFWnH7wR\n" + + "O+eIA3BLSw0x1Vh6DJRKm5H644sPVppaI1jVZDe+zBwp2e/j8XH7KDlp/WaRUhcU\n" + + "bjGg2Ss5TMbBjR6B4nMwjvqaCIFoAD6aFRYc80px/KY6KTSyOFF0FBQNuhSsUZQy\n" + + "p74aRjUraSu/RiJMA8A6OYGo1b7W9o/UOg0MB4WQkfwl+Mxh+58QKjLjZr9VVapW\n" + + "4yv0G/G6rT/pHrRiyBcT7Kt4xNFsmMFAN4BXL9WI9mkGDa4iwDmWVjIjAaiilaaC\n" + + "MIXwwm3eg/QBgWBUrwXf3YC+1HXkaFDZc5apQ5uaNJPjQo9nQ6xqfpnACXTJ/Lwm\n" + + "JBu4YlXPby5Vh6mWWSyVdbICrCD7BtGP8aSBPFGPEuPEjK32uyeoGWVwwSubVFPX\n" + + "ARhLX5oSFZUySvHgYg==\n" + + "-----END CERTIFICATE-----"; + + public void runTest(ValidatePathWithParams pathValidator) throws Exception { + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Mon Oct 23 14:44:23 PDT 2023", System.out); + } +} diff --git a/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java b/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java new file mode 100644 index 00000000000..eb8fc2c2029 --- /dev/null +++ b/jdk/test/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java @@ -0,0 +1,179 @@ +/* + * 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 + * @bug 8319187 + * @summary Interoperability tests with eMudhra emSign Root CA G2 CS root + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=certpath EmSignRootG2CA OCSP + * @run main/othervm -Djava.security.debug=certpath EmSignRootG2CA CRL + */ + +public class EmSignRootG2CA { + + // Owner: CN=emSign CS CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Issuer: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Serial number: c084e666596139a1fa9b + // Valid from: Sun Feb 18 10:30:00 PST 2018 until: Fri Feb 18 10:30:00 PST 2033 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGeDCCBGCgAwIBAgILAMCE5mZZYTmh+pswDQYJKoZIhvcNAQEMBQAwZzELMAkG\n" + + "A1UEBhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0kxJTAjBgNVBAoTHGVNdWRocmEg\n" +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a1SPjocRb/vuCaGp74T\n" + + "n8oADP42XudDnp8wlOKWxFJulhNi960Rev+5vZOPF/LGfS78GI6yzBjR49VJGhOP\n" + + "EJK8NSNmK3FNblQfOyFM7VE0uOGHOUwpMGVM2A==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=test, OU=test, O=test, L=test, ST=test, C=IN + // Issuer: CN=emSign CS CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Serial number: 7c9ade672c0ad1b6 + // Valid from: Wed Aug 30 05:39:25 PDT 2023 until: Sat Aug 30 05:39:25 PDT 2025 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIGNjCCBB6gAwIBAgIIfJreZywK0bYwDQYJKoZIhvcNAQEMBQAwZTELMAkGA1UE\n" + + "BhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0kxJTAjBgNVBAoTHGVNdWRocmEgVGVj\n" + + "aG5vbG9naWVzIExpbWl0ZWQxGjAYBgNVBAMTEWVtU2lnbiBDUyBDQSAtIEcyMB4X\n" + + "DTIzMDgzMDEyMzkyNVoXDTI1MDgzMDEyMzkyNVowWDELMAkGA1UEBhMCSU4xDTAL\n" + + "BgNVBAgTBHRlc3QxDTALBgNVBAcTBHRlc3QxDTALBgNVBAoMBHRlc3QxDTALBgNV\n" + + "BAsTBHRlc3QxDTALBgNVBAMTBHRlc3QwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAw\n" + + "ggGKAoIBgQC04pOiSFbl7Bd4wFYXzzyukKh+EmwIq8xRGQDkuYH+C6Zao36VAV+k\n" + + "xGw7lmM3rf4YUcArgZYHfrxgPJNBbGrCi/YnEPYQTNwSrBAePUx1tt13LVBxHfNu\n" + + "cQQT+kqE7064WsYfmfr/uzJZemqVH7lG82DN23+8E/235AIh3lz/pn7T9ByLj7TV\n" + + "zWP40oT0UfQXQvWUpFevPONu/RksRP+NiKV3ji6/wYpvrfodzkrGxw2DPfOh4Iam\n" + + "j6bBH2rkTMToH853plsQGr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l3Bu6qTEbQRgUI5XsVXmXXn8Pg\n" + + "IANliTEsbsN9CMWrJ56ciEujU7w2L+IBfvKhl10N1AQNHwpQzwfFyz2BUbACN75o\n" + + "feIUBarM3ssNzpnt7idgkCTwWVrdEL1NHyW967aEMWyVwaRrtkjFOW/0xuSr2rEI\n" + + "jBpPj5RPdP6ZEaqnmg5PIgSrJ8FBjx6JmvVgZH/XEl5MZ7PsvJFfIMun6RxXtGn7\n" + + "QP0+ipkRrI6USNFS84H53Q0WJhQWZUgd3cdm37wpFGvxOVEskIgJNW9SbOgiT9sB\n" + + "zTIy3ceOK2onmUkDM2Q2+Hbc7A4BmNIlW4fpYXvZlM7IXSl9U3Voks92Hi45azgz\n" + + "StWZv9+Ronmmp+b7JKCe7MZXIBHfj0JhAVNJiYTZ9BqkY2VRvuQPVUdKxske9fQ6\n" + + "ciFJ5a6RDOhce6pFloaQu39ci2XCY1N4mIR3vFzpmBNkttlEXviK07XNTv9cnQt6\n" + + "3CW5aMAsfTbmOw==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=test, OU=test, O=test, L=test, ST=test, C=IN + // Issuer: CN=emSign CS CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Serial number: cf02dedd03d2f509 + // Valid from: Thu Oct 05 22:38:51 PDT 2023 until: Sun Oct 05 22:38:51 PDT 2025 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIGNzCCBB+gAwIBAgIJAM8C3t0D0vUJMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNV\n" + + "BAYTAklOMRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVkaHJhIFRl\n" + + "Y2hub2xvZ2llcyBMaW1pdGVkMRowGAYDVQQDExFlbVNpZ24gQ1MgQ0EgLSBHMjAe\n" + + "Fw0yMzEwMDYwNTM4NTFaFw0yNTEwMDYwNTM4NTFaMFgxCzAJBgNVBAYTAklOMQ0w\n" + + "CwYDVQQIEwR0ZXN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wBBAEwcwYIKwYBBQUHAQEEZzBlMCIGCCsGAQUFBzAB\n" + + "hhZodHRwOi8vb2NzcC5lbVNpZ24uY29tMD8GCCsGAQUFBzAChjNodHRwOi8vcmVw\n" + + "b3NpdG9yeS5lbXNpZ24uY29tL2NlcnRzL2VtU2lnbkNTQ0FHMi5jcnQwDAYDVR0T\n" + + "AQH/BAIwADANBgkqhkiG9w0BAQwFAAOCAgEAGa2XSoRkoIkHHHGXrdzTBCf/+KgK\n" + + "FlHhqlBOk5rwLDX1sfNlmsaz10I69phE90Ac8Coa/xCrBaFrTYqRvmkY9gU19jkn\n" + + "FdVcwQEHNku7Ro/Z/mbyi+aTBzHMTy0Vl4HqVnQInjV891n64SerUuAB7wNVOOho\n" + + "GoBfpf6lzDzzuEmetFokHYv1tWGQqPF/dHLARQraUlQpWjsnOx0QcZ5cM79REONE\n" + + "y6uzXT2vaatT3ns8Mtx8zooq+t8pnZlXJqlrwNTcnPad9gSsVu6vfsnWhLhz0VLG\n" + + "sYPXcWIssLbBQW3v5z0l1Isj7vy2UFfbn8AmZ0PanPo3v3C2sk19DK+Zlc9xBAXc\n" + + "KKwc4m8le6QkP/EB2wUA7ey5Cf29hjNDJpZznquEaWl9aKbBRdJDKsK88IBJjzK0\n" + + "Gbpw9fYJ3txuGA7Q27gyaZAeGAIrFvOtRY0XFbr20qSh2GBBYN57+lBPh4UKqgy8\n" + + "Z2Kk/2jK9k+nm41JYCmwVZHg3Va9RRfW8FkeE95gAUFPDWjeV+GvcimCbcB3DwaZ\n" + + "9fy1qfV4xsduhC3ei6f7Ask8LbAEWaEIXmgK10YbIfhzomCyCzlA+E+gwkq/bmkv\n" + + "B8hh27KWA6IRt7URI51MZlh0e8fULyXlOZcoJA/IPX9RdePa2RHFuPSypBHjoN7z\n" + + "6bCML1XZ2xnHIAg=\n" + + "-----END CERTIFICATE-----"; + + public static void main(String[] args) throws Exception { + + ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); + + if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { + pathValidator.enableCRLCheck(); + } else { + // OCSP check by default + pathValidator.enableOCSPCheck(); + } + + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Thu Oct 05 22:51:36 PDT 2023", System.out); + } +} \ No newline at end of file diff --git a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java index afad9cee62c..4007227c862 100644 --- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java +++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java @@ -30,7 +30,7 @@ * @test * @bug 6216082 * @summary Redirect problem with HttpsURLConnection using a proxy - * @library .. /lib + * @library .. /test/lib * @build jdk.test.lib.NetworkConfiguration * jdk.test.lib.Platform * HttpCallback TestHttpsServer ClosedChannelList diff --git a/jdk/test/sun/security/ec/SignedObjectChain.java b/jdk/test/sun/security/ec/SignedObjectChain.java index 7e2610a512a..38e2d56c0ab 100644 --- a/jdk/test/sun/security/ec/SignedObjectChain.java +++ b/jdk/test/sun/security/ec/SignedObjectChain.java @@ -25,7 +25,7 @@ * @test * @bug 8050374 8146293 * @summary Verify a chain of signed objects - * @library /lib + * @library /test/lib * @compile ../../../java/security/SignedObject/Chain.java * @run main SignedObjectChain */ diff --git a/jdk/test/sun/security/krb5/config/YesNo.java b/jdk/test/sun/security/krb5/config/YesNo.java new file mode 100644 index 00000000000..c25c8279663 --- /dev/null +++ b/jdk/test/sun/security/krb5/config/YesNo.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2014, 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 8029995 + * @summary accept yes/no for boolean krb5.conf settings + * @compile -XDignore.symbol.file YesNo.java + * @run main/othervm YesNo + */ +import sun.security.krb5.Config; +import sun.security.krb5.internal.crypto.EType; + +import java.util.Arrays; + +public class YesNo { + static Config config = null; + public static void main(String[] args) throws Exception { + System.setProperty("java.security.krb5.conf", + System.getProperty("test.src", ".") +"/yesno.conf"); + config = Config.getInstance(); + check("a", Boolean.TRUE); + check("b", Boolean.FALSE); + check("c", Boolean.TRUE); + check("d", Boolean.FALSE); + check("e", null); + check("f", null); + + if (!Arrays.stream(EType.getBuiltInDefaults()) + .anyMatch(n -> n < 4)) { + throw new Exception(); + } + } + + static void check(String k, Boolean expected) throws Exception { + Boolean result = config.getBooleanObject("libdefaults", k); + if (expected != result) { + throw new Exception("value for " + k + " is " + result); + } + } +} diff --git a/jdk/test/sun/security/krb5/config/yesno.conf b/jdk/test/sun/security/krb5/config/yesno.conf new file mode 100644 index 00000000000..681c19daf51 --- /dev/null +++ b/jdk/test/sun/security/krb5/config/yesno.conf @@ -0,0 +1,7 @@ +[libdefaults] +a = true +b = FALSE +c = YES +d = no +e = nothing +allow_weak_crypto = yes diff --git a/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java b/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java index 62edefbf1d3..bd36adc38f8 100644 --- a/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java +++ b/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java @@ -28,7 +28,7 @@ * 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136 * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 - * 8305975 8304760 8307134 8295894 8314960 + * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 8319187 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -54,12 +54,12 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 98; + private static final int COUNT = 107; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "59:33:AC:F5:76:C0:93:53:6E:3B:49:FD:97:27:6A:60:A0:0B:9A:BD:46:8C:41:F2:8C:E9:0F:46:5A:9A:0E:F7"; + = "11:F5:01:EF:E4:6F:50:3F:A4:DD:28:BA:EC:4F:45:EF:58:23:65:DF:31:55:CE:43:2E:DD:C9:B5:EB:39:EC:23"; // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") private static final Map FINGERPRINT_MAP @@ -151,6 +151,8 @@ public class VerifyCACerts { "5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE"); put("letsencryptisrgx1 [jdk]", "96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6"); + put("letsencryptisrgx2 [jdk]", + "69:72:9B:8E:15:A8:6E:FC:17:7A:57:AF:B7:17:1D:FC:64:AD:D2:8C:2F:CA:8C:F1:50:7E:34:45:3C:CB:14:70"); put("luxtrustglobalrootca [jdk]", "A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50"); put("quovadisrootca [jdk]", @@ -165,6 +167,14 @@ public class VerifyCACerts { "18:F1:FC:7F:20:5D:F8:AD:DD:EB:7F:E0:07:DD:57:E3:AF:37:5A:9C:4D:8D:73:54:6B:F4:F1:FE:D1:E1:8D:35"); put("quovadisrootca3g3 [jdk]", "88:EF:81:DE:20:2E:B0:18:45:2E:43:F8:64:72:5C:EA:5F:BD:1F:C2:D9:D2:05:73:07:09:C5:D8:B8:69:0F:46"); + put("digicertcseccrootg5 [jdk]", + "26:C5:6A:D2:20:8D:1E:9B:15:2F:66:85:3B:F4:79:7C:BE:B7:55:2C:1F:3F:47:72:51:E8:CB:1A:E7:E7:97:BF"); + put("digicertcsrsarootg5 [jdk]", + "73:53:B6:D6:C2:D6:DA:42:47:77:3F:3F:07:D0:75:DE:CB:51:34:21:2B:EA:D0:92:8E:F1:F4:61:15:26:09:41"); + put("digicerttlseccrootg5 [jdk]", + "01:8E:13:F0:77:25:32:CF:80:9B:D1:B1:72:81:86:72:83:FC:48:C6:E1:3B:E9:C6:98:12:85:4A:49:0C:1B:05"); + put("digicerttlsrsarootg5 [jdk]", + "37:1A:00:DC:05:33:B3:72:1A:7E:EB:40:E8:41:9E:70:79:9D:2B:0A:0F:2C:1D:80:69:31:65:F7:CE:C4:AD:75"); put("secomscrootca2 [jdk]", "51:3B:2C:EC:B8:10:D4:CD:E5:DD:85:39:1A:DF:C6:C2:DD:60:D8:7B:B7:36:D2:B5:21:48:4A:A4:7A:0E:BE:F6"); put("swisssigngoldg2ca [jdk]", @@ -261,6 +271,14 @@ public class VerifyCACerts { "5C:C3:D7:8E:4E:1D:5E:45:54:7A:04:E6:87:3E:64:F9:0C:F9:53:6D:1C:CC:2E:F8:00:F3:55:C4:C5:FD:70:FD"); put("certignarootca [jdk]", "D4:8D:3D:23:EE:DB:50:A4:59:E5:51:97:60:1C:27:77:4B:9D:7B:18:C9:4D:5A:05:95:11:A1:02:50:B9:31:68"); + put("teliarootcav2 [jdk]", + "24:2B:69:74:2F:CB:1E:5B:2A:BF:98:89:8B:94:57:21:87:54:4E:5B:4D:99:11:78:65:73:62:1F:6A:74:B8:2C"); + put("emsignrootcag1 [jdk]", + "40:F6:AF:03:46:A9:9A:A1:CD:1D:55:5A:4E:9C:CE:62:C7:F9:63:46:03:EE:40:66:15:83:3D:C8:C8:D0:03:67"); + put("emsigneccrootcag3 [jdk]", + "86:A1:EC:BA:08:9C:4A:8D:3B:BE:27:34:C6:12:BA:34:1D:81:3E:04:3C:F9:E8:A8:62:CD:5C:57:A3:6B:BE:6B"); + put("emsignrootcag2 [jdk]", + "1A:A0:C2:70:9E:83:1B:D6:E3:B5:12:9A:00:BA:41:F7:EE:EF:02:08:72:F1:E6:50:4B:F0:F6:C3:F2:4F:3A:F3"); } }; diff --git a/jdk/test/sun/security/mscapi/SignedObjectChain.java b/jdk/test/sun/security/mscapi/SignedObjectChain.java index 931a0b30841..e6a5d848705 100644 --- a/jdk/test/sun/security/mscapi/SignedObjectChain.java +++ b/jdk/test/sun/security/mscapi/SignedObjectChain.java @@ -25,7 +25,7 @@ * @test * @bug 8050374 8146293 * @summary Verify a chain of signed objects - * @library /lib + * @library /test/lib * @compile ../../../java/security/SignedObject/Chain.java * @run main SignedObjectChain */ diff --git a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java index 717590f62ae..51358b43228 100644 --- a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java +++ b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java @@ -31,7 +31,7 @@ * @bug 6405536 * @summary Verify that all ciphersuites work (incl. ECC using NSS crypto) * @author Andreas Sterbenz - * @library /lib .. ../../../../javax/net/ssl/TLSCommon + * @library /test/lib .. ../../../../javax/net/ssl/TLSCommon * @library ../../../../java/security/testlibrary * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" * ClientJSSEServerJSSE diff --git a/jdk/test/sun/security/pkcs12/EmptyPassword.java b/jdk/test/sun/security/pkcs12/EmptyPassword.java index 4a24b06d97b..23d3d22f4dd 100644 --- a/jdk/test/sun/security/pkcs12/EmptyPassword.java +++ b/jdk/test/sun/security/pkcs12/EmptyPassword.java @@ -26,7 +26,7 @@ * @bug 8202299 * @modules java.base/sun.security.tools.keytool * java.base/sun.security.x509 - * @library /lib / + * @library /test/lib / * @summary Java Keystore fails to load PKCS12/PFX certificates created in WindowsServer2016 */ diff --git a/jdk/test/sun/security/pkcs12/ParamsPreferences.java b/jdk/test/sun/security/pkcs12/ParamsPreferences.java index 8a1cf73cbb7..b08825e6167 100644 --- a/jdk/test/sun/security/pkcs12/ParamsPreferences.java +++ b/jdk/test/sun/security/pkcs12/ParamsPreferences.java @@ -38,7 +38,7 @@ /* * @test * @bug 8076190 - * @library /lib/testlibrary /lib + * @library /lib/testlibrary /test/lib * @modules java.base/sun.security.pkcs * java.base/sun.security.x509 * java.base/sun.security.util diff --git a/jdk/test/sun/security/pkcs12/ParamsTest.java b/jdk/test/sun/security/pkcs12/ParamsTest.java index 62f434e3d39..6c2ca7bffc2 100644 --- a/jdk/test/sun/security/pkcs12/ParamsTest.java +++ b/jdk/test/sun/security/pkcs12/ParamsTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8076190 - * @library /lib/testlibrary /lib + * @library /lib/testlibrary /test/lib * @modules java.base/sun.security.pkcs * java.base/sun.security.x509 * java.base/sun.security.util diff --git a/jdk/test/sun/security/rsa/RSAPaddingCheck.java b/jdk/test/sun/security/rsa/RSAPaddingCheck.java new file mode 100644 index 00000000000..807e4e3bf4b --- /dev/null +++ b/jdk/test/sun/security/rsa/RSAPaddingCheck.java @@ -0,0 +1,63 @@ +/* + * 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 + * @bug 8302017 + * @summary Ensure that RSAPadding class works as expected after refactoring + * @modules java.base/sun.security.rsa + */ +import java.util.Arrays; +import sun.security.rsa.RSAPadding; + +public class RSAPaddingCheck { + + private static int[] PADDING_TYPES = { + RSAPadding.PAD_BLOCKTYPE_1, + RSAPadding.PAD_BLOCKTYPE_2, + RSAPadding.PAD_NONE, + RSAPadding.PAD_OAEP_MGF1, + }; + + public static void main(String[] args) throws Exception { + int size = 2048 >> 3; + byte[] testData = "This is some random to-be-padded Data".getBytes(); + for (int type : PADDING_TYPES) { + byte[] data = (type == RSAPadding.PAD_NONE? + Arrays.copyOf(testData, size) : testData); + System.out.println("Testing PaddingType: " + type); + RSAPadding padding = RSAPadding.getInstance(type, size); + byte[] paddedData = padding.pad(data); + if (paddedData == null) { + throw new RuntimeException("Unexpected padding op failure!"); + } + + byte[] data2 = padding.unpad(paddedData); + if (data2 == null) { + throw new RuntimeException("Unexpected unpadding op failure!"); + } + if (!Arrays.equals(data, data2)) { + throw new RuntimeException("diff check failure!"); + } + } + } +} diff --git a/jdk/test/sun/security/rsa/SignatureTest.java b/jdk/test/sun/security/rsa/SignatureTest.java index 0752bd084b4..7b60384018c 100644 --- a/jdk/test/sun/security/rsa/SignatureTest.java +++ b/jdk/test/sun/security/rsa/SignatureTest.java @@ -38,7 +38,7 @@ * @summary Create a signature for RSA and get its signed data. re-initiate * the signature with the public key. The signature can be verified * by acquired signed data. - * @library /lib + * @library /test/lib * @key randomness * @library ../../../lib/testlibrary * @run main SignatureTest MD2withRSA 512 diff --git a/jdk/test/sun/security/rsa/SignedObjectChain.java b/jdk/test/sun/security/rsa/SignedObjectChain.java index fea6028d92e..d1923730dac 100644 --- a/jdk/test/sun/security/rsa/SignedObjectChain.java +++ b/jdk/test/sun/security/rsa/SignedObjectChain.java @@ -25,7 +25,7 @@ * @test * @bug 8050374 8146293 * @summary Verify a chain of signed objects - * @library /lib + * @library /test/lib * @compile ../../../java/security/SignedObject/Chain.java * @run main SignedObjectChain */ diff --git a/jdk/test/sun/security/rsa/TestKeyPairGenerator.java b/jdk/test/sun/security/rsa/TestKeyPairGenerator.java index 5039ed98060..4a64554045d 100644 --- a/jdk/test/sun/security/rsa/TestKeyPairGenerator.java +++ b/jdk/test/sun/security/rsa/TestKeyPairGenerator.java @@ -25,7 +25,7 @@ * @test * @bug 4853305 4865198 4888410 4963723 8146293 * @summary Verify that the RSA KeyPairGenerator works - * @library /lib + * @library /test/lib * @build jdk.test.lib.SigTestUtil * @run main TestKeyPairGenerator * @author Andreas Sterbenz diff --git a/jdk/test/sun/security/rsa/TestSignatures.java b/jdk/test/sun/security/rsa/TestSignatures.java index 1cda2929781..68dfd1adf05 100644 --- a/jdk/test/sun/security/rsa/TestSignatures.java +++ b/jdk/test/sun/security/rsa/TestSignatures.java @@ -25,7 +25,7 @@ * @test * @bug 4853305 4963723 8146293 * @summary Test signing/verifying using all the signature algorithms - * @library /lib + * @library /test/lib * @build jdk.test.lib.SigTestUtil * @run main TestSignatures * @author Andreas Sterbenz diff --git a/jdk/test/sun/security/rsa/WithoutNULL.java b/jdk/test/sun/security/rsa/WithoutNULL.java new file mode 100644 index 00000000000..4a403c93941 --- /dev/null +++ b/jdk/test/sun/security/rsa/WithoutNULL.java @@ -0,0 +1,57 @@ +/* + * 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 + * @bug 8320597 + * @summary Verify RSA signature with omitted digest params (should be encoded as NULL) + * for backward compatibility + */ +import java.security.KeyFactory; +import java.security.Signature; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; + +public class WithoutNULL { + public static void main(String[] args) throws Exception { + + // A 1024-bit RSA public key + byte[] key = Base64.getMimeDecoder().decode( + "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrfTrEm4KvdFSpGAM7InrFEzALTKdphT9fK6Gu" + + "eVjHtKsuCSEaULCdjhJvPpFK40ONr1JEC1Ywp1UYrfBBdKunnbDZqNZL1cFv+IzF4Yj6JO6pOeHi" + + "1Zpur1GaQRRlYTvzmyWY/AATQDh8JfKObNnDVwXeezFODUG8h5+XL1ZXZQIDAQAB"); + + // A SHA1withRSA signature on an empty input where the digestAlgorithm + // inside DigestInfo does not have a parameters field. + byte[] sig = Base64.getMimeDecoder().decode( + "D1FpiT44WEXlDfYK880bdorLO+e9qJVXZWiBgqs9dfK7lYQwyEt9dL23mbUAKm5TVEj2ZxtHkEvk" + + "b8oaWkxk069jDTM1RhllPJZkAjeQRbw4gkg4N6wKZz9B/jdSRMNJg/b9QdRYZOHOBxsEHMbUREPV" + + "DoCOLaxB8eIXX0EWkiE="); + + Signature s = Signature.getInstance("SHA1withRSA", "SunRsaSign"); + s.initVerify(KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(key))); + if (!s.verify(sig)) { + throw new RuntimeException("Does not verify"); + } + } +} diff --git a/jdk/test/sun/security/rsa/pss/SignatureTestPSS.java b/jdk/test/sun/security/rsa/pss/SignatureTestPSS.java index b92cd925aa5..daa0fc51d8a 100644 --- a/jdk/test/sun/security/rsa/pss/SignatureTestPSS.java +++ b/jdk/test/sun/security/rsa/pss/SignatureTestPSS.java @@ -36,7 +36,7 @@ * @summary Create a signature for RSASSA-PSS and get its signed data. * re-initiate the signature with the public key. The signature * can be verified by acquired signed data. - * @library /lib + * @library /test/lib * @build jdk.test.lib.SigTestUtil * @run main SignatureTestPSS 512 * @run main SignatureTestPSS 768 diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java index 50bbb87868f..b9fb72b8faf 100644 --- a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java +++ b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java @@ -54,7 +54,7 @@ * @test * @bug 8165367 * @summary Verify the restrictions for certificate path on JSSE with custom trust store. - * @library /lib + * @library /test/lib * @build jdk.test.lib.Utils * jdk.test.lib.Asserts * jdk.test.lib.JDKToolFinder diff --git a/jdk/test/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java b/jdk/test/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java index 70a6f5ba831..378f97cd7a0 100644 --- a/jdk/test/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java +++ b/jdk/test/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java @@ -25,7 +25,7 @@ * @test * @bug 7126889 * @summary Incorrect SSLEngine debug output - * @library /lib /lib/security + * @library /test/lib /lib/security * @run main DebugReportsOneExtraByte */ /* diff --git a/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java b/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java index 1d5b21baa56..46957d83d43 100644 --- a/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java +++ b/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java @@ -25,7 +25,7 @@ * @test * @bug 8050374 8146293 * @summary Verify a chain of signed objects - * @library /lib + * @library /test/lib * @compile ../../../../java/security/SignedObject/Chain.java * @run main SignedObjectChain */ diff --git a/jdk/test/sun/security/util/DerInputBuffer/PaddedBitString.java b/jdk/test/sun/security/util/DerInputBuffer/PaddedBitString.java index b9a72957114..7a5719c18ac 100644 --- a/jdk/test/sun/security/util/DerInputBuffer/PaddedBitString.java +++ b/jdk/test/sun/security/util/DerInputBuffer/PaddedBitString.java @@ -25,7 +25,7 @@ * @test * @bug 4511556 * @summary Verify BitString value containing padding bits is accepted. - * @library /lib + * @library /test/lib */ import java.io.*; import java.math.BigInteger; diff --git a/make/Main.gmk b/make/Main.gmk index 19244c8dcd1..4292cfe6b02 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -167,6 +167,9 @@ docs-zip-only: start-make @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip) @$(call TargetExit) +update-build-docs: + +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk) + sign-jars: jdk sign-jars-only sign-jars-only: start-make @$(call TargetEnter) @@ -258,7 +261,7 @@ reconfigure: @( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) ) .PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs docs-zip -.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only docs-zip-only +.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only docs-zip-only update-build-docs .PHONY: default all clean dist-clean bootcycle-images start-make .PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-docs-zip clean-test clean-overlay-images clean-bootcycle-build .PHONY: profiles profiles-only diff --git a/make/UpdateBuildDocs.gmk b/make/UpdateBuildDocs.gmk new file mode 100644 index 00000000000..ae5bb733334 --- /dev/null +++ b/make/UpdateBuildDocs.gmk @@ -0,0 +1,97 @@ +# +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# 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. +# + +default: all + +include $(SPEC) +include MakeBase.gmk + +################################################################################ +# This makefile updates the generated build html documentation. +# +################################################################################ + +ifeq ($(PANDOC), ) + $(info No pandoc executable was detected by configure) + $(error Cannot continue) +endif + +################################################################################ +# Setup make rules for converting a markdown file to html. +# +# Parameter 1 is the name of the rule. This name is used as variable prefix, +# and the targets generated are listed in a variable by that name. +# +# Remaining parameters are named arguments. These include: +# SOURCE_FILE The markdown source file +# TARGET_DIR The directory where to store the generated html file +# +define SetupMarkdownToHtml + $(foreach i,2 3, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupMarkdownToHtml($1),$2,$3) + $(if $(4),$(error Internal makefile error: Too many arguments to SetupMarkdownToHtml, please update UpdateBuildDocs.gmk)) + + ifeq ($$($1_SOURCE_FILE), ) + $$(error SOURCE_FILE is missing in SetupMarkdownToHtml $1) + endif + + ifeq ($$($1_TARGET_DIR), ) + $$(error TARGET_DIR is missing in SetupMarkdownToHtml $1) + endif + + $1_BASENAME := $$(notdir $$(basename $$($1_SOURCE_FILE))) + $1_OUTPUT_FILE := $$($1_TARGET_DIR)/$$($1_BASENAME).html + +$$($1_OUTPUT_FILE): $$($1_SOURCE_FILE) + $$(ECHO) $$(LOG_INFO) Converting $$(notdir $1) to html + $$(MKDIR) -p $$($1_TARGET_DIR) + $$(PANDOC) -f markdown -t html --standalone '$$<' -o '$$@' + TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` ; \ + if [ "x$${TOO_LONG_LINES}" != x ]; then \ + $$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \ + $$(ECHO) "The following lines are longer than 80 characters:" ; \ + $$(GREP) -E -e '^.{80}.+$$$$' $$< ; \ + fi + + $1 := $$($1_OUTPUT_FILE) + + TARGETS += $$($1) +endef + +################################################################################ + +BUILD_DOCS_DIR := $(TOPDIR)/doc +BUILD_DOCS_MD_FILE := building.md + +$(eval $(call SetupMarkdownToHtml,building, \ + SOURCE_FILE := $(BUILD_DOCS_DIR)/$(BUILD_DOCS_MD_FILE), \ + TARGET_DIR := $(BUILD_DOCS_DIR) \ +)) + +################################################################################ + +all: $(TARGETS) + +.PHONY: all default diff --git a/nashorn/src/jdk/nashorn/internal/objects/Global.java b/nashorn/src/jdk/nashorn/internal/objects/Global.java index 18505f00eaa..b27d07615f3 100644 --- a/nashorn/src/jdk/nashorn/internal/objects/Global.java +++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java @@ -1430,9 +1430,11 @@ public static Object __noSuchProperty__(final Object self, final Object name) { if ("context".equals(nameStr)) { return sctxt; } else if ("engine".equals(nameStr)) { - // expose "engine" variable only when there is no security manager - // or when no class filter is set. - if (System.getSecurityManager() == null || global.getClassFilter() == null) { + // expose "engine" variable only when there is no security manager, + // or when no class filter is set and --no-java is not set + if (System.getSecurityManager() == null || + (global.getClassFilter() == null && + !global.getContext().getEnv()._no_java)) { return global.engine; } } diff --git a/jdk/test/lib/ClassFileInstaller.java b/test/lib/ClassFileInstaller.java similarity index 100% rename from jdk/test/lib/ClassFileInstaller.java rename to test/lib/ClassFileInstaller.java diff --git a/jdk/test/lib/jdk/test/lib/Asserts.java b/test/lib/jdk/test/lib/Asserts.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Asserts.java rename to test/lib/jdk/test/lib/Asserts.java diff --git a/jdk/test/lib/jdk/test/lib/BuildHelper.java b/test/lib/jdk/test/lib/BuildHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/BuildHelper.java rename to test/lib/jdk/test/lib/BuildHelper.java diff --git a/jdk/test/lib/jdk/test/lib/ByteCodeLoader.java b/test/lib/jdk/test/lib/ByteCodeLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/ByteCodeLoader.java rename to test/lib/jdk/test/lib/ByteCodeLoader.java diff --git a/jdk/test/lib/jdk/test/lib/Container.java b/test/lib/jdk/test/lib/Container.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Container.java rename to test/lib/jdk/test/lib/Container.java diff --git a/jdk/test/lib/jdk/test/lib/Convert.java b/test/lib/jdk/test/lib/Convert.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Convert.java rename to test/lib/jdk/test/lib/Convert.java diff --git a/jdk/test/lib/jdk/test/lib/FileInstaller.java b/test/lib/jdk/test/lib/FileInstaller.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/FileInstaller.java rename to test/lib/jdk/test/lib/FileInstaller.java diff --git a/jdk/test/lib/jdk/test/lib/InfiniteLoop.java b/test/lib/jdk/test/lib/InfiniteLoop.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/InfiniteLoop.java rename to test/lib/jdk/test/lib/InfiniteLoop.java diff --git a/jdk/test/lib/jdk/test/lib/JDKToolFinder.java b/test/lib/jdk/test/lib/JDKToolFinder.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/JDKToolFinder.java rename to test/lib/jdk/test/lib/JDKToolFinder.java diff --git a/jdk/test/lib/jdk/test/lib/JDKToolLauncher.java b/test/lib/jdk/test/lib/JDKToolLauncher.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/JDKToolLauncher.java rename to test/lib/jdk/test/lib/JDKToolLauncher.java diff --git a/jdk/test/lib/jdk/test/lib/LockFreeLogger.java b/test/lib/jdk/test/lib/LockFreeLogger.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/LockFreeLogger.java rename to test/lib/jdk/test/lib/LockFreeLogger.java diff --git a/jdk/test/lib/jdk/test/lib/NetworkConfiguration.java b/test/lib/jdk/test/lib/NetworkConfiguration.java similarity index 60% rename from jdk/test/lib/jdk/test/lib/NetworkConfiguration.java rename to test/lib/jdk/test/lib/NetworkConfiguration.java index b8a4720643a..b6599627888 100644 --- a/jdk/test/lib/jdk/test/lib/NetworkConfiguration.java +++ b/test/lib/jdk/test/lib/NetworkConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, 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,9 +23,9 @@ package jdk.test.lib; +import java.io.IOException; import java.io.PrintStream; import java.io.UncheckedIOException; -import java.io.IOException; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; @@ -35,9 +35,9 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; + import static java.net.NetworkInterface.getNetworkInterfaces; import static java.util.Collections.list; @@ -49,12 +49,140 @@ public class NetworkConfiguration { private Map> ip4Interfaces; private Map> ip6Interfaces; + private final boolean isIPv6Available; + private boolean has_testableipv6address = false; + private boolean has_sitelocaladdress = false; + private boolean has_linklocaladdress = false; + private boolean has_globaladdress = false; private NetworkConfiguration( Map> ip4Interfaces, Map> ip6Interfaces) { this.ip4Interfaces = ip4Interfaces; this.ip6Interfaces = ip6Interfaces; + + // initialize properties that can be queried + isIPv6Available = !ip6Interfaces().collect(Collectors.toList()).isEmpty(); + ip6Interfaces().forEach(nif -> { + ip6Addresses(nif) + // On Solaris or AIX, a configuration with only local or loopback + // addresses does not fully enable IPv6 operations. + // E.g. IPv6 multicasting does not work. + // So, don't set has_testableipv6address if we only find these. + .filter(addr -> Platform.isSolaris() || Platform.isAix() ? + !(addr.isAnyLocalAddress() || addr.isLoopbackAddress()) : true) + .forEach(ia -> { + has_testableipv6address = true; + if (ia.isLinkLocalAddress()) has_linklocaladdress = true; + if (ia.isSiteLocalAddress()) has_sitelocaladdress = true; + + if (!ia.isLinkLocalAddress() && + !ia.isSiteLocalAddress() && + !ia.isLoopbackAddress()) { + has_globaladdress = true; + } + }); + }); + } + + private static boolean isNotExcludedInterface(NetworkInterface nif) { + if (Platform.isOSX() && nif.getName().contains("awdl")) { + return false; + } + if (Platform.isWindows()) { + String dName = nif.getDisplayName(); + if (dName != null && dName.contains("Teredo")) { + return false; + } + } + return true; + } + + private static boolean isNotLoopback(NetworkInterface nif) { + try { + return !nif.isLoopback(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private boolean hasIp4Addresses(NetworkInterface nif) { + return ip4Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress()); + } + + private boolean hasIp6Addresses(NetworkInterface nif) { + return ip6Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress()); + } + + private boolean supportsIp4Multicast(NetworkInterface nif) { + try { + if (!nif.supportsMulticast()) { + return false; + } + + // On AIX there is a bug: + // When IPv6 is enabled on the system, the JDK opens sockets as AF_INET6. + // If there's an interface configured with IPv4 addresses only, it should + // be able to become the network interface for a multicast socket (that + // could be in both, IPv4 or IPv6 space). But both possible setsockopt + // calls for either IPV6_MULTICAST_IF or IP_MULTICAST_IF return + // EADDRNOTAVAIL. So we must skip such interfaces here. + if (Platform.isAix() && isIPv6Available() && !hasIp6Addresses(nif)) { + return false; + } + + return hasIp4Addresses(nif); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private boolean supportsIp6Multicast(NetworkInterface nif) { + try { + if (!nif.supportsMulticast()) { + return false; + } + + return hasIp6Addresses(nif); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + /** + * Returns whether IPv6 is available at all. + * This should resemble the result of native ipv6_available() in net_util.c + */ + public boolean isIPv6Available() { + return isIPv6Available; + } + + /** + * Does any (usable) IPv6 address exist in the network configuration? + */ + public boolean hasTestableIPv6Address() { + return has_testableipv6address; + } + + /** + * Does any site local address exist? + */ + public boolean hasSiteLocalAddress() { + return has_sitelocaladdress; + } + + /** + * Does any link local address exist? + */ + public boolean hasLinkLocalAddress() { + return has_linklocaladdress; + } + + /** + * Does any global IPv6 address exist? + */ + public boolean has_globaladdress() { + return has_globaladdress; } /** @@ -72,7 +200,7 @@ public Stream ip4Interfaces() { return ip4Interfaces.keySet() .stream() .filter(NetworkConfiguration::isNotExcludedInterface) - .filter(hasIp4Addresses); + .filter(this::hasIp4Addresses); } /** @@ -82,63 +210,56 @@ public Stream ip6Interfaces() { return ip6Interfaces.keySet() .stream() .filter(NetworkConfiguration::isNotExcludedInterface) - .filter(hasIp6Addresses); + .filter(this::hasIp6Addresses); } - private static boolean isNotExcludedInterface(NetworkInterface nif) { - if (Platform.isOSX() && nif.getName().contains("awdl")) { - return false; - } - String dName = nif.getDisplayName(); - if (Platform.isWindows() && dName != null && dName.contains("Teredo")) { - return false; - } - return true; + /** + * Returns a stream of interfaces suitable for functional tests. + */ + public Stream multicastInterfaces(boolean includeLoopback) { + return Stream + .concat(ip4MulticastInterfaces(includeLoopback), + ip6MulticastInterfaces(includeLoopback)) + .distinct(); } - private final Predicate hasIp4Addresses = nif -> - ip4Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress()); - - private final Predicate hasIp6Addresses = nif -> - ip6Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress()); - - /** * Returns a stream of interfaces suitable for IPv4 multicast tests. + * + * The loopback interface will not be included. */ public Stream ip4MulticastInterfaces() { - return ip4Interfaces().filter(supportsIp4Multicast); + return ip4MulticastInterfaces(false); + } + + /** + * Returns a stream of interfaces suitable for IPv4 multicast tests. + */ + public Stream ip4MulticastInterfaces(boolean includeLoopback) { + return (includeLoopback) ? + ip4Interfaces().filter(this::supportsIp4Multicast) : + ip4Interfaces().filter(this::supportsIp4Multicast) + .filter(NetworkConfiguration::isNotLoopback); } /** * Returns a stream of interfaces suitable for IPv6 multicast tests. + * + * The loopback interface will not be included. */ public Stream ip6MulticastInterfaces() { - return ip6Interfaces().filter(supportsIp6Multicast); + return ip6MulticastInterfaces(false); } - private final Predicate supportsIp4Multicast = nif -> { - try { - if (!nif.supportsMulticast() || nif.isLoopback()) { - return false; - } - return hasIp4Addresses.test(nif); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }; - - private final Predicate supportsIp6Multicast = nif -> { - try { - if (!nif.supportsMulticast() || nif.isLoopback()) { - return false; - } - - return hasIp6Addresses.test(nif); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }; + /** + * Returns a stream of interfaces suitable for IPv6 multicast tests. + */ + public Stream ip6MulticastInterfaces(boolean includeLoopback) { + return (includeLoopback) ? + ip6Interfaces().filter(this::supportsIp6Multicast) : + ip6Interfaces().filter(this::supportsIp6Multicast) + .filter(NetworkConfiguration::isNotLoopback); + } /** * Returns all addresses on all "functional" interfaces. @@ -176,6 +297,12 @@ public Stream ip6Addresses(NetworkInterface nif) { return ip6Interfaces.get(nif).stream(); } + @Override + public String toString() { + return interfaces().map(NetworkConfiguration::interfaceInformation) + .collect(Collectors.joining()); + } + /** * Return a NetworkConfiguration instance. */ @@ -205,12 +332,6 @@ public static NetworkConfiguration probe() throws IOException { return new NetworkConfiguration(ip4Interfaces, ip6Interfaces); } - @Override - public String toString() { - return interfaces().map(NetworkConfiguration::interfaceInformation) - .collect(Collectors.joining()); - } - /** Returns detailed information for the given interface. */ public static String interfaceInformation(NetworkInterface nif) { StringBuilder sb = new StringBuilder(); diff --git a/jdk/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Platform.java rename to test/lib/jdk/test/lib/Platform.java diff --git a/jdk/test/lib/jdk/test/lib/RandomFactory.java b/test/lib/jdk/test/lib/RandomFactory.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/RandomFactory.java rename to test/lib/jdk/test/lib/RandomFactory.java diff --git a/jdk/test/lib/jdk/test/lib/SigTestUtil.java b/test/lib/jdk/test/lib/SigTestUtil.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/SigTestUtil.java rename to test/lib/jdk/test/lib/SigTestUtil.java diff --git a/jdk/test/lib/jdk/test/lib/TimeLimitedRunner.java b/test/lib/jdk/test/lib/TimeLimitedRunner.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/TimeLimitedRunner.java rename to test/lib/jdk/test/lib/TimeLimitedRunner.java diff --git a/jdk/test/lib/jdk/test/lib/Utils.java b/test/lib/jdk/test/lib/Utils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/Utils.java rename to test/lib/jdk/test/lib/Utils.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/Artifact.java b/test/lib/jdk/test/lib/artifacts/Artifact.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/Artifact.java rename to test/lib/jdk/test/lib/artifacts/Artifact.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/ArtifactContainer.java b/test/lib/jdk/test/lib/artifacts/ArtifactContainer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/ArtifactContainer.java rename to test/lib/jdk/test/lib/artifacts/ArtifactContainer.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/ArtifactManager.java b/test/lib/jdk/test/lib/artifacts/ArtifactManager.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/ArtifactManager.java rename to test/lib/jdk/test/lib/artifacts/ArtifactManager.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java b/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java rename to test/lib/jdk/test/lib/artifacts/ArtifactResolver.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java b/test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java rename to test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java b/test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java rename to test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java diff --git a/jdk/test/lib/jdk/test/lib/artifacts/JibArtifactManager.java b/test/lib/jdk/test/lib/artifacts/JibArtifactManager.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/artifacts/JibArtifactManager.java rename to test/lib/jdk/test/lib/artifacts/JibArtifactManager.java diff --git a/jdk/test/lib/jdk/test/lib/cds/CDSOptions.java b/test/lib/jdk/test/lib/cds/CDSOptions.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cds/CDSOptions.java rename to test/lib/jdk/test/lib/cds/CDSOptions.java diff --git a/jdk/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cds/CDSTestUtils.java rename to test/lib/jdk/test/lib/cds/CDSTestUtils.java diff --git a/jdk/test/lib/jdk/test/lib/classloader/ClassLoadUtils.java b/test/lib/jdk/test/lib/classloader/ClassLoadUtils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/classloader/ClassLoadUtils.java rename to test/lib/jdk/test/lib/classloader/ClassLoadUtils.java diff --git a/jdk/test/lib/jdk/test/lib/classloader/FilterClassLoader.java b/test/lib/jdk/test/lib/classloader/FilterClassLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/classloader/FilterClassLoader.java rename to test/lib/jdk/test/lib/classloader/FilterClassLoader.java diff --git a/jdk/test/lib/jdk/test/lib/classloader/GeneratingClassLoader.java b/test/lib/jdk/test/lib/classloader/GeneratingClassLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/classloader/GeneratingClassLoader.java rename to test/lib/jdk/test/lib/classloader/GeneratingClassLoader.java diff --git a/jdk/test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java b/test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java rename to test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java diff --git a/jdk/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java rename to test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java diff --git a/jdk/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java rename to test/lib/jdk/test/lib/cli/CommandLineOptionTest.java diff --git a/jdk/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java b/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java rename to test/lib/jdk/test/lib/cli/predicate/AndPredicate.java diff --git a/jdk/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java b/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java rename to test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java diff --git a/jdk/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java b/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java rename to test/lib/jdk/test/lib/cli/predicate/NotPredicate.java diff --git a/jdk/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java b/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java rename to test/lib/jdk/test/lib/cli/predicate/OrPredicate.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/CPUSetsReader.java b/test/lib/jdk/test/lib/containers/cgroup/CPUSetsReader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/CPUSetsReader.java rename to test/lib/jdk/test/lib/containers/cgroup/CPUSetsReader.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/CgroupMetricsTester.java b/test/lib/jdk/test/lib/containers/cgroup/CgroupMetricsTester.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/CgroupMetricsTester.java rename to test/lib/jdk/test/lib/containers/cgroup/CgroupMetricsTester.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java b/test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java rename to test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java b/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java rename to test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java diff --git a/jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java b/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java rename to test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java diff --git a/jdk/test/lib/jdk/test/lib/containers/docker/Common.java b/test/lib/jdk/test/lib/containers/docker/Common.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/docker/Common.java rename to test/lib/jdk/test/lib/containers/docker/Common.java diff --git a/jdk/test/lib/jdk/test/lib/containers/docker/DockerRunOptions.java b/test/lib/jdk/test/lib/containers/docker/DockerRunOptions.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/docker/DockerRunOptions.java rename to test/lib/jdk/test/lib/containers/docker/DockerRunOptions.java diff --git a/jdk/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java b/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java rename to test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java diff --git a/jdk/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java b/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java rename to test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/CommandExecutor.java b/test/lib/jdk/test/lib/dcmd/CommandExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/CommandExecutor.java rename to test/lib/jdk/test/lib/dcmd/CommandExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java b/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java rename to test/lib/jdk/test/lib/dcmd/CommandExecutorException.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java rename to test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/JMXExecutor.java b/test/lib/jdk/test/lib/dcmd/JMXExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/JMXExecutor.java rename to test/lib/jdk/test/lib/dcmd/JMXExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java rename to test/lib/jdk/test/lib/dcmd/JcmdExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java rename to test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java rename to test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/HprofParser.java b/test/lib/jdk/test/lib/hprof/HprofParser.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/HprofParser.java rename to test/lib/jdk/test/lib/hprof/HprofParser.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/README b/test/lib/jdk/test/lib/hprof/README similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/README rename to test/lib/jdk/test/lib/hprof/README diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java b/test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java rename to test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java b/test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java rename to test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/HackJavaValue.java b/test/lib/jdk/test/lib/hprof/model/HackJavaValue.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/HackJavaValue.java rename to test/lib/jdk/test/lib/hprof/model/HackJavaValue.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaBoolean.java b/test/lib/jdk/test/lib/hprof/model/JavaBoolean.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaBoolean.java rename to test/lib/jdk/test/lib/hprof/model/JavaBoolean.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaByte.java b/test/lib/jdk/test/lib/hprof/model/JavaByte.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaByte.java rename to test/lib/jdk/test/lib/hprof/model/JavaByte.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaChar.java b/test/lib/jdk/test/lib/hprof/model/JavaChar.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaChar.java rename to test/lib/jdk/test/lib/hprof/model/JavaChar.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaClass.java b/test/lib/jdk/test/lib/hprof/model/JavaClass.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaClass.java rename to test/lib/jdk/test/lib/hprof/model/JavaClass.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaDouble.java b/test/lib/jdk/test/lib/hprof/model/JavaDouble.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaDouble.java rename to test/lib/jdk/test/lib/hprof/model/JavaDouble.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaField.java b/test/lib/jdk/test/lib/hprof/model/JavaField.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaField.java rename to test/lib/jdk/test/lib/hprof/model/JavaField.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaFloat.java b/test/lib/jdk/test/lib/hprof/model/JavaFloat.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaFloat.java rename to test/lib/jdk/test/lib/hprof/model/JavaFloat.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java b/test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java b/test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java rename to test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaInt.java b/test/lib/jdk/test/lib/hprof/model/JavaInt.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaInt.java rename to test/lib/jdk/test/lib/hprof/model/JavaInt.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java b/test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaLong.java b/test/lib/jdk/test/lib/hprof/model/JavaLong.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaLong.java rename to test/lib/jdk/test/lib/hprof/model/JavaLong.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaObject.java b/test/lib/jdk/test/lib/hprof/model/JavaObject.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaObject.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java b/test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java rename to test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java b/test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java rename to test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaShort.java b/test/lib/jdk/test/lib/hprof/model/JavaShort.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaShort.java rename to test/lib/jdk/test/lib/hprof/model/JavaShort.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaStatic.java b/test/lib/jdk/test/lib/hprof/model/JavaStatic.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaStatic.java rename to test/lib/jdk/test/lib/hprof/model/JavaStatic.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaThing.java b/test/lib/jdk/test/lib/hprof/model/JavaThing.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaThing.java rename to test/lib/jdk/test/lib/hprof/model/JavaThing.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaValue.java b/test/lib/jdk/test/lib/hprof/model/JavaValue.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaValue.java rename to test/lib/jdk/test/lib/hprof/model/JavaValue.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java b/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java rename to test/lib/jdk/test/lib/hprof/model/JavaValueArray.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java b/test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java rename to test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java b/test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java rename to test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ReachableObjects.java b/test/lib/jdk/test/lib/hprof/model/ReachableObjects.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ReachableObjects.java rename to test/lib/jdk/test/lib/hprof/model/ReachableObjects.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/ReferenceChain.java b/test/lib/jdk/test/lib/hprof/model/ReferenceChain.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/ReferenceChain.java rename to test/lib/jdk/test/lib/hprof/model/ReferenceChain.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/Root.java b/test/lib/jdk/test/lib/hprof/model/Root.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/Root.java rename to test/lib/jdk/test/lib/hprof/model/Root.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/Snapshot.java b/test/lib/jdk/test/lib/hprof/model/Snapshot.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/Snapshot.java rename to test/lib/jdk/test/lib/hprof/model/Snapshot.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/StackFrame.java b/test/lib/jdk/test/lib/hprof/model/StackFrame.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/StackFrame.java rename to test/lib/jdk/test/lib/hprof/model/StackFrame.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/model/StackTrace.java b/test/lib/jdk/test/lib/hprof/model/StackTrace.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/model/StackTrace.java rename to test/lib/jdk/test/lib/hprof/model/StackTrace.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/HprofReader.java b/test/lib/jdk/test/lib/hprof/parser/HprofReader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/HprofReader.java rename to test/lib/jdk/test/lib/hprof/parser/HprofReader.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java b/test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java rename to test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java b/test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java rename to test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/parser/Reader.java b/test/lib/jdk/test/lib/hprof/parser/Reader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/parser/Reader.java rename to test/lib/jdk/test/lib/hprof/parser/Reader.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/ArraySorter.java b/test/lib/jdk/test/lib/hprof/util/ArraySorter.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/ArraySorter.java rename to test/lib/jdk/test/lib/hprof/util/ArraySorter.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/Comparer.java b/test/lib/jdk/test/lib/hprof/util/Comparer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/Comparer.java rename to test/lib/jdk/test/lib/hprof/util/Comparer.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java b/test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java rename to test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/Misc.java b/test/lib/jdk/test/lib/hprof/util/Misc.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/Misc.java rename to test/lib/jdk/test/lib/hprof/util/Misc.java diff --git a/jdk/test/lib/jdk/test/lib/hprof/util/VectorSorter.java b/test/lib/jdk/test/lib/hprof/util/VectorSorter.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/hprof/util/VectorSorter.java rename to test/lib/jdk/test/lib/hprof/util/VectorSorter.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java b/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/AppExecutorHelper.java rename to test/lib/jdk/test/lib/jfr/AppExecutorHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/CommonHelper.java b/test/lib/jdk/test/lib/jfr/CommonHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/CommonHelper.java rename to test/lib/jdk/test/lib/jfr/CommonHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/EventField.java b/test/lib/jdk/test/lib/jfr/EventField.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/EventField.java rename to test/lib/jdk/test/lib/jfr/EventField.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/EventNames.java b/test/lib/jdk/test/lib/jfr/EventNames.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/EventNames.java rename to test/lib/jdk/test/lib/jfr/EventNames.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/EventTypePrototype.java b/test/lib/jdk/test/lib/jfr/EventTypePrototype.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/EventTypePrototype.java rename to test/lib/jdk/test/lib/jfr/EventTypePrototype.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/EventVerifier.java b/test/lib/jdk/test/lib/jfr/EventVerifier.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/EventVerifier.java rename to test/lib/jdk/test/lib/jfr/EventVerifier.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/Events.java b/test/lib/jdk/test/lib/jfr/Events.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/Events.java rename to test/lib/jdk/test/lib/jfr/Events.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/FileHelper.java b/test/lib/jdk/test/lib/jfr/FileHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/FileHelper.java rename to test/lib/jdk/test/lib/jfr/FileHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/GCHelper.java b/test/lib/jdk/test/lib/jfr/GCHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/GCHelper.java rename to test/lib/jdk/test/lib/jfr/GCHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/RecurseThread.java b/test/lib/jdk/test/lib/jfr/RecurseThread.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/RecurseThread.java rename to test/lib/jdk/test/lib/jfr/RecurseThread.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/SimpleEvent.java b/test/lib/jdk/test/lib/jfr/SimpleEvent.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/SimpleEvent.java rename to test/lib/jdk/test/lib/jfr/SimpleEvent.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/SimpleEventHelper.java b/test/lib/jdk/test/lib/jfr/SimpleEventHelper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/SimpleEventHelper.java rename to test/lib/jdk/test/lib/jfr/SimpleEventHelper.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/SimpleSetting.java b/test/lib/jdk/test/lib/jfr/SimpleSetting.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/SimpleSetting.java rename to test/lib/jdk/test/lib/jfr/SimpleSetting.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/Stressor.java b/test/lib/jdk/test/lib/jfr/Stressor.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/Stressor.java rename to test/lib/jdk/test/lib/jfr/Stressor.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/TestClassLoader.java b/test/lib/jdk/test/lib/jfr/TestClassLoader.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/TestClassLoader.java rename to test/lib/jdk/test/lib/jfr/TestClassLoader.java diff --git a/jdk/test/lib/jdk/test/lib/jfr/VoidFunction.java b/test/lib/jdk/test/lib/jfr/VoidFunction.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/jfr/VoidFunction.java rename to test/lib/jdk/test/lib/jfr/VoidFunction.java diff --git a/jdk/test/lib/jdk/test/lib/management/DynamicVMOption.java b/test/lib/jdk/test/lib/management/DynamicVMOption.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/management/DynamicVMOption.java rename to test/lib/jdk/test/lib/management/DynamicVMOption.java diff --git a/jdk/test/lib/jdk/test/lib/management/InputArguments.java b/test/lib/jdk/test/lib/management/InputArguments.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/management/InputArguments.java rename to test/lib/jdk/test/lib/management/InputArguments.java diff --git a/jdk/test/lib/jdk/test/lib/management/ThreadMXBeanTool.java b/test/lib/jdk/test/lib/management/ThreadMXBeanTool.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/management/ThreadMXBeanTool.java rename to test/lib/jdk/test/lib/management/ThreadMXBeanTool.java diff --git a/jdk/test/lib/jdk/test/lib/process/ExitCode.java b/test/lib/jdk/test/lib/process/ExitCode.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/ExitCode.java rename to test/lib/jdk/test/lib/process/ExitCode.java diff --git a/jdk/test/lib/jdk/test/lib/process/OutputAnalyzer.java b/test/lib/jdk/test/lib/process/OutputAnalyzer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/OutputAnalyzer.java rename to test/lib/jdk/test/lib/process/OutputAnalyzer.java diff --git a/jdk/test/lib/jdk/test/lib/process/OutputBuffer.java b/test/lib/jdk/test/lib/process/OutputBuffer.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/OutputBuffer.java rename to test/lib/jdk/test/lib/process/OutputBuffer.java diff --git a/jdk/test/lib/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/ProcessTools.java rename to test/lib/jdk/test/lib/process/ProcessTools.java diff --git a/jdk/test/lib/jdk/test/lib/process/StreamPumper.java b/test/lib/jdk/test/lib/process/StreamPumper.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/process/StreamPumper.java rename to test/lib/jdk/test/lib/process/StreamPumper.java diff --git a/jdk/test/lib/jdk/test/lib/thread/TestThread.java b/test/lib/jdk/test/lib/thread/TestThread.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/thread/TestThread.java rename to test/lib/jdk/test/lib/thread/TestThread.java diff --git a/jdk/test/lib/jdk/test/lib/thread/XRun.java b/test/lib/jdk/test/lib/thread/XRun.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/thread/XRun.java rename to test/lib/jdk/test/lib/thread/XRun.java diff --git a/jdk/test/lib/jdk/test/lib/util/Pair.java b/test/lib/jdk/test/lib/util/Pair.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/util/Pair.java rename to test/lib/jdk/test/lib/util/Pair.java diff --git a/jdk/test/lib/jdk/test/lib/util/SerializationUtils.java b/test/lib/jdk/test/lib/util/SerializationUtils.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/util/SerializationUtils.java rename to test/lib/jdk/test/lib/util/SerializationUtils.java diff --git a/jdk/test/lib/jdk/test/lib/util/Triple.java b/test/lib/jdk/test/lib/util/Triple.java similarity index 100% rename from jdk/test/lib/jdk/test/lib/util/Triple.java rename to test/lib/jdk/test/lib/util/Triple.java diff --git a/jdk/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java similarity index 100% rename from jdk/test/lib/sun/hotspot/WhiteBox.java rename to test/lib/sun/hotspot/WhiteBox.java diff --git a/jdk/test/lib/sun/hotspot/code/BlobType.java b/test/lib/sun/hotspot/code/BlobType.java similarity index 100% rename from jdk/test/lib/sun/hotspot/code/BlobType.java rename to test/lib/sun/hotspot/code/BlobType.java diff --git a/jdk/test/lib/sun/hotspot/code/CodeBlob.java b/test/lib/sun/hotspot/code/CodeBlob.java similarity index 100% rename from jdk/test/lib/sun/hotspot/code/CodeBlob.java rename to test/lib/sun/hotspot/code/CodeBlob.java diff --git a/jdk/test/lib/sun/hotspot/code/Compiler.java b/test/lib/sun/hotspot/code/Compiler.java similarity index 100% rename from jdk/test/lib/sun/hotspot/code/Compiler.java rename to test/lib/sun/hotspot/code/Compiler.java diff --git a/jdk/test/lib/sun/hotspot/code/NMethod.java b/test/lib/sun/hotspot/code/NMethod.java similarity index 100% rename from jdk/test/lib/sun/hotspot/code/NMethod.java rename to test/lib/sun/hotspot/code/NMethod.java diff --git a/jdk/test/lib/sun/hotspot/cpuinfo/CPUInfo.java b/test/lib/sun/hotspot/cpuinfo/CPUInfo.java similarity index 100% rename from jdk/test/lib/sun/hotspot/cpuinfo/CPUInfo.java rename to test/lib/sun/hotspot/cpuinfo/CPUInfo.java diff --git a/jdk/test/lib/sun/hotspot/gc/GC.java b/test/lib/sun/hotspot/gc/GC.java similarity index 100% rename from jdk/test/lib/sun/hotspot/gc/GC.java rename to test/lib/sun/hotspot/gc/GC.java diff --git a/jdk/test/lib/sun/hotspot/parser/DiagnosticCommand.java b/test/lib/sun/hotspot/parser/DiagnosticCommand.java similarity index 100% rename from jdk/test/lib/sun/hotspot/parser/DiagnosticCommand.java rename to test/lib/sun/hotspot/parser/DiagnosticCommand.java