From b5b24b904a68432153e8fa5c10cab5c27e871722 Mon Sep 17 00:00:00 2001 From: Semyon Sadetsky Date: Mon, 3 Jun 2019 08:13:18 -0700 Subject: [PATCH 001/109] 8196096: javax/swing/JPopupMenu/6580930/bug6580930.java fails Reviewed-by: serb --- test/jdk/ProblemList.txt | 2 +- .../swing/JPopupMenu/6580930/bug6580930.java | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 7904f4f399f..7b7f69cbc26 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -735,7 +735,7 @@ javax/swing/JFileChooser/DeserializedJFileChooser/DeserializedJFileChooserTest.j javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8198003 generic-all javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8193942 generic-all javax/swing/JList/6462008/bug6462008.java 7156347 generic-all -javax/swing/JPopupMenu/6580930/bug6580930.java 8196096 windows-all,macosx-all +javax/swing/JPopupMenu/6580930/bug6580930.java 7124313 macosx-all javax/swing/JPopupMenu/6800513/bug6800513.java 7184956 macosx-all javax/swing/JPopupMenu/6675802/bug6675802.java 8196097 windows-all javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all diff --git a/test/jdk/javax/swing/JPopupMenu/6580930/bug6580930.java b/test/jdk/javax/swing/JPopupMenu/6580930/bug6580930.java index c545d8191f1..6e935e72d8e 100644 --- a/test/jdk/javax/swing/JPopupMenu/6580930/bug6580930.java +++ b/test/jdk/javax/swing/JPopupMenu/6580930/bug6580930.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -42,6 +42,8 @@ public class bug6580930 { private static JPopupMenu popup; private static Toolkit toolkit; private static volatile boolean skipTest = false; + private static Point loc; + private static int y; private static void createGui() { frame = new JFrame(); @@ -93,12 +95,15 @@ public class bug6580930 { if(skipTest) { return; } - Point loc = frame.getLocationOnScreen(); + + SwingUtilities.invokeAndWait(() -> loc = frame.getLocationOnScreen()); + robot.waitForIdle(); robot.mouseMove(loc.x, loc.y); showPopup(); robot.waitForIdle(); - if (isHeavyWeightMenuVisible()) { + if (!System.getProperty("os.name").startsWith("Mac") + && isHeavyWeightMenuVisible()) { throw new RuntimeException("HeavyWeightPopup is unexpectedly visible"); } @@ -106,12 +111,16 @@ public class bug6580930 { robot.keyRelease(KeyEvent.VK_ESCAPE); int x = loc.x; - int y = loc.y + (frame.getHeight() - popup.getPreferredSize().height) + 1; + SwingUtilities.invokeAndWait( () -> y = loc.y + (frame.getHeight() - + popup.getPreferredSize().height) + 1); + robot.waitForIdle(); robot.mouseMove(x, y); showPopup(); + SwingUtilities.invokeAndWait(() -> loc = popup.getLocationOnScreen()); + robot.waitForIdle(); - if (!popup.getLocationOnScreen().equals(new Point(x, y))) { + if (!loc.equals(new Point(x, y))) { throw new RuntimeException("Popup is unexpectedly shifted"); } From 427e1e28b1e43e5ee494482eb55049b80b7952d1 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Tue, 4 Jun 2019 14:43:57 +0530 Subject: [PATCH 002/109] 8224876: javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java fails on linux-x64 Reviewed-by: serb, jdv --- .../swing/JWindow/ShapedAndTranslucentWindows/Common.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java b/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java index e43365bba9f..a79b62df432 100644 --- a/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java +++ b/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java @@ -385,13 +385,13 @@ public abstract class Common { // Drag Point location = window.getLocationOnScreen(); robot.dragAndDrop(location.x + 30, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl)); - robot.waitForIdle(delay); + robot.waitForIdle(2*delay); checkDynamicShape(); // Resize location = window.getLocationOnScreen(); robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl); - robot.waitForIdle(delay); + robot.waitForIdle(2*delay); checkDynamicShape(); EventQueue.invokeAndWait(this::dispose); From eb555dec7793d380e98ef27c9175e83561496f55 Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Thu, 6 Jun 2019 15:46:36 +0300 Subject: [PATCH 003/109] 8225118: Robot.createScreenCapture() returns black image on HiDPI linux with gtk3 Reviewed-by: serb --- .../unix/native/libawt_xawt/awt/gtk3_interface.c | 11 ++++++++--- .../unix/native/libawt_xawt/awt/gtk3_interface.h | 1 + .../HiDPIRobotScreenCaptureTest.java | 14 ++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c index f5cf4914ef8..62da2a7edf2 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c @@ -324,6 +324,8 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name) /* GDK */ fp_gdk_get_default_root_window = dl_symbol("gdk_get_default_root_window"); + fp_gdk_window_get_scale_factor = + dl_symbol("gdk_window_get_scale_factor"); /* Pixbuf */ fp_gdk_pixbuf_new = dl_symbol("gdk_pixbuf_new"); @@ -2888,7 +2890,10 @@ static gboolean gtk3_get_drawable_data(JNIEnv *env, jintArray pixelArray, jint *ary; GdkWindow *root = (*fp_gdk_get_default_root_window)(); - pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(root, x, y, width, height); + int win_scale = (*fp_gdk_window_get_scale_factor)(root); + pixbuf = (*fp_gdk_pixbuf_get_from_drawable)( + root, x, y, (int)(width / (float)win_scale + 0.5), (int)(height / (float)win_scale + 0.5)); + if (pixbuf && scale != 1) { GdkPixbuf *scaledPixbuf; x /= scale; @@ -2906,8 +2911,8 @@ static gboolean gtk3_get_drawable_data(JNIEnv *env, jintArray pixelArray, if (pixbuf) { int nchan = (*fp_gdk_pixbuf_get_n_channels)(pixbuf); int stride = (*fp_gdk_pixbuf_get_rowstride)(pixbuf); - if ((*fp_gdk_pixbuf_get_width)(pixbuf) == width - && (*fp_gdk_pixbuf_get_height)(pixbuf) == height + if ((*fp_gdk_pixbuf_get_width)(pixbuf) >= width + && (*fp_gdk_pixbuf_get_height)(pixbuf) >= height && (*fp_gdk_pixbuf_get_bits_per_sample)(pixbuf) == 8 && (*fp_gdk_pixbuf_get_colorspace)(pixbuf) == GDK_COLORSPACE_RGB && nchan >= 3 diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h index 62a81252176..44c0db7086e 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h +++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h @@ -253,6 +253,7 @@ static gchar* (*fp_gtk_check_version)(guint required_major, guint static void (*fp_g_free)(gpointer mem); static void (*fp_g_object_unref)(gpointer object); static GdkWindow *(*fp_gdk_get_default_root_window) (void); +static int (*fp_gdk_window_get_scale_factor) (GdkWindow *window); static int (*fp_gdk_pixbuf_get_bits_per_sample)(const GdkPixbuf *pixbuf); static guchar *(*fp_gdk_pixbuf_get_pixels)(const GdkPixbuf *pixbuf); diff --git a/test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java b/test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java index f99437208e3..85378f00ad6 100644 --- a/test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java +++ b/test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java @@ -38,7 +38,7 @@ import javax.swing.UIManager; * @bug 8073320 * @summary Windows HiDPI support * @author Alexander Scherbatiy - * @requires (os.family == "windows") + * @requires (os.family == "linux" | os.family == "windows") * @run main/othervm -Dsun.java2d.win.uiScaleX=3 -Dsun.java2d.win.uiScaleY=2 * HiDPIRobotScreenCaptureTest */ @@ -50,11 +50,13 @@ public class HiDPIRobotScreenCaptureTest { public static void main(String[] args) throws Exception { - try { - UIManager.setLookAndFeel( - "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); - } catch (Exception e) { - return; + if (System.getProperty("os.name").toLowerCase().contains("win")) { + try { + UIManager.setLookAndFeel( + "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); + } catch (Exception e) { + return; + } } Frame frame = new Frame(); From 4a53af6cbc5889f386e8ed8958c2f04f5166133a Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Sun, 9 Jun 2019 14:12:18 -0700 Subject: [PATCH 004/109] 8222083: Support of "64-bit IEEE floating point" encoding for the AU file format Reviewed-by: prr --- .../com/sun/media/sound/AuFileFormat.java | 6 +- .../com/sun/media/sound/AuFileReader.java | 12 +- .../spi/AudioFileReader/RecognizeAuFloat.java | 707 ++++++++++++++++++ 3 files changed, 717 insertions(+), 8 deletions(-) create mode 100644 test/jdk/javax/sound/sampled/spi/AudioFileReader/RecognizeAuFloat.java diff --git a/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java b/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java index dc425e40a65..a684cfb970f 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -45,8 +45,8 @@ final class AuFileFormat extends StandardFileFormat { static final int AU_LINEAR_24 = 4; /* 24-bit linear PCM */ static final int AU_LINEAR_32 = 5; /* 32-bit linear PCM */ static final int AU_FLOAT = 6; /* 32-bit IEEE floating point */ + static final int AU_DOUBLE = 7; /* 64-bit IEEE floating point */ // we don't support these ... -// static final int AU_DOUBLE = 7; /* 64-bit IEEE floating point */ // static final int AU_ADPCM_G721 = 23; /* 4-bit CCITT g.721 ADPCM */ // static final int AU_ADPCM_G722 = 24; /* CCITT g.722 ADPCM */ // static final int AU_ADPCM_G723_3 = 25; /* CCITT g.723 3-bit ADPCM */ @@ -93,6 +93,8 @@ final class AuFileFormat extends StandardFileFormat { } else if (AudioFormat.Encoding.PCM_FLOAT.equals(encoding)) { if (format.getSampleSizeInBits() == 32) { auType = AU_FLOAT; + } else if (format.getSampleSizeInBits() == 64) { + auType = AU_DOUBLE; } } } diff --git a/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java b/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java index 8ca5e796f04..ccc74771b0c 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -101,12 +101,12 @@ public final class AuFileReader extends SunFileReader { encoding = AudioFormat.Encoding.PCM_FLOAT; sampleSizeInBits = 32; break; + case AuFileFormat.AU_DOUBLE: + encoding = AudioFormat.Encoding.PCM_FLOAT; + sampleSizeInBits = 64; + break; // we don't support these ... - /* case AuFileFormat.AU_DOUBLE: - encoding = new AudioFormat.DOUBLE; - sampleSizeInBits = 8; - break; - case AuFileFormat.AU_ADPCM_G721: + /* case AuFileFormat.AU_ADPCM_G721: encoding = new AudioFormat.G721_ADPCM; sampleSizeInBits = 16; break; diff --git a/test/jdk/javax/sound/sampled/spi/AudioFileReader/RecognizeAuFloat.java b/test/jdk/javax/sound/sampled/spi/AudioFileReader/RecognizeAuFloat.java new file mode 100644 index 00000000000..fdf901157b5 --- /dev/null +++ b/test/jdk/javax/sound/sampled/spi/AudioFileReader/RecognizeAuFloat.java @@ -0,0 +1,707 @@ +/* + * Copyright (c) 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 + * 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.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; + +/** + * @test + * @bug 8146239 + * @summary Tests that AU_FLOAT and AU_DOUBLE formats are supported + */ +public final class RecognizeAuFloat { + // Create the audio file + // $sox -c 2 -n -b 32 -e floating-point -r 32000 --comment '' tmp.au synth 0.01 sine 1-90000 sine 90000-1 + // sndfile will remove the optional information chunk + // $sndfile-convert tmp.au data.au + private static final byte[] data32 = + new byte[]{46, 115, 110, 100, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 6, + 0, 0, 125, 0, 0, 0, 0, 2, 55, 30, 0, 0, -66, 83, 22, 72, 57, + 20, 0, 0, -66, -22, -69, 4, 57, -100, -96, 0, 62, -119, 4, + -42, 57, -15, -80, 0, -67, -102, -15, -24, 58, 39, -84, 0, + -68, 77, 29, 64, 58, 88, -104, 0, 61, 39, -13, -64, 58, + -122, -16, 0, -69, -74, -27, -128, 58, -94, -26, 0, -66, 42, + 16, 116, 58, -63, 38, 0, 63, 5, 27, -95, 58, -32, -6, 0, + -65, 25, 104, -34, 59, 1, -98, 0, -66, -67, -43, 98, 59, 19, + -85, 0, 62, -37, 121, -120, 59, 39, 4, 0, 63, 21, 30, 50, + 59, 59, 110, 0, 63, 65, 109, 87, 59, 81, 60, 0, 63, 11, 74, + 112, 59, 104, 67, 0, 62, -36, 123, -48, 59, -128, 100, 0, + -66, -50, -18, -128, 59, -115, 88, -128, -65, 20, -62, 90, + 59, -101, 27, -128, -67, -122, 39, -88, 59, -87, -89, -128, + 63, 81, 60, -32, 59, -71, 18, -128, -65, 52, -14, 17, 59, + -55, 95, -128, 62, 91, 110, -100, 59, -38, -97, 0, 62, 36, + 28, -120, 59, -20, -38, 0, -66, -97, 28, -24, 60, 0, 15, 0, + 62, -95, 14, 112, 60, 10, 60, -128, -66, -125, -38, 104, 60, + 20, -5, 0, 62, 64, -85, -72, 60, 32, 83, -64, -66, 0, -88, + -124, 60, 44, 75, -128, 61, -104, -68, -104, 60, 56, -19, + 64, -67, 11, -80, 16, 60, 70, 62, 0, 59, 12, 0, 0, 60, 84, + 73, 64, 60, -72, 108, -128, 60, 99, 21, 0, -67, 6, -91, 32, + 60, 114, -83, -128, 61, 110, -11, 32, 60, -127, -116, -64, + -67, 73, -87, -64, 60, -118, 51, 64, 61, -71, 28, -96, 60, + -109, 77, -32, -67, -66, 26, -72, 60, -100, -29, -96, 61, + -101, 24, -112, 60, -90, -7, 32, -67, 110, -4, -64, 60, -79, + -107, -96, 61, -85, -41, 112, 60, -68, -66, 64, -67, -117, + 85, 8, 60, -56, 122, -96, 61, 119, 33, -128, 60, -44, -48, + -32, -67, -123, -116, 104, 60, -31, -56, -64, 60, -101, -65, + -128, 60, -17, 105, 96, 60, 71, 29, -128, 60, -3, -70, -32, + -67, -121, -72, 32, 61, 6, 98, -80, 62, 17, 12, -52, 61, 14, + 72, -96, -66, 98, -7, 120, 61, 22, -109, -48, 62, -89, -123, + -114, 61, 31, 72, -64, -66, -46, -27, -126, 61, 40, 108, + 112, 62, -24, 13, -98, 61, 50, 3, -64, -66, -49, -111, -118, + 61, 60, 20, 32, 62, 65, -50, 0, 61, 70, -94, -48, 62, 7, + -53, -92, 61, 81, -75, -80, -65, 15, 22, 51, 61, 93, 82, + -112, 63, 75, 122, 6, 61, 105, 127, -64, -65, 39, -103, 108, + 61, 118, 67, -128, 61, 102, -22, 32, 61, -127, -46, 80, 63, + 3, -8, 3, 61, -120, -44, -16, -65, 13, 31, -78, 61, -112, + 45, 88, -66, 26, 95, 88, 61, -105, -33, 40, 63, 56, 1, -51, + 61, -97, -18, 104, -66, -87, 96, -96, 61, -88, 94, -24, -65, + 14, -12, 116, 61, -79, 53, 8, 62, -28, 8, -68, 61, -70, 116, + -16, 62, -11, -35, 8, 61, -60, 35, 48, -65, 7, -110, 47, 61, + -50, 68, 96, -65, 4, 62, -13, 61, -40, -35, 48, 62, -54, + -54, 70, 61, -29, -14, -64, 63, 28, -19, -10, 61, -17, -119, + -80, -66, 74, 117, -88, 61, -5, -89, -24, -65, 55, 82, 2, + 62, 4, 40, -40, -66, 119, -21, -24, 62, 10, -58, -4, 62, -8, + 108, 110, 62, 17, -80, 40, 63, 38, 48, 49, 62, 24, -24, + -112, -67, 110, -90, 32, 62, 32, 113, 92, -65, 29, -111, + -11, 62, 40, 79, -92, -65, 31, 111, 119, 62, 48, -125, -68, + -67, -99, -66, -80, 62, 57, 19, -60, 62, -13, -69, 100, 62, + 65, -1, 16, 63, 53, 109, -123, 62, 75, 76, -64, 62, -112, + 45, 8, 62, 84, -5, 36, -66, -117, -58, -90, 62, 95, 18, 24, + -65, 43, -15, -111, 62, 105, -113, 36, -65, 37, -126, 17, + 62, 116, 122, 72, -66, -71, 7, 124, 62, 127, -48, -48, 61, + -80, 58, 104, 62, -123, -52, -22, 63, 10, -42, -96, 62, + -117, -23, -88, 63, 53, 17, -15, 62, -110, 64, -8, 63, 4, + -33, -105, 62, -104, -46, -42, 62, 14, -16, 16, 62, -97, + -97, 98, -66, -120, -100, 48, 62, -90, -88, 106, -65, 16, + -55, 65, 62, -83, -22, -104, -65, 50, 111, 94, 62, -75, 106, + 126, -65, 43, -76, -4, 62, -67, 31, -16, -65, 5, 60, 84, 62, + -59, 19, 34, -66, -101, 116, -118, 62, -51, 53, -64, -67, + -114, -112, 112, 62, -43, -108, 62, 62, 124, 61, 4, 62, -34, + 25, 4, 63, 12, -46, 66, 62, -26, -44, -28, 63, 46, -89, -62, + 62, -17, -86, 94, 63, 49, -118, -31, 62, -8, -83, -6, 63, + 18, 74, -70, 63, 0, -35, 49, 62, -57, -13, -10, 63, 5, 115, + 21, 62, 39, 28, -108, 63, 10, 2, -109, -67, 91, 2, -48, 63, + 14, -106, 126, -66, -125, -114, 6, 63, 19, 22, 108, -66, + -43, -29, 52, 63, 23, -118, -117, -65, 11, 119, -38, 63, 27, + -39, -51, -65, 32, -43, 72, 63, 32, 6, -41, -65, 46, 64, + -64, 63, 35, -6, 65, -65, 51, -67, -118, 63, 39, -83, -78, + -65, 51, -12, -67, 63, 43, 14, 38, -65, 47, -33, -17, 63, + 46, 8, 121, -65, 41, 19, 46, 63, 48, -111, 23, -65, 32, -60, + -18, 63, 50, -124, 76, -65, 23, -122, -109, 63, 51, -31, 5, + -65, 14, -121, 38, 63, 52, 111, -48, -65, 5, -96, -7, 63, + 52, 60, -30, -66, -5, -52, -60, 63, 50, -5, 32, -66, -19, + -110, -102, 63, 48, -58, 58, -66, -30, 112, -76, 63, 45, 59, + -112, -66, -40, -12, 36, 63, 40, -121, -76, -66, -46, -85, + 120, 63, 34, 53, -105, -66, -50, 29, 12, 63, 26, -125, 46, + -66, -52, -124, 104, 63, 16, -17, -11, -66, -52, -114, 12, + 63, 5, -54, -26, -66, -49, 34, 40, 62, -15, 39, -124, -66, + -45, 38, -34, 62, -45, 83, 6, -66, -39, 53, 112, 62, -79, + 58, -88, -66, -32, 113, 10, 62, -117, -71, 118, -66, -23, + 44, -72, 62, 68, -124, 88, -66, -14, -61, 36, 61, -41, 35, + -48, -66, -3, 76, -16, 60, 73, 21, 64, -65, 4, 41, 121, -67, + -84, -32, 56, -65, 9, -32, 97, -66, 59, -16, -68, -65, 15, + -95, -73, -66, -112, -19, 104, -65, 21, 83, -106, -66, -62, + 84, 28, -65, 26, -38, 66, -66, -15, 61, -70, -65, 32, 18, + -104, -65, 13, 91, 117, -65, 36, -21, 35, -65, 31, 24, -23, + -65, 41, 61, 53, -65, 43, -67, -83, -65, 44, -1, 47, -65, + 51, 118, 20, -65, 48, 11, 126, -65, 51, -106, -70, -65, 50, + 94, -68, -65, 45, 55, 12, -65, 51, -40, 0, -65, 29, 54, 57, + -65, 52, 121, 12, -65, 6, 103, 50, -65, 52, 40, 15, -66, + -54, 55, 44, -65, 50, -21, 51, -66, 126, 66, -44, -65, 48, + -79, 26, -67, 117, 95, -48, -65, 45, -125, -61, 61, -106, + 52, -96, -65, 41, 90, -97, 61, -57, 113, -120, -65, 36, 66, + -15, 62, 12, -23, 24, -65, 30, 60, -115, 62, 48, 125, 20, + -65, 23, 87, 95, 62, 90, -59, 68, -65, 15, -102, -111, 62, + -127, -1, 112, -65, 7, 24, 12, 62, -104, 94, -106, -66, -5, + -71, -60, 62, -82, -25, -76, -66, -25, -8, -128, 62, -58, + 53, -84, -66, -45, 14, -22, 62, -35, -81, -96, -66, -67, 36, + -120, 62, -11, 6, -66, -66, -90, 97, 4, 63, 6, 3, 127, -66, + -114, -21, -84, 63, 16, -20, 40, -66, 109, -36, 56, 63, 27, + 40, 41, -66, 61, 28, 72, 63, 36, 33, -103, -66, 11, -23, 72, + 63, 43, -83, 65, -67, -75, 19, 40, 63, 49, 27, 71, -67, 37, + 37, 48, 63, 52, 32, -92, 59, -13, 9, 0, 63, 51, -1, -36, 61, + 95, 94, -112, 63, 48, 88, -114, 61, -50, 123, -8, 63, 40, + 111, -36, 62, 21, -110, 52, 63, 27, -12, -26, 62, 66, -90, + -48, 63, 10, 76, 35, 62, 110, 78, 0, 62, -26, -13, -12, 62, + -116, 49, -14, 62, -82, 100, -112, 62, -96, 99, 6, 62, 88, + -35, 60, 62, -77, -83, 18, 61, -122, 105, 8, 62, -58, 4, 54, + -67, -72, 110, -32, 62, -41, 95, -40, -66, -128, -100, 68, + 62, -25, -72, -8, -66, -50, -95, -10, 62, -9, 11, 32, -65, + 10, 90, -74, 63, 2, -87, -56, -65, 36, 41, 100, 63, 9, 72, + -63, -65, 51, 48, -12, 63, 15, 98, -30, -65, 49, 114, 53, + 63, 20, -7, 86, -65, 31, -51, 3, 63, 26, 13, -7, -66, -14, + -93, 4, 63, 30, -93, 56, -66, -118, -69, 76, 63, 34, -68, + 16, -70, -82, 44, 0, 63, 38, 91, -23, 62, 94, 113, -52, 63, + 41, -122, -105, 62, -89, -122, -42, 63, 44, 64, 56, 62, -28, + 76, -10, 63, 46, -115, 50, 63, 12, 66, 105, 63, 48, 114, 28, + 63, 34, 21, 2, 63, 49, -13, -73, 63, 48, 66, -126, 63, 51, + 22, -34, 63, 52, 69, -91, 63, 51, -32, 123, 63, 44, 33, -96, + 63, 52, 85, -126, 63, 21, 55, -35, 63, 52, 122, -32, 62, + -33, -42, 72, 63, 52, 85, 123, 62, 113, 54, 96, 63, 51, -22, + 37, -69, 84, -27, 0, 63, 51, 61, -98, -66, -125, -34, -80, + 63, 50, 84, -124, -66, -7, -59, 56, 63, 49, 51, 90, -65, 38, + -69, 12, 63, 47, -34, 124, -65, 52, 120, -13, 63, 46, 90, + 32, -65, 28, -48, -75, 63, 44, -86, 84, -66, -62, -122, 2, + 63, 42, -46, -4, -68, -66, 18, -64, 63, 40, -41, -49, 62, + -125, 39, -32, 63, 38, -68, 89, 62, -23, 125, -60, 63, 36, + -125, -7, 63, 32, 56, 64, 63, 34, 49, -32, 63, 51, -95, -58, + 63, 31, -55, 21, 63, 41, -75, 70, 63, 29, 76, 114, 62, -7, + -33, -98, 63, 26, -66, -91, 62, 65, -30, 76, 63, 24, 34, 52, + -66, 48, 71, -116, 63, 21, 121, 124, -65, 2, -67, 114, 63, + 18, -58, -80, -65, 49, 29, -36, 63, 16, 11, -32, -65, 34, + -68, -19, 63, 13, 74, -12, -66, -104, 24, -26, 63, 10, -123, + -76, 62, 51, 28, -80, 63, 7, -67, -61, 63, 2, 89, -28, 63, + 4, -12, -89, 63, 47, -73, -62, 63, 2, 43, -61, 63, 39, 28, + 20, 62, -2, -56, -64, 62, -77, 8, -104, 62, -7, 63, 86, -67, + -19, -18, -96, 62, -13, -67, 110, -65, 14, -31, -41, 62, + -18, 68, -10, -65, 50, -108, 124, 62, -24, -41, -72, -66, + -51, -101, 100, 62, -29, 119, 74, 62, 81, -23, -92, 62, -34, + 37, 28, 63, 35, 19, -90, 62, -40, -30, 118, 63, 42, 75, 0, + 62, -45, -80, -126, 62, -101, 23, -2, 62, -50, -112, 60, + -66, -92, 113, 88, 62, -55, -126, -110, -65, 48, 57, -75, + 62, -60, -120, 62, -66, -18, 109, -36, 62, -65, -95, -2, 62, + -122, 46, -94, 62, -70, -48, 80, 63, 43, -78, 92, 62, -74, + 19, -56, 63, 8, -56, 59, 62, -79, 108, -82, -66, 53, 9, -12, + 62, -84, -37, 124, -65, 45, -38, -43, 62, -88, 96, 68, -66, + -64, 66, -114, 62, -93, -5, 104, 62, -5, -24, -122, 62, -97, + -84, -46, 63, 37, -56, 106, 62, -101, 116, -52, -69, -51, + 74, 0, 62, -105, 83, 38, -65, 52, 39, 12, 62, -109, 72, 12, + -66, 105, -56, -88, 62, -113, 83, 68, 63, 34, 28, -23, 62, + -117, 116, -54, 62, -41, 27, -96, 62, -121, -84, 124, -65, + 6, 56, 36, 62, -125, -6, 18, -66, -24, -78, 120, 62, -128, + 93, -98, 63, 26, -115, 55, 62, 121, -84, -36, 62, -72, -90, + 88, 62, 114, -54, 0, -65, 24, -101, -10, 62, 108, 16, 20, + -66, 52, -39, -8, 62, 101, -127, 68, 63, 69, 45, 6, 62, 95, + 25, 120, -66, -68, 112, 34, 62, 88, -36, 112, -66, -63, + -116, 94, 62, 82, -60, 72, 63, 28, 61, 0, 62, 76, -42, -116, + -66, 27, 72, 116, 62, 71, 11, 104, -66, -7, -1, -124, 62, + 65, 106, 68, 63, 84, 48, 84, 62, 59, -23, 120, -65, 42, 107, + 50, 62, 54, -110, 16, 62, -125, -115, -8, 62, 49, 89, 0, 62, + 57, -24, -4, 62, 44, 72, 60, -66, -35, -117, 4, 62, 39, 84, + 100, 63, 1, -103, 34, 62, 34, -121, 12, -66, -17, 116, 4, + 62, 29, -42, 0, 62, -65, -115, 24, 62, 25, 72, -72, -66, + 120, -42, -28, 62, 20, -40, 64, 62, 26, 47, 8, 62, 16, -121, + -112, -67, 77, -2, 32, 62, 12, 85, -124, 59, 64, 93, 0, 62, + 8, 61, -16, 61, 73, 86, -80, 62, 4, 72, 80, -67, -102, 14, + 0, 62, 0, 102, 100, 61, -76, -35, 112, 61, -7, 86, 72, -67, + 121, 104, -96, 61, -15, -9, 56, 61, 123, -75, 16, 61, -22, + -15, 64, -67, 115, -85, 64, 61, -29, -15, 8, 61, -125, -102, + 40, 61, -35, 86, -16, -68, -17, 52, 32, 61, -42, -80, -128, + 61, 30, -101, 112, 61, -48, 124, -16, 60, 14, -37, 0, 61, + -54, 44, 88, -67, 38, 97, 112, 61, -60, 89, 8, 61, 79, -37, + -96, 61, -66, 91, -64, -67, 76, 109, 80, 61, -72, -31, 72, + 61, -73, -94, -88, 61, -77, 54, 72, -67, -4, 114, -24, 61, + -82, 12, 32, 62, 5, 28, 48, 61, -88, -77, -8, -66, 37, 7, + 20, 61, -93, -48, 88, 62, 36, -101, 8, 61, -98, -52, -16, + -67, -40, 80, 112, 61, -102, 37, 64, -67, -91, -60, 104, 61, + -107, 121, -88, 62, -47, 16, 34, 61, -111, 2, -72, -65, 69, + 50, -82, 61, -116, -78, -96, 63, 20, -70, 1, 61, -120, 97, + 56, 62, -127, -67, -36, 61, -124, 112, 96, -65, 33, -9, -43, + 61, -128, 57, -16, -66, -7, -70, 72, 61, 121, 86, -32, 62, + 41, -78, 116, 61, 113, 13, -80, 63, 18, -75, -76, 61, 106, + -72, 112, 63, 48, 90, 88, 61, 98, -123, 48, 63, 52, 13, -69, + 61, 92, -10, 16, 63, 45, 31, -18, 61, 84, -47, 48, 62, -32, + 12, 26, 61, 80, 0, 48, -66, 38, -81, 88, 61, 71, -23, -16, + -65, 63, -24, 61, 61, 67, -57, 0, 62, -106, -40, 110, 61, + 59, -55, 48, 62, 116, 6, 44, 61, 56, 58, 80, -66, -67, 31, + 42, 61, 48, 106, 64, 62, -88, 121, 104, 61, 45, 73, 16, -66, + -115, -11, -110, 61, 37, -53, 48, 62, -128, -110, -42, 61, + 34, -33, -80, -66, 121, 84, -44, 61, 27, -17, 48, 62, 79, + -38, 28, 61, 24, -30, -16, 61, 91, 108, 16, 61, 18, -23, 32, + -65, 38, 12, 43, 61, 15, 26, -64, 62, 59, -92, -104, 61, 11, + 11, 96, 62, -37, 45, 18, 61, 4, -81, -48, 61, 74, 69, -16, + 61, 6, -67, 80,}; + + // Create the audio file + // $sox -c 2 -n -b 64 -e floating-point -r 32000 --comment '' tmp.au synth 0.01 sine 1-90000 sine 90000-1 + // sndfile will remove the optional information chunk + // $sndfile-convert tmp.au data.au + private static final byte[] data64 = + new byte[]{46, 115, 110, 100, 0, 0, 0, 24, 0, 0, 20, 0, 0, 0, 0, 7, + 0, 0, 125, 0, 0, 0, 0, 2, 62, -29, -76, -128, 0, 0, 0, 0, + -65, -54, 98, -55, 10, 0, 0, 0, 63, 34, 127, 32, 0, 0, 0, 0, + -65, -35, 87, 96, -84, -128, 0, 0, 63, 51, -108, 34, 0, 0, + 0, 0, 63, -47, 32, -102, -49, -128, 0, 0, 63, 62, 54, 74, 0, + 0, 0, 0, -65, -77, 94, 60, -84, 0, 0, 0, 63, 68, -11, 79, 0, + 0, 0, 0, -65, -119, -93, -86, 48, 0, 0, 0, 63, 75, 19, 0, 0, + 0, 0, 0, 63, -92, -2, 120, 56, 0, 0, 0, 63, 80, -34, 23, + -128, 0, 0, 0, -65, 118, -36, -82, 0, 0, 0, 0, 63, 84, 92, + -63, -128, 0, 0, 0, -65, -59, 66, 14, 115, 0, 0, 0, 63, 88, + 36, -38, 0, 0, 0, 0, 63, -32, -93, 116, 32, 0, 0, 0, 63, 92, + 31, 46, -128, 0, 0, 0, -65, -29, 45, 27, -52, 64, 0, 0, 63, + 96, 51, -72, -64, 0, 0, 0, -65, -41, -70, -84, 58, -128, 0, + 0, 63, 98, 117, 82, -128, 0, 0, 0, 63, -37, 111, 49, 18, 0, + 0, 0, 63, 100, -32, 114, -128, 0, 0, 0, 63, -30, -93, -58, + 66, -64, 0, 0, 63, 103, 109, -69, -64, 0, 0, 0, 63, -24, 45, + -86, -27, -128, 0, 0, 63, 106, 39, 113, 0, 0, 0, 0, 63, -31, + 105, 78, 14, 0, 0, 0, 63, 109, 8, 89, 0, 0, 0, 0, 63, -37, + -113, 121, -3, -128, 0, 0, 63, 112, 12, 124, 96, 0, 0, 0, + -65, -39, -35, -48, 29, -128, 0, 0, 63, 113, -85, 22, -32, + 0, 0, 0, -65, -30, -104, 75, 72, -64, 0, 0, 63, 115, 99, + 111, 64, 0, 0, 0, -65, -80, -60, -11, 82, 0, 0, 0, 63, 117, + 52, -17, -128, 0, 0, 0, 63, -22, 39, -100, 28, 64, 0, 0, 63, + 119, 34, 84, -32, 0, 0, 0, -65, -26, -98, 66, 30, 0, 0, 0, + 63, 121, 43, -20, -96, 0, 0, 0, 63, -53, 109, -45, 127, 0, + 0, 0, 63, 123, 83, -34, 0, 0, 0, 0, 63, -60, -125, -111, 35, + 0, 0, 0, 63, 125, -101, 60, 64, 0, 0, 0, -65, -45, -29, -99, + 28, -128, 0, 0, 63, -128, 1, -33, 0, 0, 0, 0, 63, -44, 33, + -50, 29, 0, 0, 0, 63, -127, 71, -115, -80, 0, 0, 0, -65, + -48, 123, 77, 30, 0, 0, 0, 63, -126, -97, 96, -96, 0, 0, 0, + 63, -56, 21, 119, 58, 0, 0, 0, 63, -124, 10, 118, 80, 0, 0, + 0, -65, -64, 21, 16, -60, 0, 0, 0, 63, -123, -119, 115, -96, + 0, 0, 0, 63, -77, 23, -109, 98, 0, 0, 0, 63, -121, 29, -87, + -16, 0, 0, 0, -65, -95, 118, 1, 44, 0, 0, 0, 63, -120, -57, + -66, -128, 0, 0, 0, 63, 97, 127, -7, 0, 0, 0, 0, 63, -118, + -119, 40, -96, 0, 0, 0, 63, -105, 13, -111, 56, 0, 0, 0, 63, + -116, 98, -99, -96, 0, 0, 0, -65, -96, -44, -92, 100, 0, 0, + 0, 63, -114, 85, -80, 32, 0, 0, 0, 63, -83, -34, -93, -24, + 0, 0, 0, 63, -112, 49, -103, 80, 0, 0, 0, -65, -87, 53, 56, + 100, 0, 0, 0, 63, -111, 70, 102, 32, 0, 0, 0, 63, -73, 35, + -108, 44, 0, 0, 0, 63, -110, 105, -69, 40, 0, 0, 0, -65, + -73, -61, 87, -118, 0, 0, 0, 63, -109, -100, 116, 88, 0, 0, + 0, 63, -77, 99, 17, -86, 0, 0, 0, 63, -108, -33, 37, 80, 0, + 0, 0, -65, -83, -33, -104, -20, 0, 0, 0, 63, -106, 50, -78, + 8, 0, 0, 0, 63, -75, 122, -19, -18, 0, 0, 0, 63, -105, -105, + -57, 104, 0, 0, 0, -65, -79, 106, -95, 80, 0, 0, 0, 63, + -103, 15, 82, 104, 0, 0, 0, 63, -82, -28, 47, -68, 0, 0, 0, + 63, -102, -102, 26, 96, 0, 0, 0, -65, -80, -79, -115, -122, + 0, 0, 0, 63, -100, 57, 23, 96, 0, 0, 0, 63, -109, 119, -17, + 0, 0, 0, 0, 63, -99, -19, 43, -8, 0, 0, 0, 63, -120, -29, + -81, -32, 0, 0, 0, 63, -97, -73, 93, -96, 0, 0, 0, -65, -80, + -9, 3, -100, 0, 0, 0, 63, -96, -52, 85, 76, 0, 0, 0, 63, + -62, 33, -103, -109, 0, 0, 0, 63, -95, -55, 20, 116, 0, 0, + 0, -65, -52, 95, 46, -25, 0, 0, 0, 63, -94, -46, 121, 84, 0, + 0, 0, 63, -44, -16, -79, -41, -128, 0, 0, 63, -93, -23, 24, + -80, 0, 0, 0, -65, -38, 92, -80, 77, 0, 0, 0, 63, -91, 13, + -115, -32, 0, 0, 0, 63, -35, 1, -77, -25, 0, 0, 0, 63, -90, + 64, 120, -56, 0, 0, 0, -65, -39, -14, 49, 104, -128, 0, 0, + 63, -89, -126, -125, -120, 0, 0, 0, 63, -56, 57, -65, -19, + 0, 0, 0, 63, -88, -44, 90, 108, 0, 0, 0, 63, -64, -7, 116, + 100, 0, 0, 0, 63, -86, 54, -74, -12, 0, 0, 0, -65, -31, -30, + -58, 100, -64, 0, 0, 63, -85, -86, 83, 0, 0, 0, 0, 63, -23, + 111, 64, -60, -64, 0, 0, 63, -83, 47, -8, 120, 0, 0, 0, -65, + -28, -13, 45, -110, -128, 0, 0, 63, -82, -56, 111, -100, 0, + 0, 0, 63, -84, -35, 68, 16, 0, 0, 0, 63, -80, 58, 73, -36, + 0, 0, 0, 63, -32, 127, 0, 107, 64, 0, 0, 63, -79, 26, -98, + 4, 0, 0, 0, -65, -31, -93, -10, 83, 64, 0, 0, 63, -78, 5, + -85, 102, 0, 0, 0, -65, -61, 75, -21, 38, 0, 0, 0, 63, -78, + -5, -27, 50, 0, 0, 0, 63, -25, 0, 57, -88, -128, 0, 0, 63, + -77, -3, -52, -102, 0, 0, 0, -65, -43, 44, 20, 8, -128, 0, + 0, 63, -75, 11, -36, -46, 0, 0, 0, -65, -31, -34, -114, + -106, -128, 0, 0, 63, -74, 38, -95, 8, 0, 0, 0, 63, -36, + -127, 23, -107, 0, 0, 0, 63, -73, 78, -99, -84, 0, 0, 0, 63, + -34, -69, -95, 14, 0, 0, 0, 63, -72, -124, 102, 120, 0, 0, + 0, -65, -32, -14, 69, -38, 64, 0, 0, 63, -71, -56, -117, + -40, 0, 0, 0, -65, -32, -121, -34, 103, -64, 0, 0, 63, -69, + 27, -90, 118, 0, 0, 0, 63, -39, 89, 72, -38, 0, 0, 0, 63, + -68, 126, 87, -94, 0, 0, 0, 63, -29, -99, -66, -42, 0, 0, 0, + 63, -67, -15, 54, 116, 0, 0, 0, -65, -55, 78, -76, -34, 0, + 0, 0, 63, -65, 116, -4, -82, 0, 0, 0, -65, -26, -22, 64, 89, + -64, 0, 0, 63, -64, -123, 27, 3, 0, 0, 0, -65, -50, -3, 125, + 21, 0, 0, 0, 63, -63, 88, -33, 109, 0, 0, 0, 63, -33, 13, + -115, -60, 0, 0, 0, 63, -62, 54, 5, 67, 0, 0, 0, 63, -28, + -58, 6, 53, 64, 0, 0, 63, -61, 29, 17, -18, 0, 0, 0, -65, + -83, -44, -61, -116, 0, 0, 0, 63, -60, 14, 43, 126, 0, 0, 0, + -65, -29, -78, 62, -76, -64, 0, 0, 63, -59, 9, -12, 83, 0, + 0, 0, -65, -29, -19, -18, -10, -64, 0, 0, 63, -58, 16, 119, + -96, 0, 0, 0, -65, -77, -73, -42, 14, 0, 0, 0, 63, -57, 34, + 120, -123, 0, 0, 0, 63, -34, 119, 108, -99, 0, 0, 0, 63, + -56, 63, -30, 64, 0, 0, 0, 63, -26, -83, -80, -100, -64, 0, + 0, 63, -55, 105, -105, -2, 0, 0, 0, 63, -46, 5, -96, -15, + -128, 0, 0, 63, -54, -97, 100, -116, 0, 0, 0, -65, -47, 120, + -44, -83, -128, 0, 0, 63, -53, -30, 66, -15, 0, 0, 0, -65, + -27, 126, 50, 30, 0, 0, 0, 63, -51, 49, -28, -110, 0, 0, 0, + -65, -28, -80, 66, 35, 0, 0, 0, 63, -50, -113, 73, 47, 0, 0, + 0, -65, -41, 32, -17, 119, -128, 0, 0, 63, -49, -6, 26, 31, + 0, 0, 0, 63, -74, 7, 77, 102, 0, 0, 0, 63, -48, -71, -99, + 98, 0, 0, 0, 63, -31, 90, -44, 17, 64, 0, 0, 63, -47, 125, + 53, 14, -128, 0, 0, 63, -26, -94, 62, 29, 0, 0, 0, 63, -46, + 72, 31, 11, 0, 0, 0, 63, -32, -101, -14, -11, 64, 0, 0, 63, + -45, 26, 90, -23, 0, 0, 0, 63, -63, -34, 1, -36, 0, 0, 0, + 63, -45, -13, -20, 70, -128, 0, 0, -65, -47, 19, -123, -14, + -128, 0, 0, 63, -44, -43, 13, 101, -128, 0, 0, -65, -30, 25, + 40, 47, -128, 0, 0, 63, -43, -67, 83, 25, 0, 0, 0, -65, -26, + 77, -21, -50, -64, 0, 0, 63, -42, -83, 79, -58, 0, 0, 0, + -65, -27, 118, -97, -120, -64, 0, 0, 63, -41, -93, -2, 15, + 0, 0, 0, -65, -32, -89, -118, 122, -128, 0, 0, 63, -40, -94, + 100, 65, 0, 0, 0, -65, -45, 110, -111, 82, -128, 0, 0, 63, + -39, -90, -72, 34, -128, 0, 0, -65, -79, -46, 14, 48, 0, 0, + 0, 63, -38, -78, -121, -43, -128, 0, 0, 63, -49, -121, -96, + 108, 0, 0, 0, 63, -37, -61, 32, -94, -128, 0, 0, 63, -31, + -102, 72, 77, 0, 0, 0, 63, -36, -38, -100, -100, 0, 0, 0, + 63, -27, -44, -8, 75, 64, 0, 0, 63, -35, -11, 75, -73, -128, + 0, 0, 63, -26, 49, 92, 55, 0, 0, 0, 63, -33, 21, -65, 93, + -128, 0, 0, 63, -30, 73, 87, 61, 64, 0, 0, 63, -32, 27, -90, + 45, -64, 0, 0, 63, -40, -2, 126, -69, 0, 0, 0, 63, -32, -82, + 98, -88, 0, 0, 0, 63, -60, -29, -110, 102, 0, 0, 0, 63, -31, + 64, 82, 94, -64, 0, 0, -65, -85, 96, 91, 4, 0, 0, 0, 63, + -31, -46, -49, -65, -64, 0, 0, -65, -48, 113, -64, -42, 0, + 0, 0, 63, -30, 98, -51, -112, 64, 0, 0, -65, -38, -68, 102, + -91, -128, 0, 0, 63, -30, -15, 81, 95, 0, 0, 0, -65, -31, + 110, -5, 67, 0, 0, 0, 63, -29, 123, 57, -90, -128, 0, 0, + -65, -28, 26, -87, 15, -64, 0, 0, 63, -28, 0, -38, -22, + -128, 0, 0, -65, -27, -56, 24, 7, 0, 0, 0, 63, -28, 127, 72, + 54, -128, 0, 0, -65, -26, 119, -79, 75, 0, 0, 0, 63, -28, + -11, -74, 71, 64, 0, 0, -65, -26, 126, -105, -79, 64, 0, 0, + 63, -27, 97, -60, -41, -64, 0, 0, -65, -27, -5, -3, -16, 64, + 0, 0, 63, -27, -63, 15, 40, -64, 0, 0, -65, -27, 34, 101, + -55, 64, 0, 0, 63, -26, 18, 34, -27, -64, 0, 0, -65, -28, + 24, -99, -49, 0, 0, 0, 63, -26, 80, -119, -121, 0, 0, 0, + -65, -30, -16, -46, 103, 0, 0, 0, 63, -26, 124, 32, -98, + -64, 0, 0, -65, -31, -48, -28, -55, -64, 0, 0, 63, -26, + -115, -6, 10, 0, 0, 0, -65, -32, -76, 31, 26, -64, 0, 0, 63, + -26, -121, -100, 75, 64, 0, 0, -65, -33, 121, -104, -99, 0, + 0, 0, 63, -26, 95, 100, 7, -128, 0, 0, -65, -35, -78, 83, + 60, 0, 0, 0, 63, -26, 24, -57, 81, 0, 0, 0, -65, -36, 78, + 22, -86, -128, 0, 0, 63, -27, -89, 113, -4, -64, 0, 0, -65, + -37, 30, -124, -87, -128, 0, 0, 63, -27, 16, -10, 127, -64, + 0, 0, -65, -38, 85, 111, 36, -128, 0, 0, 63, -28, 70, -78, + -26, -128, 0, 0, -65, -39, -61, -95, 119, 0, 0, 0, 63, -29, + 80, 101, -46, 64, 0, 0, -65, -39, -112, -115, 43, -128, 0, + 0, 63, -30, 29, -2, -81, 64, 0, 0, -65, -39, -111, -63, 125, + 0, 0, 0, 63, -32, -71, 92, -46, 0, 0, 0, -65, -39, -28, 69, + 16, 0, 0, 0, 63, -34, 36, -16, 122, -128, 0, 0, -65, -38, + 100, -37, -65, 0, 0, 0, 63, -38, 106, 96, -55, 0, 0, 0, -65, + -37, 38, -82, 17, 0, 0, 0, 63, -42, 39, 85, 33, 0, 0, 0, + -65, -36, 14, 33, 82, 0, 0, 0, 63, -47, 119, 46, -80, -128, + 0, 0, -65, -35, 37, -105, 5, -128, 0, 0, 63, -56, -112, + -118, -42, 0, 0, 0, -65, -34, 88, 100, -116, -128, 0, 0, 63, + -70, -28, 121, -10, 0, 0, 0, -65, -33, -87, -98, 26, -128, + 0, 0, 63, -119, 34, -92, 64, 0, 0, 0, -65, -32, -123, 47, + 53, 64, 0, 0, -65, -75, -100, 7, 12, 0, 0, 0, -65, -31, 60, + 12, 44, 0, 0, 0, -65, -57, 126, 23, -88, 0, 0, 0, -65, -31, + -12, 54, -30, -128, 0, 0, -65, -46, 29, -83, 7, -128, 0, 0, + -65, -30, -86, 114, -44, 64, 0, 0, -65, -40, 74, -125, 121, + -128, 0, 0, -65, -29, 91, 72, 77, 64, 0, 0, -65, -34, 39, + -73, 65, -128, 0, 0, -65, -28, 2, 83, 7, 64, 0, 0, -65, -31, + -85, 110, -101, -64, 0, 0, -65, -28, -99, 100, 118, 64, 0, + 0, -65, -29, -29, 29, 57, 64, 0, 0, -65, -27, 39, -90, -96, + 0, 0, 0, -65, -27, 119, -75, -92, 0, 0, 0, -65, -27, -97, + -27, -34, -128, 0, 0, -65, -26, 110, -62, -112, 64, 0, 0, + -65, -26, 1, 111, -67, 64, 0, 0, -65, -26, 114, -41, 64, + -128, 0, 0, -65, -26, 75, -41, -118, -64, 0, 0, -65, -27, + -90, -31, -123, -64, 0, 0, -65, -26, 123, 0, 25, 64, 0, 0, + -65, -29, -90, -57, 30, 64, 0, 0, -65, -26, -113, 33, -103, + 0, 0, 0, -65, -32, -52, -26, 84, -128, 0, 0, -65, -26, -123, + 1, -28, 64, 0, 0, -65, -39, 70, -27, 117, 0, 0, 0, -65, -26, + 93, 102, 118, 0, 0, 0, -65, -49, -56, 90, 97, 0, 0, 0, -65, + -26, 22, 35, 81, -64, 0, 0, -65, -82, -85, -7, -92, 0, 0, 0, + -65, -27, -80, 120, 104, 0, 0, 0, 63, -78, -58, -109, -68, + 0, 0, 0, -65, -27, 43, 83, -31, 64, 0, 0, 63, -72, -18, 49, + 104, 0, 0, 0, -65, -28, -120, 94, 42, 0, 0, 0, 63, -63, -99, + 35, 2, 0, 0, 0, -65, -29, -57, -111, -85, 64, 0, 0, 63, -58, + 15, -94, 118, 0, 0, 0, -65, -30, -22, -21, -37, 64, 0, 0, + 63, -53, 88, -88, -60, 0, 0, 0, -65, -31, -13, 82, 55, 64, + 0, 0, 63, -48, 63, -18, 34, 0, 0, 0, -65, -32, -29, 1, 122, + -64, 0, 0, 63, -45, 11, -46, -68, 0, 0, 0, -65, -33, 119, + 56, 126, 0, 0, 0, 63, -43, -36, -10, -87, -128, 0, 0, -65, + -36, -1, 15, -10, 0, 0, 0, 63, -40, -58, -75, -91, 0, 0, 0, + -65, -38, 97, -35, 81, -128, 0, 0, 63, -37, -75, -12, 36, 0, + 0, 0, -65, -41, -92, -111, 21, -128, 0, 0, 63, -34, -96, + -41, -42, 0, 0, 0, -65, -44, -52, 32, -107, -128, 0, 0, 63, + -32, -64, 111, -10, 64, 0, 0, -65, -47, -35, 117, 127, 0, 0, + 0, 63, -30, 29, -123, 22, -128, 0, 0, -65, -51, -69, -121, + 60, 0, 0, 0, 63, -29, 101, 5, 56, -128, 0, 0, -65, -57, -93, + -119, 56, 0, 0, 0, 63, -28, -124, 51, 40, 0, 0, 0, -65, -63, + 125, 41, 21, 0, 0, 0, 63, -27, 117, -88, 29, -128, 0, 0, + -65, -74, -94, 100, -80, 0, 0, 0, 63, -26, 35, 104, -15, + -128, 0, 0, -65, -92, -92, -91, -16, 0, 0, 0, 63, -26, -124, + 20, -119, -64, 0, 0, 63, 126, 97, 28, 32, 0, 0, 0, 63, -26, + 127, -5, 123, -128, 0, 0, 63, -85, -21, -46, -32, 0, 0, 0, + 63, -26, 11, 17, -44, -128, 0, 0, 63, -71, -49, 126, -70, 0, + 0, 0, 63, -27, 13, -5, -122, 64, 0, 0, 63, -62, -78, 70, + -80, 0, 0, 0, 63, -29, 126, -100, -51, -64, 0, 0, 63, -56, + 84, -39, -32, 0, 0, 0, 63, -31, 73, -124, 104, -64, 0, 0, + 63, -51, -55, -65, -14, 0, 0, 0, 63, -36, -34, 126, -95, 0, + 0, 0, 63, -47, -122, 62, 92, 0, 0, 0, 63, -43, -52, -110, + 13, -128, 0, 0, 63, -44, 12, 96, -44, -128, 0, 0, 63, -53, + 27, -89, -108, 0, 0, 0, 63, -42, 117, -94, 70, 0, 0, 0, 63, + -80, -51, 33, 86, 0, 0, 0, 63, -40, -64, -122, -40, 0, 0, 0, + -65, -73, 13, -37, -72, 0, 0, 0, 63, -38, -21, -5, 36, -128, + 0, 0, -65, -48, 19, -120, -98, -128, 0, 0, 63, -36, -9, 31, + 1, 0, 0, 0, -65, -39, -44, 62, -40, 0, 0, 0, 63, -34, -31, + 100, 1, 0, 0, 0, -65, -31, 75, 86, -55, 64, 0, 0, 63, -32, + 85, 57, 23, 64, 0, 0, -65, -28, -123, 44, -111, 0, 0, 0, 63, + -31, 41, 24, 30, -64, 0, 0, -65, -26, 102, 30, -108, 64, 0, + 0, 63, -31, -20, 92, 76, 64, 0, 0, -65, -26, 46, 70, -87, + -128, 0, 0, 63, -30, -97, 42, -49, -128, 0, 0, -65, -29, -7, + -96, 121, -128, 0, 0, 63, -29, 65, -65, 33, 0, 0, 0, -65, + -34, 84, 96, -90, -128, 0, 0, 63, -29, -44, 103, 5, 0, 0, 0, + -65, -47, 87, 105, 113, -128, 0, 0, 63, -28, 87, -126, 5, + -128, 0, 0, -65, 85, -59, 122, 0, 0, 0, 0, 63, -28, -53, + 125, 53, -128, 0, 0, 63, -53, -50, 57, 82, 0, 0, 0, 63, -27, + 48, -46, -10, 64, 0, 0, 63, -44, -16, -38, -63, 0, 0, 0, 63, + -27, -120, 7, 2, -64, 0, 0, 63, -36, -119, -98, -76, -128, + 0, 0, 63, -27, -47, -90, 68, 64, 0, 0, 63, -31, -120, 77, + 53, 0, 0, 0, 63, -26, 14, 67, 126, -128, 0, 0, 63, -28, 66, + -96, 73, 64, 0, 0, 63, -26, 62, 118, -24, 64, 0, 0, 63, -26, + 8, 80, 66, -64, 0, 0, 63, -26, 98, -37, -67, -64, 0, 0, 63, + -26, -120, -76, -79, 0, 0, 0, 63, -26, 124, 15, 117, -128, + 0, 0, 63, -27, -124, 51, -4, 0, 0, 0, 63, -26, -118, -80, + 71, 0, 0, 0, 63, -30, -90, -5, -78, 0, 0, 0, 63, -26, -113, + 92, 0, -64, 0, 0, 63, -37, -6, -56, -2, -128, 0, 0, 63, -26, + -118, -81, 92, -64, 0, 0, 63, -50, 38, -52, 64, 0, 0, 0, 63, + -26, 125, 68, -75, 64, 0, 0, -65, 106, -100, -111, -64, 0, + 0, 0, 63, -26, 103, -77, -59, 0, 0, 0, -65, -48, 123, -43, + -12, 0, 0, 0, 63, -26, 74, -112, -108, 0, 0, 0, -65, -33, + 56, -89, 1, -128, 0, 0, 63, -26, 38, 107, 71, 64, 0, 0, -65, + -28, -41, 97, -115, -128, 0, 0, 63, -27, -5, -49, 123, -64, + 0, 0, -65, -26, -113, 30, 103, -64, 0, 0, 63, -27, -53, 67, + -4, -64, 0, 0, -65, -29, -102, 22, -80, -64, 0, 0, 63, -27, + -107, 74, -114, -64, 0, 0, -65, -40, 80, -64, 70, 0, 0, 0, + 63, -27, 90, 95, -120, -64, 0, 0, -65, -105, -62, 88, -64, + 0, 0, 0, 63, -27, 26, -7, -6, 0, 0, 0, 63, -48, 100, -4, 29, + 0, 0, 0, 63, -28, -41, -117, 54, 0, 0, 0, 63, -35, 47, -72, + -117, 0, 0, 0, 63, -28, -112, 127, 49, -128, 0, 0, 63, -28, + 7, 8, 0, -64, 0, 0, 63, -28, 70, 60, 21, 0, 0, 0, 63, -26, + 116, 56, -39, -128, 0, 0, 63, -29, -7, 34, -72, 0, 0, 0, 63, + -27, 54, -88, -53, -128, 0, 0, 63, -29, -87, -114, 65, -128, + 0, 0, 63, -33, 59, -13, -32, 0, 0, 0, 63, -29, 87, -44, -80, + -64, 0, 0, 63, -56, 60, 73, -112, 0, 0, 0, 63, -29, 4, 70, + -111, 64, 0, 0, -65, -58, 8, -15, 84, 0, 0, 0, 63, -30, -81, + 47, -124, 0, 0, 0, -65, -32, 87, -82, 61, 64, 0, 0, 63, -30, + 88, -42, 9, 0, 0, 0, -65, -26, 35, -69, -119, -64, 0, 0, 63, + -30, 1, 124, 2, -64, 0, 0, -65, -28, 87, -99, -98, 64, 0, 0, + 63, -31, -87, 94, -111, 64, 0, 0, -65, -45, 3, 28, -55, 0, + 0, 0, 63, -31, 80, -74, -114, -128, 0, 0, 63, -58, 99, -107, + -26, 0, 0, 0, 63, -32, -9, -72, 118, -128, 0, 0, 63, -32, + 75, 60, -115, 64, 0, 0, 63, -32, -98, -108, -34, 64, 0, 0, + 63, -27, -10, -8, 88, -64, 0, 0, 63, -32, 69, 120, 96, -128, + 0, 0, 63, -28, -29, -126, 123, 64, 0, 0, 63, -33, -39, 24, + 37, -128, 0, 0, 63, -42, 97, 18, -1, 0, 0, 0, 63, -33, 39, + -22, -25, 0, 0, 0, -65, -67, -67, -45, -14, 0, 0, 0, 63, + -34, 119, -83, -70, 0, 0, 0, -65, -31, -36, 58, -38, -64, 0, + 0, 63, -35, -56, -98, -35, -128, 0, 0, -65, -26, 82, -113, + -127, 0, 0, 0, 63, -35, 26, -9, 16, -128, 0, 0, -65, -39, + -77, 108, 121, 0, 0, 0, 63, -36, 110, -23, 49, -128, 0, 0, + 63, -54, 61, 52, -56, 0, 0, 0, 63, -37, -60, -93, -119, 0, + 0, 0, 63, -28, 98, 116, -68, -64, 0, 0, 63, -37, 28, 78, + -53, -128, 0, 0, 63, -27, 73, 96, 4, -64, 0, 0, 63, -38, + 118, 16, 65, -128, 0, 0, 63, -45, 98, -1, -37, -128, 0, 0, + 63, -39, -46, 7, -128, 0, 0, 0, -65, -44, -114, 42, -15, + -128, 0, 0, 63, -39, 48, 82, 66, -128, 0, 0, -65, -26, 7, + 54, -101, -64, 0, 0, 63, -40, -111, 7, -40, 0, 0, 0, -65, + -35, -51, -69, -109, 0, 0, 0, 63, -41, -12, 63, -39, -128, + 0, 0, 63, -48, -59, -44, 99, -128, 0, 0, 63, -41, 90, 10, 1, + -128, 0, 0, 63, -27, 118, 75, -116, 0, 0, 0, 63, -42, -62, + 121, 24, -128, 0, 0, 63, -31, 25, 7, 100, 64, 0, 0, 63, -42, + 45, -107, -23, 0, 0, 0, -65, -58, -95, 62, 125, 0, 0, 0, 63, + -43, -101, 111, -122, -128, 0, 0, -65, -27, -69, 90, -76, + -128, 0, 0, 63, -43, 12, 8, -126, -128, 0, 0, -65, -40, 8, + 81, -41, -128, 0, 0, 63, -44, 127, 108, -11, 0, 0, 0, 63, + -33, 125, 16, -56, -128, 0, 0, 63, -45, -11, -102, 68, 0, 0, + 0, 63, -28, -71, 13, 81, 64, 0, 0, 63, -45, 110, -103, -94, + 0, 0, 0, -65, 121, -87, 70, -96, 0, 0, 0, 63, -46, -22, 100, + -25, -128, 0, 0, -65, -26, -124, -31, -123, 0, 0, 0, 63, + -46, 105, 1, -108, -128, 0, 0, -65, -51, 57, 21, 0, 0, 0, 0, + 63, -47, -22, 104, 115, -128, 0, 0, 63, -28, 67, -99, 49, + -64, 0, 0, 63, -47, 110, -103, 96, 0, 0, 0, 63, -38, -29, + 115, -19, -128, 0, 0, 63, -48, -11, -113, -88, 0, 0, 0, -65, + -32, -57, 4, -111, -64, 0, 0, 63, -48, 127, 66, 73, -128, 0, + 0, -65, -35, 22, 79, 22, -128, 0, 0, 63, -48, 11, -77, -49, + -128, 0, 0, 63, -29, 81, -90, -35, 0, 0, 0, 63, -49, 53, + -101, -54, 0, 0, 0, 63, -41, 20, -53, 34, 0, 0, 0, 63, -50, + 89, 64, 25, 0, 0, 0, -65, -29, 19, 126, -68, 64, 0, 0, 63, + -51, -126, 2, 123, 0, 0, 0, -65, -58, -101, 63, 23, 0, 0, 0, + 63, -52, -80, 40, 91, 0, 0, 0, 63, -24, -91, -96, -50, 0, 0, + 0, 63, -53, -29, 47, 22, 0, 0, 0, -65, -41, -114, 4, 95, + -128, 0, 0, 63, -53, 27, -114, 46, 0, 0, 0, -65, -40, 49, + -117, -81, 0, 0, 0, 63, -54, 88, -119, 16, 0, 0, 0, 63, -29, + -121, -96, 15, -128, 0, 0, 63, -55, -102, -47, -87, 0, 0, 0, + -65, -61, 105, 14, -83, 0, 0, 0, 63, -56, -31, 108, -33, 0, + 0, 0, -65, -33, 63, -16, -111, -128, 0, 0, 63, -56, 45, 72, + -84, 0, 0, 0, 63, -22, -122, 10, -109, -128, 0, 0, 63, -57, + 125, 47, 67, 0, 0, 0, -65, -27, 77, 102, 63, -64, 0, 0, 63, + -58, -46, 65, -16, 0, 0, 0, 63, -48, 113, -66, -14, -128, 0, + 0, 63, -58, 43, 32, 18, 0, 0, 0, 63, -57, 61, 31, -100, 0, + 0, 0, 63, -59, -119, 7, -105, 0, 0, 0, -65, -37, -79, 96, + -95, -128, 0, 0, 63, -60, -22, -116, 96, 0, 0, 0, 63, -32, + 51, 36, 61, -64, 0, 0, 63, -60, 80, -31, 125, 0, 0, 0, -65, + -35, -18, -128, -112, -128, 0, 0, 63, -61, -70, -64, 56, 0, + 0, 0, 63, -41, -15, -93, 33, -128, 0, 0, 63, -61, 41, 23, + 61, 0, 0, 0, -65, -49, 26, -36, -127, 0, 0, 0, 63, -62, + -101, 7, -36, 0, 0, 0, 63, -61, 69, -32, -25, 0, 0, 0, 63, + -62, 16, -14, 0, 0, 0, 0, -65, -87, -65, -61, -96, 0, 0, 0, + 63, -63, -118, -80, -78, 0, 0, 0, 63, 104, 11, -91, 64, 0, + 0, 0, 63, -63, 7, -66, 20, 0, 0, 0, 63, -87, 42, -43, -36, + 0, 0, 0, 63, -64, -119, 9, -46, 0, 0, 0, -65, -77, 65, -65, + -116, 0, 0, 0, 63, -64, 12, -52, 89, 0, 0, 0, 63, -74, -101, + -83, -58, 0, 0, 0, 63, -65, 42, -56, -30, 0, 0, 0, -65, -81, + 45, 20, -48, 0, 0, 0, 63, -66, 62, -26, -48, 0, 0, 0, 63, + -81, 118, -95, -108, 0, 0, 0, 63, -67, 94, 40, 80, 0, 0, 0, + -65, -82, 117, 104, -28, 0, 0, 0, 63, -68, 126, 32, -26, 0, + 0, 0, 63, -80, 115, 69, 50, 0, 0, 0, 63, -69, -86, -34, 124, + 0, 0, 0, -65, -99, -26, -124, 32, 0, 0, 0, 63, -70, -42, 15, + -78, 0, 0, 0, 63, -93, -45, 109, -44, 0, 0, 0, 63, -70, 15, + -98, 2, 0, 0, 0, 63, -127, -37, 95, 16, 0, 0, 0, 63, -71, + 69, -118, -82, 0, 0, 0, -65, -92, -52, 45, 36, 0, 0, 0, 63, + -72, -117, 32, -84, 0, 0, 0, 63, -87, -5, 115, 84, 0, 0, 0, + 63, -73, -53, 119, -96, 0, 0, 0, -65, -87, -115, -86, -80, + 0, 0, 0, 63, -73, 28, 40, -26, 0, 0, 0, 63, -74, -12, 85, + 22, 0, 0, 0, 63, -74, 102, -55, -126, 0, 0, 0, -65, -65, + -114, 92, -36, 0, 0, 0, 63, -75, -63, -125, -78, 0, 0, 0, + 63, -64, -93, -123, -55, 0, 0, 0, 63, -75, 22, 126, -110, 0, + 0, 0, -65, -60, -96, -30, 79, 0, 0, 0, 63, -76, 122, 11, 0, + 0, 0, 0, 63, -60, -109, 97, 47, 0, 0, 0, 63, -77, -39, -99, + -18, 0, 0, 0, -65, -69, 10, 14, 2, 0, 0, 0, 63, -77, 68, + -88, 54, 0, 0, 0, -65, -76, -72, -116, -102, 0, 0, 0, 63, + -78, -81, 52, -44, 0, 0, 0, 63, -38, 34, 4, 75, -128, 0, 0, + 63, -78, 32, 86, -46, 0, 0, 0, -65, -24, -90, 85, -58, 0, 0, + 0, 63, -79, -106, 83, -40, 0, 0, 0, 63, -30, -105, 64, 26, + -64, 0, 0, 63, -79, 12, 38, -62, 0, 0, 0, 63, -48, 55, -69, + 121, -128, 0, 0, 63, -80, -114, 12, 80, 0, 0, 0, -65, -28, + 62, -6, -92, -64, 0, 0, 63, -80, 7, 62, 66, 0, 0, 0, -65, + -33, 55, 73, 0, 0, 0, 0, 63, -81, 42, -36, -104, 0, 0, 0, + 63, -59, 54, 78, 79, 0, 0, 0, 63, -82, 33, -74, 44, 0, 0, 0, + 63, -30, 86, -74, -109, 0, 0, 0, 63, -83, 87, 14, 100, 0, 0, + 0, 63, -26, 11, 75, 15, 64, 0, 0, 63, -84, 80, -91, -68, 0, + 0, 0, 63, -26, -127, -73, 103, -128, 0, 0, 63, -85, -98, + -62, 84, 0, 0, 0, 63, -27, -93, -3, -41, 64, 0, 0, 63, -86, + -102, 37, -108, 0, 0, 0, 63, -36, 1, -125, 75, -128, 0, 0, + 63, -86, 0, 5, -4, 0, 0, 0, -65, -60, -43, -22, -40, 0, 0, + 0, 63, -88, -3, 61, -8, 0, 0, 0, -65, -25, -3, 7, -90, -64, + 0, 0, 63, -88, 120, -33, 124, 0, 0, 0, 63, -46, -37, 13, + -62, -128, 0, 0, 63, -89, 121, 37, -104, 0, 0, 0, 63, -50, + -128, -59, -125, 0, 0, 0, 63, -89, 7, 73, 52, 0, 0, 0, -65, + -41, -93, -27, 70, 0, 0, 0, 63, -90, 13, 72, -32, 0, 0, 0, + 63, -43, 15, 45, 20, 0, 0, 0, 63, -91, -87, 33, 104, 0, 0, + 0, -65, -47, -66, -78, 59, 0, 0, 0, 63, -92, -71, 101, -36, + 0, 0, 0, 63, -48, 18, 90, -72, -128, 0, 0, 63, -92, 91, -10, + 92, 0, 0, 0, -65, -49, 42, -102, -49, 0, 0, 0, 63, -93, 125, + -26, -36, 0, 0, 0, 63, -55, -5, 67, 105, 0, 0, 0, 63, -93, + 28, 93, -20, 0, 0, 0, 63, -85, 109, -126, -76, 0, 0, 0, 63, + -94, 93, 36, -20, 0, 0, 0, -65, -28, -63, -123, 118, 0, 0, + 0, 63, -95, -29, 88, 16, 0, 0, 0, 63, -57, 116, -110, -20, + 0, 0, 0, 63, -95, 97, 107, 88, 0, 0, 0, 63, -37, 101, -94, + 50, 0, 0, 0, 63, -96, -107, -6, 36, 0, 0, 0, 63, -87, 72, + -66, 4, 0, 0, 0, 63, -96, -41, -86, 72, 0, 0, 0}; + + public static void main(final String[] args) throws Exception { + test(data32, 32); + test(data64, 64); + } + + private static void test(final byte[] data, final int bits) + throws Exception { + + // Audio data should contain the same format as a command lines above + checkAudioStream(new ByteArrayInputStream(data), data, bits); + + // Checks that the data will be preserved when we save audio data to the + // file and read it again + final File file = File.createTempFile("sound", "test"); + try (final InputStream fis = new FileInputStream(file); + final InputStream is = new ByteArrayInputStream(data); + final AudioInputStream ais = AudioSystem.getAudioInputStream(is)) { + AudioSystem.write(ais, AudioFileFormat.Type.AU, file); + if (!Arrays.equals(data, fis.readAllBytes())) { + throw new RuntimeException("Wrong data in the file"); + } + } finally { + Files.delete(Paths.get(file.getAbsolutePath())); + } + + // Checks that the data will be preserved when we save audio data to the + // stream and read it again + try (final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + final InputStream is = new ByteArrayInputStream(data); + final AudioInputStream ais = AudioSystem.getAudioInputStream(is)) { + AudioSystem.write(ais, AudioFileFormat.Type.AU, baos); + if (!Arrays.equals(data, baos.toByteArray())) { + throw new RuntimeException("Wrong data in the stream"); + } + } + } + + /** + * Tests that audio data is the same format as a command lines above. + */ + private static void checkAudioStream(final InputStream is, + final byte[] data, final int bits) + throws Exception { + final AudioFileFormat aff = AudioSystem.getAudioFileFormat(is); + final int byteLength = aff.getByteLength(); + if (byteLength != data.length) { + throw new RuntimeException("Wrong byteLength: " + byteLength); + } + final AudioFileFormat.Type type = aff.getType(); + if (!type.equals(AudioFileFormat.Type.AU)) { + throw new RuntimeException("Wrong type: " + type); + } + final int frameLength = aff.getFrameLength(); + if (frameLength != 0.01f * aff.getFormat().getFrameRate()) { + throw new RuntimeException("Wrong frameLength: " + frameLength); + } + checkAudioFormat(aff.getFormat(), bits); + try (AudioInputStream ais = AudioSystem.getAudioInputStream(is)) { + final AudioFormat format = ais.getFormat(); + if (ais.getFrameLength() != 0.01f * format.getFrameRate()) { + throw new RuntimeException( + "Wrong frameLength: " + ais.getFrameLength()); + } + checkAudioFormat(format, bits); + } + } + + /** + * Tests that audio data is the same format as a command lines above. + */ + private static void checkAudioFormat(final AudioFormat audioFormat, + final int bits) { + final int channels = audioFormat.getChannels(); + if (channels != 2) { + throw new RuntimeException("Wrong channels: " + channels); + } + final int sizeInBits = audioFormat.getSampleSizeInBits(); + if (sizeInBits != bits) { + throw new RuntimeException("Wrong sizeInBits: " + sizeInBits); + } + final int frameSize = audioFormat.getFrameSize(); + if (frameSize != sizeInBits * channels / 8) { + throw new RuntimeException("Wrong frameSize: " + frameSize); + } + final AudioFormat.Encoding encoding = audioFormat.getEncoding(); + if (!encoding.equals(AudioFormat.Encoding.PCM_FLOAT)) { + throw new RuntimeException("Wrong encoding: " + encoding); + } + final float frameRate = audioFormat.getFrameRate(); + if (frameRate != 32000) { + throw new RuntimeException("Wrong frameRate: " + frameRate); + } + final float sampleRate = audioFormat.getSampleRate(); + if (sampleRate != 32000) { + throw new RuntimeException("Wrong sampleRate: " + sampleRate); + } + } +} From cb5aa60f49e55f5d2eb28a5c967fd77ad24de1c3 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Sun, 9 Jun 2019 17:46:05 -0700 Subject: [PATCH 005/109] 8223045: GraphicsEnvironment does not detect resolution changes in multiscreen systems Reviewed-by: prr --- .../native/libawt_xawt/awt/awt_GraphicsEnv.c | 68 ++++++++++--------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c index 174e9b69745..93506e2f7ef 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c @@ -119,9 +119,8 @@ typedef struct { } XineramaScreenInfo; typedef XineramaScreenInfo* XineramaQueryScreensFunc(Display*, int*); - +static XineramaQueryScreensFunc* XineramaQueryScreens = NULL; Bool usingXinerama = False; -XRectangle fbrects[MAXFRAMEBUFFERS]; JNIEXPORT void JNICALL Java_sun_awt_X11GraphicsConfig_initIDs (JNIEnv *env, jclass cls) @@ -586,7 +585,6 @@ static void xineramaInit(void) { int32_t locNumScr = 0; XineramaScreenInfo *xinInfo; char* XineramaQueryScreensName = "XineramaQueryScreens"; - XineramaQueryScreensFunc* XineramaQueryScreens = NULL; gotXinExt = XQueryExtension(awt_display, XinExtName, &major_opcode, &first_event, &first_error); @@ -612,36 +610,27 @@ static void xineramaInit(void) { XineramaQueryScreens = (XineramaQueryScreensFunc*) dlsym(libHandle, XineramaQueryScreensName); - if (XineramaQueryScreens != NULL) { + if (XineramaQueryScreens == NULL) { + DTRACE_PRINTLN("couldn't load XineramaQueryScreens symbol"); + dlclose(libHandle); + } else { DTRACE_PRINTLN("calling XineramaQueryScreens func"); xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr); - if (xinInfo != NULL && locNumScr > XScreenCount(awt_display)) { - int32_t idx; - DTRACE_PRINTLN("Enabling Xinerama support"); - usingXinerama = True; - /* set global number of screens */ - DTRACE_PRINTLN1(" num screens = %i\n", locNumScr); - awt_numScreens = locNumScr; - - /* stuff values into fbrects */ - for (idx = 0; idx < awt_numScreens; idx++) { - DASSERT(xinInfo[idx].screen_number == idx); - - fbrects[idx].width = xinInfo[idx].width; - fbrects[idx].height = xinInfo[idx].height; - fbrects[idx].x = xinInfo[idx].x_org; - fbrects[idx].y = xinInfo[idx].y_org; + if (xinInfo != NULL) { + if (locNumScr > XScreenCount(awt_display)) { + DTRACE_PRINTLN("Enabling Xinerama support"); + usingXinerama = True; + /* set global number of screens */ + DTRACE_PRINTLN1(" num screens = %i\n", locNumScr); + awt_numScreens = locNumScr; + } else { + DTRACE_PRINTLN("XineramaQueryScreens <= XScreenCount"); } + XFree(xinInfo); } else { - DTRACE_PRINTLN((xinInfo == NULL) ? - "calling XineramaQueryScreens didn't work" : - "XineramaQueryScreens <= XScreenCount" - ); + DTRACE_PRINTLN("calling XineramaQueryScreens didn't work"); } - } else { - DTRACE_PRINTLN("couldn't load XineramaQueryScreens symbol"); } - dlclose(libHandle); } else { DTRACE_PRINTLN1("\ncouldn't open shared library: %s\n", dlerror()); } @@ -1303,6 +1292,8 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen jmethodID mid; jobject bounds = NULL; AwtGraphicsConfigDataPtr adata; + int32_t locNumScr = 0; + XineramaScreenInfo *xinInfo; adata = (AwtGraphicsConfigDataPtr) JNU_GetLongFieldAsPtr(env, this, x11GraphicsConfigIDs.aData); @@ -1313,17 +1304,30 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen if (mid != NULL) { if (usingXinerama) { if (0 <= screen && screen < awt_numScreens) { - bounds = (*env)->NewObject(env, clazz, mid, fbrects[screen].x, - fbrects[screen].y, - fbrects[screen].width, - fbrects[screen].height); + AWT_LOCK(); + xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr); + AWT_UNLOCK(); + if (xinInfo != NULL && locNumScr > 0) { + if (screen >= locNumScr) { + screen = 0; // fallback to the main screen + } + DASSERT(xinInfo[screen].screen_number == screen); + bounds = (*env)->NewObject(env, clazz, mid, + xinInfo[screen].x_org, + xinInfo[screen].y_org, + xinInfo[screen].width, + xinInfo[screen].height); + XFree(xinInfo); + } } else { jclass exceptionClass = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); if (exceptionClass != NULL) { (*env)->ThrowNew(env, exceptionClass, "Illegal screen index"); } } - } else { + } + if (!bounds) { + // Xinerama cannot provide correct bounds, will try X11 XWindowAttributes xwa; memset(&xwa, 0, sizeof(xwa)); From 024c62ce0c3b3e8995374b98966e4c566cc0fe97 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Mon, 10 Jun 2019 10:52:11 +0530 Subject: [PATCH 006/109] 8225368: broken links in java.desktop files Reviewed-by: serb --- src/java.desktop/share/classes/java/awt/Font.java | 7 ++++--- src/java.desktop/share/classes/java/awt/FontMetrics.java | 5 +++-- .../classes/java/awt/doc-files/DesktopProperties.html | 4 ++-- .../javax/imageio/metadata/doc-files/tiff_metadata.html | 2 +- src/java.desktop/share/classes/javax/print/DocFlavor.java | 6 +++--- .../share/classes/javax/print/attribute/package-info.java | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/java.desktop/share/classes/java/awt/Font.java b/src/java.desktop/share/classes/java/awt/Font.java index e25557f0e25..7c3c7874dbf 100644 --- a/src/java.desktop/share/classes/java/awt/Font.java +++ b/src/java.desktop/share/classes/java/awt/Font.java @@ -2144,9 +2144,10 @@ public class Font implements java.io.Serializable * Checks if this {@code Font} has a glyph for the specified * character. * - *

Note: This method cannot handle supplementary - * characters. To support all Unicode characters, including + *

Note: This method cannot handle + * + * supplementary characters. + * To support all Unicode characters, including * supplementary characters, use the {@link #canDisplay(int)} * method or {@code canDisplayUpTo} methods. * diff --git a/src/java.desktop/share/classes/java/awt/FontMetrics.java b/src/java.desktop/share/classes/java/awt/FontMetrics.java index 7ec69f77b61..2f6a1af22d3 100644 --- a/src/java.desktop/share/classes/java/awt/FontMetrics.java +++ b/src/java.desktop/share/classes/java/awt/FontMetrics.java @@ -317,8 +317,9 @@ public abstract class FontMetrics implements java.io.Serializable { * of its characters. * *

Note: This method cannot handle supplementary - * characters. To support all Unicode characters, including + * href="../../../java.base/java/lang/Character.html#supplementary"> + * supplementary characters. + * To support all Unicode characters, including * supplementary characters, use the {@link #charWidth(int)} method. * * @param ch the character to be measured diff --git a/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html b/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html index c24a507dfc3..478a0238a8e 100644 --- a/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html +++ b/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html @@ -65,12 +65,12 @@ here, and their value types. awt.font.desktophints -java.util.Map +{@link java.util.Map java.util.Map} Font smoothing (text antialiasing) settings. sun.awt.enableExtraMouseButtons -java.lang.Boolean +{@link java.lang.Boolean java.lang.Boolean} Controls if mouse events from extra buttons are to be generated or not diff --git a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html index f88555f7881..4b9644fcc99 100644 --- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html +++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html @@ -191,7 +191,7 @@ and set the ImageTypeSpecifier using with the ICC profile-based color space, then a second ImageTypeSpecifier derived from this inferred color space will be included in the -Iterator returned by +{@link java.util.Iterator Iterator} returned by ImageReader.getImageTypes. If the iterator contains more than one type, the first one will be based on the ICC profile and the second on the inferred color space.

diff --git a/src/java.desktop/share/classes/javax/print/DocFlavor.java b/src/java.desktop/share/classes/javax/print/DocFlavor.java index 9556bb2bac4..a52b0e18852 100644 --- a/src/java.desktop/share/classes/javax/print/DocFlavor.java +++ b/src/java.desktop/share/classes/javax/print/DocFlavor.java @@ -44,9 +44,9 @@ import java.io.Serializable; * the IANA MIME-preferred name, or its canonical name if no preferred name is * specified. Additionally a few historical names supported by earlier * versions of the Java platform may be recognized. See - * character encodings - * for more information on the character encodings supported on the Java - * platform. + * + * character encodings for more information on the character encodings + * supported on the Java platform. *
  • Representation class name. This specifies the fully-qualified * name of the class of the object from which the actual print data comes, as * returned by the {@link Class#getName() Class.getName()} method. (Thus the diff --git a/src/java.desktop/share/classes/javax/print/attribute/package-info.java b/src/java.desktop/share/classes/javax/print/attribute/package-info.java index 3e796fe0927..2470175ec21 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/package-info.java +++ b/src/java.desktop/share/classes/javax/print/attribute/package-info.java @@ -137,7 +137,7 @@ * AttributeSet interface. *

    * The {@code AttributeSet} interface is similar to the - * Map interface: it provides a map of + * {@link java.util.Map Map} interface: it provides a map of * key to values, in which each key is unique and can contain no more than one * value. However, the {@code AttributeSet} interface is designed to * specifically support the needs of the Java Print Service API. An From fa85fe2012d35120ff6274756d5b98167125afdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Lid=C3=A9n?= Date: Mon, 10 Jun 2019 12:52:56 +0200 Subject: [PATCH 007/109] 8224966: ZGC: Don't skip oop verification in OopMapSet::all_do() Reviewed-by: stefank, eosterlund --- src/hotspot/share/compiler/oopMap.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/compiler/oopMap.cpp b/src/hotspot/share/compiler/oopMap.cpp index f8ab97bedd2..5426dd24222 100644 --- a/src/hotspot/share/compiler/oopMap.cpp +++ b/src/hotspot/share/compiler/oopMap.cpp @@ -379,12 +379,8 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map, continue; } #ifdef ASSERT - // We can not verify the oop here if we are using ZGC, the oop - // will be bad in case we had a safepoint between a load and a - // load barrier. - if (!UseZGC && - ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) || - !Universe::heap()->is_in_or_null(*loc))) { + if ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) || + !Universe::heap()->is_in_or_null(*loc)) { tty->print_cr("# Found non oop pointer. Dumping state at failure"); // try to dump out some helpful debugging information trace_codeblob_maps(fr, reg_map); From 797a62e9385e8ffaa63c23251abf794aae512a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Lid=C3=A9n?= Date: Mon, 10 Jun 2019 12:52:57 +0200 Subject: [PATCH 008/109] 8225227: ZGC: Be exact in what load barrier to use in ZHeapIterator Reviewed-by: stefank --- src/hotspot/share/gc/z/zHeap.cpp | 4 +- src/hotspot/share/gc/z/zHeapIterator.cpp | 105 ++++++++++++----------- src/hotspot/share/gc/z/zHeapIterator.hpp | 13 +-- 3 files changed, 65 insertions(+), 57 deletions(-) diff --git a/src/hotspot/share/gc/z/zHeap.cpp b/src/hotspot/share/gc/z/zHeap.cpp index df2c5c4b3fb..cb585e0ffa8 100644 --- a/src/hotspot/share/gc/z/zHeap.cpp +++ b/src/hotspot/share/gc/z/zHeap.cpp @@ -471,8 +471,8 @@ void ZHeap::relocate() { void ZHeap::object_iterate(ObjectClosure* cl, bool visit_referents) { assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint"); - ZHeapIterator iter(visit_referents); - iter.objects_do(cl); + ZHeapIterator iter; + iter.objects_do(cl, visit_referents); } void ZHeap::serviceability_initialize() { diff --git a/src/hotspot/share/gc/z/zHeapIterator.cpp b/src/hotspot/share/gc/z/zHeapIterator.cpp index 6c95bfd93cd..13d57837729 100644 --- a/src/hotspot/share/gc/z/zHeapIterator.cpp +++ b/src/hotspot/share/gc/z/zHeapIterator.cpp @@ -51,18 +51,29 @@ public: } }; +template class ZHeapIteratorRootOopClosure : public ZRootsIteratorClosure { private: ZHeapIterator* const _iter; + oop load_oop(oop* p) { + if (Weak) { + return NativeAccess::oop_load(p); + } + + if (Concurrent) { + return NativeAccess::oop_load(p); + } + + return RawAccess<>::oop_load(p); + } + public: ZHeapIteratorRootOopClosure(ZHeapIterator* iter) : _iter(iter) {} virtual void do_oop(oop* p) { - // Load barrier needed here, even on non-concurrent strong roots, - // for the same reason we need fixup_partial_loads() in ZHeap::mark_end(). - const oop obj = NativeAccess::oop_load(p); + const oop obj = load_oop(p); _iter->push(obj); } @@ -71,28 +82,27 @@ public: } }; +template class ZHeapIteratorOopClosure : public BasicOopIterateClosure { private: ZHeapIterator* const _iter; const oop _base; - const bool _visit_referents; - oop load_oop(oop* p) const { - if (_visit_referents) { - return HeapAccess::oop_load_at(_base, _base->field_offset(p)); - } else { - return HeapAccess::oop_load(p); + oop load_oop(oop* p) { + if (VisitReferents) { + return HeapAccess::oop_load_at(_base, _base->field_offset(p)); } + + return HeapAccess::oop_load(p); } public: - ZHeapIteratorOopClosure(ZHeapIterator* iter, oop base, bool visit_referents) : + ZHeapIteratorOopClosure(ZHeapIterator* iter, oop base) : _iter(iter), - _base(base), - _visit_referents(visit_referents) {} + _base(base) {} virtual ReferenceIterationMode reference_iteration_mode() { - return _visit_referents ? DO_FIELDS : DO_FIELDS_EXCEPT_REFERENT; + return VisitReferents ? DO_FIELDS : DO_FIELDS_EXCEPT_REFERENT; } virtual void do_oop(oop* p) { @@ -111,10 +121,9 @@ public: #endif }; -ZHeapIterator::ZHeapIterator(bool visit_referents) : +ZHeapIterator::ZHeapIterator() : _visit_stack(), - _visit_map(), - _visit_referents(visit_referents) {} + _visit_map() {} ZHeapIterator::~ZHeapIterator() { ZVisitMapIterator iter(&_visit_map); @@ -162,49 +171,45 @@ void ZHeapIterator::push(oop obj) { _visit_stack.push(obj); } +template +void ZHeapIterator::push_roots() { + ZHeapIteratorRootOopClosure cl(this); + RootsIterator roots; + roots.oops_do(&cl); +} + +template +void ZHeapIterator::push_fields(oop obj) { + ZHeapIteratorOopClosure cl(this, obj); + obj->oop_iterate(&cl); +} + +template void ZHeapIterator::objects_do(ObjectClosure* cl) { - // Note that the heap iterator visits all reachable objects, including - // objects that might be unreachable from the application, such as a - // not yet cleared JNIWeakGloablRef. However, also note that visiting - // the JVMTI tag map is a requirement to make sure we visit all tagged - // objects, even those that might now have become phantom reachable. - // If we didn't do this the application would have expected to see - // ObjectFree events for phantom reachable objects in the tag map. - ZStatTimerDisable disable; - ZHeapIteratorRootOopClosure root_cl(this); - // Push strong roots onto stack - { - ZRootsIterator roots; - roots.oops_do(&root_cl); - } - - { - ZConcurrentRootsIterator roots; - roots.oops_do(&root_cl); - } - - // Push weak roots onto stack - { - ZWeakRootsIterator roots; - roots.oops_do(&root_cl); - } - - { - ZConcurrentWeakRootsIterator roots; - roots.oops_do(&root_cl); - } + // Push roots to visit + push_roots(); + push_roots(); + push_roots(); + push_roots(); // Drain stack while (!_visit_stack.is_empty()) { const oop obj = _visit_stack.pop(); - // Visit + // Visit object cl->do_object(obj); - // Push members to visit - ZHeapIteratorOopClosure push_cl(this, obj, _visit_referents); - obj->oop_iterate(&push_cl); + // Push fields to visit + push_fields(obj); + } +} + +void ZHeapIterator::objects_do(ObjectClosure* cl, bool visit_referents) { + if (visit_referents) { + objects_do(cl); + } else { + objects_do(cl); } } diff --git a/src/hotspot/share/gc/z/zHeapIterator.hpp b/src/hotspot/share/gc/z/zHeapIterator.hpp index f04f655ab54..c32fad4f9ab 100644 --- a/src/hotspot/share/gc/z/zHeapIterator.hpp +++ b/src/hotspot/share/gc/z/zHeapIterator.hpp @@ -32,8 +32,8 @@ class ObjectClosure; class ZHeapIteratorBitMap; class ZHeapIterator : public StackObj { - friend class ZHeapIteratorRootOopClosure; - friend class ZHeapIteratorOopClosure; + template friend class ZHeapIteratorRootOopClosure; + template friend class ZHeapIteratorOopClosure; private: typedef ZGranuleMap ZVisitMap; @@ -42,16 +42,19 @@ private: ZVisitStack _visit_stack; ZVisitMap _visit_map; - const bool _visit_referents; ZHeapIteratorBitMap* object_map(oop obj); void push(oop obj); + template void push_roots(); + template void push_fields(oop obj); + template void objects_do(ObjectClosure* cl); + public: - ZHeapIterator(bool visit_referents); + ZHeapIterator(); ~ZHeapIterator(); - void objects_do(ObjectClosure* cl); + void objects_do(ObjectClosure* cl, bool visit_referents); }; #endif // SHARE_GC_Z_ZHEAPITERATOR_HPP From 6d3f5f851eb001f8ee124404618d4dcc98d4923d Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Mon, 10 Jun 2019 20:38:15 +0800 Subject: [PATCH 009/109] 8221719: Jarsigner fails to verify signed by alias if alias given in wrong case Reviewed-by: weijun --- .../sun/security/tools/jarsigner/Main.java | 48 ++++--- .../JavaKeyStoreAliasCaseInsensitive.java | 135 ++++++++++++++++++ 2 files changed, 162 insertions(+), 21 deletions(-) create mode 100644 test/jdk/sun/security/tools/jarsigner/JavaKeyStoreAliasCaseInsensitive.java diff --git a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java index bbb2eb274af..742caf79374 100644 --- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java +++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -1300,7 +1300,7 @@ public class Main { String alias = storeHash.get(c); if (alias != null) { - certStr.append(space).append(alias); + certStr.append(space).append("(").append(alias).append(")"); } if (x509Cert != null) { @@ -1425,37 +1425,43 @@ public class Main { } int result = 0; - List certs = signer.getSignerCertPath().getCertificates(); - for (Certificate c : certs) { - String alias = storeHash.get(c); - if (alias != null) { - if (alias.startsWith("(")) { - result |= IN_KEYSTORE; - } - if (ckaliases.contains(alias.substring(1, alias.length() - 1))) { - result |= SIGNED_BY_ALIAS; - } - } else { - if (store != null) { - try { + if (store != null) { + try { + List certs = + signer.getSignerCertPath().getCertificates(); + for (Certificate c : certs) { + String alias = storeHash.get(c); + if (alias == null) { alias = store.getCertificateAlias(c); - } catch (KeyStoreException kse) { - // never happens, because keystore has been loaded + if (alias != null) { + storeHash.put(c, alias); + } } if (alias != null) { - storeHash.put(c, "(" + alias + ")"); result |= IN_KEYSTORE; } + for (String ckalias : ckaliases) { + if (c.equals(store.getCertificate(ckalias))) { + result |= SIGNED_BY_ALIAS; + // must continue with next certificate c and cannot + // return or break outer loop because has to fill + // storeHash for printCert + break; + } + } } - if (ckaliases.contains(alias)) { - result |= SIGNED_BY_ALIAS; - } + } catch (KeyStoreException kse) { + // never happens, because keystore has been loaded } } cacheForInKS.put(signer, result); return result; } + /** + * Maps certificates (as keys) to alias names associated in the keystore + * {@link #store} (as values). + */ Hashtable storeHash = new Hashtable<>(); int inKeyStore(CodeSigner[] signers) { diff --git a/test/jdk/sun/security/tools/jarsigner/JavaKeyStoreAliasCaseInsensitive.java b/test/jdk/sun/security/tools/jarsigner/JavaKeyStoreAliasCaseInsensitive.java new file mode 100644 index 00000000000..7f05dd30587 --- /dev/null +++ b/test/jdk/sun/security/tools/jarsigner/JavaKeyStoreAliasCaseInsensitive.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 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 + * 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 8221719 + * @library /test/lib + * @run testng JavaKeyStoreAliasCaseInsensitive + * @summary Checks that jarsigner verifies a signed jar with the same alias as + * was specified for signing, particularly regarding upper and lower case and + * its conversion to lower case by JKS + * ({@link sun.security.provider.JavaKeyStore.JKS#convertAlias(String)}). + */ + +import java.nio.file.Files; +import java.nio.file.Paths; +import jdk.test.lib.util.JarUtils; +import jdk.test.lib.SecurityTools; +import org.testng.annotations.Test; + +public class JavaKeyStoreAliasCaseInsensitive { + + /** + * Alias for certificates in the keystore with letters in different + * (upper and lower) cases. + */ + static final String ALIAS = "AlIaS"; + + @Test + public void testAliasCase() throws Exception { + final String KEYSTORE_OPTIONS = "-storetype JKS -keystore " + + "test-alias-case.jks -storepass changeit"; + SecurityTools.keytool(KEYSTORE_OPTIONS + " -genkeypair" + + " -keypass changeit -alias " + ALIAS + " -dname CN=" + ALIAS) + .shouldHaveExitValue(0); + String jarFilename = "test-alias-case.jar"; + JarUtils.createJarFile(Paths.get(jarFilename), Paths.get("."), + Files.write(Paths.get("aFile"), new byte[1])); + + SecurityTools.jarsigner(KEYSTORE_OPTIONS + " -verbose -debug " + + jarFilename + " " + ALIAS).shouldHaveExitValue(0); + + SecurityTools.jarsigner("-verify -strict " + KEYSTORE_OPTIONS + + " -debug -verbose " + jarFilename + " " + ALIAS) + .shouldHaveExitValue(0) + .shouldNotContain( + "This jar contains signed entries which are not " + + "signed by the specified alias(es)."); + } + + /** + * This test essentially covers compatibility with the previous version of + * {@link sun.security.tools.jarsigner.Main#inKeyStoreForOneSigner} in case + * a certificate and alias entry is already in + * {@link sun.security.tools.jarsigner.Main#storeHash} when + * {@link sun.security.tools.jarsigner.Main#inKeyStoreForOneSigner} is + * invoked from a previous invocation of it. + * It passed with the previous {@code jarsigner} version with a lowercase + * alias {@link #ALIAS} and basically covers the duplicated portions of + * code in {@link sun.security.tools.jarsigner.Main#inKeyStoreForOneSigner} + * near {@code IN_KEYSTORE} and {@code SIGNED_BY_ALIAS} before having + * refactored and re-unified them in order to demonstrate identical + * behavior. + */ + @Test + public void testAliasCaseStoreHash() throws Exception { + // Create a keystore with a certificate associated with ALIAS + "2" + // signed by another certificate associated with ALIAS + "1". + final String KEYSTORE_OPTIONS = "-storetype JKS -keystore" + + " test-alias-storeHash-case.jks -storepass changeit"; + SecurityTools.keytool(KEYSTORE_OPTIONS + " -genkeypair" + + " -keypass changeit -alias " + ALIAS + "1 -dname CN=" + + ALIAS + "1").shouldHaveExitValue(0); + SecurityTools.keytool(KEYSTORE_OPTIONS + " -genkeypair" + + " -keypass changeit -alias " + ALIAS + "2 -dname CN=" + + ALIAS + "2").shouldHaveExitValue(0); + String certReq = SecurityTools.keytool(KEYSTORE_OPTIONS + + " -certreq -keypass changeit -alias " + ALIAS + "2") + .shouldHaveExitValue(0).getStdout(); + SecurityTools.setResponse(certReq); + String cert = SecurityTools.keytool(KEYSTORE_OPTIONS + + " -gencert -rfc -keypass changeit -alias " + ALIAS + "1") + .shouldHaveExitValue(0).getOutput(); + SecurityTools.setResponse(cert); + SecurityTools.keytool(KEYSTORE_OPTIONS + + " -importcert -keypass changeit -alias " + ALIAS + "2") + .shouldHaveExitValue(0); + + // Create a jar file signed by ALIAS + "2" and then add another file to + // that same jar and sign it by ALIAS + "1", ALIAS + "1" being an alias + // for a certificate which is part of the certificate chain of ALIAS + + // "2" but not the certificate ALIAS + "2" points to directly. + String jarFilename = "test-alias-storeHash-case.jar"; + JarUtils.createJarFile(Paths.get(jarFilename), Paths.get(".")); + SecurityTools.jarsigner(KEYSTORE_OPTIONS + " -verbose -debug " + + jarFilename + " " + ALIAS + "2").shouldHaveExitValue(0); + JarUtils.updateJarFile(Paths.get(jarFilename), Paths.get("."), + Files.write(Paths.get("added-file"), new byte[1])); + SecurityTools.jarsigner(KEYSTORE_OPTIONS + " -verbose -debug " + + jarFilename + " " + ALIAS + "1").shouldHaveExitValue(0); + + // The later added file "added-file" is signed by the certificate + // associated with alias ALIAS + "1" directly while the other jarfile + // contents is signed by a certificate associated with alias ALIAS + "2" + // which includes the certificate associated with alias ALIAS + "1" in + // its certification path. + SecurityTools.jarsigner("-verify -strict " + KEYSTORE_OPTIONS + + " -debug -verbose " + jarFilename + " " + ALIAS + "1") + .shouldHaveExitValue(0) + .shouldNotContain( + "This jar contains signed entries which are not " + + "signed by the specified alias(es)."); + } + +} From 9ee5ab51243c9dfe7775e0277c65a6d17d76ef23 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Mon, 10 Jun 2019 09:52:04 -0400 Subject: [PATCH 010/109] 8224952: RI deviates from JVMS - non-zero minor_version for class files throws UnsupportedClassVersionError Change the JVM to follow the JVM Spec and accept non-zero minor_version for appropriate older class file versions. Reviewed-by: acorn, dholmes, iignatyev --- .../share/classfile/classFileParser.cpp | 102 +++++++++--------- .../runtime/ClassFile/PreviewVersion.java | 14 +-- 2 files changed, 59 insertions(+), 57 deletions(-) diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 417de672bf2..1583441e7e1 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -4754,60 +4754,62 @@ static bool has_illegal_visibility(jint flags) { // A legal major_version.minor_version must be one of the following: // -// Major_version = 45, any minor_version. -// Major_version >= 46 and major_version <= current_major_version and minor_version = 0. -// Major_version = current_major_version and minor_version = 65535 and --enable-preview is present. +// Major_version >= 45 and major_version < 56, any minor_version. +// Major_version >= 56 and major_version <= JVM_CLASSFILE_MAJOR_VERSION and minor_version = 0. +// Major_version = JVM_CLASSFILE_MAJOR_VERSION and minor_version = 65535 and --enable-preview is present. // static void verify_class_version(u2 major, u2 minor, Symbol* class_name, TRAPS){ + ResourceMark rm(THREAD); const u2 max_version = JVM_CLASSFILE_MAJOR_VERSION; - if (major != JAVA_MIN_SUPPORTED_VERSION) { // All 45.* are ok including 45.65535 - if (minor == JAVA_PREVIEW_MINOR_VERSION) { - if (major != max_version) { - ResourceMark rm(THREAD); - Exceptions::fthrow( - THREAD_AND_LOCATION, - vmSymbols::java_lang_UnsupportedClassVersionError(), - "%s (class file version %u.%u) was compiled with preview features that are unsupported. " - "This version of the Java Runtime only recognizes preview features for class file version %u.%u", - class_name->as_C_string(), major, minor, JVM_CLASSFILE_MAJOR_VERSION, JAVA_PREVIEW_MINOR_VERSION); - return; - } + if (major < JAVA_MIN_SUPPORTED_VERSION) { + Exceptions::fthrow( + THREAD_AND_LOCATION, + vmSymbols::java_lang_UnsupportedClassVersionError(), + "%s (class file version %u.%u) was compiled with an invalid major version", + class_name->as_C_string(), major, minor); + return; + } - if (!Arguments::enable_preview()) { - ResourceMark rm(THREAD); - Exceptions::fthrow( - THREAD_AND_LOCATION, - vmSymbols::java_lang_UnsupportedClassVersionError(), - "Preview features are not enabled for %s (class file version %u.%u). Try running with '--enable-preview'", - class_name->as_C_string(), major, minor); - return; - } + if (major > max_version) { + Exceptions::fthrow( + THREAD_AND_LOCATION, + vmSymbols::java_lang_UnsupportedClassVersionError(), + "%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), " + "this version of the Java Runtime only recognizes class file versions up to %u.0", + class_name->as_C_string(), major, minor, JVM_CLASSFILE_MAJOR_VERSION); + return; + } - } else { // minor != JAVA_PREVIEW_MINOR_VERSION - if (major > max_version) { - ResourceMark rm(THREAD); - Exceptions::fthrow( - THREAD_AND_LOCATION, - vmSymbols::java_lang_UnsupportedClassVersionError(), - "%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), " - "this version of the Java Runtime only recognizes class file versions up to %u.0", - class_name->as_C_string(), major, minor, JVM_CLASSFILE_MAJOR_VERSION); - } else if (major < JAVA_MIN_SUPPORTED_VERSION) { - ResourceMark rm(THREAD); - Exceptions::fthrow( - THREAD_AND_LOCATION, - vmSymbols::java_lang_UnsupportedClassVersionError(), - "%s (class file version %u.%u) was compiled with an invalid major version", - class_name->as_C_string(), major, minor); - } else if (minor != 0) { - ResourceMark rm(THREAD); - Exceptions::fthrow( - THREAD_AND_LOCATION, - vmSymbols::java_lang_UnsupportedClassVersionError(), - "%s (class file version %u.%u) was compiled with an invalid non-zero minor version", - class_name->as_C_string(), major, minor); - } + if (major < JAVA_12_VERSION || minor == 0) { + return; + } + + if (minor == JAVA_PREVIEW_MINOR_VERSION) { + if (major != max_version) { + Exceptions::fthrow( + THREAD_AND_LOCATION, + vmSymbols::java_lang_UnsupportedClassVersionError(), + "%s (class file version %u.%u) was compiled with preview features that are unsupported. " + "This version of the Java Runtime only recognizes preview features for class file version %u.%u", + class_name->as_C_string(), major, minor, JVM_CLASSFILE_MAJOR_VERSION, JAVA_PREVIEW_MINOR_VERSION); + return; } + + if (!Arguments::enable_preview()) { + Exceptions::fthrow( + THREAD_AND_LOCATION, + vmSymbols::java_lang_UnsupportedClassVersionError(), + "Preview features are not enabled for %s (class file version %u.%u). Try running with '--enable-preview'", + class_name->as_C_string(), major, minor); + return; + } + + } else { // minor != JAVA_PREVIEW_MINOR_VERSION + Exceptions::fthrow( + THREAD_AND_LOCATION, + vmSymbols::java_lang_UnsupportedClassVersionError(), + "%s (class file version %u.%u) was compiled with an invalid non-zero minor version", + class_name->as_C_string(), major, minor); } } @@ -5641,11 +5643,11 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa } if (ik->minor_version() == JAVA_PREVIEW_MINOR_VERSION && - ik->major_version() != JAVA_MIN_SUPPORTED_VERSION && + ik->major_version() == JVM_CLASSFILE_MAJOR_VERSION && log_is_enabled(Info, class, preview)) { ResourceMark rm; log_info(class, preview)("Loading class %s that depends on preview features (class file version %d.65535)", - ik->external_name(), ik->major_version()); + ik->external_name(), JVM_CLASSFILE_MAJOR_VERSION); } if (log_is_enabled(Debug, class, resolve)) { diff --git a/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java b/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java index de84800459c..8bd2294fa60 100644 --- a/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java +++ b/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -73,7 +73,7 @@ public class PreviewVersion { // Subtract 1 from class's major version. The class should fail to load // because its major_version does not match the JVM current version. - int prev_major_version = Runtime.version().feature() - 1; + int prev_major_version = (klassbuf[6] << 8 | klassbuf[7]) - 1; klassbuf[6] = (byte)((prev_major_version >> 8) & 0xff); klassbuf[7] = (byte)(prev_major_version & 0xff); try { @@ -81,8 +81,8 @@ public class PreviewVersion { throw new RuntimeException("UnsupportedClassVersionError exception not thrown"); } catch (java.lang.UnsupportedClassVersionError e) { if (!e.getMessage().contains("compiled with preview features that are unsupported")) { - throw new RuntimeException( - "Wrong UnsupportedClassVersionError exception: " + e.getMessage()); + throw new RuntimeException( + "Wrong UnsupportedClassVersionError exception: " + e.getMessage()); } } @@ -97,10 +97,10 @@ public class PreviewVersion { "Unexpected UnsupportedClassVersionError exception thrown: " + e.getMessage()); } - // Check that a class with a recent older major version and a non-zero - // minor version fails to load. + // Check that a class with a recent older major version > JDK-11 and a minor version + // that is neither 0 nor 65535 fails to load. klassbuf[6] = 0; - klassbuf[7] = 53; + klassbuf[7] = 56; klassbuf[4] = 0; klassbuf[5] = 2; try { From be42d7e20df81242dc2273c095224191d3d6c4c6 Mon Sep 17 00:00:00 2001 From: Dmitrij Pochepko Date: Mon, 10 Jun 2019 17:02:35 +0300 Subject: [PATCH 011/109] 8222412: AARCH64: multiple instructions encoding issues Reviewed-by: aph --- src/hotspot/cpu/aarch64/aarch64-asmtest.py | 1177 +++++++++ src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 2184 +++++++++-------- src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 125 +- src/hotspot/cpu/aarch64/register_aarch64.hpp | 2 +- 4 files changed, 2485 insertions(+), 1003 deletions(-) create mode 100644 src/hotspot/cpu/aarch64/aarch64-asmtest.py diff --git a/src/hotspot/cpu/aarch64/aarch64-asmtest.py b/src/hotspot/cpu/aarch64/aarch64-asmtest.py new file mode 100644 index 00000000000..f54903041ed --- /dev/null +++ b/src/hotspot/cpu/aarch64/aarch64-asmtest.py @@ -0,0 +1,1177 @@ +import random + +AARCH64_AS = "" +AARCH64_OBJDUMP = "" +AARCH64_OBJCOPY = "" + +class Operand(object): + + def generate(self): + return self + +class Register(Operand): + + def generate(self): + self.number = random.randint(0, 30) + return self + + def astr(self, prefix): + return prefix + str(self.number) + +class FloatRegister(Register): + + def __str__(self): + return self.astr("v") + + def nextReg(self): + next = FloatRegister() + next.number = (self.number + 1) % 32 + return next + +class GeneralRegister(Register): + + def __str__(self): + return self.astr("r") + +class GeneralRegisterOrZr(Register): + + def generate(self): + self.number = random.randint(0, 31) + return self + + def astr(self, prefix = ""): + if (self.number == 31): + return prefix + "zr" + else: + return prefix + str(self.number) + + def __str__(self): + if (self.number == 31): + return self.astr() + else: + return self.astr("r") + +class GeneralRegisterOrSp(Register): + def generate(self): + self.number = random.randint(0, 31) + return self + + def astr(self, prefix = ""): + if (self.number == 31): + return "sp" + else: + return prefix + str(self.number) + + def __str__(self): + if (self.number == 31): + return self.astr() + else: + return self.astr("r") + +class FloatZero(Operand): + + def __str__(self): + return "0.0" + + def astr(self, ignored): + return "#0.0" + +class OperandFactory: + + _modes = {'x' : GeneralRegister, + 'w' : GeneralRegister, + 's' : FloatRegister, + 'd' : FloatRegister, + 'z' : FloatZero} + + @classmethod + def create(cls, mode): + return OperandFactory._modes[mode]() + +class ShiftKind: + + def generate(self): + self.kind = ["LSL", "LSR", "ASR"][random.randint(0,2)] + return self + + def cstr(self): + return self.kind + +class Instruction(object): + + def __init__(self, name): + self._name = name + self.isWord = name.endswith("w") | name.endswith("wi") + self.asmRegPrefix = ["x", "w"][self.isWord] + + def aname(self): + if (self._name.endswith("wi")): + return self._name[:len(self._name)-2] + else: + if (self._name.endswith("i") | self._name.endswith("w")): + return self._name[:len(self._name)-1] + else: + return self._name + + def emit(self) : + pass + + def compare(self) : + pass + + def generate(self) : + return self + + def cstr(self): + return '__ %s(' % self.name() + + def astr(self): + return '%s\t' % self.aname() + + def name(self): + name = self._name + if name == "and": + name = "andr" # Special case: the name "and" can't be used + # in HotSpot, even for a member. + return name + + def multipleForms(self): + return 0 + +class InstructionWithModes(Instruction): + + def __init__(self, name, mode): + Instruction.__init__(self, name) + self.mode = mode + self.isFloat = (mode == 'd') | (mode == 's') + if self.isFloat: + self.isWord = mode != 'd' + self.asmRegPrefix = ["d", "s"][self.isWord] + else: + self.isWord = mode != 'x' + self.asmRegPrefix = ["x", "w"][self.isWord] + + def name(self): + return self._name + (self.mode if self.mode != 'x' else '') + + def aname(self): + return (self._name+mode if (mode == 'b' or mode == 'h') + else self._name) + +class ThreeRegInstruction(Instruction): + + def generate(self): + self.reg = [GeneralRegister().generate(), GeneralRegister().generate(), + GeneralRegister().generate()] + return self + + + def cstr(self): + return (super(ThreeRegInstruction, self).cstr() + + ('%s, %s, %s' + % (self.reg[0], + self.reg[1], self.reg[2]))) + + def astr(self): + prefix = self.asmRegPrefix + return (super(ThreeRegInstruction, self).astr() + + ('%s, %s, %s' + % (self.reg[0].astr(prefix), + self.reg[1].astr(prefix), self.reg[2].astr(prefix)))) + +class FourRegInstruction(ThreeRegInstruction): + + def generate(self): + self.reg = ThreeRegInstruction.generate(self).reg + [GeneralRegister().generate()] + return self + + + def cstr(self): + return (super(FourRegInstruction, self).cstr() + + (', %s' % self.reg[3])) + + def astr(self): + prefix = self.asmRegPrefix + return (super(FourRegInstruction, self).astr() + + (', %s' % self.reg[3].astr(prefix))) + +class TwoRegInstruction(Instruction): + + def generate(self): + self.reg = [GeneralRegister().generate(), GeneralRegister().generate()] + return self + + def cstr(self): + return (super(TwoRegInstruction, self).cstr() + + '%s, %s' % (self.reg[0], + self.reg[1])) + + def astr(self): + prefix = self.asmRegPrefix + return (super(TwoRegInstruction, self).astr() + + ('%s, %s' + % (self.reg[0].astr(prefix), + self.reg[1].astr(prefix)))) + +class TwoRegImmedInstruction(TwoRegInstruction): + + def generate(self): + super(TwoRegImmedInstruction, self).generate() + self.immed = random.randint(0, 1<<11 -1) + return self + + def cstr(self): + return (super(TwoRegImmedInstruction, self).cstr() + + ', %su' % self.immed) + + def astr(self): + return (super(TwoRegImmedInstruction, self).astr() + + ', #%s' % self.immed) + +class OneRegOp(Instruction): + + def generate(self): + self.reg = GeneralRegister().generate() + return self + + def cstr(self): + return (super(OneRegOp, self).cstr() + + '%s);' % self.reg) + + def astr(self): + return (super(OneRegOp, self).astr() + + '%s' % self.reg.astr(self.asmRegPrefix)) + +class ArithOp(ThreeRegInstruction): + + def generate(self): + super(ArithOp, self).generate() + self.kind = ShiftKind().generate() + self.distance = random.randint(0, (1<<5)-1 if self.isWord else (1<<6)-1) + return self + + def cstr(self): + return ('%s, Assembler::%s, %s);' + % (ThreeRegInstruction.cstr(self), + self.kind.cstr(), self.distance)) + + def astr(self): + return ('%s, %s #%s' + % (ThreeRegInstruction.astr(self), + self.kind.cstr(), + self.distance)) + +class AddSubCarryOp(ThreeRegInstruction): + + def cstr(self): + return ('%s);' + % (ThreeRegInstruction.cstr(self))) + +class AddSubExtendedOp(ThreeRegInstruction): + + uxtb, uxth, uxtw, uxtx, sxtb, sxth, sxtw, sxtx = range(8) + optNames = ["uxtb", "uxth", "uxtw", "uxtx", "sxtb", "sxth", "sxtw", "sxtx"] + + def generate(self): + super(AddSubExtendedOp, self).generate() + self.amount = random.randint(1, 4) + self.option = random.randint(0, 7) + return self + + def cstr(self): + return (super(AddSubExtendedOp, self).cstr() + + (", ext::" + AddSubExtendedOp.optNames[self.option] + + ", " + str(self.amount) + ");")) + + def astr(self): + return (super(AddSubExtendedOp, self).astr() + + (", " + AddSubExtendedOp.optNames[self.option] + + " #" + str(self.amount))) + +class AddSubImmOp(TwoRegImmedInstruction): + + def cstr(self): + return super(AddSubImmOp, self).cstr() + ");" + +class LogicalImmOp(AddSubImmOp): + + # These tables are legal immediate logical operands + immediates32 \ + = [0x1, 0x3f, 0x1f0, 0x7e0, + 0x1c00, 0x3ff0, 0x8000, 0x1e000, + 0x3e000, 0x78000, 0xe0000, 0x100000, + 0x1fffe0, 0x3fe000, 0x780000, 0x7ffff8, + 0xff8000, 0x1800180, 0x1fffc00, 0x3c003c0, + 0x3ffff00, 0x7c00000, 0x7fffe00, 0xf000f00, + 0xfffe000, 0x18181818, 0x1ffc0000, 0x1ffffffe, + 0x3f003f00, 0x3fffe000, 0x60006000, 0x7f807f80, + 0x7ffffc00, 0x800001ff, 0x803fffff, 0x9f9f9f9f, + 0xc0000fff, 0xc0c0c0c0, 0xe0000000, 0xe003e003, + 0xe3ffffff, 0xf0000fff, 0xf0f0f0f0, 0xf80000ff, + 0xf83ff83f, 0xfc00007f, 0xfc1fffff, 0xfe0001ff, + 0xfe3fffff, 0xff003fff, 0xff800003, 0xff87ff87, + 0xffc00fff, 0xffe0000f, 0xffefffef, 0xfff1fff1, + 0xfff83fff, 0xfffc0fff, 0xfffe0fff, 0xffff3fff, + 0xffffc007, 0xffffe1ff, 0xfffff80f, 0xfffffe07, + 0xffffffbf, 0xfffffffd] + + immediates \ + = [0x1, 0x1f80, 0x3fff0, 0x3ffffc, + 0x3fe0000, 0x1ffc0000, 0xf8000000, 0x3ffffc000, + 0xffffffe00, 0x3ffffff800, 0xffffc00000, 0x3f000000000, + 0x7fffffff800, 0x1fe000001fe0, 0x3ffffff80000, 0xc00000000000, + 0x1ffc000000000, 0x3ffff0003ffff, 0x7ffffffe00000, 0xfffffffffc000, + 0x1ffffffffffc00, 0x3fffffffffff00, 0x7ffffffffffc00, 0xffffffffff8000, + 0x1ffffffff800000, 0x3fffffc03fffffc, 0x7fffc0000000000, 0xff80ff80ff80ff8, + 0x1c00000000000000, 0x1fffffffffff0000, 0x3fffff803fffff80, 0x7fc000007fc00000, + 0x8000000000000000, 0x803fffff803fffff, 0xc000007fc000007f, 0xe00000000000ffff, + 0xe3ffffffffffffff, 0xf007f007f007f007, 0xf80003ffffffffff, 0xfc000003fc000003, + 0xfe000000007fffff, 0xff00000000007fff, 0xff800000000003ff, 0xffc00000000000ff, + 0xffe00000000003ff, 0xfff0000000003fff, 0xfff80000001fffff, 0xfffc0000fffc0000, + 0xfffe003fffffffff, 0xffff3fffffffffff, 0xffffc0000007ffff, 0xffffe01fffffe01f, + 0xfffff800000007ff, 0xfffffc0fffffffff, 0xffffff00003fffff, 0xffffffc0000007ff, + 0xfffffff0000001ff, 0xfffffffc00003fff, 0xffffffff07ffffff, 0xffffffffe003ffff, + 0xfffffffffc01ffff, 0xffffffffffc00003, 0xfffffffffffc000f, 0xffffffffffffe07f] + + def generate(self): + AddSubImmOp.generate(self) + self.immed = \ + self.immediates32[random.randint(0, len(self.immediates32)-1)] \ + if self.isWord \ + else \ + self.immediates[random.randint(0, len(self.immediates)-1)] + + return self + + def astr(self): + return (super(TwoRegImmedInstruction, self).astr() + + ', #0x%x' % self.immed) + + def cstr(self): + return super(AddSubImmOp, self).cstr() + "l);" + +class MultiOp(): + + def multipleForms(self): + return 3 + + def forms(self): + return ["__ pc()", "back", "forth"] + + def aforms(self): + return [".", "back", "forth"] + +class AbsOp(MultiOp, Instruction): + + def cstr(self): + return super(AbsOp, self).cstr() + "%s);" + + def astr(self): + return Instruction.astr(self) + "%s" + +class RegAndAbsOp(MultiOp, Instruction): + + def multipleForms(self): + if self.name() == "adrp": + # We can only test one form of adrp because anything other + # than "adrp ." requires relocs in the assembler output + return 1 + return 3 + + def generate(self): + Instruction.generate(self) + self.reg = GeneralRegister().generate() + return self + + def cstr(self): + if self.name() == "adrp": + return "__ _adrp(" + "%s, %s);" % (self.reg, "%s") + return (super(RegAndAbsOp, self).cstr() + + "%s, %s);" % (self.reg, "%s")) + + def astr(self): + return (super(RegAndAbsOp, self).astr() + + self.reg.astr(self.asmRegPrefix) + ", %s") + +class RegImmAbsOp(RegAndAbsOp): + + def cstr(self): + return (Instruction.cstr(self) + + "%s, %s, %s);" % (self.reg, self.immed, "%s")) + + def astr(self): + return (Instruction.astr(self) + + ("%s, #%s, %s" + % (self.reg.astr(self.asmRegPrefix), self.immed, "%s"))) + + def generate(self): + super(RegImmAbsOp, self).generate() + self.immed = random.randint(0, 1<<5 -1) + return self + +class MoveWideImmOp(RegImmAbsOp): + + def multipleForms(self): + return 0 + + def cstr(self): + return (Instruction.cstr(self) + + "%s, %s, %s);" % (self.reg, self.immed, self.shift)) + + def astr(self): + return (Instruction.astr(self) + + ("%s, #%s, lsl %s" + % (self.reg.astr(self.asmRegPrefix), + self.immed, self.shift))) + + def generate(self): + super(RegImmAbsOp, self).generate() + self.immed = random.randint(0, 1<<16 -1) + if self.isWord: + self.shift = random.randint(0, 1) * 16 + else: + self.shift = random.randint(0, 3) * 16 + return self + +class BitfieldOp(TwoRegInstruction): + + def cstr(self): + return (Instruction.cstr(self) + + ("%s, %s, %s, %s);" + % (self.reg[0], self.reg[1], self.immr, self.imms))) + + def astr(self): + return (TwoRegInstruction.astr(self) + + (", #%s, #%s" + % (self.immr, self.imms))) + + def generate(self): + TwoRegInstruction.generate(self) + self.immr = random.randint(0, 31) + self.imms = random.randint(0, 31) + return self + +class ExtractOp(ThreeRegInstruction): + + def generate(self): + super(ExtractOp, self).generate() + self.lsb = random.randint(0, (1<<5)-1 if self.isWord else (1<<6)-1) + return self + + def cstr(self): + return (ThreeRegInstruction.cstr(self) + + (", %s);" % self.lsb)) + + def astr(self): + return (ThreeRegInstruction.astr(self) + + (", #%s" % self.lsb)) + +class CondBranchOp(MultiOp, Instruction): + + def cstr(self): + return "__ br(Assembler::" + self.name() + ", %s);" + + def astr(self): + return "b." + self.name() + "\t%s" + +class ImmOp(Instruction): + + def cstr(self): + return "%s%s);" % (Instruction.cstr(self), self.immed) + + def astr(self): + return Instruction.astr(self) + "#" + str(self.immed) + + def generate(self): + self.immed = random.randint(0, 1<<16 -1) + return self + +class Op(Instruction): + + def cstr(self): + return Instruction.cstr(self) + ");" + +class SystemOp(Instruction): + + def __init__(self, op): + Instruction.__init__(self, op[0]) + self.barriers = op[1] + + def generate(self): + Instruction.generate(self) + self.barrier \ + = self.barriers[random.randint(0, len(self.barriers)-1)] + return self + + def cstr(self): + return Instruction.cstr(self) + "Assembler::" + self.barrier + ");" + + def astr(self): + return Instruction.astr(self) + self.barrier + +conditionCodes = ["EQ", "NE", "HS", "CS", "LO", "CC", "MI", "PL", "VS", \ + "VC", "HI", "LS", "GE", "LT", "GT", "LE", "AL", "NV"] + +class ConditionalCompareOp(TwoRegImmedInstruction): + + def generate(self): + TwoRegImmedInstruction.generate(self) + self.cond = random.randint(0, 15) + self.immed = random.randint(0, 15) + return self + + def cstr(self): + return (super(ConditionalCompareOp, self).cstr() + ", " + + "Assembler::" + conditionCodes[self.cond] + ");") + + def astr(self): + return (super(ConditionalCompareOp, self).astr() + + ", " + conditionCodes[self.cond]) + +class ConditionalCompareImmedOp(Instruction): + + def generate(self): + self.reg = GeneralRegister().generate() + self.cond = random.randint(0, 15) + self.immed2 = random.randint(0, 15) + self.immed = random.randint(0, 31) + return self + + def cstr(self): + return (Instruction.cstr(self) + str(self.reg) + ", " + + str(self.immed) + ", " + + str(self.immed2) + ", " + + "Assembler::" + conditionCodes[self.cond] + ");") + + def astr(self): + return (Instruction.astr(self) + + self.reg.astr(self.asmRegPrefix) + + ", #" + str(self.immed) + + ", #" + str(self.immed2) + + ", " + conditionCodes[self.cond]) + +class TwoRegOp(TwoRegInstruction): + + def cstr(self): + return TwoRegInstruction.cstr(self) + ");" + +class ThreeRegOp(ThreeRegInstruction): + + def cstr(self): + return ThreeRegInstruction.cstr(self) + ");" + +class FourRegMulOp(FourRegInstruction): + + def cstr(self): + return FourRegInstruction.cstr(self) + ");" + + def astr(self): + isMaddsub = self.name().startswith("madd") | self.name().startswith("msub") + midPrefix = self.asmRegPrefix if isMaddsub else "w" + return (Instruction.astr(self) + + self.reg[0].astr(self.asmRegPrefix) + + ", " + self.reg[1].astr(midPrefix) + + ", " + self.reg[2].astr(midPrefix) + + ", " + self.reg[3].astr(self.asmRegPrefix)) + +class ConditionalSelectOp(ThreeRegInstruction): + + def generate(self): + ThreeRegInstruction.generate(self) + self.cond = random.randint(0, 15) + return self + + def cstr(self): + return (ThreeRegInstruction.cstr(self) + ", " + + "Assembler::" + conditionCodes[self.cond] + ");") + + def astr(self): + return (ThreeRegInstruction.astr(self) + + ", " + conditionCodes[self.cond]) + +class LoadStoreExclusiveOp(InstructionWithModes): + + def __init__(self, op): # op is a tuple of ["name", "mode", registers] + InstructionWithModes.__init__(self, op[0], op[1]) + self.num_registers = op[2] + + def astr(self): + result = self.aname() + '\t' + regs = list(self.regs) + index = regs.pop() # The last reg is the index register + prefix = ('x' if (self.mode == 'x') + & ((self.name().startswith("ld")) + | (self.name().startswith("stlr"))) # Ewww :-( + else 'w') + result = result + regs.pop(0).astr(prefix) + ", " + for s in regs: + result = result + s.astr(self.asmRegPrefix) + ", " + result = result + "[" + index.astr("x") + "]" + return result + + def cstr(self): + result = InstructionWithModes.cstr(self) + regs = list(self.regs) + index = regs.pop() # The last reg is the index register + for s in regs: + result = result + str(s) + ", " + result = result + str(index) + ");" + return result + + def appendUniqueReg(self): + result = 0 + while result == 0: + newReg = GeneralRegister().generate() + result = 1 + for i in self.regs: + result = result and (i.number != newReg.number) + self.regs.append(newReg) + + def generate(self): + self.regs = [] + for i in range(self.num_registers): + self.appendUniqueReg() + return self + + def name(self): + if self.mode == 'x': + return self._name + else: + return self._name + self.mode + + def aname(self): + if (self.mode == 'b') | (self.mode == 'h'): + return self._name + self.mode + else: + return self._name + +class Address(object): + + base_plus_unscaled_offset, pre, post, base_plus_reg, \ + base_plus_scaled_offset, pcrel, post_reg, base_only = range(8) + kinds = ["base_plus_unscaled_offset", "pre", "post", "base_plus_reg", + "base_plus_scaled_offset", "pcrel", "post_reg", "base_only"] + extend_kinds = ["uxtw", "lsl", "sxtw", "sxtx"] + + @classmethod + def kindToStr(cls, i): + return cls.kinds[i] + + def generate(self, kind, shift_distance): + self.kind = kind + self.base = GeneralRegister().generate() + self.index = GeneralRegister().generate() + self.offset = { + Address.base_plus_unscaled_offset: random.randint(-1<<8, 1<<8-1) | 1, + Address.pre: random.randint(-1<<8, 1<<8-1), + Address.post: random.randint(-1<<8, 1<<8-1), + Address.pcrel: random.randint(0, 2), + Address.base_plus_reg: 0, + Address.base_plus_scaled_offset: (random.randint(0, 1<<11-1) | (3 << 9))*8, + Address.post_reg: 0, + Address.base_only: 0} [kind] + self.offset >>= (3 - shift_distance) + self.extend_kind = Address.extend_kinds[random.randint(0, 3)] + self.shift_distance = random.randint(0, 1) * shift_distance + return self + + def __str__(self): + result = { + Address.base_plus_unscaled_offset: "Address(%s, %s)" \ + % (str(self.base), self.offset), + Address.pre: "Address(__ pre(%s, %s))" % (str(self.base), self.offset), + Address.post: "Address(__ post(%s, %s))" % (str(self.base), self.offset), + Address.post_reg: "Address(__ post(%s, %s))" % (str(self.base), self.index), + Address.base_only: "Address(%s)" % (str(self.base)), + Address.pcrel: "", + Address.base_plus_reg: "Address(%s, %s, Address::%s(%s))" \ + % (self.base, self.index, self.extend_kind, self.shift_distance), + Address.base_plus_scaled_offset: + "Address(%s, %s)" % (self.base, self.offset) } [self.kind] + if (self.kind == Address.pcrel): + result = ["__ pc()", "back", "forth"][self.offset] + return result + + def astr(self, prefix): + extend_prefix = prefix + if self.kind == Address.base_plus_reg: + if self.extend_kind.endswith("w"): + extend_prefix = "w" + result = { + Address.base_plus_unscaled_offset: "[%s, %s]" \ + % (self.base.astr(prefix), self.offset), + Address.pre: "[%s, %s]!" % (self.base.astr(prefix), self.offset), + Address.post: "[%s], %s" % (self.base.astr(prefix), self.offset), + Address.post_reg: "[%s], %s" % (self.base.astr(prefix), self.index.astr(prefix)), + Address.base_only: "[%s]" % (self.base.astr(prefix)), + Address.pcrel: "", + Address.base_plus_reg: "[%s, %s, %s #%s]" \ + % (self.base.astr(prefix), self.index.astr(extend_prefix), + self.extend_kind, self.shift_distance), + Address.base_plus_scaled_offset: \ + "[%s, %s]" \ + % (self.base.astr(prefix), self.offset) + } [self.kind] + if (self.kind == Address.pcrel): + result = [".", "back", "forth"][self.offset] + return result + +class LoadStoreOp(InstructionWithModes): + + def __init__(self, args): + name, self.asmname, self.kind, mode = args + InstructionWithModes.__init__(self, name, mode) + + def generate(self): + + # This is something of a kludge, but the offset needs to be + # scaled by the memory datamode somehow. + shift = 3 + if (self.mode == 'b') | (self.asmname.endswith("b")): + shift = 0 + elif (self.mode == 'h') | (self.asmname.endswith("h")): + shift = 1 + elif (self.mode == 'w') | (self.asmname.endswith("w")) \ + | (self.mode == 's') : + shift = 2 + + self.adr = Address().generate(self.kind, shift) + + isFloat = (self.mode == 'd') | (self.mode == 's') + + regMode = FloatRegister if isFloat else GeneralRegister + self.reg = regMode().generate() + return self + + def cstr(self): + if not(self._name.startswith("prfm")): + return "%s%s, %s);" % (Instruction.cstr(self), str(self.reg), str(self.adr)) + else: # No target register for a prefetch + return "%s%s);" % (Instruction.cstr(self), str(self.adr)) + + def astr(self): + if not(self._name.startswith("prfm")): + return "%s\t%s, %s" % (self.aname(), self.reg.astr(self.asmRegPrefix), + self.adr.astr("x")) + else: # No target register for a prefetch + return "%s %s" % (self.aname(), + self.adr.astr("x")) + + def aname(self): + result = self.asmname + # if self.kind == Address.base_plus_unscaled_offset: + # result = result.replace("ld", "ldu", 1) + # result = result.replace("st", "stu", 1) + return result + +class LoadStorePairOp(InstructionWithModes): + + numRegs = 2 + + def __init__(self, args): + name, self.asmname, self.kind, mode = args + InstructionWithModes.__init__(self, name, mode) + self.offset = random.randint(-1<<4, 1<<4-1) << 4 + + def generate(self): + self.reg = [OperandFactory.create(self.mode).generate() + for i in range(self.numRegs)] + self.base = OperandFactory.create('x').generate() + return self + + def astr(self): + address = ["[%s, #%s]", "[%s, #%s]!", "[%s], #%s"][self.kind] + address = address % (self.base.astr('x'), self.offset) + result = "%s\t%s, %s, %s" \ + % (self.asmname, + self.reg[0].astr(self.asmRegPrefix), + self.reg[1].astr(self.asmRegPrefix), address) + return result + + def cstr(self): + address = { + Address.base_plus_unscaled_offset: "Address(%s, %s)" \ + % (str(self.base), self.offset), + Address.pre: "Address(__ pre(%s, %s))" % (str(self.base), self.offset), + Address.post: "Address(__ post(%s, %s))" % (str(self.base), self.offset), + } [self.kind] + result = "__ %s(%s, %s, %s);" \ + % (self.name(), self.reg[0], self.reg[1], address) + return result + +class FloatInstruction(Instruction): + + def aname(self): + if (self._name.endswith("s") | self._name.endswith("d")): + return self._name[:len(self._name)-1] + else: + return self._name + + def __init__(self, args): + name, self.modes = args + Instruction.__init__(self, name) + + def generate(self): + self.reg = [OperandFactory.create(self.modes[i]).generate() + for i in range(self.numRegs)] + return self + + def cstr(self): + formatStr = "%s%s" + ''.join([", %s" for i in range(1, self.numRegs)] + [");"]) + return (formatStr + % tuple([Instruction.cstr(self)] + + [str(self.reg[i]) for i in range(self.numRegs)])) # Yowza + + def astr(self): + formatStr = "%s%s" + ''.join([", %s" for i in range(1, self.numRegs)]) + return (formatStr + % tuple([Instruction.astr(self)] + + [(self.reg[i].astr(self.modes[i])) for i in range(self.numRegs)])) + +class LdStSIMDOp(Instruction): + def __init__(self, args): + self._name, self.regnum, self.arrangement, self.addresskind = args + + def generate(self): + self.address = Address().generate(self.addresskind, 0) + self._firstSIMDreg = FloatRegister().generate() + if (self.addresskind == Address.post): + if (self._name in ["ld1r", "ld2r", "ld3r", "ld4r"]): + elem_size = {"8B" : 1, "16B" : 1, "4H" : 2, "8H" : 2, "2S" : 4, "4S" : 4, "1D" : 8, "2D" : 8} [self.arrangement] + self.address.offset = self.regnum * elem_size + else: + if (self.arrangement in ["8B", "4H", "2S", "1D"]): + self.address.offset = self.regnum * 8 + else: + self.address.offset = self.regnum * 16 + return self + + def cstr(self): + buf = super(LdStSIMDOp, self).cstr() + str(self._firstSIMDreg) + current = self._firstSIMDreg + for cnt in range(1, self.regnum): + buf = '%s, %s' % (buf, current.nextReg()) + current = current.nextReg() + return '%s, __ T%s, %s);' % (buf, self.arrangement, str(self.address)) + + def astr(self): + buf = '%s\t{%s.%s' % (self._name, self._firstSIMDreg, self.arrangement) + current = self._firstSIMDreg + for cnt in range(1, self.regnum): + buf = '%s, %s.%s' % (buf, current.nextReg(), self.arrangement) + current = current.nextReg() + return '%s}, %s' % (buf, self.address.astr("x")) + + def aname(self): + return self._name + +class LSEOp(Instruction): + def __init__(self, args): + self._name, self.asmname, self.size, self.suffix = args + + def generate(self): + self._name = "%s%s" % (self._name, self.suffix) + self.asmname = "%s%s" % (self.asmname, self.suffix) + self.srcReg = GeneralRegisterOrZr().generate() + self.tgtReg = GeneralRegisterOrZr().generate() + self.adrReg = GeneralRegisterOrSp().generate() + + return self + + def cstr(self): + sizeSpec = {"x" : "Assembler::xword", "w" : "Assembler::word"} [self.size] + return super(LSEOp, self).cstr() + "%s, %s, %s, %s);" % (sizeSpec, self.srcReg, self.tgtReg, self.adrReg) + + def astr(self): + return "%s\t%s, %s, [%s]" % (self.asmname, self.srcReg.astr(self.size), self.tgtReg.astr(self.size), self.adrReg.astr("x")) + + def aname(self): + return self.asmname + +class TwoRegFloatOp(FloatInstruction): + numRegs = 2 + +class ThreeRegFloatOp(TwoRegFloatOp): + numRegs = 3 + +class FourRegFloatOp(TwoRegFloatOp): + numRegs = 4 + +class FloatConvertOp(TwoRegFloatOp): + + def __init__(self, args): + self._cname, self._aname, modes = args + TwoRegFloatOp.__init__(self, [self._cname, modes]) + + def aname(self): + return self._aname + + def cname(self): + return self._cname + +class SpecialCases(Instruction): + def __init__(self, data): + self._name = data[0] + self._cstr = data[1] + self._astr = data[2] + + def cstr(self): + return self._cstr + + def astr(self): + return self._astr + +def generate(kind, names): + outfile.write("# " + kind.__name__ + "\n"); + print "\n// " + kind.__name__ + for name in names: + for i in range(1): + op = kind(name).generate() + if op.multipleForms(): + forms = op.forms() + aforms = op.aforms() + for i in range(op.multipleForms()): + cstr = op.cstr() % forms[i] + astr = op.astr() % aforms[i] + print " %-50s //\t%s" % (cstr, astr) + outfile.write("\t" + astr + "\n") + else: + print " %-50s //\t%s" % (op.cstr(), op.astr()) + outfile.write("\t" + op.astr() + "\n") + +outfile = open("aarch64ops.s", "w") + +print "// BEGIN Generated code -- do not edit" +print "// Generated by aarch64-asmtest.py" + +print " Label back, forth;" +print " __ bind(back);" + +outfile.write("back:\n") + +generate (ArithOp, + [ "add", "sub", "adds", "subs", + "addw", "subw", "addsw", "subsw", + "and", "orr", "eor", "ands", + "andw", "orrw", "eorw", "andsw", + "bic", "orn", "eon", "bics", + "bicw", "ornw", "eonw", "bicsw" ]) + +generate (AddSubImmOp, + [ "addw", "addsw", "subw", "subsw", + "add", "adds", "sub", "subs"]) +generate (LogicalImmOp, + [ "andw", "orrw", "eorw", "andsw", + "and", "orr", "eor", "ands"]) + +generate (AbsOp, [ "b", "bl" ]) + +generate (RegAndAbsOp, ["cbzw", "cbnzw", "cbz", "cbnz", "adr", "adrp"]) + +generate (RegImmAbsOp, ["tbz", "tbnz"]) + +generate (MoveWideImmOp, ["movnw", "movzw", "movkw", "movn", "movz", "movk"]) + +generate (BitfieldOp, ["sbfm", "bfmw", "ubfmw", "sbfm", "bfm", "ubfm"]) + +generate (ExtractOp, ["extrw", "extr"]) + +generate (CondBranchOp, ["EQ", "NE", "HS", "CS", "LO", "CC", "MI", "PL", "VS", "VC", + "HI", "LS", "GE", "LT", "GT", "LE", "AL", "NV" ]) + +generate (ImmOp, ["svc", "hvc", "smc", "brk", "hlt", # "dpcs1", "dpcs2", "dpcs3" + ]) + +generate (Op, ["nop", "eret", "drps", "isb"]) + +barriers = ["OSHLD", "OSHST", "OSH", "NSHLD", "NSHST", "NSH", + "ISHLD", "ISHST", "ISH", "LD", "ST", "SY"] + +generate (SystemOp, [["dsb", barriers], ["dmb", barriers]]) + +generate (OneRegOp, ["br", "blr"]) + +for mode in 'xwhb': + generate (LoadStoreExclusiveOp, [["stxr", mode, 3], ["stlxr", mode, 3], + ["ldxr", mode, 2], ["ldaxr", mode, 2], + ["stlr", mode, 2], ["ldar", mode, 2]]) + +for mode in 'xw': + generate (LoadStoreExclusiveOp, [["ldxp", mode, 3], ["ldaxp", mode, 3], + ["stxp", mode, 4], ["stlxp", mode, 4]]) + +for kind in range(6): + print "\n// " + Address.kindToStr(kind), + if kind != Address.pcrel: + generate (LoadStoreOp, + [["str", "str", kind, "x"], ["str", "str", kind, "w"], + ["str", "strb", kind, "b"], ["str", "strh", kind, "h"], + ["ldr", "ldr", kind, "x"], ["ldr", "ldr", kind, "w"], + ["ldr", "ldrb", kind, "b"], ["ldr", "ldrh", kind, "h"], + ["ldrsb", "ldrsb", kind, "x"], ["ldrsh", "ldrsh", kind, "x"], + ["ldrsh", "ldrsh", kind, "w"], ["ldrsw", "ldrsw", kind, "x"], + ["ldr", "ldr", kind, "d"], ["ldr", "ldr", kind, "s"], + ["str", "str", kind, "d"], ["str", "str", kind, "s"], + ]) + else: + generate (LoadStoreOp, + [["ldr", "ldr", kind, "x"], ["ldr", "ldr", kind, "w"]]) + + +for kind in (Address.base_plus_unscaled_offset, Address.pcrel, Address.base_plus_reg, \ + Address.base_plus_scaled_offset): + generate (LoadStoreOp, + [["prfm", "prfm\tPLDL1KEEP,", kind, "x"]]) + +generate(AddSubCarryOp, ["adcw", "adcsw", "sbcw", "sbcsw", "adc", "adcs", "sbc", "sbcs"]) + +generate(AddSubExtendedOp, ["addw", "addsw", "sub", "subsw", "add", "adds", "sub", "subs"]) + +generate(ConditionalCompareOp, ["ccmnw", "ccmpw", "ccmn", "ccmp"]) +generate(ConditionalCompareImmedOp, ["ccmnw", "ccmpw", "ccmn", "ccmp"]) +generate(ConditionalSelectOp, + ["cselw", "csincw", "csinvw", "csnegw", "csel", "csinc", "csinv", "csneg"]) + +generate(TwoRegOp, + ["rbitw", "rev16w", "revw", "clzw", "clsw", "rbit", + "rev16", "rev32", "rev", "clz", "cls"]) +generate(ThreeRegOp, + ["udivw", "sdivw", "lslvw", "lsrvw", "asrvw", "rorvw", "udiv", "sdiv", + "lslv", "lsrv", "asrv", "rorv", "umulh", "smulh"]) +generate(FourRegMulOp, + ["maddw", "msubw", "madd", "msub", "smaddl", "smsubl", "umaddl", "umsubl"]) + +generate(ThreeRegFloatOp, + [["fmuls", "sss"], ["fdivs", "sss"], ["fadds", "sss"], ["fsubs", "sss"], + ["fmuls", "sss"], + ["fmuld", "ddd"], ["fdivd", "ddd"], ["faddd", "ddd"], ["fsubd", "ddd"], + ["fmuld", "ddd"]]) + +generate(FourRegFloatOp, + [["fmadds", "ssss"], ["fmsubs", "ssss"], ["fnmadds", "ssss"], ["fnmadds", "ssss"], + ["fmaddd", "dddd"], ["fmsubd", "dddd"], ["fnmaddd", "dddd"], ["fnmaddd", "dddd"],]) + +generate(TwoRegFloatOp, + [["fmovs", "ss"], ["fabss", "ss"], ["fnegs", "ss"], ["fsqrts", "ss"], + ["fcvts", "ds"], + ["fmovd", "dd"], ["fabsd", "dd"], ["fnegd", "dd"], ["fsqrtd", "dd"], + ["fcvtd", "sd"], + ]) + +generate(FloatConvertOp, [["fcvtzsw", "fcvtzs", "ws"], ["fcvtzs", "fcvtzs", "xs"], + ["fcvtzdw", "fcvtzs", "wd"], ["fcvtzd", "fcvtzs", "xd"], + ["scvtfws", "scvtf", "sw"], ["scvtfs", "scvtf", "sx"], + ["scvtfwd", "scvtf", "dw"], ["scvtfd", "scvtf", "dx"], + ["fmovs", "fmov", "ws"], ["fmovd", "fmov", "xd"], + ["fmovs", "fmov", "sw"], ["fmovd", "fmov", "dx"]]) + +generate(TwoRegFloatOp, [["fcmps", "ss"], ["fcmpd", "dd"], + ["fcmps", "sz"], ["fcmpd", "dz"]]) + +for kind in range(3): + generate(LoadStorePairOp, [["stp", "stp", kind, "w"], ["ldp", "ldp", kind, "w"], + ["ldpsw", "ldpsw", kind, "x"], + ["stp", "stp", kind, "x"], ["ldp", "ldp", kind, "x"] + ]) +generate(LoadStorePairOp, [["stnp", "stnp", 0, "w"], ["ldnp", "ldnp", 0, "w"], + ["stnp", "stnp", 0, "x"], ["ldnp", "ldnp", 0, "x"]]) + +generate(LdStSIMDOp, [["ld1", 1, "8B", Address.base_only], + ["ld1", 2, "16B", Address.post], + ["ld1", 3, "1D", Address.post_reg], + ["ld1", 4, "8H", Address.post], + ["ld1r", 1, "8B", Address.base_only], + ["ld1r", 1, "4S", Address.post], + ["ld1r", 1, "1D", Address.post_reg], + ["ld2", 2, "2D", Address.base_only], + ["ld2", 2, "4H", Address.post], + ["ld2r", 2, "16B", Address.base_only], + ["ld2r", 2, "2S", Address.post], + ["ld2r", 2, "2D", Address.post_reg], + ["ld3", 3, "4S", Address.post_reg], + ["ld3", 3, "2S", Address.base_only], + ["ld3r", 3, "8H", Address.base_only], + ["ld3r", 3, "4S", Address.post], + ["ld3r", 3, "1D", Address.post_reg], + ["ld4", 4, "8H", Address.post], + ["ld4", 4, "8B", Address.post_reg], + ["ld4r", 4, "8B", Address.base_only], + ["ld4r", 4, "4H", Address.post], + ["ld4r", 4, "2S", Address.post_reg], +]) + +generate(SpecialCases, [["ccmn", "__ ccmn(zr, zr, 3u, Assembler::LE);", "ccmn\txzr, xzr, #3, LE"], + ["ccmnw", "__ ccmnw(zr, zr, 5u, Assembler::EQ);", "ccmn\twzr, wzr, #5, EQ"], + ["ccmp", "__ ccmp(zr, 1, 4u, Assembler::NE);", "ccmp\txzr, 1, #4, NE"], + ["ccmpw", "__ ccmpw(zr, 2, 2, Assembler::GT);", "ccmp\twzr, 2, #2, GT"], + ["extr", "__ extr(zr, zr, zr, 0);", "extr\txzr, xzr, xzr, 0"], + ["stlxp", "__ stlxp(r0, zr, zr, sp);", "stlxp\tw0, xzr, xzr, [sp]"], + ["stlxpw", "__ stlxpw(r2, zr, zr, r3);", "stlxp\tw2, wzr, wzr, [x3]"], + ["stxp", "__ stxp(r4, zr, zr, r5);", "stxp\tw4, xzr, xzr, [x5]"], + ["stxpw", "__ stxpw(r6, zr, zr, sp);", "stxp\tw6, wzr, wzr, [sp]"], + ["dup", "__ dup(v0, __ T16B, zr);", "dup\tv0.16b, wzr"], + ["mov", "__ mov(v1, __ T1D, 0, zr);", "mov\tv1.d[0], xzr"], + ["mov", "__ mov(v1, __ T2S, 1, zr);", "mov\tv1.s[1], wzr"], + ["mov", "__ mov(v1, __ T4H, 2, zr);", "mov\tv1.h[2], wzr"], + ["mov", "__ mov(v1, __ T8B, 3, zr);", "mov\tv1.b[3], wzr"], + ["ld1", "__ ld1(v31, v0, __ T2D, Address(__ post(r1, r0)));", "ld1\t{v31.2d, v0.2d}, [x1], x0"]]) + +print "\n// FloatImmediateOp" +for float in ("2.0", "2.125", "4.0", "4.25", "8.0", "8.5", "16.0", "17.0", "0.125", + "0.1328125", "0.25", "0.265625", "0.5", "0.53125", "1.0", "1.0625", + "-2.0", "-2.125", "-4.0", "-4.25", "-8.0", "-8.5", "-16.0", "-17.0", + "-0.125", "-0.1328125", "-0.25", "-0.265625", "-0.5", "-0.53125", "-1.0", "-1.0625"): + astr = "fmov d0, #" + float + cstr = "__ fmovd(v0, " + float + ");" + print " %-50s //\t%s" % (cstr, astr) + outfile.write("\t" + astr + "\n") + +# ARMv8.1A +for size in ("x", "w"): + for suffix in ("", "a", "al", "l"): + generate(LSEOp, [["swp", "swp", size, suffix], + ["ldadd", "ldadd", size, suffix], + ["ldbic", "ldclr", size, suffix], + ["ldeor", "ldeor", size, suffix], + ["ldorr", "ldset", size, suffix], + ["ldsmin", "ldsmin", size, suffix], + ["ldsmax", "ldsmax", size, suffix], + ["ldumin", "ldumin", size, suffix], + ["ldumax", "ldumax", size, suffix]]); + +print "\n __ bind(forth);" +outfile.write("forth:\n") + +outfile.close() + +import subprocess +import sys + +# compile for 8.1 because of lse atomics +subprocess.check_call([AARCH64_AS, "-march=armv8.1-a", "aarch64ops.s", "-o", "aarch64ops.o"]) + +print +print "/*", +sys.stdout.flush() +subprocess.check_call([AARCH64_OBJDUMP, "-d", "aarch64ops.o"]) +print "*/" + +subprocess.check_call([AARCH64_OBJCOPY, "-O", "binary", "-j", ".text", "aarch64ops.o", "aarch64ops.bin"]) + +infile = open("aarch64ops.bin", "r") +bytes = bytearray(infile.read()) + +print +print " static const unsigned int insns[] =" +print " {" + +i = 0 +while i < len(bytes): + print " 0x%02x%02x%02x%02x," % (bytes[i+3], bytes[i+2], bytes[i+1], bytes[i]), + i += 4 + if i%16 == 0: + print +print "\n };" +print "// END Generated code -- do not edit" + + diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp index b6c08775751..2ce19d962d2 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp @@ -103,531 +103,662 @@ void entry(CodeBuffer *cb) { __ bind(back); // ArithOp - __ add(r19, r22, r7, Assembler::LSL, 28); // add x19, x22, x7, LSL #28 - __ sub(r16, r11, r10, Assembler::LSR, 13); // sub x16, x11, x10, LSR #13 - __ adds(r27, r13, r28, Assembler::ASR, 2); // adds x27, x13, x28, ASR #2 - __ subs(r20, r28, r26, Assembler::ASR, 41); // subs x20, x28, x26, ASR #41 - __ addw(r8, r19, r19, Assembler::ASR, 19); // add w8, w19, w19, ASR #19 - __ subw(r4, r9, r10, Assembler::LSL, 14); // sub w4, w9, w10, LSL #14 - __ addsw(r8, r11, r30, Assembler::LSL, 13); // adds w8, w11, w30, LSL #13 - __ subsw(r0, r25, r19, Assembler::LSL, 9); // subs w0, w25, w19, LSL #9 - __ andr(r20, r0, r21, Assembler::LSL, 19); // and x20, x0, x21, LSL #19 - __ orr(r21, r14, r20, Assembler::LSL, 17); // orr x21, x14, x20, LSL #17 - __ eor(r25, r28, r1, Assembler::LSL, 51); // eor x25, x28, x1, LSL #51 - __ ands(r10, r27, r11, Assembler::ASR, 15); // ands x10, x27, x11, ASR #15 - __ andw(r25, r5, r12, Assembler::ASR, 23); // and w25, w5, w12, ASR #23 - __ orrw(r18, r14, r10, Assembler::LSR, 4); // orr w18, w14, w10, LSR #4 - __ eorw(r4, r21, r5, Assembler::ASR, 22); // eor w4, w21, w5, ASR #22 - __ andsw(r21, r0, r5, Assembler::ASR, 29); // ands w21, w0, w5, ASR #29 - __ bic(r26, r30, r6, Assembler::ASR, 37); // bic x26, x30, x6, ASR #37 - __ orn(r3, r1, r13, Assembler::LSR, 29); // orn x3, x1, x13, LSR #29 - __ eon(r0, r28, r9, Assembler::LSL, 47); // eon x0, x28, x9, LSL #47 - __ bics(r29, r5, r28, Assembler::LSL, 46); // bics x29, x5, x28, LSL #46 - __ bicw(r9, r18, r7, Assembler::LSR, 20); // bic w9, w18, w7, LSR #20 - __ ornw(r26, r13, r25, Assembler::ASR, 24); // orn w26, w13, w25, ASR #24 - __ eonw(r25, r4, r19, Assembler::LSL, 6); // eon w25, w4, w19, LSL #6 - __ bicsw(r5, r26, r4, Assembler::LSR, 24); // bics w5, w26, w4, LSR #24 + __ add(r15, r12, r16, Assembler::LSR, 30); // add x15, x12, x16, LSR #30 + __ sub(r1, r15, r3, Assembler::LSR, 32); // sub x1, x15, x3, LSR #32 + __ adds(r13, r25, r5, Assembler::LSL, 13); // adds x13, x25, x5, LSL #13 + __ subs(r22, r28, r6, Assembler::ASR, 17); // subs x22, x28, x6, ASR #17 + __ addw(r0, r9, r22, Assembler::ASR, 6); // add w0, w9, w22, ASR #6 + __ subw(r19, r3, r25, Assembler::LSL, 21); // sub w19, w3, w25, LSL #21 + __ addsw(r4, r19, r11, Assembler::LSL, 20); // adds w4, w19, w11, LSL #20 + __ subsw(r24, r7, r19, Assembler::ASR, 0); // subs w24, w7, w19, ASR #0 + __ andr(r30, r7, r11, Assembler::LSL, 48); // and x30, x7, x11, LSL #48 + __ orr(r24, r8, r15, Assembler::LSL, 12); // orr x24, x8, x15, LSL #12 + __ eor(r17, r9, r23, Assembler::LSL, 1); // eor x17, x9, x23, LSL #1 + __ ands(r14, r11, r4, Assembler::LSR, 55); // ands x14, x11, x4, LSR #55 + __ andw(r19, r7, r12, Assembler::LSR, 17); // and w19, w7, w12, LSR #17 + __ orrw(r19, r27, r11, Assembler::ASR, 28); // orr w19, w27, w11, ASR #28 + __ eorw(r30, r3, r22, Assembler::LSR, 31); // eor w30, w3, w22, LSR #31 + __ andsw(r19, r26, r28, Assembler::ASR, 0); // ands w19, w26, w28, ASR #0 + __ bic(r29, r6, r26, Assembler::LSL, 51); // bic x29, x6, x26, LSL #51 + __ orn(r26, r27, r17, Assembler::LSL, 35); // orn x26, x27, x17, LSL #35 + __ eon(r21, r4, r14, Assembler::LSL, 5); // eon x21, x4, x14, LSL #5 + __ bics(r2, r15, r0, Assembler::ASR, 5); // bics x2, x15, x0, ASR #5 + __ bicw(r2, r7, r2, Assembler::LSL, 29); // bic w2, w7, w2, LSL #29 + __ ornw(r24, r12, r21, Assembler::LSR, 5); // orn w24, w12, w21, LSR #5 + __ eonw(r30, r15, r19, Assembler::LSL, 2); // eon w30, w15, w19, LSL #2 + __ bicsw(r30, r23, r17, Assembler::ASR, 28); // bics w30, w23, w17, ASR #28 // AddSubImmOp - __ addw(r7, r19, 340u); // add w7, w19, #340 - __ addsw(r8, r0, 401u); // adds w8, w0, #401 - __ subw(r29, r20, 163u); // sub w29, w20, #163 - __ subsw(r8, r23, 759u); // subs w8, w23, #759 - __ add(r1, r12, 523u); // add x1, x12, #523 - __ adds(r2, r11, 426u); // adds x2, x11, #426 - __ sub(r14, r29, 716u); // sub x14, x29, #716 - __ subs(r11, r5, 582u); // subs x11, x5, #582 + __ addw(r4, r20, 660u); // add w4, w20, #660 + __ addsw(r2, r10, 710u); // adds w2, w10, #710 + __ subw(r19, r26, 244u); // sub w19, w26, #244 + __ subsw(r28, r13, 73u); // subs w28, w13, #73 + __ add(r2, r30, 862u); // add x2, x30, #862 + __ adds(r27, r16, 574u); // adds x27, x16, #574 + __ sub(r22, r9, 589u); // sub x22, x9, #589 + __ subs(r4, r1, 698u); // subs x4, x1, #698 // LogicalImmOp - __ andw(r23, r22, 32768ul); // and w23, w22, #0x8000 - __ orrw(r4, r10, 4042322160ul); // orr w4, w10, #0xf0f0f0f0 - __ eorw(r0, r24, 4042322160ul); // eor w0, w24, #0xf0f0f0f0 - __ andsw(r19, r29, 2139127680ul); // ands w19, w29, #0x7f807f80 - __ andr(r5, r10, 4503599627354112ul); // and x5, x10, #0xfffffffffc000 - __ orr(r12, r30, 18445618178097414144ul); // orr x12, x30, #0xfffc0000fffc0000 - __ eor(r30, r5, 262128ul); // eor x30, x5, #0x3fff0 - __ ands(r26, r23, 4194300ul); // ands x26, x23, #0x3ffffc + __ andw(r28, r19, 4294709247ul); // and w28, w19, #0xfffc0fff + __ orrw(r27, r5, 536870910ul); // orr w27, w5, #0x1ffffffe + __ eorw(r30, r20, 4294840319ul); // eor w30, w20, #0xfffe0fff + __ andsw(r22, r26, 4294959615ul); // ands w22, w26, #0xffffe1ff + __ andr(r5, r7, 4194300ul); // and x5, x7, #0x3ffffc + __ orr(r13, r7, 18014398509481728ul); // orr x13, x7, #0x3fffffffffff00 + __ eor(r7, r9, 18442240474082197503ul); // eor x7, x9, #0xfff0000000003fff + __ ands(r3, r0, 18374686479671656447ul); // ands x3, x0, #0xff00000000007fff // AbsOp - __ b(__ pc()); // b . - __ b(back); // b back - __ b(forth); // b forth - __ bl(__ pc()); // bl . - __ bl(back); // bl back - __ bl(forth); // bl forth + __ b(__ pc()); // b . + __ b(back); // b back + __ b(forth); // b forth + __ bl(__ pc()); // bl . + __ bl(back); // bl back + __ bl(forth); // bl forth // RegAndAbsOp - __ cbzw(r12, __ pc()); // cbz w12, . - __ cbzw(r12, back); // cbz w12, back - __ cbzw(r12, forth); // cbz w12, forth - __ cbnzw(r20, __ pc()); // cbnz w20, . - __ cbnzw(r20, back); // cbnz w20, back - __ cbnzw(r20, forth); // cbnz w20, forth - __ cbz(r12, __ pc()); // cbz x12, . - __ cbz(r12, back); // cbz x12, back - __ cbz(r12, forth); // cbz x12, forth - __ cbnz(r24, __ pc()); // cbnz x24, . - __ cbnz(r24, back); // cbnz x24, back - __ cbnz(r24, forth); // cbnz x24, forth - __ adr(r6, __ pc()); // adr x6, . - __ adr(r6, back); // adr x6, back - __ adr(r6, forth); // adr x6, forth - __ _adrp(r21, __ pc()); // adrp x21, . + __ cbzw(r16, __ pc()); // cbz w16, . + __ cbzw(r16, back); // cbz w16, back + __ cbzw(r16, forth); // cbz w16, forth + __ cbnzw(r19, __ pc()); // cbnz w19, . + __ cbnzw(r19, back); // cbnz w19, back + __ cbnzw(r19, forth); // cbnz w19, forth + __ cbz(r5, __ pc()); // cbz x5, . + __ cbz(r5, back); // cbz x5, back + __ cbz(r5, forth); // cbz x5, forth + __ cbnz(r4, __ pc()); // cbnz x4, . + __ cbnz(r4, back); // cbnz x4, back + __ cbnz(r4, forth); // cbnz x4, forth + __ adr(r27, __ pc()); // adr x27, . + __ adr(r27, back); // adr x27, back + __ adr(r27, forth); // adr x27, forth + __ _adrp(r16, __ pc()); // adrp x16, . // RegImmAbsOp - __ tbz(r1, 1, __ pc()); // tbz x1, #1, . - __ tbz(r1, 1, back); // tbz x1, #1, back - __ tbz(r1, 1, forth); // tbz x1, #1, forth - __ tbnz(r8, 9, __ pc()); // tbnz x8, #9, . - __ tbnz(r8, 9, back); // tbnz x8, #9, back - __ tbnz(r8, 9, forth); // tbnz x8, #9, forth + __ tbz(r28, 8, __ pc()); // tbz x28, #8, . + __ tbz(r28, 8, back); // tbz x28, #8, back + __ tbz(r28, 8, forth); // tbz x28, #8, forth + __ tbnz(r1, 1, __ pc()); // tbnz x1, #1, . + __ tbnz(r1, 1, back); // tbnz x1, #1, back + __ tbnz(r1, 1, forth); // tbnz x1, #1, forth // MoveWideImmOp - __ movnw(r12, 23175, 0); // movn w12, #23175, lsl 0 - __ movzw(r11, 20476, 16); // movz w11, #20476, lsl 16 - __ movkw(r21, 3716, 0); // movk w21, #3716, lsl 0 - __ movn(r29, 28661, 48); // movn x29, #28661, lsl 48 - __ movz(r3, 6927, 0); // movz x3, #6927, lsl 0 - __ movk(r22, 9828, 16); // movk x22, #9828, lsl 16 + __ movnw(r20, 8639, 16); // movn w20, #8639, lsl 16 + __ movzw(r7, 25835, 0); // movz w7, #25835, lsl 0 + __ movkw(r17, 7261, 0); // movk w17, #7261, lsl 0 + __ movn(r14, 2097, 32); // movn x14, #2097, lsl 32 + __ movz(r9, 16082, 0); // movz x9, #16082, lsl 0 + __ movk(r19, 13962, 16); // movk x19, #13962, lsl 16 // BitfieldOp - __ sbfm(r12, r8, 6, 22); // sbfm x12, x8, #6, #22 - __ bfmw(r19, r25, 25, 19); // bfm w19, w25, #25, #19 - __ ubfmw(r9, r12, 29, 15); // ubfm w9, w12, #29, #15 - __ sbfm(r28, r25, 16, 16); // sbfm x28, x25, #16, #16 - __ bfm(r12, r5, 4, 25); // bfm x12, x5, #4, #25 - __ ubfm(r0, r10, 6, 8); // ubfm x0, x10, #6, #8 + __ sbfm(r9, r22, 6, 22); // sbfm x9, x22, #6, #22 + __ bfmw(r19, r0, 11, 0); // bfm w19, w0, #11, #0 + __ ubfmw(r10, r19, 11, 19); // ubfm w10, w19, #11, #19 + __ sbfm(r4, r15, 5, 17); // sbfm x4, x15, #5, #17 + __ bfm(r3, r5, 19, 28); // bfm x3, x5, #19, #28 + __ ubfm(r12, r28, 17, 2); // ubfm x12, x28, #17, #2 // ExtractOp - __ extrw(r4, r13, r26, 24); // extr w4, w13, w26, #24 - __ extr(r23, r30, r24, 31); // extr x23, x30, x24, #31 + __ extrw(r15, r0, r22, 3); // extr w15, w0, w22, #3 + __ extr(r6, r14, r14, 55); // extr x6, x14, x14, #55 // CondBranchOp - __ br(Assembler::EQ, __ pc()); // b.EQ . - __ br(Assembler::EQ, back); // b.EQ back - __ br(Assembler::EQ, forth); // b.EQ forth - __ br(Assembler::NE, __ pc()); // b.NE . - __ br(Assembler::NE, back); // b.NE back - __ br(Assembler::NE, forth); // b.NE forth - __ br(Assembler::HS, __ pc()); // b.HS . - __ br(Assembler::HS, back); // b.HS back - __ br(Assembler::HS, forth); // b.HS forth - __ br(Assembler::CS, __ pc()); // b.CS . - __ br(Assembler::CS, back); // b.CS back - __ br(Assembler::CS, forth); // b.CS forth - __ br(Assembler::LO, __ pc()); // b.LO . - __ br(Assembler::LO, back); // b.LO back - __ br(Assembler::LO, forth); // b.LO forth - __ br(Assembler::CC, __ pc()); // b.CC . - __ br(Assembler::CC, back); // b.CC back - __ br(Assembler::CC, forth); // b.CC forth - __ br(Assembler::MI, __ pc()); // b.MI . - __ br(Assembler::MI, back); // b.MI back - __ br(Assembler::MI, forth); // b.MI forth - __ br(Assembler::PL, __ pc()); // b.PL . - __ br(Assembler::PL, back); // b.PL back - __ br(Assembler::PL, forth); // b.PL forth - __ br(Assembler::VS, __ pc()); // b.VS . - __ br(Assembler::VS, back); // b.VS back - __ br(Assembler::VS, forth); // b.VS forth - __ br(Assembler::VC, __ pc()); // b.VC . - __ br(Assembler::VC, back); // b.VC back - __ br(Assembler::VC, forth); // b.VC forth - __ br(Assembler::HI, __ pc()); // b.HI . - __ br(Assembler::HI, back); // b.HI back - __ br(Assembler::HI, forth); // b.HI forth - __ br(Assembler::LS, __ pc()); // b.LS . - __ br(Assembler::LS, back); // b.LS back - __ br(Assembler::LS, forth); // b.LS forth - __ br(Assembler::GE, __ pc()); // b.GE . - __ br(Assembler::GE, back); // b.GE back - __ br(Assembler::GE, forth); // b.GE forth - __ br(Assembler::LT, __ pc()); // b.LT . - __ br(Assembler::LT, back); // b.LT back - __ br(Assembler::LT, forth); // b.LT forth - __ br(Assembler::GT, __ pc()); // b.GT . - __ br(Assembler::GT, back); // b.GT back - __ br(Assembler::GT, forth); // b.GT forth - __ br(Assembler::LE, __ pc()); // b.LE . - __ br(Assembler::LE, back); // b.LE back - __ br(Assembler::LE, forth); // b.LE forth - __ br(Assembler::AL, __ pc()); // b.AL . - __ br(Assembler::AL, back); // b.AL back - __ br(Assembler::AL, forth); // b.AL forth - __ br(Assembler::NV, __ pc()); // b.NV . - __ br(Assembler::NV, back); // b.NV back - __ br(Assembler::NV, forth); // b.NV forth + __ br(Assembler::EQ, __ pc()); // b.EQ . + __ br(Assembler::EQ, back); // b.EQ back + __ br(Assembler::EQ, forth); // b.EQ forth + __ br(Assembler::NE, __ pc()); // b.NE . + __ br(Assembler::NE, back); // b.NE back + __ br(Assembler::NE, forth); // b.NE forth + __ br(Assembler::HS, __ pc()); // b.HS . + __ br(Assembler::HS, back); // b.HS back + __ br(Assembler::HS, forth); // b.HS forth + __ br(Assembler::CS, __ pc()); // b.CS . + __ br(Assembler::CS, back); // b.CS back + __ br(Assembler::CS, forth); // b.CS forth + __ br(Assembler::LO, __ pc()); // b.LO . + __ br(Assembler::LO, back); // b.LO back + __ br(Assembler::LO, forth); // b.LO forth + __ br(Assembler::CC, __ pc()); // b.CC . + __ br(Assembler::CC, back); // b.CC back + __ br(Assembler::CC, forth); // b.CC forth + __ br(Assembler::MI, __ pc()); // b.MI . + __ br(Assembler::MI, back); // b.MI back + __ br(Assembler::MI, forth); // b.MI forth + __ br(Assembler::PL, __ pc()); // b.PL . + __ br(Assembler::PL, back); // b.PL back + __ br(Assembler::PL, forth); // b.PL forth + __ br(Assembler::VS, __ pc()); // b.VS . + __ br(Assembler::VS, back); // b.VS back + __ br(Assembler::VS, forth); // b.VS forth + __ br(Assembler::VC, __ pc()); // b.VC . + __ br(Assembler::VC, back); // b.VC back + __ br(Assembler::VC, forth); // b.VC forth + __ br(Assembler::HI, __ pc()); // b.HI . + __ br(Assembler::HI, back); // b.HI back + __ br(Assembler::HI, forth); // b.HI forth + __ br(Assembler::LS, __ pc()); // b.LS . + __ br(Assembler::LS, back); // b.LS back + __ br(Assembler::LS, forth); // b.LS forth + __ br(Assembler::GE, __ pc()); // b.GE . + __ br(Assembler::GE, back); // b.GE back + __ br(Assembler::GE, forth); // b.GE forth + __ br(Assembler::LT, __ pc()); // b.LT . + __ br(Assembler::LT, back); // b.LT back + __ br(Assembler::LT, forth); // b.LT forth + __ br(Assembler::GT, __ pc()); // b.GT . + __ br(Assembler::GT, back); // b.GT back + __ br(Assembler::GT, forth); // b.GT forth + __ br(Assembler::LE, __ pc()); // b.LE . + __ br(Assembler::LE, back); // b.LE back + __ br(Assembler::LE, forth); // b.LE forth + __ br(Assembler::AL, __ pc()); // b.AL . + __ br(Assembler::AL, back); // b.AL back + __ br(Assembler::AL, forth); // b.AL forth + __ br(Assembler::NV, __ pc()); // b.NV . + __ br(Assembler::NV, back); // b.NV back + __ br(Assembler::NV, forth); // b.NV forth // ImmOp - __ svc(12729); // svc #12729 - __ hvc(6788); // hvc #6788 - __ smc(1535); // smc #1535 - __ brk(16766); // brk #16766 - __ hlt(9753); // hlt #9753 + __ svc(22064); // svc #22064 + __ hvc(533); // hvc #533 + __ smc(9942); // smc #9942 + __ brk(4714); // brk #4714 + __ hlt(4302); // hlt #4302 // Op - __ nop(); // nop - __ eret(); // eret - __ drps(); // drps - __ isb(); // isb + __ nop(); // nop + __ eret(); // eret + __ drps(); // drps + __ isb(); // isb // SystemOp - __ dsb(Assembler::SY); // dsb SY - __ dmb(Assembler::ISHST); // dmb ISHST + __ dsb(Assembler::OSH); // dsb OSH + __ dmb(Assembler::NSHLD); // dmb NSHLD // OneRegOp - __ br(r2); // br x2 - __ blr(r5); // blr x5 + __ br(r20); // br x20 + __ blr(r2); // blr x2 // LoadStoreExclusiveOp - __ stxr(r20, r21, r2); // stxr w20, x21, [x2] - __ stlxr(r5, r29, r7); // stlxr w5, x29, [x7] - __ ldxr(r5, r16); // ldxr x5, [x16] - __ ldaxr(r27, r29); // ldaxr x27, [x29] - __ stlr(r0, r29); // stlr x0, [x29] - __ ldar(r21, r28); // ldar x21, [x28] + __ stxr(r18, r23, r0); // stxr w18, x23, [x0] + __ stlxr(r30, r5, r22); // stlxr w30, x5, [x22] + __ ldxr(r5, r8); // ldxr x5, [x8] + __ ldaxr(r20, r16); // ldaxr x20, [x16] + __ stlr(r6, r11); // stlr x6, [x11] + __ ldar(r6, r27); // ldar x6, [x27] // LoadStoreExclusiveOp - __ stxrw(r21, r24, r7); // stxr w21, w24, [x7] - __ stlxrw(r21, r26, r28); // stlxr w21, w26, [x28] - __ ldxrw(r21, r6); // ldxr w21, [x6] - __ ldaxrw(r15, r30); // ldaxr w15, [x30] - __ stlrw(r19, r3); // stlr w19, [x3] - __ ldarw(r22, r2); // ldar w22, [x2] + __ stxrw(r10, r17, r5); // stxr w10, w17, [x5] + __ stlxrw(r22, r9, r12); // stlxr w22, w9, [x12] + __ ldxrw(r27, r8); // ldxr w27, [x8] + __ ldaxrw(r23, r2); // ldaxr w23, [x2] + __ stlrw(r26, r29); // stlr w26, [x29] + __ ldarw(r13, r10); // ldar w13, [x10] // LoadStoreExclusiveOp - __ stxrh(r18, r15, r0); // stxrh w18, w15, [x0] - __ stlxrh(r11, r5, r28); // stlxrh w11, w5, [x28] - __ ldxrh(r29, r6); // ldxrh w29, [x6] - __ ldaxrh(r18, r7); // ldaxrh w18, [x7] - __ stlrh(r25, r28); // stlrh w25, [x28] - __ ldarh(r2, r19); // ldarh w2, [x19] + __ stxrh(r25, r28, r27); // stxrh w25, w28, [x27] + __ stlxrh(r29, r22, r12); // stlxrh w29, w22, [x12] + __ ldxrh(r22, r28); // ldxrh w22, [x28] + __ ldaxrh(r3, r30); // ldaxrh w3, [x30] + __ stlrh(r24, r15); // stlrh w24, [x15] + __ ldarh(r27, r26); // ldarh w27, [x26] // LoadStoreExclusiveOp - __ stxrb(r10, r30, r1); // stxrb w10, w30, [x1] - __ stlxrb(r20, r21, r22); // stlxrb w20, w21, [x22] - __ ldxrb(r25, r2); // ldxrb w25, [x2] - __ ldaxrb(r24, r5); // ldaxrb w24, [x5] - __ stlrb(r16, r3); // stlrb w16, [x3] - __ ldarb(r22, r29); // ldarb w22, [x29] + __ stxrb(r11, r10, r19); // stxrb w11, w10, [x19] + __ stlxrb(r23, r27, r22); // stlxrb w23, w27, [x22] + __ ldxrb(r24, r16); // ldxrb w24, [x16] + __ ldaxrb(r24, r1); // ldaxrb w24, [x1] + __ stlrb(r5, r29); // stlrb w5, [x29] + __ ldarb(r24, r16); // ldarb w24, [x16] // LoadStoreExclusiveOp - __ ldxp(r8, r2, r19); // ldxp x8, x2, [x19] - __ ldaxp(r7, r19, r14); // ldaxp x7, x19, [x14] - __ stxp(r8, r27, r28, r5); // stxp w8, x27, x28, [x5] - __ stlxp(r5, r8, r14, r6); // stlxp w5, x8, x14, [x6] + __ ldxp(r25, r24, r17); // ldxp x25, x24, [x17] + __ ldaxp(r22, r12, r19); // ldaxp x22, x12, [x19] + __ stxp(r0, r26, r21, r25); // stxp w0, x26, x21, [x25] + __ stlxp(r1, r6, r11, r5); // stlxp w1, x6, x11, [x5] // LoadStoreExclusiveOp - __ ldxpw(r25, r4, r22); // ldxp w25, w4, [x22] - __ ldaxpw(r13, r14, r15); // ldaxp w13, w14, [x15] - __ stxpw(r20, r26, r8, r10); // stxp w20, w26, w8, [x10] - __ stlxpw(r23, r18, r18, r18); // stlxp w23, w18, w18, [x18] + __ ldxpw(r13, r14, r4); // ldxp w13, w14, [x4] + __ ldaxpw(r17, r2, r6); // ldaxp w17, w2, [x6] + __ stxpw(r15, r3, r9, r18); // stxp w15, w3, w9, [x18] + __ stlxpw(r18, r17, r4, r9); // stlxp w18, w17, w4, [x9] // base_plus_unscaled_offset // LoadStoreOp - __ str(r30, Address(r11, 99)); // str x30, [x11, 99] - __ strw(r23, Address(r25, -77)); // str w23, [x25, -77] - __ strb(r2, Address(r14, 3)); // strb w2, [x14, 3] - __ strh(r9, Address(r10, 5)); // strh w9, [x10, 5] - __ ldr(r20, Address(r15, 57)); // ldr x20, [x15, 57] - __ ldrw(r12, Address(r16, -78)); // ldr w12, [x16, -78] - __ ldrb(r22, Address(r26, -3)); // ldrb w22, [x26, -3] - __ ldrh(r30, Address(r19, -47)); // ldrh w30, [x19, -47] - __ ldrsb(r9, Address(r10, -12)); // ldrsb x9, [x10, -12] - __ ldrsh(r28, Address(r17, 14)); // ldrsh x28, [x17, 14] - __ ldrshw(r3, Address(r5, 10)); // ldrsh w3, [x5, 10] - __ ldrsw(r17, Address(r17, -91)); // ldrsw x17, [x17, -91] - __ ldrd(v2, Address(r20, -17)); // ldr d2, [x20, -17] - __ ldrs(v22, Address(r7, -10)); // ldr s22, [x7, -10] - __ strd(v30, Address(r18, -223)); // str d30, [x18, -223] - __ strs(v13, Address(r22, 21)); // str s13, [x22, 21] + __ str(r23, Address(r21, -49)); // str x23, [x21, -49] + __ strw(r21, Address(r2, 63)); // str w21, [x2, 63] + __ strb(r27, Address(r28, 11)); // strb w27, [x28, 11] + __ strh(r29, Address(r15, -13)); // strh w29, [x15, -13] + __ ldr(r14, Address(r30, -45)); // ldr x14, [x30, -45] + __ ldrw(r29, Address(r28, 53)); // ldr w29, [x28, 53] + __ ldrb(r20, Address(r26, 7)); // ldrb w20, [x26, 7] + __ ldrh(r25, Address(r2, -50)); // ldrh w25, [x2, -50] + __ ldrsb(r3, Address(r10, -15)); // ldrsb x3, [x10, -15] + __ ldrsh(r14, Address(r15, 19)); // ldrsh x14, [x15, 19] + __ ldrshw(r29, Address(r11, -5)); // ldrsh w29, [x11, -5] + __ ldrsw(r15, Address(r5, -71)); // ldrsw x15, [x5, -71] + __ ldrd(v19, Address(r12, 3)); // ldr d19, [x12, 3] + __ ldrs(v12, Address(r27, 42)); // ldr s12, [x27, 42] + __ strd(v22, Address(r28, 125)); // str d22, [x28, 125] + __ strs(v24, Address(r15, -20)); // str s24, [x15, -20] // pre // LoadStoreOp - __ str(r9, Address(__ pre(r18, -112))); // str x9, [x18, -112]! - __ strw(r29, Address(__ pre(r23, 11))); // str w29, [x23, 11]! - __ strb(r18, Address(__ pre(r12, -1))); // strb w18, [x12, -1]! - __ strh(r16, Address(__ pre(r20, -23))); // strh w16, [x20, -23]! - __ ldr(r3, Address(__ pre(r29, 9))); // ldr x3, [x29, 9]! - __ ldrw(r25, Address(__ pre(r3, 19))); // ldr w25, [x3, 19]! - __ ldrb(r1, Address(__ pre(r29, -1))); // ldrb w1, [x29, -1]! - __ ldrh(r8, Address(__ pre(r29, -57))); // ldrh w8, [x29, -57]! - __ ldrsb(r5, Address(__ pre(r14, -13))); // ldrsb x5, [x14, -13]! - __ ldrsh(r10, Address(__ pre(r27, 1))); // ldrsh x10, [x27, 1]! - __ ldrshw(r11, Address(__ pre(r10, 25))); // ldrsh w11, [x10, 25]! - __ ldrsw(r4, Address(__ pre(r22, -92))); // ldrsw x4, [x22, -92]! - __ ldrd(v11, Address(__ pre(r23, 8))); // ldr d11, [x23, 8]! - __ ldrs(v25, Address(__ pre(r19, 54))); // ldr s25, [x19, 54]! - __ strd(v1, Address(__ pre(r7, -174))); // str d1, [x7, -174]! - __ strs(v8, Address(__ pre(r25, 54))); // str s8, [x25, 54]! + __ str(r8, Address(__ pre(r28, -24))); // str x8, [x28, -24]! + __ strw(r6, Address(__ pre(r15, 37))); // str w6, [x15, 37]! + __ strb(r7, Address(__ pre(r1, 7))); // strb w7, [x1, 7]! + __ strh(r0, Address(__ pre(r17, 30))); // strh w0, [x17, 30]! + __ ldr(r25, Address(__ pre(r29, 84))); // ldr x25, [x29, 84]! + __ ldrw(r26, Address(__ pre(r20, -52))); // ldr w26, [x20, -52]! + __ ldrb(r26, Address(__ pre(r29, -25))); // ldrb w26, [x29, -25]! + __ ldrh(r4, Address(__ pre(r25, 26))); // ldrh w4, [x25, 26]! + __ ldrsb(r28, Address(__ pre(r8, -21))); // ldrsb x28, [x8, -21]! + __ ldrsh(r17, Address(__ pre(r14, -6))); // ldrsh x17, [x14, -6]! + __ ldrshw(r28, Address(__ pre(r23, 10))); // ldrsh w28, [x23, 10]! + __ ldrsw(r30, Address(__ pre(r27, -64))); // ldrsw x30, [x27, -64]! + __ ldrd(v20, Address(__ pre(r30, -242))); // ldr d20, [x30, -242]! + __ ldrs(v17, Address(__ pre(r27, 20))); // ldr s17, [x27, 20]! + __ strd(v7, Address(__ pre(r3, 17))); // str d7, [x3, 17]! + __ strs(v13, Address(__ pre(r11, -16))); // str s13, [x11, -16]! // post // LoadStoreOp - __ str(r5, Address(__ post(r11, 37))); // str x5, [x11], 37 - __ strw(r24, Address(__ post(r15, 19))); // str w24, [x15], 19 - __ strb(r15, Address(__ post(r26, -1))); // strb w15, [x26], -1 - __ strh(r18, Address(__ post(r18, -6))); // strh w18, [x18], -6 - __ ldr(r7, Address(__ post(r2, -230))); // ldr x7, [x2], -230 - __ ldrw(r27, Address(__ post(r11, -27))); // ldr w27, [x11], -27 - __ ldrb(r18, Address(__ post(r3, -25))); // ldrb w18, [x3], -25 - __ ldrh(r10, Address(__ post(r24, -32))); // ldrh w10, [x24], -32 - __ ldrsb(r22, Address(__ post(r10, 4))); // ldrsb x22, [x10], 4 - __ ldrsh(r17, Address(__ post(r12, 25))); // ldrsh x17, [x12], 25 - __ ldrshw(r8, Address(__ post(r7, -62))); // ldrsh w8, [x7], -62 - __ ldrsw(r23, Address(__ post(r22, -51))); // ldrsw x23, [x22], -51 - __ ldrd(v24, Address(__ post(r25, 48))); // ldr d24, [x25], 48 - __ ldrs(v21, Address(__ post(r12, -10))); // ldr s21, [x12], -10 - __ strd(v18, Address(__ post(r13, -222))); // str d18, [x13], -222 - __ strs(v16, Address(__ post(r1, -41))); // str s16, [x1], -41 + __ str(r6, Address(__ post(r9, -61))); // str x6, [x9], -61 + __ strw(r16, Address(__ post(r5, -29))); // str w16, [x5], -29 + __ strb(r29, Address(__ post(r29, 15))); // strb w29, [x29], 15 + __ strh(r4, Address(__ post(r20, 18))); // strh w4, [x20], 18 + __ ldr(r19, Address(__ post(r18, 46))); // ldr x19, [x18], 46 + __ ldrw(r22, Address(__ post(r2, 23))); // ldr w22, [x2], 23 + __ ldrb(r7, Address(__ post(r3, -30))); // ldrb w7, [x3], -30 + __ ldrh(r11, Address(__ post(r12, -29))); // ldrh w11, [x12], -29 + __ ldrsb(r8, Address(__ post(r6, -29))); // ldrsb x8, [x6], -29 + __ ldrsh(r24, Address(__ post(r23, 4))); // ldrsh x24, [x23], 4 + __ ldrshw(r17, Address(__ post(r16, 0))); // ldrsh w17, [x16], 0 + __ ldrsw(r0, Address(__ post(r20, -8))); // ldrsw x0, [x20], -8 + __ ldrd(v20, Address(__ post(r2, -126))); // ldr d20, [x2], -126 + __ ldrs(v19, Address(__ post(r30, -104))); // ldr s19, [x30], -104 + __ strd(v4, Address(__ post(r17, 118))); // str d4, [x17], 118 + __ strs(v21, Address(__ post(r19, -112))); // str s21, [x19], -112 // base_plus_reg // LoadStoreOp - __ str(r2, Address(r22, r15, Address::sxtw(0))); // str x2, [x22, w15, sxtw #0] - __ strw(r2, Address(r16, r29, Address::lsl(0))); // str w2, [x16, x29, lsl #0] - __ strb(r20, Address(r18, r14, Address::uxtw(0))); // strb w20, [x18, w14, uxtw #0] - __ strh(r6, Address(r19, r20, Address::sxtx(1))); // strh w6, [x19, x20, sxtx #1] - __ ldr(r14, Address(r29, r14, Address::sxtw(0))); // ldr x14, [x29, w14, sxtw #0] - __ ldrw(r16, Address(r20, r12, Address::sxtw(2))); // ldr w16, [x20, w12, sxtw #2] - __ ldrb(r9, Address(r12, r0, Address::sxtw(0))); // ldrb w9, [x12, w0, sxtw #0] - __ ldrh(r12, Address(r17, r3, Address::lsl(1))); // ldrh w12, [x17, x3, lsl #1] - __ ldrsb(r2, Address(r17, r3, Address::sxtx(0))); // ldrsb x2, [x17, x3, sxtx #0] - __ ldrsh(r7, Address(r1, r17, Address::uxtw(1))); // ldrsh x7, [x1, w17, uxtw #1] - __ ldrshw(r25, Address(r15, r18, Address::sxtw(1))); // ldrsh w25, [x15, w18, sxtw #1] - __ ldrsw(r23, Address(r21, r12, Address::lsl(0))); // ldrsw x23, [x21, x12, lsl #0] - __ ldrd(v5, Address(r13, r8, Address::lsl(3))); // ldr d5, [x13, x8, lsl #3] - __ ldrs(v3, Address(r10, r22, Address::lsl(2))); // ldr s3, [x10, x22, lsl #2] - __ strd(v14, Address(r2, r27, Address::sxtw(0))); // str d14, [x2, w27, sxtw #0] - __ strs(v20, Address(r6, r25, Address::lsl(0))); // str s20, [x6, x25, lsl #0] + __ str(r26, Address(r2, r19, Address::lsl(3))); // str x26, [x2, x19, lsl #3] + __ strw(r9, Address(r0, r15, Address::sxtw(2))); // str w9, [x0, w15, sxtw #2] + __ strb(r26, Address(r12, r1, Address::lsl(0))); // strb w26, [x12, x1, lsl #0] + __ strh(r21, Address(r11, r10, Address::lsl(1))); // strh w21, [x11, x10, lsl #1] + __ ldr(r16, Address(r23, r16, Address::sxtx(0))); // ldr x16, [x23, x16, sxtx #0] + __ ldrw(r10, Address(r11, r17, Address::sxtw(2))); // ldr w10, [x11, w17, sxtw #2] + __ ldrb(r13, Address(r23, r11, Address::lsl(0))); // ldrb w13, [x23, x11, lsl #0] + __ ldrh(r27, Address(r4, r21, Address::lsl(0))); // ldrh w27, [x4, x21, lsl #0] + __ ldrsb(r26, Address(r8, r15, Address::sxtw(0))); // ldrsb x26, [x8, w15, sxtw #0] + __ ldrsh(r21, Address(r10, r2, Address::sxtw(0))); // ldrsh x21, [x10, w2, sxtw #0] + __ ldrshw(r8, Address(r30, r14, Address::lsl(0))); // ldrsh w8, [x30, x14, lsl #0] + __ ldrsw(r29, Address(r14, r20, Address::sxtx(2))); // ldrsw x29, [x14, x20, sxtx #2] + __ ldrd(v30, Address(r27, r22, Address::sxtx(0))); // ldr d30, [x27, x22, sxtx #0] + __ ldrs(v13, Address(r9, r22, Address::lsl(0))); // ldr s13, [x9, x22, lsl #0] + __ strd(v8, Address(r25, r17, Address::sxtw(3))); // str d8, [x25, w17, sxtw #3] + __ strs(v1, Address(r24, r5, Address::uxtw(2))); // str s1, [x24, w5, uxtw #2] // base_plus_scaled_offset // LoadStoreOp - __ str(r30, Address(r7, 16256)); // str x30, [x7, 16256] - __ strw(r15, Address(r8, 7588)); // str w15, [x8, 7588] - __ strb(r11, Address(r0, 1866)); // strb w11, [x0, 1866] - __ strh(r3, Address(r17, 3734)); // strh w3, [x17, 3734] - __ ldr(r2, Address(r7, 14224)); // ldr x2, [x7, 14224] - __ ldrw(r5, Address(r9, 7396)); // ldr w5, [x9, 7396] - __ ldrb(r28, Address(r9, 1721)); // ldrb w28, [x9, 1721] - __ ldrh(r2, Address(r20, 3656)); // ldrh w2, [x20, 3656] - __ ldrsb(r22, Address(r14, 1887)); // ldrsb x22, [x14, 1887] - __ ldrsh(r8, Address(r0, 4080)); // ldrsh x8, [x0, 4080] - __ ldrshw(r0, Address(r30, 3916)); // ldrsh w0, [x30, 3916] - __ ldrsw(r24, Address(r19, 6828)); // ldrsw x24, [x19, 6828] - __ ldrd(v24, Address(r12, 13032)); // ldr d24, [x12, 13032] - __ ldrs(v8, Address(r8, 7452)); // ldr s8, [x8, 7452] - __ strd(v10, Address(r15, 15992)); // str d10, [x15, 15992] - __ strs(v26, Address(r19, 6688)); // str s26, [x19, 6688] + __ str(r10, Address(r21, 14496)); // str x10, [x21, 14496] + __ strw(r18, Address(r29, 7228)); // str w18, [x29, 7228] + __ strb(r23, Address(r3, 2018)); // strb w23, [x3, 2018] + __ strh(r28, Address(r11, 3428)); // strh w28, [x11, 3428] + __ ldr(r24, Address(r26, 14376)); // ldr x24, [x26, 14376] + __ ldrw(r21, Address(r2, 6972)); // ldr w21, [x2, 6972] + __ ldrb(r4, Address(r5, 1848)); // ldrb w4, [x5, 1848] + __ ldrh(r14, Address(r14, 3112)); // ldrh w14, [x14, 3112] + __ ldrsb(r4, Address(r27, 1959)); // ldrsb x4, [x27, 1959] + __ ldrsh(r4, Address(r27, 3226)); // ldrsh x4, [x27, 3226] + __ ldrshw(r10, Address(r28, 3286)); // ldrsh w10, [x28, 3286] + __ ldrsw(r10, Address(r17, 7912)); // ldrsw x10, [x17, 7912] + __ ldrd(v13, Address(r28, 13400)); // ldr d13, [x28, 13400] + __ ldrs(v24, Address(r3, 7596)); // ldr s24, [x3, 7596] + __ strd(v2, Address(r12, 15360)); // str d2, [x12, 15360] + __ strs(v17, Address(r1, 6492)); // str s17, [x1, 6492] // pcrel // LoadStoreOp - __ ldr(r10, forth); // ldr x10, forth - __ ldrw(r3, __ pc()); // ldr w3, . + __ ldr(r16, __ pc()); // ldr x16, . + __ ldrw(r13, __ pc()); // ldr w13, . // LoadStoreOp - __ prfm(Address(r23, 9)); // prfm PLDL1KEEP, [x23, 9] + __ prfm(Address(r18, -127)); // prfm PLDL1KEEP, [x18, -127] // LoadStoreOp - __ prfm(back); // prfm PLDL1KEEP, back + __ prfm(back); // prfm PLDL1KEEP, back // LoadStoreOp - __ prfm(Address(r3, r8, Address::uxtw(0))); // prfm PLDL1KEEP, [x3, w8, uxtw #0] + __ prfm(Address(r20, r2, Address::lsl(3))); // prfm PLDL1KEEP, [x20, x2, lsl #3] // LoadStoreOp - __ prfm(Address(r11, 15080)); // prfm PLDL1KEEP, [x11, 15080] + __ prfm(Address(r9, 13808)); // prfm PLDL1KEEP, [x9, 13808] // AddSubCarryOp - __ adcw(r13, r9, r28); // adc w13, w9, w28 - __ adcsw(r27, r19, r28); // adcs w27, w19, w28 - __ sbcw(r19, r18, r6); // sbc w19, w18, w6 - __ sbcsw(r14, r20, r3); // sbcs w14, w20, w3 - __ adc(r16, r14, r8); // adc x16, x14, x8 - __ adcs(r0, r29, r8); // adcs x0, x29, x8 - __ sbc(r8, r24, r20); // sbc x8, x24, x20 - __ sbcs(r12, r28, r0); // sbcs x12, x28, x0 + __ adcw(r8, r23, r2); // adc w8, w23, w2 + __ adcsw(r24, r3, r19); // adcs w24, w3, w19 + __ sbcw(r22, r24, r29); // sbc w22, w24, w29 + __ sbcsw(r12, r27, r3); // sbcs w12, w27, w3 + __ adc(r11, r23, r1); // adc x11, x23, x1 + __ adcs(r29, r5, r23); // adcs x29, x5, x23 + __ sbc(r9, r25, r12); // sbc x9, x25, x12 + __ sbcs(r12, r0, r22); // sbcs x12, x0, x22 // AddSubExtendedOp - __ addw(r23, r6, r16, ext::uxtb, 4); // add w23, w6, w16, uxtb #4 - __ addsw(r25, r25, r23, ext::sxth, 2); // adds w25, w25, w23, sxth #2 - __ sub(r26, r22, r4, ext::uxtx, 1); // sub x26, x22, x4, uxtx #1 - __ subsw(r17, r29, r19, ext::sxtx, 3); // subs w17, w29, w19, sxtx #3 - __ add(r11, r30, r21, ext::uxtb, 3); // add x11, x30, x21, uxtb #3 - __ adds(r16, r19, r0, ext::sxtb, 2); // adds x16, x19, x0, sxtb #2 - __ sub(r11, r9, r25, ext::sxtx, 1); // sub x11, x9, x25, sxtx #1 - __ subs(r17, r20, r12, ext::sxtb, 4); // subs x17, x20, x12, sxtb #4 + __ addw(r26, r12, r3, ext::uxtw, 1); // add w26, w12, w3, uxtw #1 + __ addsw(r20, r16, r18, ext::sxtb, 2); // adds w20, w16, w18, sxtb #2 + __ sub(r30, r30, r7, ext::uxtw, 2); // sub x30, x30, x7, uxtw #2 + __ subsw(r11, r21, r2, ext::uxth, 3); // subs w11, w21, w2, uxth #3 + __ add(r2, r26, r1, ext::uxtw, 2); // add x2, x26, x1, uxtw #2 + __ adds(r18, r29, r20, ext::sxth, 1); // adds x18, x29, x20, sxth #1 + __ sub(r14, r16, r4, ext::uxtw, 4); // sub x14, x16, x4, uxtw #4 + __ subs(r0, r17, r23, ext::sxtb, 3); // subs x0, x17, x23, sxtb #3 // ConditionalCompareOp - __ ccmnw(r13, r11, 3u, Assembler::LE); // ccmn w13, w11, #3, LE - __ ccmpw(r13, r12, 2u, Assembler::HI); // ccmp w13, w12, #2, HI - __ ccmn(r3, r2, 12u, Assembler::NE); // ccmn x3, x2, #12, NE - __ ccmp(r7, r21, 3u, Assembler::VS); // ccmp x7, x21, #3, VS + __ ccmnw(r20, r22, 3u, Assembler::PL); // ccmn w20, w22, #3, PL + __ ccmpw(r25, r2, 1u, Assembler::EQ); // ccmp w25, w2, #1, EQ + __ ccmn(r18, r24, 7u, Assembler::GT); // ccmn x18, x24, #7, GT + __ ccmp(r8, r13, 6u, Assembler::PL); // ccmp x8, x13, #6, PL // ConditionalCompareImmedOp - __ ccmnw(r2, 14, 4, Assembler::CC); // ccmn w2, #14, #4, CC - __ ccmpw(r17, 17, 6, Assembler::PL); // ccmp w17, #17, #6, PL - __ ccmn(r10, 12, 0, Assembler::CS); // ccmn x10, #12, #0, CS - __ ccmp(r21, 18, 14, Assembler::GE); // ccmp x21, #18, #14, GE + __ ccmnw(r9, 2, 4, Assembler::VS); // ccmn w9, #2, #4, VS + __ ccmpw(r2, 27, 7, Assembler::EQ); // ccmp w2, #27, #7, EQ + __ ccmn(r16, 1, 2, Assembler::CC); // ccmn x16, #1, #2, CC + __ ccmp(r17, 31, 3, Assembler::LT); // ccmp x17, #31, #3, LT // ConditionalSelectOp - __ cselw(r21, r13, r12, Assembler::GT); // csel w21, w13, w12, GT - __ csincw(r10, r27, r15, Assembler::LS); // csinc w10, w27, w15, LS - __ csinvw(r0, r13, r9, Assembler::HI); // csinv w0, w13, w9, HI - __ csnegw(r18, r4, r26, Assembler::VS); // csneg w18, w4, w26, VS - __ csel(r12, r29, r7, Assembler::LS); // csel x12, x29, x7, LS - __ csinc(r6, r7, r20, Assembler::VC); // csinc x6, x7, x20, VC - __ csinv(r22, r21, r3, Assembler::LE); // csinv x22, x21, x3, LE - __ csneg(r19, r12, r27, Assembler::LS); // csneg x19, x12, x27, LS + __ cselw(r23, r27, r23, Assembler::LS); // csel w23, w27, w23, LS + __ csincw(r10, r0, r6, Assembler::VS); // csinc w10, w0, w6, VS + __ csinvw(r11, r0, r9, Assembler::CC); // csinv w11, w0, w9, CC + __ csnegw(r17, r27, r18, Assembler::LO); // csneg w17, w27, w18, LO + __ csel(r12, r16, r11, Assembler::VC); // csel x12, x16, x11, VC + __ csinc(r6, r28, r6, Assembler::HI); // csinc x6, x28, x6, HI + __ csinv(r13, r27, r26, Assembler::VC); // csinv x13, x27, x26, VC + __ csneg(r29, r22, r18, Assembler::PL); // csneg x29, x22, x18, PL // TwoRegOp - __ rbitw(r0, r16); // rbit w0, w16 - __ rev16w(r17, r23); // rev16 w17, w23 - __ revw(r17, r14); // rev w17, w14 - __ clzw(r24, r30); // clz w24, w30 - __ clsw(r24, r22); // cls w24, w22 - __ rbit(r3, r17); // rbit x3, x17 - __ rev16(r12, r13); // rev16 x12, x13 - __ rev32(r9, r22); // rev32 x9, x22 - __ rev(r0, r0); // rev x0, x0 - __ clz(r5, r16); // clz x5, x16 - __ cls(r25, r22); // cls x25, x22 + __ rbitw(r12, r19); // rbit w12, w19 + __ rev16w(r23, r18); // rev16 w23, w18 + __ revw(r9, r28); // rev w9, w28 + __ clzw(r2, r19); // clz w2, w19 + __ clsw(r25, r29); // cls w25, w29 + __ rbit(r4, r23); // rbit x4, x23 + __ rev16(r29, r18); // rev16 x29, x18 + __ rev32(r7, r8); // rev32 x7, x8 + __ rev(r13, r17); // rev x13, x17 + __ clz(r17, r0); // clz x17, x0 + __ cls(r18, r26); // cls x18, x26 // ThreeRegOp - __ udivw(r29, r4, r0); // udiv w29, w4, w0 - __ sdivw(r0, r29, r29); // sdiv w0, w29, w29 - __ lslvw(r5, r17, r21); // lslv w5, w17, w21 - __ lsrvw(r9, r9, r18); // lsrv w9, w9, w18 - __ asrvw(r1, r27, r8); // asrv w1, w27, w8 - __ rorvw(r18, r20, r13); // rorv w18, w20, w13 - __ udiv(r8, r25, r12); // udiv x8, x25, x12 - __ sdiv(r7, r5, r28); // sdiv x7, x5, x28 - __ lslv(r5, r17, r27); // lslv x5, x17, x27 - __ lsrv(r23, r26, r20); // lsrv x23, x26, x20 - __ asrv(r28, r8, r28); // asrv x28, x8, x28 - __ rorv(r3, r29, r4); // rorv x3, x29, x4 + __ udivw(r11, r12, r16); // udiv w11, w12, w16 + __ sdivw(r4, r9, r7); // sdiv w4, w9, w7 + __ lslvw(r12, r7, r16); // lslv w12, w7, w16 + __ lsrvw(r19, r16, r23); // lsrv w19, w16, w23 + __ asrvw(r7, r4, r6); // asrv w7, w4, w6 + __ rorvw(r21, r20, r23); // rorv w21, w20, w23 + __ udiv(r16, r12, r28); // udiv x16, x12, x28 + __ sdiv(r4, r12, r13); // sdiv x4, x12, x13 + __ lslv(r9, r13, r7); // lslv x9, x13, x7 + __ lsrv(r28, r27, r15); // lsrv x28, x27, x15 + __ asrv(r20, r30, r14); // asrv x20, x30, x14 + __ rorv(r14, r18, r30); // rorv x14, x18, x30 + __ umulh(r3, r11, r7); // umulh x3, x11, x7 + __ smulh(r23, r20, r24); // smulh x23, x20, x24 // FourRegMulOp - __ maddw(r17, r14, r26, r21); // madd w17, w14, w26, w21 - __ msubw(r1, r30, r11, r11); // msub w1, w30, w11, w11 - __ madd(r1, r17, r6, r28); // madd x1, x17, x6, x28 - __ msub(r30, r6, r30, r8); // msub x30, x6, x30, x8 - __ smaddl(r21, r6, r14, r8); // smaddl x21, w6, w14, x8 - __ smsubl(r10, r10, r24, r19); // smsubl x10, w10, w24, x19 - __ umaddl(r20, r18, r14, r24); // umaddl x20, w18, w14, x24 - __ umsubl(r18, r2, r5, r5); // umsubl x18, w2, w5, x5 + __ maddw(r2, r5, r21, r9); // madd w2, w5, w21, w9 + __ msubw(r24, r24, r4, r8); // msub w24, w24, w4, w8 + __ madd(r11, r12, r15, r19); // madd x11, x12, x15, x19 + __ msub(r29, r25, r12, r25); // msub x29, x25, x12, x25 + __ smaddl(r17, r11, r12, r22); // smaddl x17, w11, w12, x22 + __ smsubl(r28, r3, r20, r18); // smsubl x28, w3, w20, x18 + __ umaddl(r7, r4, r28, r26); // umaddl x7, w4, w28, x26 + __ umsubl(r22, r10, r17, r5); // umsubl x22, w10, w17, x5 // ThreeRegFloatOp - __ fmuls(v8, v18, v13); // fmul s8, s18, s13 - __ fdivs(v2, v14, v28); // fdiv s2, s14, s28 - __ fadds(v15, v12, v28); // fadd s15, s12, s28 - __ fsubs(v0, v12, v1); // fsub s0, s12, s1 - __ fmuls(v15, v29, v4); // fmul s15, s29, s4 - __ fmuld(v12, v1, v23); // fmul d12, d1, d23 - __ fdivd(v27, v8, v18); // fdiv d27, d8, d18 - __ faddd(v23, v20, v11); // fadd d23, d20, d11 - __ fsubd(v8, v12, v18); // fsub d8, d12, d18 - __ fmuld(v26, v24, v23); // fmul d26, d24, d23 + __ fmuls(v17, v3, v17); // fmul s17, s3, s17 + __ fdivs(v11, v17, v6); // fdiv s11, s17, s6 + __ fadds(v29, v7, v9); // fadd s29, s7, s9 + __ fsubs(v7, v12, v19); // fsub s7, s12, s19 + __ fmuls(v0, v23, v3); // fmul s0, s23, s3 + __ fmuld(v26, v3, v21); // fmul d26, d3, d21 + __ fdivd(v0, v19, v5); // fdiv d0, d19, d5 + __ faddd(v0, v26, v9); // fadd d0, d26, d9 + __ fsubd(v25, v21, v21); // fsub d25, d21, d21 + __ fmuld(v16, v13, v19); // fmul d16, d13, d19 // FourRegFloatOp - __ fmadds(v21, v23, v13, v25); // fmadd s21, s23, s13, s25 - __ fmsubs(v22, v10, v1, v14); // fmsub s22, s10, s1, s14 - __ fnmadds(v14, v20, v2, v30); // fnmadd s14, s20, s2, s30 - __ fnmadds(v7, v29, v22, v22); // fnmadd s7, s29, s22, s22 - __ fmaddd(v13, v5, v15, v5); // fmadd d13, d5, d15, d5 - __ fmsubd(v14, v12, v5, v10); // fmsub d14, d12, d5, d10 - __ fnmaddd(v10, v19, v0, v1); // fnmadd d10, d19, d0, d1 - __ fnmaddd(v20, v2, v2, v0); // fnmadd d20, d2, d2, d0 + __ fmadds(v29, v18, v0, v16); // fmadd s29, s18, s0, s16 + __ fmsubs(v23, v13, v29, v5); // fmsub s23, s13, s29, s5 + __ fnmadds(v9, v7, v10, v14); // fnmadd s9, s7, s10, s14 + __ fnmadds(v25, v28, v15, v23); // fnmadd s25, s28, s15, s23 + __ fmaddd(v6, v13, v21, v17); // fmadd d6, d13, d21, d17 + __ fmsubd(v3, v21, v2, v7); // fmsub d3, d21, d2, d7 + __ fnmaddd(v10, v25, v5, v17); // fnmadd d10, d25, d5, d17 + __ fnmaddd(v14, v14, v20, v18); // fnmadd d14, d14, d20, d18 // TwoRegFloatOp - __ fmovs(v25, v9); // fmov s25, s9 - __ fabss(v20, v4); // fabs s20, s4 - __ fnegs(v3, v27); // fneg s3, s27 - __ fsqrts(v1, v2); // fsqrt s1, s2 - __ fcvts(v30, v0); // fcvt d30, s0 - __ fmovd(v12, v4); // fmov d12, d4 - __ fabsd(v1, v27); // fabs d1, d27 - __ fnegd(v8, v22); // fneg d8, d22 - __ fsqrtd(v11, v11); // fsqrt d11, d11 - __ fcvtd(v22, v28); // fcvt s22, d28 + __ fmovs(v15, v2); // fmov s15, s2 + __ fabss(v18, v7); // fabs s18, s7 + __ fnegs(v3, v6); // fneg s3, s6 + __ fsqrts(v12, v1); // fsqrt s12, s1 + __ fcvts(v9, v0); // fcvt d9, s0 + __ fmovd(v4, v5); // fmov d4, d5 + __ fabsd(v3, v15); // fabs d3, d15 + __ fnegd(v17, v25); // fneg d17, d25 + __ fsqrtd(v12, v24); // fsqrt d12, d24 + __ fcvtd(v21, v5); // fcvt s21, d5 // FloatConvertOp - __ fcvtzsw(r28, v22); // fcvtzs w28, s22 - __ fcvtzs(r20, v27); // fcvtzs x20, s27 - __ fcvtzdw(r14, v0); // fcvtzs w14, d0 - __ fcvtzd(r26, v11); // fcvtzs x26, d11 - __ scvtfws(v28, r22); // scvtf s28, w22 - __ scvtfs(v16, r10); // scvtf s16, x10 - __ scvtfwd(v8, r21); // scvtf d8, w21 - __ scvtfd(v21, r28); // scvtf d21, x28 - __ fmovs(r24, v24); // fmov w24, s24 - __ fmovd(r8, v19); // fmov x8, d19 - __ fmovs(v8, r12); // fmov s8, w12 - __ fmovd(v6, r7); // fmov d6, x7 + __ fcvtzsw(r4, v21); // fcvtzs w4, s21 + __ fcvtzs(r27, v3); // fcvtzs x27, s3 + __ fcvtzdw(r29, v8); // fcvtzs w29, d8 + __ fcvtzd(r9, v21); // fcvtzs x9, d21 + __ scvtfws(v20, r29); // scvtf s20, w29 + __ scvtfs(v7, r8); // scvtf s7, x8 + __ scvtfwd(v12, r21); // scvtf d12, w21 + __ scvtfd(v16, r21); // scvtf d16, x21 + __ fmovs(r18, v5); // fmov w18, s5 + __ fmovd(r25, v8); // fmov x25, d8 + __ fmovs(v18, r26); // fmov s18, w26 + __ fmovd(v0, r11); // fmov d0, x11 // TwoRegFloatOp - __ fcmps(v30, v16); // fcmp s30, s16 - __ fcmpd(v25, v11); // fcmp d25, d11 - __ fcmps(v11, 0.0); // fcmp s11, #0.0 - __ fcmpd(v11, 0.0); // fcmp d11, #0.0 + __ fcmps(v16, v6); // fcmp s16, s6 + __ fcmpd(v16, v29); // fcmp d16, d29 + __ fcmps(v30, 0.0); // fcmp s30, #0.0 + __ fcmpd(v9, 0.0); // fcmp d9, #0.0 // LoadStorePairOp - __ stpw(r29, r12, Address(r17, 128)); // stp w29, w12, [x17, #128] - __ ldpw(r22, r18, Address(r14, -96)); // ldp w22, w18, [x14, #-96] - __ ldpsw(r11, r16, Address(r1, 64)); // ldpsw x11, x16, [x1, #64] - __ stp(r0, r11, Address(r26, 112)); // stp x0, x11, [x26, #112] - __ ldp(r7, r1, Address(r26, 16)); // ldp x7, x1, [x26, #16] + __ stpw(r27, r4, Address(r12, -16)); // stp w27, w4, [x12, #-16] + __ ldpw(r3, r9, Address(r10, 80)); // ldp w3, w9, [x10, #80] + __ ldpsw(r16, r3, Address(r3, 64)); // ldpsw x16, x3, [x3, #64] + __ stp(r10, r28, Address(r19, -192)); // stp x10, x28, [x19, #-192] + __ ldp(r19, r18, Address(r7, -192)); // ldp x19, x18, [x7, #-192] // LoadStorePairOp - __ stpw(r10, r7, Address(__ pre(r24, 0))); // stp w10, w7, [x24, #0]! - __ ldpw(r7, r28, Address(__ pre(r24, -256))); // ldp w7, w28, [x24, #-256]! - __ ldpsw(r25, r28, Address(__ pre(r21, -240))); // ldpsw x25, x28, [x21, #-240]! - __ stp(r20, r18, Address(__ pre(r14, -16))); // stp x20, x18, [x14, #-16]! - __ ldp(r8, r10, Address(__ pre(r13, 80))); // ldp x8, x10, [x13, #80]! + __ stpw(r10, r16, Address(__ pre(r30, 16))); // stp w10, w16, [x30, #16]! + __ ldpw(r2, r4, Address(__ pre(r18, -240))); // ldp w2, w4, [x18, #-240]! + __ ldpsw(r24, r19, Address(__ pre(r13, 48))); // ldpsw x24, x19, [x13, #48]! + __ stp(r17, r0, Address(__ pre(r24, 0))); // stp x17, x0, [x24, #0]! + __ ldp(r14, r26, Address(__ pre(r3, -192))); // ldp x14, x26, [x3, #-192]! // LoadStorePairOp - __ stpw(r26, r24, Address(__ post(r2, -128))); // stp w26, w24, [x2], #-128 - __ ldpw(r2, r25, Address(__ post(r21, -192))); // ldp w2, w25, [x21], #-192 - __ ldpsw(r17, r2, Address(__ post(r21, -144))); // ldpsw x17, x2, [x21], #-144 - __ stp(r12, r10, Address(__ post(r11, 96))); // stp x12, x10, [x11], #96 - __ ldp(r24, r6, Address(__ post(r17, -32))); // ldp x24, x6, [x17], #-32 + __ stpw(r22, r1, Address(__ post(r0, 80))); // stp w22, w1, [x0], #80 + __ ldpw(r18, r10, Address(__ post(r0, -16))); // ldp w18, w10, [x0], #-16 + __ ldpsw(r24, r24, Address(__ post(r22, -16))); // ldpsw x24, x24, [x22], #-16 + __ stp(r12, r12, Address(__ post(r4, 80))); // stp x12, x12, [x4], #80 + __ ldp(r4, r9, Address(__ post(r19, -240))); // ldp x4, x9, [x19], #-240 // LoadStorePairOp - __ stnpw(r3, r30, Address(r14, -224)); // stnp w3, w30, [x14, #-224] - __ ldnpw(r15, r20, Address(r26, -144)); // ldnp w15, w20, [x26, #-144] - __ stnp(r22, r25, Address(r12, -128)); // stnp x22, x25, [x12, #-128] - __ ldnp(r27, r22, Address(r17, -176)); // ldnp x27, x22, [x17, #-176] + __ stnpw(r18, r26, Address(r6, -224)); // stnp w18, w26, [x6, #-224] + __ ldnpw(r21, r20, Address(r1, 112)); // ldnp w21, w20, [x1, #112] + __ stnp(r25, r29, Address(r20, -224)); // stnp x25, x29, [x20, #-224] + __ ldnp(r1, r5, Address(r23, 112)); // ldnp x1, x5, [x23, #112] + +// LdStSIMDOp + __ ld1(v4, __ T8B, Address(r20)); // ld1 {v4.8B}, [x20] + __ ld1(v24, v25, __ T16B, Address(__ post(r10, 32))); // ld1 {v24.16B, v25.16B}, [x10], 32 + __ ld1(v24, v25, v26, __ T1D, Address(__ post(r6, r15))); // ld1 {v24.1D, v25.1D, v26.1D}, [x6], x15 + __ ld1(v3, v4, v5, v6, __ T8H, Address(__ post(r4, 64))); // ld1 {v3.8H, v4.8H, v5.8H, v6.8H}, [x4], 64 + __ ld1r(v2, __ T8B, Address(r6)); // ld1r {v2.8B}, [x6] + __ ld1r(v13, __ T4S, Address(__ post(r14, 4))); // ld1r {v13.4S}, [x14], 4 + __ ld1r(v15, __ T1D, Address(__ post(r21, r24))); // ld1r {v15.1D}, [x21], x24 + __ ld2(v9, v10, __ T2D, Address(r21)); // ld2 {v9.2D, v10.2D}, [x21] + __ ld2(v29, v30, __ T4H, Address(__ post(r21, 16))); // ld2 {v29.4H, v30.4H}, [x21], 16 + __ ld2r(v8, v9, __ T16B, Address(r14)); // ld2r {v8.16B, v9.16B}, [x14] + __ ld2r(v7, v8, __ T2S, Address(__ post(r20, 8))); // ld2r {v7.2S, v8.2S}, [x20], 8 + __ ld2r(v28, v29, __ T2D, Address(__ post(r3, r3))); // ld2r {v28.2D, v29.2D}, [x3], x3 + __ ld3(v27, v28, v29, __ T4S, Address(__ post(r11, r29))); // ld3 {v27.4S, v28.4S, v29.4S}, [x11], x29 + __ ld3(v16, v17, v18, __ T2S, Address(r10)); // ld3 {v16.2S, v17.2S, v18.2S}, [x10] + __ ld3r(v21, v22, v23, __ T8H, Address(r12)); // ld3r {v21.8H, v22.8H, v23.8H}, [x12] + __ ld3r(v4, v5, v6, __ T4S, Address(__ post(r29, 12))); // ld3r {v4.4S, v5.4S, v6.4S}, [x29], 12 + __ ld3r(v24, v25, v26, __ T1D, Address(__ post(r9, r19))); // ld3r {v24.1D, v25.1D, v26.1D}, [x9], x19 + __ ld4(v10, v11, v12, v13, __ T8H, Address(__ post(r3, 64))); // ld4 {v10.8H, v11.8H, v12.8H, v13.8H}, [x3], 64 + __ ld4(v27, v28, v29, v30, __ T8B, Address(__ post(r28, r9))); // ld4 {v27.8B, v28.8B, v29.8B, v30.8B}, [x28], x9 + __ ld4r(v21, v22, v23, v24, __ T8B, Address(r30)); // ld4r {v21.8B, v22.8B, v23.8B, v24.8B}, [x30] + __ ld4r(v23, v24, v25, v26, __ T4H, Address(__ post(r14, 8))); // ld4r {v23.4H, v24.4H, v25.4H, v26.4H}, [x14], 8 + __ ld4r(v4, v5, v6, v7, __ T2S, Address(__ post(r13, r20))); // ld4r {v4.2S, v5.2S, v6.2S, v7.2S}, [x13], x20 + +// SpecialCases + __ ccmn(zr, zr, 3u, Assembler::LE); // ccmn xzr, xzr, #3, LE + __ ccmnw(zr, zr, 5u, Assembler::EQ); // ccmn wzr, wzr, #5, EQ + __ ccmp(zr, 1, 4u, Assembler::NE); // ccmp xzr, 1, #4, NE + __ ccmpw(zr, 2, 2, Assembler::GT); // ccmp wzr, 2, #2, GT + __ extr(zr, zr, zr, 0); // extr xzr, xzr, xzr, 0 + __ stlxp(r0, zr, zr, sp); // stlxp w0, xzr, xzr, [sp] + __ stlxpw(r2, zr, zr, r3); // stlxp w2, wzr, wzr, [x3] + __ stxp(r4, zr, zr, r5); // stxp w4, xzr, xzr, [x5] + __ stxpw(r6, zr, zr, sp); // stxp w6, wzr, wzr, [sp] + __ dup(v0, __ T16B, zr); // dup v0.16b, wzr + __ mov(v1, __ T1D, 0, zr); // mov v1.d[0], xzr + __ mov(v1, __ T2S, 1, zr); // mov v1.s[1], wzr + __ mov(v1, __ T4H, 2, zr); // mov v1.h[2], wzr + __ mov(v1, __ T8B, 3, zr); // mov v1.b[3], wzr + __ ld1(v31, v0, __ T2D, Address(__ post(r1, r0))); // ld1 {v31.2d, v0.2d}, [x1], x0 // FloatImmediateOp - __ fmovd(v0, 2.0); // fmov d0, #2.0 - __ fmovd(v0, 2.125); // fmov d0, #2.125 - __ fmovd(v0, 4.0); // fmov d0, #4.0 - __ fmovd(v0, 4.25); // fmov d0, #4.25 - __ fmovd(v0, 8.0); // fmov d0, #8.0 - __ fmovd(v0, 8.5); // fmov d0, #8.5 - __ fmovd(v0, 16.0); // fmov d0, #16.0 - __ fmovd(v0, 17.0); // fmov d0, #17.0 - __ fmovd(v0, 0.125); // fmov d0, #0.125 - __ fmovd(v0, 0.1328125); // fmov d0, #0.1328125 - __ fmovd(v0, 0.25); // fmov d0, #0.25 - __ fmovd(v0, 0.265625); // fmov d0, #0.265625 - __ fmovd(v0, 0.5); // fmov d0, #0.5 - __ fmovd(v0, 0.53125); // fmov d0, #0.53125 - __ fmovd(v0, 1.0); // fmov d0, #1.0 - __ fmovd(v0, 1.0625); // fmov d0, #1.0625 - __ fmovd(v0, -2.0); // fmov d0, #-2.0 - __ fmovd(v0, -2.125); // fmov d0, #-2.125 - __ fmovd(v0, -4.0); // fmov d0, #-4.0 - __ fmovd(v0, -4.25); // fmov d0, #-4.25 - __ fmovd(v0, -8.0); // fmov d0, #-8.0 - __ fmovd(v0, -8.5); // fmov d0, #-8.5 - __ fmovd(v0, -16.0); // fmov d0, #-16.0 - __ fmovd(v0, -17.0); // fmov d0, #-17.0 - __ fmovd(v0, -0.125); // fmov d0, #-0.125 - __ fmovd(v0, -0.1328125); // fmov d0, #-0.1328125 - __ fmovd(v0, -0.25); // fmov d0, #-0.25 - __ fmovd(v0, -0.265625); // fmov d0, #-0.265625 - __ fmovd(v0, -0.5); // fmov d0, #-0.5 - __ fmovd(v0, -0.53125); // fmov d0, #-0.53125 - __ fmovd(v0, -1.0); // fmov d0, #-1.0 - __ fmovd(v0, -1.0625); // fmov d0, #-1.0625 + __ fmovd(v0, 2.0); // fmov d0, #2.0 + __ fmovd(v0, 2.125); // fmov d0, #2.125 + __ fmovd(v0, 4.0); // fmov d0, #4.0 + __ fmovd(v0, 4.25); // fmov d0, #4.25 + __ fmovd(v0, 8.0); // fmov d0, #8.0 + __ fmovd(v0, 8.5); // fmov d0, #8.5 + __ fmovd(v0, 16.0); // fmov d0, #16.0 + __ fmovd(v0, 17.0); // fmov d0, #17.0 + __ fmovd(v0, 0.125); // fmov d0, #0.125 + __ fmovd(v0, 0.1328125); // fmov d0, #0.1328125 + __ fmovd(v0, 0.25); // fmov d0, #0.25 + __ fmovd(v0, 0.265625); // fmov d0, #0.265625 + __ fmovd(v0, 0.5); // fmov d0, #0.5 + __ fmovd(v0, 0.53125); // fmov d0, #0.53125 + __ fmovd(v0, 1.0); // fmov d0, #1.0 + __ fmovd(v0, 1.0625); // fmov d0, #1.0625 + __ fmovd(v0, -2.0); // fmov d0, #-2.0 + __ fmovd(v0, -2.125); // fmov d0, #-2.125 + __ fmovd(v0, -4.0); // fmov d0, #-4.0 + __ fmovd(v0, -4.25); // fmov d0, #-4.25 + __ fmovd(v0, -8.0); // fmov d0, #-8.0 + __ fmovd(v0, -8.5); // fmov d0, #-8.5 + __ fmovd(v0, -16.0); // fmov d0, #-16.0 + __ fmovd(v0, -17.0); // fmov d0, #-17.0 + __ fmovd(v0, -0.125); // fmov d0, #-0.125 + __ fmovd(v0, -0.1328125); // fmov d0, #-0.1328125 + __ fmovd(v0, -0.25); // fmov d0, #-0.25 + __ fmovd(v0, -0.265625); // fmov d0, #-0.265625 + __ fmovd(v0, -0.5); // fmov d0, #-0.5 + __ fmovd(v0, -0.53125); // fmov d0, #-0.53125 + __ fmovd(v0, -1.0); // fmov d0, #-1.0 + __ fmovd(v0, -1.0625); // fmov d0, #-1.0625 + +// LSEOp + __ swp(Assembler::xword, r21, r5, r24); // swp x21, x5, [x24] + __ ldadd(Assembler::xword, r13, r13, r15); // ldadd x13, x13, [x15] + __ ldbic(Assembler::xword, r22, r19, r26); // ldclr x22, x19, [x26] + __ ldeor(Assembler::xword, r25, r10, r26); // ldeor x25, x10, [x26] + __ ldorr(Assembler::xword, r5, r27, r15); // ldset x5, x27, [x15] + __ ldsmin(Assembler::xword, r19, r5, r11); // ldsmin x19, x5, [x11] + __ ldsmax(Assembler::xword, r26, r0, r4); // ldsmax x26, x0, [x4] + __ ldumin(Assembler::xword, r22, r23, r30); // ldumin x22, x23, [x30] + __ ldumax(Assembler::xword, r18, r28, r8); // ldumax x18, x28, [x8] + +// LSEOp + __ swpa(Assembler::xword, r13, r29, r27); // swpa x13, x29, [x27] + __ ldadda(Assembler::xword, r11, r5, r13); // ldadda x11, x5, [x13] + __ ldbica(Assembler::xword, r1, r24, r21); // ldclra x1, x24, [x21] + __ ldeora(Assembler::xword, r27, r17, r24); // ldeora x27, x17, [x24] + __ ldorra(Assembler::xword, r18, r30, r5); // ldseta x18, x30, [x5] + __ ldsmina(Assembler::xword, r7, r22, r25); // ldsmina x7, x22, [x25] + __ ldsmaxa(Assembler::xword, r4, r26, r19); // ldsmaxa x4, x26, [x19] + __ ldumina(Assembler::xword, r6, r30, r3); // ldumina x6, x30, [x3] + __ ldumaxa(Assembler::xword, r24, r23, r5); // ldumaxa x24, x23, [x5] + +// LSEOp + __ swpal(Assembler::xword, r24, r18, r28); // swpal x24, x18, [x28] + __ ldaddal(Assembler::xword, r19, zr, r7); // ldaddal x19, xzr, [x7] + __ ldbical(Assembler::xword, r13, r6, r28); // ldclral x13, x6, [x28] + __ ldeoral(Assembler::xword, r8, r15, r21); // ldeoral x8, x15, [x21] + __ ldorral(Assembler::xword, r2, r13, r1); // ldsetal x2, x13, [x1] + __ ldsminal(Assembler::xword, r17, r29, r25); // ldsminal x17, x29, [x25] + __ ldsmaxal(Assembler::xword, r25, r18, r14); // ldsmaxal x25, x18, [x14] + __ lduminal(Assembler::xword, zr, r6, r27); // lduminal xzr, x6, [x27] + __ ldumaxal(Assembler::xword, r16, r5, r15); // ldumaxal x16, x5, [x15] + +// LSEOp + __ swpl(Assembler::xword, r11, r18, r3); // swpl x11, x18, [x3] + __ ldaddl(Assembler::xword, r26, r20, r2); // ldaddl x26, x20, [x2] + __ ldbicl(Assembler::xword, r11, r4, r11); // ldclrl x11, x4, [x11] + __ ldeorl(Assembler::xword, r30, r19, r23); // ldeorl x30, x19, [x23] + __ ldorrl(Assembler::xword, r3, r15, r14); // ldsetl x3, x15, [x14] + __ ldsminl(Assembler::xword, r30, r22, r20); // ldsminl x30, x22, [x20] + __ ldsmaxl(Assembler::xword, r7, r5, r24); // ldsmaxl x7, x5, [x24] + __ lduminl(Assembler::xword, r23, r16, r15); // lduminl x23, x16, [x15] + __ ldumaxl(Assembler::xword, r11, r19, r0); // ldumaxl x11, x19, [x0] + +// LSEOp + __ swp(Assembler::word, r28, r28, r1); // swp w28, w28, [x1] + __ ldadd(Assembler::word, r11, r21, r12); // ldadd w11, w21, [x12] + __ ldbic(Assembler::word, r29, r0, r18); // ldclr w29, w0, [x18] + __ ldeor(Assembler::word, r5, r0, r25); // ldeor w5, w0, [x25] + __ ldorr(Assembler::word, r14, r0, r26); // ldset w14, w0, [x26] + __ ldsmin(Assembler::word, r28, r18, r29); // ldsmin w28, w18, [x29] + __ ldsmax(Assembler::word, r15, r1, r29); // ldsmax w15, w1, [x29] + __ ldumin(Assembler::word, r8, r26, r28); // ldumin w8, w26, [x28] + __ ldumax(Assembler::word, r17, r14, r4); // ldumax w17, w14, [x4] + +// LSEOp + __ swpa(Assembler::word, r24, r25, r1); // swpa w24, w25, [x1] + __ ldadda(Assembler::word, r10, r17, r17); // ldadda w10, w17, [x17] + __ ldbica(Assembler::word, r29, r20, r21); // ldclra w29, w20, [x21] + __ ldeora(Assembler::word, r29, r9, r12); // ldeora w29, w9, [x12] + __ ldorra(Assembler::word, r11, r6, r5); // ldseta w11, w6, [x5] + __ ldsmina(Assembler::word, r21, r7, r21); // ldsmina w21, w7, [x21] + __ ldsmaxa(Assembler::word, r10, r23, r12); // ldsmaxa w10, w23, [x12] + __ ldumina(Assembler::word, r21, r5, r10); // ldumina w21, w5, [x10] + __ ldumaxa(Assembler::word, r30, r20, r18); // ldumaxa w30, w20, [x18] + +// LSEOp + __ swpal(Assembler::word, r13, r23, r5); // swpal w13, w23, [x5] + __ ldaddal(Assembler::word, r15, r24, r5); // ldaddal w15, w24, [x5] + __ ldbical(Assembler::word, r9, r10, r25); // ldclral w9, w10, [x25] + __ ldeoral(Assembler::word, r20, r17, r17); // ldeoral w20, w17, [x17] + __ ldorral(Assembler::word, r12, r18, r30); // ldsetal w12, w18, [x30] + __ ldsminal(Assembler::word, r3, r3, r25); // ldsminal w3, w3, [x25] + __ ldsmaxal(Assembler::word, r26, r25, r10); // ldsmaxal w26, w25, [x10] + __ lduminal(Assembler::word, r2, r11, sp); // lduminal w2, w11, [sp] + __ ldumaxal(Assembler::word, r7, r2, r5); // ldumaxal w7, w2, [x5] + +// LSEOp + __ swpl(Assembler::word, r0, r7, r20); // swpl w0, w7, [x20] + __ ldaddl(Assembler::word, r5, zr, r2); // ldaddl w5, wzr, [x2] + __ ldbicl(Assembler::word, r27, r25, r27); // ldclrl w27, w25, [x27] + __ ldeorl(Assembler::word, r30, r24, r26); // ldeorl w30, w24, [x26] + __ ldorrl(Assembler::word, r15, r2, r22); // ldsetl w15, w2, [x22] + __ ldsminl(Assembler::word, r0, r3, sp); // ldsminl w0, w3, [sp] + __ ldsmaxl(Assembler::word, r15, r20, r10); // ldsmaxl w15, w20, [x10] + __ lduminl(Assembler::word, r22, r21, r14); // lduminl w22, w21, [x14] + __ ldumaxl(Assembler::word, r6, r30, r2); // ldumaxl w6, w30, [x2] __ bind(forth); @@ -638,542 +769,681 @@ aarch64ops.o: file format elf64-littleaarch64 Disassembly of section .text: 0000000000000000 : - 0: 8b0772d3 add x19, x22, x7, lsl #28 - 4: cb4a3570 sub x16, x11, x10, lsr #13 - 8: ab9c09bb adds x27, x13, x28, asr #2 - c: eb9aa794 subs x20, x28, x26, asr #41 - 10: 0b934e68 add w8, w19, w19, asr #19 - 14: 4b0a3924 sub w4, w9, w10, lsl #14 - 18: 2b1e3568 adds w8, w11, w30, lsl #13 - 1c: 6b132720 subs w0, w25, w19, lsl #9 - 20: 8a154c14 and x20, x0, x21, lsl #19 - 24: aa1445d5 orr x21, x14, x20, lsl #17 - 28: ca01cf99 eor x25, x28, x1, lsl #51 - 2c: ea8b3f6a ands x10, x27, x11, asr #15 - 30: 0a8c5cb9 and w25, w5, w12, asr #23 - 34: 2a4a11d2 orr w18, w14, w10, lsr #4 - 38: 4a855aa4 eor w4, w21, w5, asr #22 - 3c: 6a857415 ands w21, w0, w5, asr #29 - 40: 8aa697da bic x26, x30, x6, asr #37 - 44: aa6d7423 orn x3, x1, x13, lsr #29 - 48: ca29bf80 eon x0, x28, x9, lsl #47 - 4c: ea3cb8bd bics x29, x5, x28, lsl #46 - 50: 0a675249 bic w9, w18, w7, lsr #20 - 54: 2ab961ba orn w26, w13, w25, asr #24 - 58: 4a331899 eon w25, w4, w19, lsl #6 - 5c: 6a646345 bics w5, w26, w4, lsr #24 - 60: 11055267 add w7, w19, #0x154 - 64: 31064408 adds w8, w0, #0x191 - 68: 51028e9d sub w29, w20, #0xa3 - 6c: 710bdee8 subs w8, w23, #0x2f7 - 70: 91082d81 add x1, x12, #0x20b - 74: b106a962 adds x2, x11, #0x1aa - 78: d10b33ae sub x14, x29, #0x2cc - 7c: f10918ab subs x11, x5, #0x246 - 80: 121102d7 and w23, w22, #0x8000 - 84: 3204cd44 orr w4, w10, #0xf0f0f0f0 - 88: 5204cf00 eor w0, w24, #0xf0f0f0f0 - 8c: 72099fb3 ands w19, w29, #0x7f807f80 - 90: 92729545 and x5, x10, #0xfffffffffc000 - 94: b20e37cc orr x12, x30, #0xfffc0000fffc0000 - 98: d27c34be eor x30, x5, #0x3fff0 - 9c: f27e4efa ands x26, x23, #0x3ffffc - a0: 14000000 b a0 - a4: 17ffffd7 b 0 - a8: 1400017f b 6a4 - ac: 94000000 bl ac - b0: 97ffffd4 bl 0 - b4: 9400017c bl 6a4 - b8: 3400000c cbz w12, b8 - bc: 34fffa2c cbz w12, 0 - c0: 34002f2c cbz w12, 6a4 - c4: 35000014 cbnz w20, c4 - c8: 35fff9d4 cbnz w20, 0 - cc: 35002ed4 cbnz w20, 6a4 - d0: b400000c cbz x12, d0 - d4: b4fff96c cbz x12, 0 - d8: b4002e6c cbz x12, 6a4 - dc: b5000018 cbnz x24, dc - e0: b5fff918 cbnz x24, 0 - e4: b5002e18 cbnz x24, 6a4 - e8: 10000006 adr x6, e8 - ec: 10fff8a6 adr x6, 0 - f0: 10002da6 adr x6, 6a4 - f4: 90000015 adrp x21, 0 - f8: 36080001 tbz w1, #1, f8 - fc: 360ff821 tbz w1, #1, 0 - 100: 36082d21 tbz w1, #1, 6a4 - 104: 37480008 tbnz w8, #9, 104 - 108: 374ff7c8 tbnz w8, #9, 0 - 10c: 37482cc8 tbnz w8, #9, 6a4 - 110: 128b50ec movn w12, #0x5a87 - 114: 52a9ff8b movz w11, #0x4ffc, lsl #16 - 118: 7281d095 movk w21, #0xe84 - 11c: 92edfebd movn x29, #0x6ff5, lsl #48 - 120: d28361e3 movz x3, #0x1b0f - 124: f2a4cc96 movk x22, #0x2664, lsl #16 - 128: 9346590c sbfx x12, x8, #6, #17 - 12c: 33194f33 bfi w19, w25, #7, #20 - 130: 531d3d89 ubfiz w9, w12, #3, #16 - 134: 9350433c sbfx x28, x25, #16, #1 - 138: b34464ac bfxil x12, x5, #4, #22 - 13c: d3462140 ubfx x0, x10, #6, #3 - 140: 139a61a4 extr w4, w13, w26, #24 - 144: 93d87fd7 extr x23, x30, x24, #31 - 148: 54000000 b.eq 148 - 14c: 54fff5a0 b.eq 0 - 150: 54002aa0 b.eq 6a4 - 154: 54000001 b.ne 154 - 158: 54fff541 b.ne 0 - 15c: 54002a41 b.ne 6a4 - 160: 54000002 b.cs 160 - 164: 54fff4e2 b.cs 0 - 168: 540029e2 b.cs 6a4 - 16c: 54000002 b.cs 16c - 170: 54fff482 b.cs 0 - 174: 54002982 b.cs 6a4 - 178: 54000003 b.cc 178 - 17c: 54fff423 b.cc 0 - 180: 54002923 b.cc 6a4 - 184: 54000003 b.cc 184 - 188: 54fff3c3 b.cc 0 - 18c: 540028c3 b.cc 6a4 - 190: 54000004 b.mi 190 - 194: 54fff364 b.mi 0 - 198: 54002864 b.mi 6a4 - 19c: 54000005 b.pl 19c - 1a0: 54fff305 b.pl 0 - 1a4: 54002805 b.pl 6a4 - 1a8: 54000006 b.vs 1a8 - 1ac: 54fff2a6 b.vs 0 - 1b0: 540027a6 b.vs 6a4 - 1b4: 54000007 b.vc 1b4 - 1b8: 54fff247 b.vc 0 - 1bc: 54002747 b.vc 6a4 - 1c0: 54000008 b.hi 1c0 - 1c4: 54fff1e8 b.hi 0 - 1c8: 540026e8 b.hi 6a4 - 1cc: 54000009 b.ls 1cc - 1d0: 54fff189 b.ls 0 - 1d4: 54002689 b.ls 6a4 - 1d8: 5400000a b.ge 1d8 - 1dc: 54fff12a b.ge 0 - 1e0: 5400262a b.ge 6a4 - 1e4: 5400000b b.lt 1e4 - 1e8: 54fff0cb b.lt 0 - 1ec: 540025cb b.lt 6a4 - 1f0: 5400000c b.gt 1f0 - 1f4: 54fff06c b.gt 0 - 1f8: 5400256c b.gt 6a4 - 1fc: 5400000d b.le 1fc - 200: 54fff00d b.le 0 - 204: 5400250d b.le 6a4 - 208: 5400000e b.al 208 - 20c: 54ffefae b.al 0 - 210: 540024ae b.al 6a4 - 214: 5400000f b.nv 214 - 218: 54ffef4f b.nv 0 - 21c: 5400244f b.nv 6a4 - 220: d4063721 svc #0x31b9 - 224: d4035082 hvc #0x1a84 - 228: d400bfe3 smc #0x5ff - 22c: d4282fc0 brk #0x417e - 230: d444c320 hlt #0x2619 - 234: d503201f nop - 238: d69f03e0 eret - 23c: d6bf03e0 drps - 240: d5033fdf isb - 244: d5033f9f dsb sy - 248: d5033abf dmb ishst - 24c: d61f0040 br x2 - 250: d63f00a0 blr x5 - 254: c8147c55 stxr w20, x21, [x2] - 258: c805fcfd stlxr w5, x29, [x7] - 25c: c85f7e05 ldxr x5, [x16] - 260: c85fffbb ldaxr x27, [x29] - 264: c89fffa0 stlr x0, [x29] - 268: c8dfff95 ldar x21, [x28] - 26c: 88157cf8 stxr w21, w24, [x7] - 270: 8815ff9a stlxr w21, w26, [x28] - 274: 885f7cd5 ldxr w21, [x6] - 278: 885fffcf ldaxr w15, [x30] - 27c: 889ffc73 stlr w19, [x3] - 280: 88dffc56 ldar w22, [x2] - 284: 48127c0f stxrh w18, w15, [x0] - 288: 480bff85 stlxrh w11, w5, [x28] - 28c: 485f7cdd ldxrh w29, [x6] - 290: 485ffcf2 ldaxrh w18, [x7] - 294: 489fff99 stlrh w25, [x28] - 298: 48dffe62 ldarh w2, [x19] - 29c: 080a7c3e stxrb w10, w30, [x1] - 2a0: 0814fed5 stlxrb w20, w21, [x22] - 2a4: 085f7c59 ldxrb w25, [x2] - 2a8: 085ffcb8 ldaxrb w24, [x5] - 2ac: 089ffc70 stlrb w16, [x3] - 2b0: 08dfffb6 ldarb w22, [x29] - 2b4: c87f0a68 ldxp x8, x2, [x19] - 2b8: c87fcdc7 ldaxp x7, x19, [x14] - 2bc: c82870bb stxp w8, x27, x28, [x5] - 2c0: c825b8c8 stlxp w5, x8, x14, [x6] - 2c4: 887f12d9 ldxp w25, w4, [x22] - 2c8: 887fb9ed ldaxp w13, w14, [x15] - 2cc: 8834215a stxp w20, w26, w8, [x10] - 2d0: 8837ca52 stlxp w23, w18, w18, [x18] - 2d4: f806317e str x30, [x11,#99] - 2d8: b81b3337 str w23, [x25,#-77] - 2dc: 39000dc2 strb w2, [x14,#3] - 2e0: 78005149 strh w9, [x10,#5] - 2e4: f84391f4 ldr x20, [x15,#57] - 2e8: b85b220c ldr w12, [x16,#-78] - 2ec: 385fd356 ldrb w22, [x26,#-3] - 2f0: 785d127e ldrh w30, [x19,#-47] - 2f4: 389f4149 ldrsb x9, [x10,#-12] - 2f8: 79801e3c ldrsh x28, [x17,#14] - 2fc: 79c014a3 ldrsh w3, [x5,#10] - 300: b89a5231 ldrsw x17, [x17,#-91] - 304: fc5ef282 ldr d2, [x20,#-17] - 308: bc5f60f6 ldr s22, [x7,#-10] - 30c: fc12125e str d30, [x18,#-223] - 310: bc0152cd str s13, [x22,#21] - 314: f8190e49 str x9, [x18,#-112]! - 318: b800befd str w29, [x23,#11]! - 31c: 381ffd92 strb w18, [x12,#-1]! - 320: 781e9e90 strh w16, [x20,#-23]! - 324: f8409fa3 ldr x3, [x29,#9]! - 328: b8413c79 ldr w25, [x3,#19]! - 32c: 385fffa1 ldrb w1, [x29,#-1]! - 330: 785c7fa8 ldrh w8, [x29,#-57]! - 334: 389f3dc5 ldrsb x5, [x14,#-13]! - 338: 78801f6a ldrsh x10, [x27,#1]! - 33c: 78c19d4b ldrsh w11, [x10,#25]! - 340: b89a4ec4 ldrsw x4, [x22,#-92]! - 344: fc408eeb ldr d11, [x23,#8]! - 348: bc436e79 ldr s25, [x19,#54]! - 34c: fc152ce1 str d1, [x7,#-174]! - 350: bc036f28 str s8, [x25,#54]! - 354: f8025565 str x5, [x11],#37 - 358: b80135f8 str w24, [x15],#19 - 35c: 381ff74f strb w15, [x26],#-1 - 360: 781fa652 strh w18, [x18],#-6 - 364: f851a447 ldr x7, [x2],#-230 - 368: b85e557b ldr w27, [x11],#-27 - 36c: 385e7472 ldrb w18, [x3],#-25 - 370: 785e070a ldrh w10, [x24],#-32 - 374: 38804556 ldrsb x22, [x10],#4 - 378: 78819591 ldrsh x17, [x12],#25 - 37c: 78dc24e8 ldrsh w8, [x7],#-62 - 380: b89cd6d7 ldrsw x23, [x22],#-51 - 384: fc430738 ldr d24, [x25],#48 - 388: bc5f6595 ldr s21, [x12],#-10 - 38c: fc1225b2 str d18, [x13],#-222 - 390: bc1d7430 str s16, [x1],#-41 - 394: f82fcac2 str x2, [x22,w15,sxtw] - 398: b83d6a02 str w2, [x16,x29] - 39c: 382e5a54 strb w20, [x18,w14,uxtw #0] - 3a0: 7834fa66 strh w6, [x19,x20,sxtx #1] - 3a4: f86ecbae ldr x14, [x29,w14,sxtw] - 3a8: b86cda90 ldr w16, [x20,w12,sxtw #2] - 3ac: 3860d989 ldrb w9, [x12,w0,sxtw #0] - 3b0: 78637a2c ldrh w12, [x17,x3,lsl #1] - 3b4: 38a3fa22 ldrsb x2, [x17,x3,sxtx #0] - 3b8: 78b15827 ldrsh x7, [x1,w17,uxtw #1] - 3bc: 78f2d9f9 ldrsh w25, [x15,w18,sxtw #1] - 3c0: b8ac6ab7 ldrsw x23, [x21,x12] - 3c4: fc6879a5 ldr d5, [x13,x8,lsl #3] - 3c8: bc767943 ldr s3, [x10,x22,lsl #2] - 3cc: fc3bc84e str d14, [x2,w27,sxtw] - 3d0: bc3968d4 str s20, [x6,x25] - 3d4: f91fc0fe str x30, [x7,#16256] - 3d8: b91da50f str w15, [x8,#7588] - 3dc: 391d280b strb w11, [x0,#1866] - 3e0: 791d2e23 strh w3, [x17,#3734] - 3e4: f95bc8e2 ldr x2, [x7,#14224] - 3e8: b95ce525 ldr w5, [x9,#7396] - 3ec: 395ae53c ldrb w28, [x9,#1721] - 3f0: 795c9282 ldrh w2, [x20,#3656] - 3f4: 399d7dd6 ldrsb x22, [x14,#1887] - 3f8: 799fe008 ldrsh x8, [x0,#4080] - 3fc: 79de9bc0 ldrsh w0, [x30,#3916] - 400: b99aae78 ldrsw x24, [x19,#6828] - 404: fd597598 ldr d24, [x12,#13032] - 408: bd5d1d08 ldr s8, [x8,#7452] - 40c: fd1f3dea str d10, [x15,#15992] - 410: bd1a227a str s26, [x19,#6688] - 414: 5800148a ldr x10, 6a4 - 418: 18000003 ldr w3, 418 - 41c: f88092e0 prfm pldl1keep, [x23,#9] - 420: d8ffdf00 prfm pldl1keep, 0 - 424: f8a84860 prfm pldl1keep, [x3,w8,uxtw] - 428: f99d7560 prfm pldl1keep, [x11,#15080] - 42c: 1a1c012d adc w13, w9, w28 - 430: 3a1c027b adcs w27, w19, w28 - 434: 5a060253 sbc w19, w18, w6 - 438: 7a03028e sbcs w14, w20, w3 - 43c: 9a0801d0 adc x16, x14, x8 - 440: ba0803a0 adcs x0, x29, x8 - 444: da140308 sbc x8, x24, x20 - 448: fa00038c sbcs x12, x28, x0 - 44c: 0b3010d7 add w23, w6, w16, uxtb #4 - 450: 2b37ab39 adds w25, w25, w23, sxth #2 - 454: cb2466da sub x26, x22, x4, uxtx #1 - 458: 6b33efb1 subs w17, w29, w19, sxtx #3 - 45c: 8b350fcb add x11, x30, w21, uxtb #3 - 460: ab208a70 adds x16, x19, w0, sxtb #2 - 464: cb39e52b sub x11, x9, x25, sxtx #1 - 468: eb2c9291 subs x17, x20, w12, sxtb #4 - 46c: 3a4bd1a3 ccmn w13, w11, #0x3, le - 470: 7a4c81a2 ccmp w13, w12, #0x2, hi - 474: ba42106c ccmn x3, x2, #0xc, ne - 478: fa5560e3 ccmp x7, x21, #0x3, vs - 47c: 3a4e3844 ccmn w2, #0xe, #0x4, cc - 480: 7a515a26 ccmp w17, #0x11, #0x6, pl - 484: ba4c2940 ccmn x10, #0xc, #0x0, cs - 488: fa52aaae ccmp x21, #0x12, #0xe, ge - 48c: 1a8cc1b5 csel w21, w13, w12, gt - 490: 1a8f976a csinc w10, w27, w15, ls - 494: 5a8981a0 csinv w0, w13, w9, hi - 498: 5a9a6492 csneg w18, w4, w26, vs - 49c: 9a8793ac csel x12, x29, x7, ls - 4a0: 9a9474e6 csinc x6, x7, x20, vc - 4a4: da83d2b6 csinv x22, x21, x3, le - 4a8: da9b9593 csneg x19, x12, x27, ls - 4ac: 5ac00200 rbit w0, w16 - 4b0: 5ac006f1 rev16 w17, w23 - 4b4: 5ac009d1 rev w17, w14 - 4b8: 5ac013d8 clz w24, w30 - 4bc: 5ac016d8 cls w24, w22 - 4c0: dac00223 rbit x3, x17 - 4c4: dac005ac rev16 x12, x13 - 4c8: dac00ac9 rev32 x9, x22 - 4cc: dac00c00 rev x0, x0 - 4d0: dac01205 clz x5, x16 - 4d4: dac016d9 cls x25, x22 - 4d8: 1ac0089d udiv w29, w4, w0 - 4dc: 1add0fa0 sdiv w0, w29, w29 - 4e0: 1ad52225 lsl w5, w17, w21 - 4e4: 1ad22529 lsr w9, w9, w18 - 4e8: 1ac82b61 asr w1, w27, w8 - 4ec: 1acd2e92 ror w18, w20, w13 - 4f0: 9acc0b28 udiv x8, x25, x12 - 4f4: 9adc0ca7 sdiv x7, x5, x28 - 4f8: 9adb2225 lsl x5, x17, x27 - 4fc: 9ad42757 lsr x23, x26, x20 - 500: 9adc291c asr x28, x8, x28 - 504: 9ac42fa3 ror x3, x29, x4 - 508: 1b1a55d1 madd w17, w14, w26, w21 - 50c: 1b0bafc1 msub w1, w30, w11, w11 - 510: 9b067221 madd x1, x17, x6, x28 - 514: 9b1ea0de msub x30, x6, x30, x8 - 518: 9b2e20d5 smaddl x21, w6, w14, x8 - 51c: 9b38cd4a smsubl x10, w10, w24, x19 - 520: 9bae6254 umaddl x20, w18, w14, x24 - 524: 9ba59452 umsubl x18, w2, w5, x5 - 528: 1e2d0a48 fmul s8, s18, s13 - 52c: 1e3c19c2 fdiv s2, s14, s28 - 530: 1e3c298f fadd s15, s12, s28 - 534: 1e213980 fsub s0, s12, s1 - 538: 1e240baf fmul s15, s29, s4 - 53c: 1e77082c fmul d12, d1, d23 - 540: 1e72191b fdiv d27, d8, d18 - 544: 1e6b2a97 fadd d23, d20, d11 - 548: 1e723988 fsub d8, d12, d18 - 54c: 1e770b1a fmul d26, d24, d23 - 550: 1f0d66f5 fmadd s21, s23, s13, s25 - 554: 1f01b956 fmsub s22, s10, s1, s14 - 558: 1f227a8e fnmadd s14, s20, s2, s30 - 55c: 1f365ba7 fnmadd s7, s29, s22, s22 - 560: 1f4f14ad fmadd d13, d5, d15, d5 - 564: 1f45a98e fmsub d14, d12, d5, d10 - 568: 1f60066a fnmadd d10, d19, d0, d1 - 56c: 1f620054 fnmadd d20, d2, d2, d0 - 570: 1e204139 fmov s25, s9 - 574: 1e20c094 fabs s20, s4 - 578: 1e214363 fneg s3, s27 - 57c: 1e21c041 fsqrt s1, s2 - 580: 1e22c01e fcvt d30, s0 - 584: 1e60408c fmov d12, d4 - 588: 1e60c361 fabs d1, d27 - 58c: 1e6142c8 fneg d8, d22 - 590: 1e61c16b fsqrt d11, d11 - 594: 1e624396 fcvt s22, d28 - 598: 1e3802dc fcvtzs w28, s22 - 59c: 9e380374 fcvtzs x20, s27 - 5a0: 1e78000e fcvtzs w14, d0 - 5a4: 9e78017a fcvtzs x26, d11 - 5a8: 1e2202dc scvtf s28, w22 - 5ac: 9e220150 scvtf s16, x10 - 5b0: 1e6202a8 scvtf d8, w21 - 5b4: 9e620395 scvtf d21, x28 - 5b8: 1e260318 fmov w24, s24 - 5bc: 9e660268 fmov x8, d19 - 5c0: 1e270188 fmov s8, w12 - 5c4: 9e6700e6 fmov d6, x7 - 5c8: 1e3023c0 fcmp s30, s16 - 5cc: 1e6b2320 fcmp d25, d11 - 5d0: 1e202168 fcmp s11, #0.0 - 5d4: 1e602168 fcmp d11, #0.0 - 5d8: 2910323d stp w29, w12, [x17,#128] - 5dc: 297449d6 ldp w22, w18, [x14,#-96] - 5e0: 6948402b ldpsw x11, x16, [x1,#64] - 5e4: a9072f40 stp x0, x11, [x26,#112] - 5e8: a9410747 ldp x7, x1, [x26,#16] - 5ec: 29801f0a stp w10, w7, [x24,#0]! - 5f0: 29e07307 ldp w7, w28, [x24,#-256]! - 5f4: 69e272b9 ldpsw x25, x28, [x21,#-240]! - 5f8: a9bf49d4 stp x20, x18, [x14,#-16]! - 5fc: a9c529a8 ldp x8, x10, [x13,#80]! - 600: 28b0605a stp w26, w24, [x2],#-128 - 604: 28e866a2 ldp w2, w25, [x21],#-192 - 608: 68ee0ab1 ldpsw x17, x2, [x21],#-144 - 60c: a886296c stp x12, x10, [x11],#96 - 610: a8fe1a38 ldp x24, x6, [x17],#-32 - 614: 282479c3 stnp w3, w30, [x14,#-224] - 618: 286e534f ldnp w15, w20, [x26,#-144] - 61c: a8386596 stnp x22, x25, [x12,#-128] - 620: a8755a3b ldnp x27, x22, [x17,#-176] - 624: 1e601000 fmov d0, #2.000000000000000000e+00 - 628: 1e603000 fmov d0, #2.125000000000000000e+00 - 62c: 1e621000 fmov d0, #4.000000000000000000e+00 - 630: 1e623000 fmov d0, #4.250000000000000000e+00 - 634: 1e641000 fmov d0, #8.000000000000000000e+00 - 638: 1e643000 fmov d0, #8.500000000000000000e+00 - 63c: 1e661000 fmov d0, #1.600000000000000000e+01 - 640: 1e663000 fmov d0, #1.700000000000000000e+01 - 644: 1e681000 fmov d0, #1.250000000000000000e-01 - 648: 1e683000 fmov d0, #1.328125000000000000e-01 - 64c: 1e6a1000 fmov d0, #2.500000000000000000e-01 - 650: 1e6a3000 fmov d0, #2.656250000000000000e-01 - 654: 1e6c1000 fmov d0, #5.000000000000000000e-01 - 658: 1e6c3000 fmov d0, #5.312500000000000000e-01 - 65c: 1e6e1000 fmov d0, #1.000000000000000000e+00 - 660: 1e6e3000 fmov d0, #1.062500000000000000e+00 - 664: 1e701000 fmov d0, #-2.000000000000000000e+00 - 668: 1e703000 fmov d0, #-2.125000000000000000e+00 - 66c: 1e721000 fmov d0, #-4.000000000000000000e+00 - 670: 1e723000 fmov d0, #-4.250000000000000000e+00 - 674: 1e741000 fmov d0, #-8.000000000000000000e+00 - 678: 1e743000 fmov d0, #-8.500000000000000000e+00 - 67c: 1e761000 fmov d0, #-1.600000000000000000e+01 - 680: 1e763000 fmov d0, #-1.700000000000000000e+01 - 684: 1e781000 fmov d0, #-1.250000000000000000e-01 - 688: 1e783000 fmov d0, #-1.328125000000000000e-01 - 68c: 1e7a1000 fmov d0, #-2.500000000000000000e-01 - 690: 1e7a3000 fmov d0, #-2.656250000000000000e-01 - 694: 1e7c1000 fmov d0, #-5.000000000000000000e-01 - 698: 1e7c3000 fmov d0, #-5.312500000000000000e-01 - 69c: 1e7e1000 fmov d0, #-1.000000000000000000e+00 - 6a0: 1e7e3000 fmov d0, #-1.062500000000000000e+00 + 0: 8b50798f add x15, x12, x16, lsr #30 + 4: cb4381e1 sub x1, x15, x3, lsr #32 + 8: ab05372d adds x13, x25, x5, lsl #13 + c: eb864796 subs x22, x28, x6, asr #17 + 10: 0b961920 add w0, w9, w22, asr #6 + 14: 4b195473 sub w19, w3, w25, lsl #21 + 18: 2b0b5264 adds w4, w19, w11, lsl #20 + 1c: 6b9300f8 subs w24, w7, w19, asr #0 + 20: 8a0bc0fe and x30, x7, x11, lsl #48 + 24: aa0f3118 orr x24, x8, x15, lsl #12 + 28: ca170531 eor x17, x9, x23, lsl #1 + 2c: ea44dd6e ands x14, x11, x4, lsr #55 + 30: 0a4c44f3 and w19, w7, w12, lsr #17 + 34: 2a8b7373 orr w19, w27, w11, asr #28 + 38: 4a567c7e eor w30, w3, w22, lsr #31 + 3c: 6a9c0353 ands w19, w26, w28, asr #0 + 40: 8a3accdd bic x29, x6, x26, lsl #51 + 44: aa318f7a orn x26, x27, x17, lsl #35 + 48: ca2e1495 eon x21, x4, x14, lsl #5 + 4c: eaa015e2 bics x2, x15, x0, asr #5 + 50: 0a2274e2 bic w2, w7, w2, lsl #29 + 54: 2a751598 orn w24, w12, w21, lsr #5 + 58: 4a3309fe eon w30, w15, w19, lsl #2 + 5c: 6ab172fe bics w30, w23, w17, asr #28 + 60: 110a5284 add w4, w20, #0x294 + 64: 310b1942 adds w2, w10, #0x2c6 + 68: 5103d353 sub w19, w26, #0xf4 + 6c: 710125bc subs w28, w13, #0x49 + 70: 910d7bc2 add x2, x30, #0x35e + 74: b108fa1b adds x27, x16, #0x23e + 78: d1093536 sub x22, x9, #0x24d + 7c: f10ae824 subs x4, x1, #0x2ba + 80: 120e667c and w28, w19, #0xfffc0fff + 84: 321f6cbb orr w27, w5, #0x1ffffffe + 88: 520f6a9e eor w30, w20, #0xfffe0fff + 8c: 72136f56 ands w22, w26, #0xffffe1ff + 90: 927e4ce5 and x5, x7, #0x3ffffc + 94: b278b4ed orr x13, x7, #0x3fffffffffff00 + 98: d24c6527 eor x7, x9, #0xfff0000000003fff + 9c: f2485803 ands x3, x0, #0xff00000000007fff + a0: 14000000 b a0 + a4: 17ffffd7 b 0 + a8: 140001ee b 860 + ac: 94000000 bl ac + b0: 97ffffd4 bl 0 + b4: 940001eb bl 860 + b8: 34000010 cbz w16, b8 + bc: 34fffa30 cbz w16, 0 + c0: 34003d10 cbz w16, 860 + c4: 35000013 cbnz w19, c4 + c8: 35fff9d3 cbnz w19, 0 + cc: 35003cb3 cbnz w19, 860 + d0: b4000005 cbz x5, d0 + d4: b4fff965 cbz x5, 0 + d8: b4003c45 cbz x5, 860 + dc: b5000004 cbnz x4, dc + e0: b5fff904 cbnz x4, 0 + e4: b5003be4 cbnz x4, 860 + e8: 1000001b adr x27, e8 + ec: 10fff8bb adr x27, 0 + f0: 10003b9b adr x27, 860 + f4: 90000010 adrp x16, 0 + f8: 3640001c tbz w28, #8, f8 + fc: 3647f83c tbz w28, #8, 0 + 100: 36403b1c tbz w28, #8, 860 + 104: 37080001 tbnz w1, #1, 104 + 108: 370ff7c1 tbnz w1, #1, 0 + 10c: 37083aa1 tbnz w1, #1, 860 + 110: 12a437f4 mov w20, #0xde40ffff // #-566165505 + 114: 528c9d67 mov w7, #0x64eb // #25835 + 118: 72838bb1 movk w17, #0x1c5d + 11c: 92c1062e mov x14, #0xfffff7ceffffffff // #-9006546419713 + 120: d287da49 mov x9, #0x3ed2 // #16082 + 124: f2a6d153 movk x19, #0x368a, lsl #16 + 128: 93465ac9 sbfx x9, x22, #6, #17 + 12c: 330b0013 bfi w19, w0, #21, #1 + 130: 530b4e6a ubfx w10, w19, #11, #9 + 134: 934545e4 sbfx x4, x15, #5, #13 + 138: b35370a3 bfxil x3, x5, #19, #10 + 13c: d3510b8c ubfiz x12, x28, #47, #3 + 140: 13960c0f extr w15, w0, w22, #3 + 144: 93ceddc6 ror x6, x14, #55 + 148: 54000000 b.eq 148 // b.none + 14c: 54fff5a0 b.eq 0 // b.none + 150: 54003880 b.eq 860 // b.none + 154: 54000001 b.ne 154 // b.any + 158: 54fff541 b.ne 0 // b.any + 15c: 54003821 b.ne 860 // b.any + 160: 54000002 b.cs 160 // b.hs, b.nlast + 164: 54fff4e2 b.cs 0 // b.hs, b.nlast + 168: 540037c2 b.cs 860 // b.hs, b.nlast + 16c: 54000002 b.cs 16c // b.hs, b.nlast + 170: 54fff482 b.cs 0 // b.hs, b.nlast + 174: 54003762 b.cs 860 // b.hs, b.nlast + 178: 54000003 b.cc 178 // b.lo, b.ul, b.last + 17c: 54fff423 b.cc 0 // b.lo, b.ul, b.last + 180: 54003703 b.cc 860 // b.lo, b.ul, b.last + 184: 54000003 b.cc 184 // b.lo, b.ul, b.last + 188: 54fff3c3 b.cc 0 // b.lo, b.ul, b.last + 18c: 540036a3 b.cc 860 // b.lo, b.ul, b.last + 190: 54000004 b.mi 190 // b.first + 194: 54fff364 b.mi 0 // b.first + 198: 54003644 b.mi 860 // b.first + 19c: 54000005 b.pl 19c // b.nfrst + 1a0: 54fff305 b.pl 0 // b.nfrst + 1a4: 540035e5 b.pl 860 // b.nfrst + 1a8: 54000006 b.vs 1a8 + 1ac: 54fff2a6 b.vs 0 + 1b0: 54003586 b.vs 860 + 1b4: 54000007 b.vc 1b4 + 1b8: 54fff247 b.vc 0 + 1bc: 54003527 b.vc 860 + 1c0: 54000008 b.hi 1c0 // b.pmore + 1c4: 54fff1e8 b.hi 0 // b.pmore + 1c8: 540034c8 b.hi 860 // b.pmore + 1cc: 54000009 b.ls 1cc // b.plast + 1d0: 54fff189 b.ls 0 // b.plast + 1d4: 54003469 b.ls 860 // b.plast + 1d8: 5400000a b.ge 1d8 // b.tcont + 1dc: 54fff12a b.ge 0 // b.tcont + 1e0: 5400340a b.ge 860 // b.tcont + 1e4: 5400000b b.lt 1e4 // b.tstop + 1e8: 54fff0cb b.lt 0 // b.tstop + 1ec: 540033ab b.lt 860 // b.tstop + 1f0: 5400000c b.gt 1f0 + 1f4: 54fff06c b.gt 0 + 1f8: 5400334c b.gt 860 + 1fc: 5400000d b.le 1fc + 200: 54fff00d b.le 0 + 204: 540032ed b.le 860 + 208: 5400000e b.al 208 + 20c: 54ffefae b.al 0 + 210: 5400328e b.al 860 + 214: 5400000f b.nv 214 + 218: 54ffef4f b.nv 0 + 21c: 5400322f b.nv 860 + 220: d40ac601 svc #0x5630 + 224: d40042a2 hvc #0x215 + 228: d404dac3 smc #0x26d6 + 22c: d4224d40 brk #0x126a + 230: d44219c0 hlt #0x10ce + 234: d503201f nop + 238: d69f03e0 eret + 23c: d6bf03e0 drps + 240: d5033fdf isb + 244: d503339f dsb osh + 248: d50335bf dmb nshld + 24c: d61f0280 br x20 + 250: d63f0040 blr x2 + 254: c8127c17 stxr w18, x23, [x0] + 258: c81efec5 stlxr w30, x5, [x22] + 25c: c85f7d05 ldxr x5, [x8] + 260: c85ffe14 ldaxr x20, [x16] + 264: c89ffd66 stlr x6, [x11] + 268: c8dfff66 ldar x6, [x27] + 26c: 880a7cb1 stxr w10, w17, [x5] + 270: 8816fd89 stlxr w22, w9, [x12] + 274: 885f7d1b ldxr w27, [x8] + 278: 885ffc57 ldaxr w23, [x2] + 27c: 889fffba stlr w26, [x29] + 280: 88dffd4d ldar w13, [x10] + 284: 48197f7c stxrh w25, w28, [x27] + 288: 481dfd96 stlxrh w29, w22, [x12] + 28c: 485f7f96 ldxrh w22, [x28] + 290: 485fffc3 ldaxrh w3, [x30] + 294: 489ffdf8 stlrh w24, [x15] + 298: 48dfff5b ldarh w27, [x26] + 29c: 080b7e6a stxrb w11, w10, [x19] + 2a0: 0817fedb stlxrb w23, w27, [x22] + 2a4: 085f7e18 ldxrb w24, [x16] + 2a8: 085ffc38 ldaxrb w24, [x1] + 2ac: 089fffa5 stlrb w5, [x29] + 2b0: 08dffe18 ldarb w24, [x16] + 2b4: c87f6239 ldxp x25, x24, [x17] + 2b8: c87fb276 ldaxp x22, x12, [x19] + 2bc: c820573a stxp w0, x26, x21, [x25] + 2c0: c821aca6 stlxp w1, x6, x11, [x5] + 2c4: 887f388d ldxp w13, w14, [x4] + 2c8: 887f88d1 ldaxp w17, w2, [x6] + 2cc: 882f2643 stxp w15, w3, w9, [x18] + 2d0: 88329131 stlxp w18, w17, w4, [x9] + 2d4: f81cf2b7 stur x23, [x21, #-49] + 2d8: b803f055 stur w21, [x2, #63] + 2dc: 39002f9b strb w27, [x28, #11] + 2e0: 781f31fd sturh w29, [x15, #-13] + 2e4: f85d33ce ldur x14, [x30, #-45] + 2e8: b843539d ldur w29, [x28, #53] + 2ec: 39401f54 ldrb w20, [x26, #7] + 2f0: 785ce059 ldurh w25, [x2, #-50] + 2f4: 389f1143 ldursb x3, [x10, #-15] + 2f8: 788131ee ldursh x14, [x15, #19] + 2fc: 78dfb17d ldursh w29, [x11, #-5] + 300: b89b90af ldursw x15, [x5, #-71] + 304: fc403193 ldur d19, [x12, #3] + 308: bc42a36c ldur s12, [x27, #42] + 30c: fc07d396 stur d22, [x28, #125] + 310: bc1ec1f8 stur s24, [x15, #-20] + 314: f81e8f88 str x8, [x28, #-24]! + 318: b8025de6 str w6, [x15, #37]! + 31c: 38007c27 strb w7, [x1, #7]! + 320: 7801ee20 strh w0, [x17, #30]! + 324: f8454fb9 ldr x25, [x29, #84]! + 328: b85cce9a ldr w26, [x20, #-52]! + 32c: 385e7fba ldrb w26, [x29, #-25]! + 330: 7841af24 ldrh w4, [x25, #26]! + 334: 389ebd1c ldrsb x28, [x8, #-21]! + 338: 789fadd1 ldrsh x17, [x14, #-6]! + 33c: 78c0aefc ldrsh w28, [x23, #10]! + 340: b89c0f7e ldrsw x30, [x27, #-64]! + 344: fc50efd4 ldr d20, [x30, #-242]! + 348: bc414f71 ldr s17, [x27, #20]! + 34c: fc011c67 str d7, [x3, #17]! + 350: bc1f0d6d str s13, [x11, #-16]! + 354: f81c3526 str x6, [x9], #-61 + 358: b81e34b0 str w16, [x5], #-29 + 35c: 3800f7bd strb w29, [x29], #15 + 360: 78012684 strh w4, [x20], #18 + 364: f842e653 ldr x19, [x18], #46 + 368: b8417456 ldr w22, [x2], #23 + 36c: 385e2467 ldrb w7, [x3], #-30 + 370: 785e358b ldrh w11, [x12], #-29 + 374: 389e34c8 ldrsb x8, [x6], #-29 + 378: 788046f8 ldrsh x24, [x23], #4 + 37c: 78c00611 ldrsh w17, [x16], #0 + 380: b89f8680 ldrsw x0, [x20], #-8 + 384: fc582454 ldr d20, [x2], #-126 + 388: bc5987d3 ldr s19, [x30], #-104 + 38c: fc076624 str d4, [x17], #118 + 390: bc190675 str s21, [x19], #-112 + 394: f833785a str x26, [x2, x19, lsl #3] + 398: b82fd809 str w9, [x0, w15, sxtw #2] + 39c: 3821799a strb w26, [x12, x1, lsl #0] + 3a0: 782a7975 strh w21, [x11, x10, lsl #1] + 3a4: f870eaf0 ldr x16, [x23, x16, sxtx] + 3a8: b871d96a ldr w10, [x11, w17, sxtw #2] + 3ac: 386b7aed ldrb w13, [x23, x11, lsl #0] + 3b0: 7875689b ldrh w27, [x4, x21] + 3b4: 38afd91a ldrsb x26, [x8, w15, sxtw #0] + 3b8: 78a2c955 ldrsh x21, [x10, w2, sxtw] + 3bc: 78ee6bc8 ldrsh w8, [x30, x14] + 3c0: b8b4f9dd ldrsw x29, [x14, x20, sxtx #2] + 3c4: fc76eb7e ldr d30, [x27, x22, sxtx] + 3c8: bc76692d ldr s13, [x9, x22] + 3cc: fc31db28 str d8, [x25, w17, sxtw #3] + 3d0: bc255b01 str s1, [x24, w5, uxtw #2] + 3d4: f91c52aa str x10, [x21, #14496] + 3d8: b91c3fb2 str w18, [x29, #7228] + 3dc: 391f8877 strb w23, [x3, #2018] + 3e0: 791ac97c strh w28, [x11, #3428] + 3e4: f95c1758 ldr x24, [x26, #14376] + 3e8: b95b3c55 ldr w21, [x2, #6972] + 3ec: 395ce0a4 ldrb w4, [x5, #1848] + 3f0: 795851ce ldrh w14, [x14, #3112] + 3f4: 399e9f64 ldrsb x4, [x27, #1959] + 3f8: 79993764 ldrsh x4, [x27, #3226] + 3fc: 79d9af8a ldrsh w10, [x28, #3286] + 400: b99eea2a ldrsw x10, [x17, #7912] + 404: fd5a2f8d ldr d13, [x28, #13400] + 408: bd5dac78 ldr s24, [x3, #7596] + 40c: fd1e0182 str d2, [x12, #15360] + 410: bd195c31 str s17, [x1, #6492] + 414: 58000010 ldr x16, 414 + 418: 1800000d ldr w13, 418 + 41c: f8981240 prfum pldl1keep, [x18, #-127] + 420: d8ffdf00 prfm pldl1keep, 0 + 424: f8a27a80 prfm pldl1keep, [x20, x2, lsl #3] + 428: f99af920 prfm pldl1keep, [x9, #13808] + 42c: 1a0202e8 adc w8, w23, w2 + 430: 3a130078 adcs w24, w3, w19 + 434: 5a1d0316 sbc w22, w24, w29 + 438: 7a03036c sbcs w12, w27, w3 + 43c: 9a0102eb adc x11, x23, x1 + 440: ba1700bd adcs x29, x5, x23 + 444: da0c0329 sbc x9, x25, x12 + 448: fa16000c sbcs x12, x0, x22 + 44c: 0b23459a add w26, w12, w3, uxtw #1 + 450: 2b328a14 adds w20, w16, w18, sxtb #2 + 454: cb274bde sub x30, x30, w7, uxtw #2 + 458: 6b222eab subs w11, w21, w2, uxth #3 + 45c: 8b214b42 add x2, x26, w1, uxtw #2 + 460: ab34a7b2 adds x18, x29, w20, sxth #1 + 464: cb24520e sub x14, x16, w4, uxtw #4 + 468: eb378e20 subs x0, x17, w23, sxtb #3 + 46c: 3a565283 ccmn w20, w22, #0x3, pl // pl = nfrst + 470: 7a420321 ccmp w25, w2, #0x1, eq // eq = none + 474: ba58c247 ccmn x18, x24, #0x7, gt + 478: fa4d5106 ccmp x8, x13, #0x6, pl // pl = nfrst + 47c: 3a426924 ccmn w9, #0x2, #0x4, vs + 480: 7a5b0847 ccmp w2, #0x1b, #0x7, eq // eq = none + 484: ba413a02 ccmn x16, #0x1, #0x2, cc // cc = lo, ul, last + 488: fa5fba23 ccmp x17, #0x1f, #0x3, lt // lt = tstop + 48c: 1a979377 csel w23, w27, w23, ls // ls = plast + 490: 1a86640a csinc w10, w0, w6, vs + 494: 5a89300b csinv w11, w0, w9, cc // cc = lo, ul, last + 498: 5a923771 csneg w17, w27, w18, cc // cc = lo, ul, last + 49c: 9a8b720c csel x12, x16, x11, vc + 4a0: 9a868786 csinc x6, x28, x6, hi // hi = pmore + 4a4: da9a736d csinv x13, x27, x26, vc + 4a8: da9256dd csneg x29, x22, x18, pl // pl = nfrst + 4ac: 5ac0026c rbit w12, w19 + 4b0: 5ac00657 rev16 w23, w18 + 4b4: 5ac00b89 rev w9, w28 + 4b8: 5ac01262 clz w2, w19 + 4bc: 5ac017b9 cls w25, w29 + 4c0: dac002e4 rbit x4, x23 + 4c4: dac0065d rev16 x29, x18 + 4c8: dac00907 rev32 x7, x8 + 4cc: dac00e2d rev x13, x17 + 4d0: dac01011 clz x17, x0 + 4d4: dac01752 cls x18, x26 + 4d8: 1ad0098b udiv w11, w12, w16 + 4dc: 1ac70d24 sdiv w4, w9, w7 + 4e0: 1ad020ec lsl w12, w7, w16 + 4e4: 1ad72613 lsr w19, w16, w23 + 4e8: 1ac62887 asr w7, w4, w6 + 4ec: 1ad72e95 ror w21, w20, w23 + 4f0: 9adc0990 udiv x16, x12, x28 + 4f4: 9acd0d84 sdiv x4, x12, x13 + 4f8: 9ac721a9 lsl x9, x13, x7 + 4fc: 9acf277c lsr x28, x27, x15 + 500: 9ace2bd4 asr x20, x30, x14 + 504: 9ade2e4e ror x14, x18, x30 + 508: 9bc77d63 umulh x3, x11, x7 + 50c: 9b587e97 smulh x23, x20, x24 + 510: 1b1524a2 madd w2, w5, w21, w9 + 514: 1b04a318 msub w24, w24, w4, w8 + 518: 9b0f4d8b madd x11, x12, x15, x19 + 51c: 9b0ce73d msub x29, x25, x12, x25 + 520: 9b2c5971 smaddl x17, w11, w12, x22 + 524: 9b34c87c smsubl x28, w3, w20, x18 + 528: 9bbc6887 umaddl x7, w4, w28, x26 + 52c: 9bb19556 umsubl x22, w10, w17, x5 + 530: 1e310871 fmul s17, s3, s17 + 534: 1e261a2b fdiv s11, s17, s6 + 538: 1e2928fd fadd s29, s7, s9 + 53c: 1e333987 fsub s7, s12, s19 + 540: 1e230ae0 fmul s0, s23, s3 + 544: 1e75087a fmul d26, d3, d21 + 548: 1e651a60 fdiv d0, d19, d5 + 54c: 1e692b40 fadd d0, d26, d9 + 550: 1e753ab9 fsub d25, d21, d21 + 554: 1e7309b0 fmul d16, d13, d19 + 558: 1f00425d fmadd s29, s18, s0, s16 + 55c: 1f1d95b7 fmsub s23, s13, s29, s5 + 560: 1f2a38e9 fnmadd s9, s7, s10, s14 + 564: 1f2f5f99 fnmadd s25, s28, s15, s23 + 568: 1f5545a6 fmadd d6, d13, d21, d17 + 56c: 1f429ea3 fmsub d3, d21, d2, d7 + 570: 1f65472a fnmadd d10, d25, d5, d17 + 574: 1f7449ce fnmadd d14, d14, d20, d18 + 578: 1e20404f fmov s15, s2 + 57c: 1e20c0f2 fabs s18, s7 + 580: 1e2140c3 fneg s3, s6 + 584: 1e21c02c fsqrt s12, s1 + 588: 1e22c009 fcvt d9, s0 + 58c: 1e6040a4 fmov d4, d5 + 590: 1e60c1e3 fabs d3, d15 + 594: 1e614331 fneg d17, d25 + 598: 1e61c30c fsqrt d12, d24 + 59c: 1e6240b5 fcvt s21, d5 + 5a0: 1e3802a4 fcvtzs w4, s21 + 5a4: 9e38007b fcvtzs x27, s3 + 5a8: 1e78011d fcvtzs w29, d8 + 5ac: 9e7802a9 fcvtzs x9, d21 + 5b0: 1e2203b4 scvtf s20, w29 + 5b4: 9e220107 scvtf s7, x8 + 5b8: 1e6202ac scvtf d12, w21 + 5bc: 9e6202b0 scvtf d16, x21 + 5c0: 1e2600b2 fmov w18, s5 + 5c4: 9e660119 fmov x25, d8 + 5c8: 1e270352 fmov s18, w26 + 5cc: 9e670160 fmov d0, x11 + 5d0: 1e262200 fcmp s16, s6 + 5d4: 1e7d2200 fcmp d16, d29 + 5d8: 1e2023c8 fcmp s30, #0.0 + 5dc: 1e602128 fcmp d9, #0.0 + 5e0: 293e119b stp w27, w4, [x12, #-16] + 5e4: 294a2543 ldp w3, w9, [x10, #80] + 5e8: 69480c70 ldpsw x16, x3, [x3, #64] + 5ec: a934726a stp x10, x28, [x19, #-192] + 5f0: a97448f3 ldp x19, x18, [x7, #-192] + 5f4: 298243ca stp w10, w16, [x30, #16]! + 5f8: 29e21242 ldp w2, w4, [x18, #-240]! + 5fc: 69c64db8 ldpsw x24, x19, [x13, #48]! + 600: a9800311 stp x17, x0, [x24, #0]! + 604: a9f4686e ldp x14, x26, [x3, #-192]! + 608: 288a0416 stp w22, w1, [x0], #80 + 60c: 28fe2812 ldp w18, w10, [x0], #-16 + 610: 68fe62d8 .inst 0x68fe62d8 ; undefined + 614: a885308c stp x12, x12, [x4], #80 + 618: a8f12664 ldp x4, x9, [x19], #-240 + 61c: 282468d2 stnp w18, w26, [x6, #-224] + 620: 284e5035 ldnp w21, w20, [x1, #112] + 624: a8327699 stnp x25, x29, [x20, #-224] + 628: a84716e1 ldnp x1, x5, [x23, #112] + 62c: 0c407284 ld1 {v4.8b}, [x20] + 630: 4cdfa158 ld1 {v24.16b, v25.16b}, [x10], #32 + 634: 0ccf6cd8 ld1 {v24.1d-v26.1d}, [x6], x15 + 638: 4cdf2483 ld1 {v3.8h-v6.8h}, [x4], #64 + 63c: 0d40c0c2 ld1r {v2.8b}, [x6] + 640: 4ddfc9cd ld1r {v13.4s}, [x14], #4 + 644: 0dd8ceaf ld1r {v15.1d}, [x21], x24 + 648: 4c408ea9 ld2 {v9.2d, v10.2d}, [x21] + 64c: 0cdf86bd ld2 {v29.4h, v30.4h}, [x21], #16 + 650: 4d60c1c8 ld2r {v8.16b, v9.16b}, [x14] + 654: 0dffca87 ld2r {v7.2s, v8.2s}, [x20], #8 + 658: 4de3cc7c ld2r {v28.2d, v29.2d}, [x3], x3 + 65c: 4cdd497b ld3 {v27.4s-v29.4s}, [x11], x29 + 660: 0c404950 ld3 {v16.2s-v18.2s}, [x10] + 664: 4d40e595 ld3r {v21.8h-v23.8h}, [x12] + 668: 4ddfeba4 ld3r {v4.4s-v6.4s}, [x29], #12 + 66c: 0dd3ed38 ld3r {v24.1d-v26.1d}, [x9], x19 + 670: 4cdf046a ld4 {v10.8h-v13.8h}, [x3], #64 + 674: 0cc9039b ld4 {v27.8b-v30.8b}, [x28], x9 + 678: 0d60e3d5 ld4r {v21.8b-v24.8b}, [x30] + 67c: 0dffe5d7 ld4r {v23.4h-v26.4h}, [x14], #8 + 680: 0df4e9a4 ld4r {v4.2s-v7.2s}, [x13], x20 + 684: ba5fd3e3 ccmn xzr, xzr, #0x3, le + 688: 3a5f03e5 ccmn wzr, wzr, #0x5, eq // eq = none + 68c: fa411be4 ccmp xzr, #0x1, #0x4, ne // ne = any + 690: 7a42cbe2 ccmp wzr, #0x2, #0x2, gt + 694: 93df03ff ror xzr, xzr, #0 + 698: c820ffff stlxp w0, xzr, xzr, [sp] + 69c: 8822fc7f stlxp w2, wzr, wzr, [x3] + 6a0: c8247cbf stxp w4, xzr, xzr, [x5] + 6a4: 88267fff stxp w6, wzr, wzr, [sp] + 6a8: 4e010fe0 dup v0.16b, wzr + 6ac: 4e081fe1 mov v1.d[0], xzr + 6b0: 4e0c1fe1 mov v1.s[1], wzr + 6b4: 4e0a1fe1 mov v1.h[2], wzr + 6b8: 4e071fe1 mov v1.b[3], wzr + 6bc: 4cc0ac3f ld1 {v31.2d, v0.2d}, [x1], x0 + 6c0: 1e601000 fmov d0, #2.000000000000000000e+00 + 6c4: 1e603000 fmov d0, #2.125000000000000000e+00 + 6c8: 1e621000 fmov d0, #4.000000000000000000e+00 + 6cc: 1e623000 fmov d0, #4.250000000000000000e+00 + 6d0: 1e641000 fmov d0, #8.000000000000000000e+00 + 6d4: 1e643000 fmov d0, #8.500000000000000000e+00 + 6d8: 1e661000 fmov d0, #1.600000000000000000e+01 + 6dc: 1e663000 fmov d0, #1.700000000000000000e+01 + 6e0: 1e681000 fmov d0, #1.250000000000000000e-01 + 6e4: 1e683000 fmov d0, #1.328125000000000000e-01 + 6e8: 1e6a1000 fmov d0, #2.500000000000000000e-01 + 6ec: 1e6a3000 fmov d0, #2.656250000000000000e-01 + 6f0: 1e6c1000 fmov d0, #5.000000000000000000e-01 + 6f4: 1e6c3000 fmov d0, #5.312500000000000000e-01 + 6f8: 1e6e1000 fmov d0, #1.000000000000000000e+00 + 6fc: 1e6e3000 fmov d0, #1.062500000000000000e+00 + 700: 1e701000 fmov d0, #-2.000000000000000000e+00 + 704: 1e703000 fmov d0, #-2.125000000000000000e+00 + 708: 1e721000 fmov d0, #-4.000000000000000000e+00 + 70c: 1e723000 fmov d0, #-4.250000000000000000e+00 + 710: 1e741000 fmov d0, #-8.000000000000000000e+00 + 714: 1e743000 fmov d0, #-8.500000000000000000e+00 + 718: 1e761000 fmov d0, #-1.600000000000000000e+01 + 71c: 1e763000 fmov d0, #-1.700000000000000000e+01 + 720: 1e781000 fmov d0, #-1.250000000000000000e-01 + 724: 1e783000 fmov d0, #-1.328125000000000000e-01 + 728: 1e7a1000 fmov d0, #-2.500000000000000000e-01 + 72c: 1e7a3000 fmov d0, #-2.656250000000000000e-01 + 730: 1e7c1000 fmov d0, #-5.000000000000000000e-01 + 734: 1e7c3000 fmov d0, #-5.312500000000000000e-01 + 738: 1e7e1000 fmov d0, #-1.000000000000000000e+00 + 73c: 1e7e3000 fmov d0, #-1.062500000000000000e+00 + 740: f8358305 swp x21, x5, [x24] + 744: f82d01ed ldadd x13, x13, [x15] + 748: f8361353 ldclr x22, x19, [x26] + 74c: f839234a ldeor x25, x10, [x26] + 750: f82531fb ldset x5, x27, [x15] + 754: f8335165 ldsmin x19, x5, [x11] + 758: f83a4080 ldsmax x26, x0, [x4] + 75c: f83673d7 ldumin x22, x23, [x30] + 760: f832611c ldumax x18, x28, [x8] + 764: f8ad837d swpa x13, x29, [x27] + 768: f8ab01a5 ldadda x11, x5, [x13] + 76c: f8a112b8 ldclra x1, x24, [x21] + 770: f8bb2311 ldeora x27, x17, [x24] + 774: f8b230be ldseta x18, x30, [x5] + 778: f8a75336 ldsmina x7, x22, [x25] + 77c: f8a4427a ldsmaxa x4, x26, [x19] + 780: f8a6707e ldumina x6, x30, [x3] + 784: f8b860b7 ldumaxa x24, x23, [x5] + 788: f8f88392 swpal x24, x18, [x28] + 78c: f8f300ff ldaddal x19, xzr, [x7] + 790: f8ed1386 ldclral x13, x6, [x28] + 794: f8e822af ldeoral x8, x15, [x21] + 798: f8e2302d ldsetal x2, x13, [x1] + 79c: f8f1533d ldsminal x17, x29, [x25] + 7a0: f8f941d2 ldsmaxal x25, x18, [x14] + 7a4: f8ff7366 lduminal xzr, x6, [x27] + 7a8: f8f061e5 ldumaxal x16, x5, [x15] + 7ac: f86b8072 swpl x11, x18, [x3] + 7b0: f87a0054 ldaddl x26, x20, [x2] + 7b4: f86b1164 ldclrl x11, x4, [x11] + 7b8: f87e22f3 ldeorl x30, x19, [x23] + 7bc: f86331cf ldsetl x3, x15, [x14] + 7c0: f87e5296 ldsminl x30, x22, [x20] + 7c4: f8674305 ldsmaxl x7, x5, [x24] + 7c8: f87771f0 lduminl x23, x16, [x15] + 7cc: f86b6013 ldumaxl x11, x19, [x0] + 7d0: b83c803c swp w28, w28, [x1] + 7d4: b82b0195 ldadd w11, w21, [x12] + 7d8: b83d1240 ldclr w29, w0, [x18] + 7dc: b8252320 ldeor w5, w0, [x25] + 7e0: b82e3340 ldset w14, w0, [x26] + 7e4: b83c53b2 ldsmin w28, w18, [x29] + 7e8: b82f43a1 ldsmax w15, w1, [x29] + 7ec: b828739a ldumin w8, w26, [x28] + 7f0: b831608e ldumax w17, w14, [x4] + 7f4: b8b88039 swpa w24, w25, [x1] + 7f8: b8aa0231 ldadda w10, w17, [x17] + 7fc: b8bd12b4 ldclra w29, w20, [x21] + 800: b8bd2189 ldeora w29, w9, [x12] + 804: b8ab30a6 ldseta w11, w6, [x5] + 808: b8b552a7 ldsmina w21, w7, [x21] + 80c: b8aa4197 ldsmaxa w10, w23, [x12] + 810: b8b57145 ldumina w21, w5, [x10] + 814: b8be6254 ldumaxa w30, w20, [x18] + 818: b8ed80b7 swpal w13, w23, [x5] + 81c: b8ef00b8 ldaddal w15, w24, [x5] + 820: b8e9132a ldclral w9, w10, [x25] + 824: b8f42231 ldeoral w20, w17, [x17] + 828: b8ec33d2 ldsetal w12, w18, [x30] + 82c: b8e35323 ldsminal w3, w3, [x25] + 830: b8fa4159 ldsmaxal w26, w25, [x10] + 834: b8e273eb lduminal w2, w11, [sp] + 838: b8e760a2 ldumaxal w7, w2, [x5] + 83c: b8608287 swpl w0, w7, [x20] + 840: b865005f staddl w5, [x2] + 844: b87b1379 ldclrl w27, w25, [x27] + 848: b87e2358 ldeorl w30, w24, [x26] + 84c: b86f32c2 ldsetl w15, w2, [x22] + 850: b86053e3 ldsminl w0, w3, [sp] + 854: b86f4154 ldsmaxl w15, w20, [x10] + 858: b87671d5 lduminl w22, w21, [x14] + 85c: b866605e ldumaxl w6, w30, [x2] */ static const unsigned int insns[] = { - 0x8b0772d3, 0xcb4a3570, 0xab9c09bb, 0xeb9aa794, - 0x0b934e68, 0x4b0a3924, 0x2b1e3568, 0x6b132720, - 0x8a154c14, 0xaa1445d5, 0xca01cf99, 0xea8b3f6a, - 0x0a8c5cb9, 0x2a4a11d2, 0x4a855aa4, 0x6a857415, - 0x8aa697da, 0xaa6d7423, 0xca29bf80, 0xea3cb8bd, - 0x0a675249, 0x2ab961ba, 0x4a331899, 0x6a646345, - 0x11055267, 0x31064408, 0x51028e9d, 0x710bdee8, - 0x91082d81, 0xb106a962, 0xd10b33ae, 0xf10918ab, - 0x121102d7, 0x3204cd44, 0x5204cf00, 0x72099fb3, - 0x92729545, 0xb20e37cc, 0xd27c34be, 0xf27e4efa, - 0x14000000, 0x17ffffd7, 0x1400017f, 0x94000000, - 0x97ffffd4, 0x9400017c, 0x3400000c, 0x34fffa2c, - 0x34002f2c, 0x35000014, 0x35fff9d4, 0x35002ed4, - 0xb400000c, 0xb4fff96c, 0xb4002e6c, 0xb5000018, - 0xb5fff918, 0xb5002e18, 0x10000006, 0x10fff8a6, - 0x10002da6, 0x90000015, 0x36080001, 0x360ff821, - 0x36082d21, 0x37480008, 0x374ff7c8, 0x37482cc8, - 0x128b50ec, 0x52a9ff8b, 0x7281d095, 0x92edfebd, - 0xd28361e3, 0xf2a4cc96, 0x9346590c, 0x33194f33, - 0x531d3d89, 0x9350433c, 0xb34464ac, 0xd3462140, - 0x139a61a4, 0x93d87fd7, 0x54000000, 0x54fff5a0, - 0x54002aa0, 0x54000001, 0x54fff541, 0x54002a41, - 0x54000002, 0x54fff4e2, 0x540029e2, 0x54000002, - 0x54fff482, 0x54002982, 0x54000003, 0x54fff423, - 0x54002923, 0x54000003, 0x54fff3c3, 0x540028c3, - 0x54000004, 0x54fff364, 0x54002864, 0x54000005, - 0x54fff305, 0x54002805, 0x54000006, 0x54fff2a6, - 0x540027a6, 0x54000007, 0x54fff247, 0x54002747, - 0x54000008, 0x54fff1e8, 0x540026e8, 0x54000009, - 0x54fff189, 0x54002689, 0x5400000a, 0x54fff12a, - 0x5400262a, 0x5400000b, 0x54fff0cb, 0x540025cb, - 0x5400000c, 0x54fff06c, 0x5400256c, 0x5400000d, - 0x54fff00d, 0x5400250d, 0x5400000e, 0x54ffefae, - 0x540024ae, 0x5400000f, 0x54ffef4f, 0x5400244f, - 0xd4063721, 0xd4035082, 0xd400bfe3, 0xd4282fc0, - 0xd444c320, 0xd503201f, 0xd69f03e0, 0xd6bf03e0, - 0xd5033fdf, 0xd5033f9f, 0xd5033abf, 0xd61f0040, - 0xd63f00a0, 0xc8147c55, 0xc805fcfd, 0xc85f7e05, - 0xc85fffbb, 0xc89fffa0, 0xc8dfff95, 0x88157cf8, - 0x8815ff9a, 0x885f7cd5, 0x885fffcf, 0x889ffc73, - 0x88dffc56, 0x48127c0f, 0x480bff85, 0x485f7cdd, - 0x485ffcf2, 0x489fff99, 0x48dffe62, 0x080a7c3e, - 0x0814fed5, 0x085f7c59, 0x085ffcb8, 0x089ffc70, - 0x08dfffb6, 0xc87f0a68, 0xc87fcdc7, 0xc82870bb, - 0xc825b8c8, 0x887f12d9, 0x887fb9ed, 0x8834215a, - 0x8837ca52, 0xf806317e, 0xb81b3337, 0x39000dc2, - 0x78005149, 0xf84391f4, 0xb85b220c, 0x385fd356, - 0x785d127e, 0x389f4149, 0x79801e3c, 0x79c014a3, - 0xb89a5231, 0xfc5ef282, 0xbc5f60f6, 0xfc12125e, - 0xbc0152cd, 0xf8190e49, 0xb800befd, 0x381ffd92, - 0x781e9e90, 0xf8409fa3, 0xb8413c79, 0x385fffa1, - 0x785c7fa8, 0x389f3dc5, 0x78801f6a, 0x78c19d4b, - 0xb89a4ec4, 0xfc408eeb, 0xbc436e79, 0xfc152ce1, - 0xbc036f28, 0xf8025565, 0xb80135f8, 0x381ff74f, - 0x781fa652, 0xf851a447, 0xb85e557b, 0x385e7472, - 0x785e070a, 0x38804556, 0x78819591, 0x78dc24e8, - 0xb89cd6d7, 0xfc430738, 0xbc5f6595, 0xfc1225b2, - 0xbc1d7430, 0xf82fcac2, 0xb83d6a02, 0x382e5a54, - 0x7834fa66, 0xf86ecbae, 0xb86cda90, 0x3860d989, - 0x78637a2c, 0x38a3fa22, 0x78b15827, 0x78f2d9f9, - 0xb8ac6ab7, 0xfc6879a5, 0xbc767943, 0xfc3bc84e, - 0xbc3968d4, 0xf91fc0fe, 0xb91da50f, 0x391d280b, - 0x791d2e23, 0xf95bc8e2, 0xb95ce525, 0x395ae53c, - 0x795c9282, 0x399d7dd6, 0x799fe008, 0x79de9bc0, - 0xb99aae78, 0xfd597598, 0xbd5d1d08, 0xfd1f3dea, - 0xbd1a227a, 0x5800148a, 0x18000003, 0xf88092e0, - 0xd8ffdf00, 0xf8a84860, 0xf99d7560, 0x1a1c012d, - 0x3a1c027b, 0x5a060253, 0x7a03028e, 0x9a0801d0, - 0xba0803a0, 0xda140308, 0xfa00038c, 0x0b3010d7, - 0x2b37ab39, 0xcb2466da, 0x6b33efb1, 0x8b350fcb, - 0xab208a70, 0xcb39e52b, 0xeb2c9291, 0x3a4bd1a3, - 0x7a4c81a2, 0xba42106c, 0xfa5560e3, 0x3a4e3844, - 0x7a515a26, 0xba4c2940, 0xfa52aaae, 0x1a8cc1b5, - 0x1a8f976a, 0x5a8981a0, 0x5a9a6492, 0x9a8793ac, - 0x9a9474e6, 0xda83d2b6, 0xda9b9593, 0x5ac00200, - 0x5ac006f1, 0x5ac009d1, 0x5ac013d8, 0x5ac016d8, - 0xdac00223, 0xdac005ac, 0xdac00ac9, 0xdac00c00, - 0xdac01205, 0xdac016d9, 0x1ac0089d, 0x1add0fa0, - 0x1ad52225, 0x1ad22529, 0x1ac82b61, 0x1acd2e92, - 0x9acc0b28, 0x9adc0ca7, 0x9adb2225, 0x9ad42757, - 0x9adc291c, 0x9ac42fa3, 0x1b1a55d1, 0x1b0bafc1, - 0x9b067221, 0x9b1ea0de, 0x9b2e20d5, 0x9b38cd4a, - 0x9bae6254, 0x9ba59452, 0x1e2d0a48, 0x1e3c19c2, - 0x1e3c298f, 0x1e213980, 0x1e240baf, 0x1e77082c, - 0x1e72191b, 0x1e6b2a97, 0x1e723988, 0x1e770b1a, - 0x1f0d66f5, 0x1f01b956, 0x1f227a8e, 0x1f365ba7, - 0x1f4f14ad, 0x1f45a98e, 0x1f60066a, 0x1f620054, - 0x1e204139, 0x1e20c094, 0x1e214363, 0x1e21c041, - 0x1e22c01e, 0x1e60408c, 0x1e60c361, 0x1e6142c8, - 0x1e61c16b, 0x1e624396, 0x1e3802dc, 0x9e380374, - 0x1e78000e, 0x9e78017a, 0x1e2202dc, 0x9e220150, - 0x1e6202a8, 0x9e620395, 0x1e260318, 0x9e660268, - 0x1e270188, 0x9e6700e6, 0x1e3023c0, 0x1e6b2320, - 0x1e202168, 0x1e602168, 0x2910323d, 0x297449d6, - 0x6948402b, 0xa9072f40, 0xa9410747, 0x29801f0a, - 0x29e07307, 0x69e272b9, 0xa9bf49d4, 0xa9c529a8, - 0x28b0605a, 0x28e866a2, 0x68ee0ab1, 0xa886296c, - 0xa8fe1a38, 0x282479c3, 0x286e534f, 0xa8386596, - 0xa8755a3b, 0x1e601000, 0x1e603000, 0x1e621000, - 0x1e623000, 0x1e641000, 0x1e643000, 0x1e661000, - 0x1e663000, 0x1e681000, 0x1e683000, 0x1e6a1000, - 0x1e6a3000, 0x1e6c1000, 0x1e6c3000, 0x1e6e1000, - 0x1e6e3000, 0x1e701000, 0x1e703000, 0x1e721000, - 0x1e723000, 0x1e741000, 0x1e743000, 0x1e761000, - 0x1e763000, 0x1e781000, 0x1e783000, 0x1e7a1000, - 0x1e7a3000, 0x1e7c1000, 0x1e7c3000, 0x1e7e1000, - 0x1e7e3000, + 0x8b50798f, 0xcb4381e1, 0xab05372d, 0xeb864796, + 0x0b961920, 0x4b195473, 0x2b0b5264, 0x6b9300f8, + 0x8a0bc0fe, 0xaa0f3118, 0xca170531, 0xea44dd6e, + 0x0a4c44f3, 0x2a8b7373, 0x4a567c7e, 0x6a9c0353, + 0x8a3accdd, 0xaa318f7a, 0xca2e1495, 0xeaa015e2, + 0x0a2274e2, 0x2a751598, 0x4a3309fe, 0x6ab172fe, + 0x110a5284, 0x310b1942, 0x5103d353, 0x710125bc, + 0x910d7bc2, 0xb108fa1b, 0xd1093536, 0xf10ae824, + 0x120e667c, 0x321f6cbb, 0x520f6a9e, 0x72136f56, + 0x927e4ce5, 0xb278b4ed, 0xd24c6527, 0xf2485803, + 0x14000000, 0x17ffffd7, 0x140001ee, 0x94000000, + 0x97ffffd4, 0x940001eb, 0x34000010, 0x34fffa30, + 0x34003d10, 0x35000013, 0x35fff9d3, 0x35003cb3, + 0xb4000005, 0xb4fff965, 0xb4003c45, 0xb5000004, + 0xb5fff904, 0xb5003be4, 0x1000001b, 0x10fff8bb, + 0x10003b9b, 0x90000010, 0x3640001c, 0x3647f83c, + 0x36403b1c, 0x37080001, 0x370ff7c1, 0x37083aa1, + 0x12a437f4, 0x528c9d67, 0x72838bb1, 0x92c1062e, + 0xd287da49, 0xf2a6d153, 0x93465ac9, 0x330b0013, + 0x530b4e6a, 0x934545e4, 0xb35370a3, 0xd3510b8c, + 0x13960c0f, 0x93ceddc6, 0x54000000, 0x54fff5a0, + 0x54003880, 0x54000001, 0x54fff541, 0x54003821, + 0x54000002, 0x54fff4e2, 0x540037c2, 0x54000002, + 0x54fff482, 0x54003762, 0x54000003, 0x54fff423, + 0x54003703, 0x54000003, 0x54fff3c3, 0x540036a3, + 0x54000004, 0x54fff364, 0x54003644, 0x54000005, + 0x54fff305, 0x540035e5, 0x54000006, 0x54fff2a6, + 0x54003586, 0x54000007, 0x54fff247, 0x54003527, + 0x54000008, 0x54fff1e8, 0x540034c8, 0x54000009, + 0x54fff189, 0x54003469, 0x5400000a, 0x54fff12a, + 0x5400340a, 0x5400000b, 0x54fff0cb, 0x540033ab, + 0x5400000c, 0x54fff06c, 0x5400334c, 0x5400000d, + 0x54fff00d, 0x540032ed, 0x5400000e, 0x54ffefae, + 0x5400328e, 0x5400000f, 0x54ffef4f, 0x5400322f, + 0xd40ac601, 0xd40042a2, 0xd404dac3, 0xd4224d40, + 0xd44219c0, 0xd503201f, 0xd69f03e0, 0xd6bf03e0, + 0xd5033fdf, 0xd503339f, 0xd50335bf, 0xd61f0280, + 0xd63f0040, 0xc8127c17, 0xc81efec5, 0xc85f7d05, + 0xc85ffe14, 0xc89ffd66, 0xc8dfff66, 0x880a7cb1, + 0x8816fd89, 0x885f7d1b, 0x885ffc57, 0x889fffba, + 0x88dffd4d, 0x48197f7c, 0x481dfd96, 0x485f7f96, + 0x485fffc3, 0x489ffdf8, 0x48dfff5b, 0x080b7e6a, + 0x0817fedb, 0x085f7e18, 0x085ffc38, 0x089fffa5, + 0x08dffe18, 0xc87f6239, 0xc87fb276, 0xc820573a, + 0xc821aca6, 0x887f388d, 0x887f88d1, 0x882f2643, + 0x88329131, 0xf81cf2b7, 0xb803f055, 0x39002f9b, + 0x781f31fd, 0xf85d33ce, 0xb843539d, 0x39401f54, + 0x785ce059, 0x389f1143, 0x788131ee, 0x78dfb17d, + 0xb89b90af, 0xfc403193, 0xbc42a36c, 0xfc07d396, + 0xbc1ec1f8, 0xf81e8f88, 0xb8025de6, 0x38007c27, + 0x7801ee20, 0xf8454fb9, 0xb85cce9a, 0x385e7fba, + 0x7841af24, 0x389ebd1c, 0x789fadd1, 0x78c0aefc, + 0xb89c0f7e, 0xfc50efd4, 0xbc414f71, 0xfc011c67, + 0xbc1f0d6d, 0xf81c3526, 0xb81e34b0, 0x3800f7bd, + 0x78012684, 0xf842e653, 0xb8417456, 0x385e2467, + 0x785e358b, 0x389e34c8, 0x788046f8, 0x78c00611, + 0xb89f8680, 0xfc582454, 0xbc5987d3, 0xfc076624, + 0xbc190675, 0xf833785a, 0xb82fd809, 0x3821799a, + 0x782a7975, 0xf870eaf0, 0xb871d96a, 0x386b7aed, + 0x7875689b, 0x38afd91a, 0x78a2c955, 0x78ee6bc8, + 0xb8b4f9dd, 0xfc76eb7e, 0xbc76692d, 0xfc31db28, + 0xbc255b01, 0xf91c52aa, 0xb91c3fb2, 0x391f8877, + 0x791ac97c, 0xf95c1758, 0xb95b3c55, 0x395ce0a4, + 0x795851ce, 0x399e9f64, 0x79993764, 0x79d9af8a, + 0xb99eea2a, 0xfd5a2f8d, 0xbd5dac78, 0xfd1e0182, + 0xbd195c31, 0x58000010, 0x1800000d, 0xf8981240, + 0xd8ffdf00, 0xf8a27a80, 0xf99af920, 0x1a0202e8, + 0x3a130078, 0x5a1d0316, 0x7a03036c, 0x9a0102eb, + 0xba1700bd, 0xda0c0329, 0xfa16000c, 0x0b23459a, + 0x2b328a14, 0xcb274bde, 0x6b222eab, 0x8b214b42, + 0xab34a7b2, 0xcb24520e, 0xeb378e20, 0x3a565283, + 0x7a420321, 0xba58c247, 0xfa4d5106, 0x3a426924, + 0x7a5b0847, 0xba413a02, 0xfa5fba23, 0x1a979377, + 0x1a86640a, 0x5a89300b, 0x5a923771, 0x9a8b720c, + 0x9a868786, 0xda9a736d, 0xda9256dd, 0x5ac0026c, + 0x5ac00657, 0x5ac00b89, 0x5ac01262, 0x5ac017b9, + 0xdac002e4, 0xdac0065d, 0xdac00907, 0xdac00e2d, + 0xdac01011, 0xdac01752, 0x1ad0098b, 0x1ac70d24, + 0x1ad020ec, 0x1ad72613, 0x1ac62887, 0x1ad72e95, + 0x9adc0990, 0x9acd0d84, 0x9ac721a9, 0x9acf277c, + 0x9ace2bd4, 0x9ade2e4e, 0x9bc77d63, 0x9b587e97, + 0x1b1524a2, 0x1b04a318, 0x9b0f4d8b, 0x9b0ce73d, + 0x9b2c5971, 0x9b34c87c, 0x9bbc6887, 0x9bb19556, + 0x1e310871, 0x1e261a2b, 0x1e2928fd, 0x1e333987, + 0x1e230ae0, 0x1e75087a, 0x1e651a60, 0x1e692b40, + 0x1e753ab9, 0x1e7309b0, 0x1f00425d, 0x1f1d95b7, + 0x1f2a38e9, 0x1f2f5f99, 0x1f5545a6, 0x1f429ea3, + 0x1f65472a, 0x1f7449ce, 0x1e20404f, 0x1e20c0f2, + 0x1e2140c3, 0x1e21c02c, 0x1e22c009, 0x1e6040a4, + 0x1e60c1e3, 0x1e614331, 0x1e61c30c, 0x1e6240b5, + 0x1e3802a4, 0x9e38007b, 0x1e78011d, 0x9e7802a9, + 0x1e2203b4, 0x9e220107, 0x1e6202ac, 0x9e6202b0, + 0x1e2600b2, 0x9e660119, 0x1e270352, 0x9e670160, + 0x1e262200, 0x1e7d2200, 0x1e2023c8, 0x1e602128, + 0x293e119b, 0x294a2543, 0x69480c70, 0xa934726a, + 0xa97448f3, 0x298243ca, 0x29e21242, 0x69c64db8, + 0xa9800311, 0xa9f4686e, 0x288a0416, 0x28fe2812, + 0x68fe62d8, 0xa885308c, 0xa8f12664, 0x282468d2, + 0x284e5035, 0xa8327699, 0xa84716e1, 0x0c407284, + 0x4cdfa158, 0x0ccf6cd8, 0x4cdf2483, 0x0d40c0c2, + 0x4ddfc9cd, 0x0dd8ceaf, 0x4c408ea9, 0x0cdf86bd, + 0x4d60c1c8, 0x0dffca87, 0x4de3cc7c, 0x4cdd497b, + 0x0c404950, 0x4d40e595, 0x4ddfeba4, 0x0dd3ed38, + 0x4cdf046a, 0x0cc9039b, 0x0d60e3d5, 0x0dffe5d7, + 0x0df4e9a4, 0xba5fd3e3, 0x3a5f03e5, 0xfa411be4, + 0x7a42cbe2, 0x93df03ff, 0xc820ffff, 0x8822fc7f, + 0xc8247cbf, 0x88267fff, 0x4e010fe0, 0x4e081fe1, + 0x4e0c1fe1, 0x4e0a1fe1, 0x4e071fe1, 0x4cc0ac3f, + 0x1e601000, 0x1e603000, 0x1e621000, 0x1e623000, + 0x1e641000, 0x1e643000, 0x1e661000, 0x1e663000, + 0x1e681000, 0x1e683000, 0x1e6a1000, 0x1e6a3000, + 0x1e6c1000, 0x1e6c3000, 0x1e6e1000, 0x1e6e3000, + 0x1e701000, 0x1e703000, 0x1e721000, 0x1e723000, + 0x1e741000, 0x1e743000, 0x1e761000, 0x1e763000, + 0x1e781000, 0x1e783000, 0x1e7a1000, 0x1e7a3000, + 0x1e7c1000, 0x1e7c3000, 0x1e7e1000, 0x1e7e3000, + 0xf8358305, 0xf82d01ed, 0xf8361353, 0xf839234a, + 0xf82531fb, 0xf8335165, 0xf83a4080, 0xf83673d7, + 0xf832611c, 0xf8ad837d, 0xf8ab01a5, 0xf8a112b8, + 0xf8bb2311, 0xf8b230be, 0xf8a75336, 0xf8a4427a, + 0xf8a6707e, 0xf8b860b7, 0xf8f88392, 0xf8f300ff, + 0xf8ed1386, 0xf8e822af, 0xf8e2302d, 0xf8f1533d, + 0xf8f941d2, 0xf8ff7366, 0xf8f061e5, 0xf86b8072, + 0xf87a0054, 0xf86b1164, 0xf87e22f3, 0xf86331cf, + 0xf87e5296, 0xf8674305, 0xf87771f0, 0xf86b6013, + 0xb83c803c, 0xb82b0195, 0xb83d1240, 0xb8252320, + 0xb82e3340, 0xb83c53b2, 0xb82f43a1, 0xb828739a, + 0xb831608e, 0xb8b88039, 0xb8aa0231, 0xb8bd12b4, + 0xb8bd2189, 0xb8ab30a6, 0xb8b552a7, 0xb8aa4197, + 0xb8b57145, 0xb8be6254, 0xb8ed80b7, 0xb8ef00b8, + 0xb8e9132a, 0xb8f42231, 0xb8ec33d2, 0xb8e35323, + 0xb8fa4159, 0xb8e273eb, 0xb8e760a2, 0xb8608287, + 0xb865005f, 0xb87b1379, 0xb87e2358, 0xb86f32c2, + 0xb86053e3, 0xb86f4154, 0xb87671d5, 0xb866605e, + }; // END Generated code -- do not edit diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 9788931d4e1..3bb620d52e0 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -306,10 +306,12 @@ public: }; class Post : public PrePost { Register _idx; + bool _is_postreg; public: - Post(Register reg, int o) : PrePost(reg, o) { _idx = NULL; } - Post(Register reg, Register idx) : PrePost(reg, 0) { _idx = idx; } + Post(Register reg, int o) : PrePost(reg, o) { _idx = NULL; _is_postreg = false; } + Post(Register reg, Register idx) : PrePost(reg, 0) { _idx = idx; _is_postreg = true; } Register idx_reg() { return _idx; } + bool is_postreg() {return _is_postreg; } }; namespace ext @@ -393,7 +395,7 @@ class Address { : _base(p.reg()), _offset(p.offset()), _mode(pre) { } Address(Post p) : _base(p.reg()), _index(p.idx_reg()), _offset(p.offset()), - _mode(p.idx_reg() == NULL ? post : post_reg), _target(0) { } + _mode(p.is_postreg() ? post_reg : post), _target(0) { } Address(address target, RelocationHolder const& rspec) : _mode(literal), _rspec(rspec), @@ -807,32 +809,34 @@ public: #undef INSN // Bitfield -#define INSN(NAME, opcode) \ +#define INSN(NAME, opcode, size) \ void NAME(Register Rd, Register Rn, unsigned immr, unsigned imms) { \ starti; \ + guarantee(size == 1 || (immr < 32 && imms < 32), "incorrect immr/imms");\ f(opcode, 31, 22), f(immr, 21, 16), f(imms, 15, 10); \ zrf(Rn, 5), rf(Rd, 0); \ } - INSN(sbfmw, 0b0001001100); - INSN(bfmw, 0b0011001100); - INSN(ubfmw, 0b0101001100); - INSN(sbfm, 0b1001001101); - INSN(bfm, 0b1011001101); - INSN(ubfm, 0b1101001101); + INSN(sbfmw, 0b0001001100, 0); + INSN(bfmw, 0b0011001100, 0); + INSN(ubfmw, 0b0101001100, 0); + INSN(sbfm, 0b1001001101, 1); + INSN(bfm, 0b1011001101, 1); + INSN(ubfm, 0b1101001101, 1); #undef INSN // Extract -#define INSN(NAME, opcode) \ +#define INSN(NAME, opcode, size) \ void NAME(Register Rd, Register Rn, Register Rm, unsigned imms) { \ starti; \ + guarantee(size == 1 || imms < 32, "incorrect imms"); \ f(opcode, 31, 21), f(imms, 15, 10); \ - rf(Rm, 16), rf(Rn, 5), rf(Rd, 0); \ + zrf(Rm, 16), zrf(Rn, 5), zrf(Rd, 0); \ } - INSN(extrw, 0b00010011100); - INSN(extr, 0b10010011110); + INSN(extrw, 0b00010011100, 0); + INSN(extr, 0b10010011110, 1); #undef INSN @@ -1126,7 +1130,7 @@ public: Register Rn, enum operand_size sz, int op, bool ordered) { starti; f(sz, 31, 30), f(0b001000, 29, 24), f(op, 23, 21); - rf(Rs, 16), f(ordered, 15), rf(Rt2, 10), srf(Rn, 5), zrf(Rt1, 0); + rf(Rs, 16), f(ordered, 15), zrf(Rt2, 10), srf(Rn, 5), zrf(Rt1, 0); } void load_exclusive(Register dst, Register addr, @@ -1255,7 +1259,7 @@ public: enum operand_size sz, int op1, int op2, bool a, bool r) { starti; f(sz, 31, 30), f(0b111000, 29, 24), f(a, 23), f(r, 22), f(1, 21); - rf(Rs, 16), f(op1, 15), f(op2, 14, 12), f(0, 11, 10), srf(Rn, 5), zrf(Rt, 0); + zrf(Rs, 16), f(op1, 15), f(op2, 14, 12), f(0, 11, 10), srf(Rn, 5), zrf(Rt, 0); } #define INSN(NAME, NAME_A, NAME_L, NAME_AL, op1, op2) \ @@ -1477,6 +1481,7 @@ public: void NAME(Register Rd, Register Rn, Register Rm, \ enum shift_kind kind = LSL, unsigned shift = 0) { \ starti; \ + guarantee(size == 1 || shift < 32, "incorrect shift"); \ f(N, 21); \ zrf(Rm, 16), zrf(Rn, 5), zrf(Rd, 0); \ op_shifted_reg(0b01010, kind, shift, size, op); \ @@ -1539,6 +1544,7 @@ void mvnw(Register Rd, Register Rm, starti; \ f(0, 21); \ assert_cond(kind != ROR); \ + guarantee(size == 1 || shift < 32, "incorrect shift");\ zrf(Rd, 0), zrf(Rn, 5), zrf(Rm, 16); \ op_shifted_reg(0b01011, kind, shift, size, op); \ } @@ -1567,7 +1573,7 @@ void mvnw(Register Rd, Register Rm, void add_sub_extended_reg(unsigned op, unsigned decode, Register Rd, Register Rn, Register Rm, unsigned opt, ext::operation option, unsigned imm) { - guarantee(imm <= 4, "shift amount must be < 4"); + guarantee(imm <= 4, "shift amount must be <= 4"); f(op, 31, 29), f(decode, 28, 24), f(opt, 23, 22), f(1, 21); f(option, 15, 13), f(imm, 12, 10); } @@ -1652,7 +1658,7 @@ void mvnw(Register Rd, Register Rm, f(o2, 10); f(o3, 4); f(nzcv, 3, 0); - f(imm5, 20, 16), rf(Rn, 5); + f(imm5, 20, 16), zrf(Rn, 5); } #define INSN(NAME, op) \ @@ -2121,7 +2127,12 @@ public: } void ld_st(FloatRegister Vt, SIMD_Arrangement T, Register Xn, int imm, int op1, int op2, int regs) { - guarantee(T <= T1Q && imm == SIMD_Size_in_bytes[T] * regs, "bad offset"); + + bool replicate = op2 >> 2 == 3; + // post-index value (imm) is formed differently for replicate/non-replicate ld* instructions + int expectedImmediate = replicate ? regs * (1 << (T >> 1)) : SIMD_Size_in_bytes[T] * regs; + guarantee(T < T1Q , "incorrect arrangement"); + guarantee(imm == expectedImmediate, "bad offset"); starti; f(0,31), f((int)T & 1, 30); f(op1 | 0b100, 29, 21), f(0b11111, 20, 16), f(op2, 15, 12); @@ -2228,42 +2239,47 @@ public: #undef INSN -#define INSN(NAME, opc, opc2) \ +#define INSN(NAME, opc, opc2, acceptT2D) \ void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm) { \ + guarantee(T != T1Q && T != T1D, "incorrect arrangement"); \ + if (!acceptT2D) guarantee(T != T2D, "incorrect arrangement"); \ starti; \ f(0, 31), f((int)T & 1, 30), f(opc, 29), f(0b01110, 28, 24); \ f((int)T >> 1, 23, 22), f(1, 21), rf(Vm, 16), f(opc2, 15, 10); \ rf(Vn, 5), rf(Vd, 0); \ } - INSN(addv, 0, 0b100001); - INSN(subv, 1, 0b100001); - INSN(mulv, 0, 0b100111); - INSN(mlav, 0, 0b100101); - INSN(mlsv, 1, 0b100101); - INSN(sshl, 0, 0b010001); - INSN(ushl, 1, 0b010001); - INSN(umullv, 1, 0b110000); - INSN(umlalv, 1, 0b100000); + INSN(addv, 0, 0b100001, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D + INSN(subv, 1, 0b100001, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D + INSN(mulv, 0, 0b100111, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S + INSN(mlav, 0, 0b100101, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S + INSN(mlsv, 1, 0b100101, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S + INSN(sshl, 0, 0b010001, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D + INSN(ushl, 1, 0b010001, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D + INSN(umullv, 1, 0b110000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S + INSN(umlalv, 1, 0b100000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S #undef INSN -#define INSN(NAME, opc, opc2) \ +#define INSN(NAME, opc, opc2, accepted) \ void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn) { \ + guarantee(T != T1Q && T != T1D, "incorrect arrangement"); \ + if (accepted < 2) guarantee(T != T2S && T != T2D, "incorrect arrangement"); \ + if (accepted == 0) guarantee(T == T8B || T == T16B, "incorrect arrangement"); \ starti; \ f(0, 31), f((int)T & 1, 30), f(opc, 29), f(0b01110, 28, 24); \ f((int)T >> 1, 23, 22), f(opc2, 21, 10); \ rf(Vn, 5), rf(Vd, 0); \ } - INSN(absr, 0, 0b100000101110); - INSN(negr, 1, 0b100000101110); - INSN(notr, 1, 0b100000010110); - INSN(addv, 0, 0b110001101110); - INSN(cls, 0, 0b100000010010); - INSN(clz, 1, 0b100000010010); - INSN(cnt, 0, 0b100000010110); - INSN(uaddlv, 1, 0b110000001110); + INSN(absr, 0, 0b100000101110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S + INSN(negr, 1, 0b100000101110, 2); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D + INSN(notr, 1, 0b100000010110, 0); // accepted arrangements: T8B, T16B + INSN(addv, 0, 0b110001101110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S + INSN(cls, 0, 0b100000010010, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S + INSN(clz, 1, 0b100000010010, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S + INSN(cnt, 0, 0b100000010110, 0); // accepted arrangements: T8B, T16B + INSN(uaddlv, 1, 0b110000001110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S #undef INSN @@ -2287,7 +2303,7 @@ public: starti; \ assert(lsl == 0 || \ ((T == T4H || T == T8H) && lsl == 8) || \ - ((T == T2S || T == T4S) && ((lsl >> 3) < 4)), "invalid shift"); \ + ((T == T2S || T == T4S) && ((lsl >> 3) < 4) && ((lsl & 7) == 0)), "invalid shift");\ cmode |= lsl >> 2; \ if (T == T4H || T == T8H) cmode |= 0b1000; \ if (!(T == T4H || T == T8H || T == T2S || T == T4S)) { \ @@ -2448,7 +2464,8 @@ public: #undef INSN - void ushll(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) { +private: + void _ushll(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) { starti; /* The encodings for the immh:immb fields (bits 22:16) are * 0001 xxx 8H, 8B/16b shift = xxx @@ -2461,8 +2478,16 @@ public: f(0, 31), f(Tb & 1, 30), f(0b1011110, 29, 23), f((1 << ((Tb>>1)+3))|shift, 22, 16); f(0b101001, 15, 10), rf(Vn, 5), rf(Vd, 0); } + +public: + void ushll(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) { + assert(Tb == T8B || Tb == T4H || Tb == T2S, "invalid arrangement"); + _ushll(Vd, Ta, Vn, Tb, shift); + } + void ushll2(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) { - ushll(Vd, Ta, Vn, Tb, shift); + assert(Tb == T16B || Tb == T8H || Tb == T4S, "invalid arrangement"); + _ushll(Vd, Ta, Vn, Tb, shift); } // Move from general purpose register @@ -2470,19 +2495,21 @@ public: void mov(FloatRegister Vd, SIMD_Arrangement T, int index, Register Xn) { starti; f(0b01001110000, 31, 21), f(((1 << (T >> 1)) | (index << ((T >> 1) + 1))), 20, 16); - f(0b000111, 15, 10), rf(Xn, 5), rf(Vd, 0); + f(0b000111, 15, 10), zrf(Xn, 5), rf(Vd, 0); } // Move to general purpose register // mov Rd, Vn.T[index] void mov(Register Xd, FloatRegister Vn, SIMD_Arrangement T, int index) { + guarantee(T >= T2S && T < T1Q, "only D and S arrangements are supported"); starti; f(0, 31), f((T >= T1D) ? 1:0, 30), f(0b001110000, 29, 21); f(((1 << (T >> 1)) | (index << ((T >> 1) + 1))), 20, 16); f(0b001111, 15, 10), rf(Vn, 5), rf(Xd, 0); } - void pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) { +private: + void _pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) { starti; assert((Ta == T1Q && (Tb == T1D || Tb == T2D)) || (Ta == T8H && (Tb == T8B || Tb == T16B)), "Invalid Size specifier"); @@ -2490,9 +2517,16 @@ public: f(0, 31), f(Tb & 1, 30), f(0b001110, 29, 24), f(size, 23, 22); f(1, 21), rf(Vm, 16), f(0b111000, 15, 10), rf(Vn, 5), rf(Vd, 0); } + +public: + void pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) { + assert(Tb == T1D || Tb == T8B, "pmull assumes T1D or T8B as the second size specifier"); + _pmull(Vd, Ta, Vn, Vm, Tb); + } + void pmull2(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) { assert(Tb == T2D || Tb == T16B, "pmull2 assumes T2D or T16B as the second size specifier"); - pmull(Vd, Ta, Vn, Vm, Tb); + _pmull(Vd, Ta, Vn, Vm, Tb); } void uqxtn(FloatRegister Vd, SIMD_Arrangement Tb, FloatRegister Vn, SIMD_Arrangement Ta) { @@ -2509,7 +2543,7 @@ public: starti; assert(T != T1D, "reserved encoding"); f(0,31), f((int)T & 1, 30), f(0b001110000, 29, 21); - f((1 << (T >> 1)), 20, 16), f(0b000011, 15, 10), rf(Xs, 5), rf(Vd, 0); + f((1 << (T >> 1)), 20, 16), f(0b000011, 15, 10), zrf(Xs, 5), rf(Vd, 0); } void dup(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, int index = 0) @@ -2524,6 +2558,7 @@ public: // AdvSIMD ZIP/UZP/TRN #define INSN(NAME, opcode) \ void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm) { \ + guarantee(T != T1D && T != T1Q, "invalid arrangement"); \ starti; \ f(0, 31), f(0b001110, 29, 24), f(0, 21), f(0, 15); \ f(opcode, 14, 12), f(0b10, 11, 10); \ diff --git a/src/hotspot/cpu/aarch64/register_aarch64.hpp b/src/hotspot/cpu/aarch64/register_aarch64.hpp index 1d3e3239df7..3bacd5e10fe 100644 --- a/src/hotspot/cpu/aarch64/register_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/register_aarch64.hpp @@ -136,7 +136,7 @@ class FloatRegisterImpl: public AbstractRegisterImpl { VMReg as_VMReg(); // derived registers, offsets, and addresses - FloatRegister successor() const { return as_FloatRegister(encoding() + 1); } + FloatRegister successor() const { return as_FloatRegister((encoding() + 1) % 32); } // accessors int encoding() const { assert(is_valid(), "invalid register"); return (intptr_t)this; } From 2f1b1de1e84d21429a7f69a90602aba37d0165a7 Mon Sep 17 00:00:00 2001 From: Daniil Titov Date: Mon, 10 Jun 2019 09:41:09 -0700 Subject: [PATCH 012/109] 8222828: vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004/TestDescription.java failed Reviewed-by: cjplummer, gadams, jcbeyler --- .../vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java index 9806d30f4da..50b7d24a506 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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,6 +23,7 @@ package nsk.jdi.BScenarios.multithrd; +import jdk.test.lib.Utils; import nsk.share.*; import nsk.share.jpda.*; import nsk.share.jdi.*; @@ -95,7 +96,7 @@ public class tc02x004 { ArgumentHandler argHandler = new ArgumentHandler(argv); log = new Log(out, argHandler); - waitTime = argHandler.getWaitTime() * 60000; + waitTime = Utils.adjustTimeout(argHandler.getWaitTime() * 60000); Binder binder = new Binder(argHandler, log); debugee = binder.bindToDebugee(debugeeName); @@ -114,6 +115,7 @@ public class tc02x004 { } display("Test finished. exitStatus = " + exitStatus); + debugee.endDebugee(); return exitStatus; } From 712996ae87e7f25c995d833a64594ceb5753f7f9 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Mon, 10 Jun 2019 13:42:11 -0400 Subject: [PATCH 013/109] 8225514: Shenandoah: ShenandoahCodeRoots should inherit from AllStatic Reviewed-by: shade --- src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp index 5b51426dac2..4a9ea36ba90 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved. + * Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved. * * 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 @@ -122,7 +122,7 @@ public: void possibly_parallel_blobs_do(CodeBlobClosure* f); }; -class ShenandoahCodeRoots : public CHeapObj { +class ShenandoahCodeRoots : public AllStatic { friend class ShenandoahHeap; friend class ShenandoahCodeRootsIterator; From 3c5ff8db74f572ffae5b65610d386a359622e17a Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Mon, 10 Jun 2019 15:55:11 -0700 Subject: [PATCH 014/109] 8225492: Update JVMCI Reviewed-by: iveresov, kvn --- src/hotspot/share/jvmci/jvmciRuntime.cpp | 27 ++++++++++--------- .../src/jdk/vm/ci/runtime/JVMCI.java | 2 ++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp index bcc403412d5..c22d50ca1a8 100644 --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp @@ -1339,6 +1339,18 @@ JVMCI::CodeInstallResult JVMCIRuntime::validate_compile_task_dependencies(Depend return JVMCI::dependencies_invalid; } +// Reports a pending exception and exits the VM. +static void fatal_exception_in_compile(JVMCIEnv* JVMCIENV, JavaThread* thread, const char* msg) { + // Only report a fatal JVMCI compilation exception once + static volatile int report_init_failure = 0; + if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) { + tty->print_cr("%s:", msg); + JVMCIENV->describe_pending_exception(true); + } + JVMCIENV->clear_pending_exception(); + before_exit(thread); + vm_exit(-1); +} void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, const methodHandle& method, int entry_bci) { JVMCI_EXCEPTION_CONTEXT @@ -1360,9 +1372,7 @@ void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, c HandleMark hm; JVMCIObject receiver = get_HotSpotJVMCIRuntime(JVMCIENV); if (JVMCIENV->has_pending_exception()) { - JVMCIENV->describe_pending_exception(true); - compile_state->set_failure(false, "exception getting HotSpotJVMCIRuntime object"); - return; + fatal_exception_in_compile(JVMCIENV, thread, "Exception during HotSpotJVMCIRuntime initialization"); } JVMCIObject jvmci_method = JVMCIENV->get_jvmci_method(method, JVMCIENV); if (JVMCIENV->has_pending_exception()) { @@ -1397,16 +1407,7 @@ void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, c } else { // An uncaught exception here implies failure during compiler initialization. // The only sensible thing to do here is to exit the VM. - - // Only report initialization failure once - static volatile int report_init_failure = 0; - if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) { - tty->print_cr("Exception during JVMCI compiler initialization:"); - JVMCIENV->describe_pending_exception(true); - } - JVMCIENV->clear_pending_exception(); - before_exit((JavaThread*) THREAD); - vm_exit(-1); + fatal_exception_in_compile(JVMCIENV, thread, "Exception during JVMCI compiler initialization"); } if (compiler->is_bootstrapping()) { compiler->set_bootstrap_compilation_request_handled(); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java index bd7ef10ea87..12ad2bb30d3 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java @@ -71,6 +71,8 @@ public class JVMCI { errorMessage.format("Currently used Java home directory is %s.%n", javaHome); errorMessage.format("Currently used VM configuration is: %s", vmName); throw new UnsupportedOperationException(errorMessage.toString()); + } finally { + initializing = false; } } } From ac1a11dfc640726ffc1a513baa5a14c449692bda Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 10 Jun 2019 15:53:35 -0700 Subject: [PATCH 015/109] 8225532: Update source enums to describe 12 and 13 language features Reviewed-by: jjg --- .../share/classes/javax/lang/model/SourceVersion.java | 4 ++-- .../share/classes/com/sun/tools/javac/code/Source.java | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java index 0e37c9d95bc..fd967a0b73e 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -58,8 +58,8 @@ public enum SourceVersion { * 9: modules, small cleanups to 1.7 and 1.8 changes * 10: local-variable type inference (var) * 11: local-variable syntax for lambda parameters - * 12: no changes (switch expressions in preview) - * 13: TBD + * 12: no changes (switch expressions were in preview) + * 13: no changes (switch expressions and text blocks in preview) */ /** diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java index 311bd4c7d6b..e8c0eb32d76 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -84,10 +84,13 @@ public enum Source { /** 1.11 local-variable syntax for lambda parameters */ JDK11("11"), - /** 12 covers the to be determined language features that will be added in JDK 12. */ + /** 12, no language features; switch expression were in preview */ JDK12("12"), - /** 13 covers the to be determined language features that will be added in JDK 13. */ + /** + * 13, no language features; text blocks and revised switch + * expressions in preview + */ JDK13("13"); private static final Context.Key sourceKey = new Context.Key<>(); From 6758853b547c4958cbffdb1316dd881420fa0631 Mon Sep 17 00:00:00 2001 From: Stuart Marks Date: Mon, 10 Jun 2019 17:33:11 -0700 Subject: [PATCH 016/109] 8205131: remove Runtime trace methods Reviewed-by: lancea, rriggs, iklam --- .../share/classes/java/lang/Runtime.java | 26 ------------------- .../jaxp/unittest/transform/ProcessXSLT.java | 3 --- .../CommandEnvironment/SetChildEnv.java | 4 +-- .../jdk/sun/rmi/log/ReliableLog/Recovery.java | 8 +----- 4 files changed, 2 insertions(+), 39 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Runtime.java b/src/java.base/share/classes/java/lang/Runtime.java index ee83c7abb41..efe3adefb63 100644 --- a/src/java.base/share/classes/java/lang/Runtime.java +++ b/src/java.base/share/classes/java/lang/Runtime.java @@ -683,32 +683,6 @@ public class Runtime { SharedSecrets.getJavaLangRefAccess().runFinalization(); } - /** - * Not implemented, does nothing. - * - * @deprecated - * This method was intended to control instruction tracing. - * It has been superseded by JVM-specific tracing mechanisms. - * This method is subject to removal in a future version of Java SE. - * - * @param on ignored - */ - @Deprecated(since="9", forRemoval=true) - public void traceInstructions(boolean on) { } - - /** - * Not implemented, does nothing. - * - * @deprecated - * This method was intended to control method call tracing. - * It has been superseded by JVM-specific tracing mechanisms. - * This method is subject to removal in a future version of Java SE. - * - * @param on ignored - */ - @Deprecated(since="9", forRemoval=true) - public void traceMethodCalls(boolean on) { } - /** * Loads the native library specified by the filename argument. The filename * argument must be an absolute path name. diff --git a/test/jaxp/javax/xml/jaxp/unittest/transform/ProcessXSLT.java b/test/jaxp/javax/xml/jaxp/unittest/transform/ProcessXSLT.java index 3425585fb22..ccaa8c7122b 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/transform/ProcessXSLT.java +++ b/test/jaxp/javax/xml/jaxp/unittest/transform/ProcessXSLT.java @@ -145,15 +145,12 @@ public class ProcessXSLT */ public static void main(String argv[]) { - // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off boolean doStackDumpOnError = false; boolean doDiag = false; boolean setQuietMode = false; String msg = null; boolean isSecureProcessing = false; - // Runtime.getRuntime().traceMethodCalls(false); - // Runtime.getRuntime().traceInstructions(false); /** * The default diagnostic writer... */ diff --git a/test/jdk/java/rmi/activation/CommandEnvironment/SetChildEnv.java b/test/jdk/java/rmi/activation/CommandEnvironment/SetChildEnv.java index c544c3d526d..1b7b8f6a7f5 100644 --- a/test/jdk/java/rmi/activation/CommandEnvironment/SetChildEnv.java +++ b/test/jdk/java/rmi/activation/CommandEnvironment/SetChildEnv.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, 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 @@ -123,9 +123,7 @@ public class SetChildEnv "WHO INQUIRE ABOUT MY PARENTS."; System.out.println(complaint); - //Runtime.getRuntime().traceMethodCalls(true); String res = doctor.complain(complaint); - //Runtime.getRuntime().traceMethodCalls(false); System.out.println (" => " + res); // Get debugExec line, allowing 15 seconds for it to flush diff --git a/test/jdk/sun/rmi/log/ReliableLog/Recovery.java b/test/jdk/sun/rmi/log/ReliableLog/Recovery.java index 4e45bb11df8..61d9a633ac9 100644 --- a/test/jdk/sun/rmi/log/ReliableLog/Recovery.java +++ b/test/jdk/sun/rmi/log/ReliableLog/Recovery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2002, 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 @@ -88,13 +88,7 @@ public class Recovery Recovery handler = new Recovery(); ReliableLog log; - if (size == 4 && deathpoint == 6) { - Runtime.getRuntime().traceMethodCalls(true); - } log = new ReliableLog(dir, handler); - if (size == 4 && deathpoint == 6) { - Runtime.getRuntime().traceMethodCalls(false); - } // Generate a number of updates (size - 1) until failing int i; From 6a7c8b3e0181e8ca3511bc859befe8e1834b2a4c Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Mon, 10 Jun 2019 17:11:04 -0700 Subject: [PATCH 017/109] 8209917: fix TODO in GatherDiagnosticInfoObserver Reviewed-by: jjg, dholmes --- .../jtreg/GatherDiagnosticInfoObserver.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java index 045c27a4c98..12dd8a42b44 100644 --- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ package jdk.test.failurehandler.jtreg; import com.sun.javatest.Harness; import com.sun.javatest.Parameters; import com.sun.javatest.TestResult; -import com.sun.javatest.InterviewParameters; +import com.sun.javatest.regtest.config.RegressionParameters; import jdk.test.failurehandler.*; import java.io.File; @@ -46,8 +46,8 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer { public static final String LOG_FILENAME = "environment.log"; public static final String ENVIRONMENT_OUTPUT = "environment.html"; - private String compileJdk; - private String testJdk; + private Path compileJdk; + private Path testJdk; /* * The harness calls this method after each test. @@ -80,7 +80,7 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer { log.printf("%s ---%n", name); GathererFactory gathererFactory = new GathererFactory( OS.current().family, workDir, log, - Paths.get(testJdk), Paths.get(compileJdk)); + testJdk, compileJdk); gatherEnvInfo(workDir, name, log, gathererFactory.getEnvironmentInfoGatherer()); } catch (Throwable e) { @@ -117,12 +117,9 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer { */ @Override public void startingTestRun(Parameters params) { - // TODO find a better way to get JDKs - InterviewParameters rp = (InterviewParameters) params; - Map map = new HashMap<>(); - rp.save(map); - compileJdk = map.get("regtest.compilejdk"); - testJdk = map.get("regtest.testjdk"); + RegressionParameters rp = (RegressionParameters) params; + compileJdk = rp.getCompileJDK().getAbsoluteFile().toPath(); + testJdk = rp.getTestJDK().getAbsoluteFile().toPath(); } @Override From d216c34a434865e9b349f799b90a1300d81fcbcd Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Tue, 11 Jun 2019 09:27:51 +0200 Subject: [PATCH 018/109] 8225509: clean_catch_blocks must add preds first Reviewed-by: kvn --- src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp index 887496941ae..867448c4473 100644 --- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp +++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp @@ -1356,6 +1356,14 @@ void ZBarrierSetC2::clean_catch_blocks(PhaseIdealLoop* phase) const { while(nodeStack.length() > 0) { Node *n = nodeStack.pop(); + for (uint i = 0; i < n->len(); i++) { + if (n->in(i)) { + if (!visited.test_set(n->in(i)->_idx)) { + nodeStack.push(n->in(i)); + } + } + } + bool is_old_node = (n->_idx < new_ids); // don't process nodes that were created during cleanup if (n->is_Load() && is_old_node) { LoadNode* load = n->isa_Load(); @@ -1364,14 +1372,6 @@ void ZBarrierSetC2::clean_catch_blocks(PhaseIdealLoop* phase) const { process_catch_cleanup_candidate(phase, load); } } - - for (uint i = 0; i < n->len(); i++) { - if (n->in(i)) { - if (!visited.test_set(n->in(i)->_idx)) { - nodeStack.push(n->in(i)); - } - } - } } C->print_method(PHASE_CALL_CATCH_CLEANUP, 2); From 98e6903c57b0a75323c4556b79ff2062ad7a22ed Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Tue, 11 Jun 2019 09:51:33 +0200 Subject: [PATCH 019/109] 8224826: Implement fast class initialization checks on PPC64 Reviewed-by: vlivanov, gromero --- src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 14 ++++++- src/hotspot/cpu/ppc/interp_masm_ppc.hpp | 2 + src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp | 12 ++++++ src/hotspot/cpu/ppc/macroAssembler_ppc.cpp | 35 +++++++++++++++++ src/hotspot/cpu/ppc/macroAssembler_ppc.hpp | 6 +++ src/hotspot/cpu/ppc/ppc.ad | 18 +++++++++ src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp | 40 +++++++++++++++++++- src/hotspot/cpu/ppc/templateTable_ppc_64.cpp | 22 ++++++++--- src/hotspot/cpu/ppc/vm_version_ppc.hpp | 3 ++ 9 files changed, 145 insertions(+), 7 deletions(-) diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp index fb188235673..e22a4c5ee93 100644 --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp @@ -80,7 +80,19 @@ int LIR_Assembler::check_icache() { } void LIR_Assembler::clinit_barrier(ciMethod* method) { - ShouldNotReachHere(); // not implemented + assert(!method->holder()->is_not_initialized(), "initialization should have been started"); + + Label L_skip_barrier; + Register klass = R20; + + metadata2reg(method->holder()->constant_encoding(), klass); + __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/); + + __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0); + __ mtctr(klass); + __ bctr(); + + __ bind(L_skip_barrier); } void LIR_Assembler::osr_entry() { diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc.hpp b/src/hotspot/cpu/ppc/interp_masm_ppc.hpp index 0522422e9e4..d58740d5a74 100644 --- a/src/hotspot/cpu/ppc/interp_masm_ppc.hpp +++ b/src/hotspot/cpu/ppc/interp_masm_ppc.hpp @@ -82,6 +82,8 @@ class InterpreterMacroAssembler: public MacroAssembler { // load cpool->resolved_klass_at(index) void load_resolved_klass_at_offset(Register Rcpool, Register Roffset, Register Rklass); + void load_resolved_method_at_index(int byte_no, Register cache, Register method); + void load_receiver(Register Rparam_count, Register Rrecv_dst); // helpers for expression stack diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp index a8d719a7836..692595859f7 100644 --- a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp @@ -516,6 +516,18 @@ void InterpreterMacroAssembler::load_resolved_klass_at_offset(Register Rcpool, R ldx(Rklass, Rklass, Roffset); } +void InterpreterMacroAssembler::load_resolved_method_at_index(int byte_no, + Register cache, + Register method) { + const int method_offset = in_bytes( + ConstantPoolCache::base_offset() + + ((byte_no == TemplateTable::f2_byte) + ? ConstantPoolCacheEntry::f2_offset() + : ConstantPoolCacheEntry::f1_offset())); + + ld(method, method_offset, cache); // get f1 Method* +} + // Generate a subtype check: branch to ok_is_subtype if sub_klass is // a subtype of super_klass. Blows registers Rsub_klass, tmp1, tmp2. void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, Register Rsuper_klass, Register Rtmp1, diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp index 2af92f4a131..d67c55b8f33 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp @@ -2011,6 +2011,35 @@ void MacroAssembler::check_klass_subtype(Register sub_klass, bind(L_failure); // Fallthru if not successful. } +void MacroAssembler::clinit_barrier(Register klass, Register thread, Label* L_fast_path, Label* L_slow_path) { + assert(L_fast_path != NULL || L_slow_path != NULL, "at least one is required"); + + Label L_fallthrough; + if (L_fast_path == NULL) { + L_fast_path = &L_fallthrough; + } else if (L_slow_path == NULL) { + L_slow_path = &L_fallthrough; + } + + // Fast path check: class is fully initialized + lbz(R0, in_bytes(InstanceKlass::init_state_offset()), klass); + cmpwi(CCR0, R0, InstanceKlass::fully_initialized); + beq(CCR0, *L_fast_path); + + // Fast path check: current thread is initializer thread + ld(R0, in_bytes(InstanceKlass::init_thread_offset()), klass); + cmpd(CCR0, thread, R0); + if (L_slow_path == &L_fallthrough) { + beq(CCR0, *L_fast_path); + } else if (L_fast_path == &L_fallthrough) { + bne(CCR0, *L_slow_path); + } else { + Unimplemented(); + } + + bind(L_fallthrough); +} + void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg, Register temp_reg, Label& wrong_method_type) { @@ -3194,6 +3223,12 @@ void MacroAssembler::load_mirror_from_const_method(Register mirror, Register con resolve_oop_handle(mirror); } +void MacroAssembler::load_method_holder(Register holder, Register method) { + ld(holder, in_bytes(Method::const_offset()), method); + ld(holder, in_bytes(ConstMethod::constants_offset()), holder); + ld(holder, ConstantPool::pool_holder_offset_in_bytes(), holder); +} + // Clear Array // For very short arrays. tmp == R0 is allowed. void MacroAssembler::clear_memory_unrolled(Register base_ptr, int cnt_dwords, Register tmp, int offset) { diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp index f16538c1682..5a756653fb6 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp @@ -559,6 +559,11 @@ class MacroAssembler: public Assembler { Register temp2_reg, Label& L_success); + void clinit_barrier(Register klass, + Register thread, + Label* L_fast_path = NULL, + Label* L_slow_path = NULL); + // Method handle support (JSR 292). void check_method_handle_type(Register mtype_reg, Register mh_reg, Register temp_reg, Label& wrong_method_type); @@ -722,6 +727,7 @@ class MacroAssembler: public Assembler { void resolve_oop_handle(Register result); void load_mirror_from_const_method(Register mirror, Register const_method); + void load_method_holder(Register holder, Register method); static int instr_size_for_decode_klass_not_null(); void decode_klass_not_null(Register dst, Register src = noreg); diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index 301a1aa3590..73272a0c1cd 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -1400,6 +1400,24 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { ___(mflr) mflr(return_pc); } + if (C->clinit_barrier_on_entry()) { + assert(!C->method()->holder()->is_not_initialized(), "initialization should have been started"); + + Label L_skip_barrier; + Register klass = toc_temp; + + // Notify OOP recorder (don't need the relocation) + AddressLiteral md = __ constant_metadata_address(C->method()->holder()->constant_encoding()); + __ load_const_optimized(klass, md.value(), R0); + __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/); + + __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0); + __ mtctr(klass); + __ bctr(); + + __ bind(L_skip_barrier); + } + // Calls to C2R adapters often do not accept exceptional returns. // We require that their callers must bang for them. But be // careful, because some VM calls (such as call site linkage) can diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp index bbf22fb792c..35bec6eed21 100644 --- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp +++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp @@ -1274,7 +1274,30 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm // entry: c2i - c2i_entry = gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, call_interpreter, ientry); + c2i_entry = __ pc(); + + // Class initialization barrier for static methods + if (VM_Version::supports_fast_class_init_checks()) { + Label L_skip_barrier; + + { // Bypass the barrier for non-static methods + __ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method); + __ andi_(R0, R0, JVM_ACC_STATIC); + __ beq(CCR0, L_skip_barrier); // non-static + } + + Register klass = R11_scratch1; + __ load_method_holder(klass, R19_method); + __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/); + + __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0); + __ mtctr(klass); + __ bctr(); + + __ bind(L_skip_barrier); + } + + gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, call_interpreter, ientry); return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry); } @@ -2106,6 +2129,21 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, __ tabort_(); } + if (VM_Version::supports_fast_class_init_checks() && method->needs_clinit_barrier()) { + Label L_skip_barrier; + Register klass = r_temp_1; + // Notify OOP recorder (don't need the relocation) + AddressLiteral md = __ constant_metadata_address(method->method_holder()); + __ load_const_optimized(klass, md.value(), R0); + __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/); + + __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0); + __ mtctr(klass); + __ bctr(); + + __ bind(L_skip_barrier); + } + __ save_LR_CR(r_temp_1); __ generate_stack_overflow_check(frame_size_in_bytes); // Check before creating frame. __ mr(r_callers_sp, R1_SP); // Remember frame pointer. diff --git a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp index 90cb02ab52a..35feb1df956 100644 --- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp @@ -2232,7 +2232,7 @@ void TemplateTable::_return(TosState state) { void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Register Rscratch, size_t index_size) { __ get_cache_and_index_at_bcp(Rcache, 1, index_size); - Label Lresolved, Ldone; + Label Lresolved, Ldone, L_clinit_barrier_slow; Bytecodes::Code code = bytecode(); switch (code) { @@ -2253,6 +2253,9 @@ void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Regist __ cmpdi(CCR0, Rscratch, (int)code); __ beq(CCR0, Lresolved); + // Class initialization barrier slow path lands here as well. + __ bind(L_clinit_barrier_slow); + address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache); __ li(R4_ARG2, code); __ call_VM(noreg, entry, R4_ARG2, true); @@ -2263,6 +2266,17 @@ void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Regist __ bind(Lresolved); __ isync(); // Order load wrt. succeeding loads. + + // Class initialization barrier for static methods + if (VM_Version::supports_fast_class_init_checks() && bytecode() == Bytecodes::_invokestatic) { + const Register method = Rscratch; + const Register klass = Rscratch; + + __ load_resolved_method_at_index(byte_no, Rcache, method); + __ load_method_holder(klass, method); + __ clinit_barrier(klass, R16_thread, NULL /*L_fast_path*/, &L_clinit_barrier_slow); + } + __ bind(Ldone); } @@ -2329,7 +2343,7 @@ void TemplateTable::load_invoke_cp_cache_entry(int byte_no, // Already resolved. __ get_cache_and_index_at_bcp(Rcache, 1); } else { - resolve_cache_and_index(byte_no, Rcache, R0, is_invokedynamic ? sizeof(u4) : sizeof(u2)); + resolve_cache_and_index(byte_no, Rcache, /* temp */ Rmethod, is_invokedynamic ? sizeof(u4) : sizeof(u2)); } __ ld(Rmethod, method_offset, Rcache); @@ -3634,9 +3648,7 @@ void TemplateTable::invokeinterface(int byte_no) { // Find entry point to call. // Get declaring interface class from method - __ ld(Rinterface_klass, in_bytes(Method::const_offset()), Rmethod); - __ ld(Rinterface_klass, in_bytes(ConstMethod::constants_offset()), Rinterface_klass); - __ ld(Rinterface_klass, ConstantPool::pool_holder_offset_in_bytes(), Rinterface_klass); + __ load_method_holder(Rinterface_klass, Rmethod); // Get itable index from method __ lwa(Rindex, in_bytes(Method::itable_index_offset()), Rmethod); diff --git a/src/hotspot/cpu/ppc/vm_version_ppc.hpp b/src/hotspot/cpu/ppc/vm_version_ppc.hpp index 787e1474387..8cdee5d0040 100644 --- a/src/hotspot/cpu/ppc/vm_version_ppc.hpp +++ b/src/hotspot/cpu/ppc/vm_version_ppc.hpp @@ -95,6 +95,9 @@ public: // Override Abstract_VM_Version implementation static bool use_biased_locking(); + // PPC64 supports fast class initialization checks for static methods. + static bool supports_fast_class_init_checks() { return true; } + static bool is_determine_features_test_running() { return _is_determine_features_test_running; } // CPU instruction support static bool has_fsqrt() { return (_features & fsqrt_m) != 0; } From b6696bad842a97bf9ff97746e8eabbfccc98071b Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Tue, 11 Jun 2019 09:21:34 +0100 Subject: [PATCH 020/109] 8225426: Replace plain with system-default in Socket and ServerSocket Reviewed-by: alanb, dfuchs --- .../share/classes/java/net/ServerSocket.java | 14 ++++---- .../share/classes/java/net/Socket.java | 36 +++++++++++-------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java index 70f65061e02..bf399270755 100644 --- a/src/java.base/share/classes/java/net/ServerSocket.java +++ b/src/java.base/share/classes/java/net/ServerSocket.java @@ -106,9 +106,10 @@ class ServerSocket implements java.io.Closeable { * request to connect) is set to {@code 50}. If a connection * indication arrives when the queue is full, the connection is refused. *

    - * If the application has specified a server socket factory, that - * factory's {@code createSocketImpl} method is called to create - * the actual socket implementation. Otherwise a "plain" socket is created. + * If the application has specified a server socket implementation + * factory, that factory's {@code createSocketImpl} method is called to + * create the actual socket implementation. Otherwise a system-default + * socket implementation is created. *

    * If there is a security manager, * its {@code checkListen} method is called @@ -150,9 +151,10 @@ class ServerSocket implements java.io.Closeable { * a connection indication arrives when the queue is full, the * connection is refused. *

    - * If the application has specified a server socket factory, that - * factory's {@code createSocketImpl} method is called to create - * the actual socket implementation. Otherwise a "plain" socket is created. + * If the application has specified a server socket implementation + * factory, that factory's {@code createSocketImpl} method is called to + * create the actual socket implementation. Otherwise a system-default + * socket implementation is created. *

    * If there is a security manager, * its {@code checkListen} method is called diff --git a/src/java.base/share/classes/java/net/Socket.java b/src/java.base/share/classes/java/net/Socket.java index 7393780adfa..2a2989f89f2 100644 --- a/src/java.base/share/classes/java/net/Socket.java +++ b/src/java.base/share/classes/java/net/Socket.java @@ -89,8 +89,12 @@ class Socket implements java.io.Closeable { } /** - * Creates an unconnected socket, with the - * system-default type of SocketImpl. + * Creates an unconnected Socket. + *

    + * If the application has specified a client socket implementation + * factory, that factory's {@code createSocketImpl} method is called to + * create the actual socket implementation. Otherwise a system-default + * socket implementation is created. * * @since 1.1 * @revised 1.4 @@ -194,9 +198,10 @@ class Socket implements java.io.Closeable { * In other words, it is equivalent to specifying an address of the * loopback interface.

    *

    - * If the application has specified a server socket factory, that - * factory's {@code createSocketImpl} method is called to create - * the actual socket implementation. Otherwise a "plain" socket is created. + * If the application has specified a client socket implementation + * factory, that factory's {@code createSocketImpl} method is called to + * create the actual socket implementation. Otherwise a system-default + * socket implementation is created. *

    * If there is a security manager, its * {@code checkConnect} method is called @@ -232,9 +237,10 @@ class Socket implements java.io.Closeable { * Creates a stream socket and connects it to the specified port * number at the specified IP address. *

    - * If the application has specified a socket factory, that factory's - * {@code createSocketImpl} method is called to create the - * actual socket implementation. Otherwise a "plain" socket is created. + * If the application has specified a client socket implementation + * factory, that factory's {@code createSocketImpl} method is called to + * create the actual socket implementation. Otherwise a system-default + * socket implementation is created. *

    * If there is a security manager, its * {@code checkConnect} method is called @@ -358,9 +364,10 @@ class Socket implements java.io.Closeable { * stream socket. If the stream argument is {@code false}, it * creates a datagram socket. *

    - * If the application has specified a server socket factory, that - * factory's {@code createSocketImpl} method is called to create - * the actual socket implementation. Otherwise a "plain" socket is created. + * If the application has specified a client socket implementation + * factory, that factory's {@code createSocketImpl} method is called to + * create the actual socket implementation. Otherwise a system-default + * socket implementation is created. *

    * If there is a security manager, its * {@code checkConnect} method is called @@ -400,9 +407,10 @@ class Socket implements java.io.Closeable { * stream socket. If the stream argument is {@code false}, it * creates a datagram socket. *

    - * If the application has specified a server socket factory, that - * factory's {@code createSocketImpl} method is called to create - * the actual socket implementation. Otherwise a "plain" socket is created. + * If the application has specified a client socket implementation + * factory, that factory's {@code createSocketImpl} method is called to + * create the actual socket implementation. Otherwise a system-default + * socket implementation is created. * *

    If there is a security manager, its * {@code checkConnect} method is called From 2f25526470a2e6cb3d4431bee6679b7a02d8090e Mon Sep 17 00:00:00 2001 From: Rahul Raghavan Date: Tue, 11 Jun 2019 14:33:34 +0530 Subject: [PATCH 021/109] 8225567: Wrong file headers with 8202414 fix changeset Corrected source file headers Reviewed-by: thartmann --- src/hotspot/share/opto/memnode.cpp | 2 +- test/hotspot/jtreg/compiler/c2/Test8202414.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index 21610977b65..af0d0a13d59 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/hotspot/jtreg/compiler/c2/Test8202414.java b/test/hotspot/jtreg/compiler/c2/Test8202414.java index 1d8ef8d936a..f4a93a12a85 100644 --- a/test/hotspot/jtreg/compiler/c2/Test8202414.java +++ b/test/hotspot/jtreg/compiler/c2/Test8202414.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Huawei Technologies Co. Ltd. All rights reserved. + * Copyright (c) 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 From cf7990753682fcc37ab914fe73cf941ced981735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Tue, 11 Jun 2019 10:55:17 +0200 Subject: [PATCH 022/109] 8224871: os::attempt_reserve_memory_at() tries too hard Reviewed-by: pliden, coleenp, stuefe --- src/hotspot/os/bsd/os_bsd.cpp | 50 +----------- src/hotspot/os/linux/os_linux.cpp | 50 +----------- src/hotspot/os/solaris/os_solaris.cpp | 106 +------------------------- 3 files changed, 6 insertions(+), 200 deletions(-) diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index 713a9c0842c..0f50818a9b9 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -2189,11 +2189,6 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr, int f // available (and not reserved for something else). char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) { - const int max_tries = 10; - char* base[max_tries]; - size_t size[max_tries]; - const size_t gap = 0x000000; - // Assert only that the size is a multiple of the page size, since // that's all that mmap requires, and since that's all we really know // about at this low abstraction level. If we need higher alignment, @@ -2216,50 +2211,7 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) { anon_munmap(addr, bytes); } - int i; - for (i = 0; i < max_tries; ++i) { - base[i] = reserve_memory(bytes); - - if (base[i] != NULL) { - // Is this the block we wanted? - if (base[i] == requested_addr) { - size[i] = bytes; - break; - } - - // Does this overlap the block we wanted? Give back the overlapped - // parts and try again. - - size_t top_overlap = requested_addr + (bytes + gap) - base[i]; - if (top_overlap >= 0 && top_overlap < bytes) { - unmap_memory(base[i], top_overlap); - base[i] += top_overlap; - size[i] = bytes - top_overlap; - } else { - size_t bottom_overlap = base[i] + bytes - requested_addr; - if (bottom_overlap >= 0 && bottom_overlap < bytes) { - unmap_memory(requested_addr, bottom_overlap); - size[i] = bytes - bottom_overlap; - } else { - size[i] = bytes; - } - } - } - } - - // Give back the unused reserved pieces. - - for (int j = 0; j < i; ++j) { - if (base[j] != NULL) { - unmap_memory(base[j], size[j]); - } - } - - if (i < max_tries) { - return requested_addr; - } else { - return NULL; - } + return NULL; } // Sleep forever; naked call to OS-specific sleep; use with CAUTION diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 439f6b781d1..ee154e24618 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -4105,11 +4105,6 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr, int f // available (and not reserved for something else). char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) { - const int max_tries = 10; - char* base[max_tries]; - size_t size[max_tries]; - const size_t gap = 0x000000; - // Assert only that the size is a multiple of the page size, since // that's all that mmap requires, and since that's all we really know // about at this low abstraction level. If we need higher alignment, @@ -4132,50 +4127,7 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) { anon_munmap(addr, bytes); } - int i; - for (i = 0; i < max_tries; ++i) { - base[i] = reserve_memory(bytes); - - if (base[i] != NULL) { - // Is this the block we wanted? - if (base[i] == requested_addr) { - size[i] = bytes; - break; - } - - // Does this overlap the block we wanted? Give back the overlapped - // parts and try again. - - ptrdiff_t top_overlap = requested_addr + (bytes + gap) - base[i]; - if (top_overlap >= 0 && (size_t)top_overlap < bytes) { - unmap_memory(base[i], top_overlap); - base[i] += top_overlap; - size[i] = bytes - top_overlap; - } else { - ptrdiff_t bottom_overlap = base[i] + bytes - requested_addr; - if (bottom_overlap >= 0 && (size_t)bottom_overlap < bytes) { - unmap_memory(requested_addr, bottom_overlap); - size[i] = bytes - bottom_overlap; - } else { - size[i] = bytes; - } - } - } - } - - // Give back the unused reserved pieces. - - for (int j = 0; j < i; ++j) { - if (base[j] != NULL) { - unmap_memory(base[j], size[j]); - } - } - - if (i < max_tries) { - return requested_addr; - } else { - return NULL; - } + return NULL; } // Sleep forever; naked call to OS-specific sleep; use with CAUTION diff --git a/src/hotspot/os/solaris/os_solaris.cpp b/src/hotspot/os/solaris/os_solaris.cpp index 4c0ade1d760..9c6d4d6a783 100644 --- a/src/hotspot/os/solaris/os_solaris.cpp +++ b/src/hotspot/os/solaris/os_solaris.cpp @@ -2553,17 +2553,6 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr, int f // available (and not reserved for something else). char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) { - const int max_tries = 10; - char* base[max_tries]; - size_t size[max_tries]; - - // Solaris adds a gap between mmap'ed regions. The size of the gap - // is dependent on the requested size and the MMU. Our initial gap - // value here is just a guess and will be corrected later. - bool had_top_overlap = false; - bool have_adjusted_gap = false; - size_t gap = 0x400000; - // Assert only that the size is a multiple of the page size, since // that's all that mmap requires, and since that's all we really know // about at this low abstraction level. If we need higher alignment, @@ -2572,105 +2561,18 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) { assert(bytes % os::vm_page_size() == 0, "reserving unexpected size block"); // Since snv_84, Solaris attempts to honor the address hint - see 5003415. - // Give it a try, if the kernel honors the hint we can return immediately. char* addr = Solaris::anon_mmap(requested_addr, bytes, 0, false); volatile int err = errno; if (addr == requested_addr) { return addr; - } else if (addr != NULL) { + } + + if (addr != NULL) { pd_unmap_memory(addr, bytes); } - if (log_is_enabled(Warning, os)) { - char buf[256]; - buf[0] = '\0'; - if (addr == NULL) { - jio_snprintf(buf, sizeof(buf), ": %s", os::strerror(err)); - } - log_info(os)("attempt_reserve_memory_at: couldn't reserve " SIZE_FORMAT " bytes at " - PTR_FORMAT ": reserve_memory_helper returned " PTR_FORMAT - "%s", bytes, requested_addr, addr, buf); - } - - // Address hint method didn't work. Fall back to the old method. - // In theory, once SNV becomes our oldest supported platform, this - // code will no longer be needed. - // - // Repeatedly allocate blocks until the block is allocated at the - // right spot. Give up after max_tries. - int i; - for (i = 0; i < max_tries; ++i) { - base[i] = reserve_memory(bytes); - - if (base[i] != NULL) { - // Is this the block we wanted? - if (base[i] == requested_addr) { - size[i] = bytes; - break; - } - - // check that the gap value is right - if (had_top_overlap && !have_adjusted_gap) { - size_t actual_gap = base[i-1] - base[i] - bytes; - if (gap != actual_gap) { - // adjust the gap value and retry the last 2 allocations - assert(i > 0, "gap adjustment code problem"); - have_adjusted_gap = true; // adjust the gap only once, just in case - gap = actual_gap; - log_info(os)("attempt_reserve_memory_at: adjusted gap to 0x%lx", gap); - unmap_memory(base[i], bytes); - unmap_memory(base[i-1], size[i-1]); - i-=2; - continue; - } - } - - // Does this overlap the block we wanted? Give back the overlapped - // parts and try again. - // - // There is still a bug in this code: if top_overlap == bytes, - // the overlap is offset from requested region by the value of gap. - // In this case giving back the overlapped part will not work, - // because we'll give back the entire block at base[i] and - // therefore the subsequent allocation will not generate a new gap. - // This could be fixed with a new algorithm that used larger - // or variable size chunks to find the requested region - - // but such a change would introduce additional complications. - // It's rare enough that the planets align for this bug, - // so we'll just wait for a fix for 6204603/5003415 which - // will provide a mmap flag to allow us to avoid this business. - - size_t top_overlap = requested_addr + (bytes + gap) - base[i]; - if (top_overlap >= 0 && top_overlap < bytes) { - had_top_overlap = true; - unmap_memory(base[i], top_overlap); - base[i] += top_overlap; - size[i] = bytes - top_overlap; - } else { - size_t bottom_overlap = base[i] + bytes - requested_addr; - if (bottom_overlap >= 0 && bottom_overlap < bytes) { - if (bottom_overlap == 0) { - log_info(os)("attempt_reserve_memory_at: possible alignment bug"); - } - unmap_memory(requested_addr, bottom_overlap); - size[i] = bytes - bottom_overlap; - } else { - size[i] = bytes; - } - } - } - } - - // Give back the unused reserved pieces. - - for (int j = 0; j < i; ++j) { - if (base[j] != NULL) { - unmap_memory(base[j], size[j]); - } - } - - return (i < max_tries) ? requested_addr : NULL; + return NULL; } bool os::pd_release_memory(char* addr, size_t bytes) { From 5fa2642f15601a6e9f7e2d7947577f93a9abeb0e Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Tue, 11 Jun 2019 12:39:37 +0200 Subject: [PATCH 023/109] 8225564: Remove wrong assert in clean_catch_blocks Reviewed-by: thartmann --- src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp index 867448c4473..9fb4e477111 100644 --- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp +++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp @@ -866,7 +866,6 @@ static bool fixup_uses_in_catch(PhaseIdealLoop *phase, Node *start_ctrl, Node *n // In some very rare cases a load that doesn't need a barrier will end up here // Treat it as a LoadP and the insertion of phis will be done correctly. if (node->is_Load()) { - assert(node->as_Load()->barrier_data() == 0, "Sanity"); call_catch_cleanup_one(phase, node->as_Load(), phase->get_ctrl(node)); } else { for (DUIterator_Fast jmax, i = node->fast_outs(jmax); i < jmax; i++) { From 02f1d4430c8b2436b6c7111c27a7392eadaaa777 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Tue, 11 Jun 2019 08:03:29 -0400 Subject: [PATCH 024/109] 8225568: ProblemList compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java Reviewed-by: thartmann --- test/hotspot/jtreg/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 2fa1f648ae4..6ca15a71879 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -43,6 +43,7 @@ compiler/ciReplay/TestSAServer.java 8029528 generic-all compiler/codecache/stress/OverloadCompileQueueTest.java 8166554 generic-all compiler/codegen/Test6896617.java 8193479 generic-all +compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all From d571d105ae483cf1acc8d8e460869ecdeb3333cb Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 11 Jun 2019 07:31:47 -0400 Subject: [PATCH 025/109] 8224847: gc/stress/TestReclaimStringsLeaksMemory.java fails with reserved greater than expected Rehash threshold was too low for StringTable, and rehashed size table was too large. Reviewed-by: rehn, gziemski --- src/hotspot/share/classfile/stringTable.cpp | 9 +++++---- src/hotspot/share/classfile/symbolTable.cpp | 9 +++++---- test/hotspot/jtreg/ProblemList.txt | 1 - .../gc/stress/TestReclaimStringsLeaksMemory.java | 14 ++++++++++++-- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/hotspot/share/classfile/stringTable.cpp b/src/hotspot/share/classfile/stringTable.cpp index 35165c1370a..bfe6d07df8a 100644 --- a/src/hotspot/share/classfile/stringTable.cpp +++ b/src/hotspot/share/classfile/stringTable.cpp @@ -58,8 +58,8 @@ const double PREF_AVG_LIST_LEN = 2.0; // 2^24 is max size const size_t END_SIZE = 24; -// If a chain gets to 32 something might be wrong -const size_t REHASH_LEN = 32; +// If a chain gets to 100 something might be wrong +const size_t REHASH_LEN = 100; // If we have as many dead items as 50% of the number of bucket const double CLEAN_DEAD_HIGH_WATER_MARK = 0.5; @@ -496,8 +496,9 @@ bool StringTable::do_rehash() { return false; } - // We use max size - StringTableHash* new_table = new StringTableHash(END_SIZE, END_SIZE, REHASH_LEN); + // We use current size, not max size. + size_t new_size = _local_table->get_size_log2(Thread::current()); + StringTableHash* new_table = new StringTableHash(new_size, END_SIZE, REHASH_LEN); // Use alt hash from now on _alt_hash = true; if (!_local_table->try_move_nodes_to(Thread::current(), new_table)) { diff --git a/src/hotspot/share/classfile/symbolTable.cpp b/src/hotspot/share/classfile/symbolTable.cpp index 5a36b2ed230..4023e722eee 100644 --- a/src/hotspot/share/classfile/symbolTable.cpp +++ b/src/hotspot/share/classfile/symbolTable.cpp @@ -267,7 +267,7 @@ void SymbolTable::symbols_do(SymbolClosure *cl) { // all symbols from the dynamic table SymbolsDo sd(cl); if (!_local_table->try_scan(Thread::current(), sd)) { - log_info(stringtable)("symbols_do unavailable at this moment"); + log_info(symboltable)("symbols_do unavailable at this moment"); } } @@ -557,7 +557,7 @@ void SymbolTable::verify() { Thread* thr = Thread::current(); VerifySymbols vs; if (!_local_table->try_scan(thr, vs)) { - log_info(stringtable)("verify unavailable at this moment"); + log_info(symboltable)("verify unavailable at this moment"); } } @@ -763,8 +763,9 @@ bool SymbolTable::do_rehash() { return false; } - // We use max size - SymbolTableHash* new_table = new SymbolTableHash(END_SIZE, END_SIZE, REHASH_LEN); + // We use current size + size_t new_size = _local_table->get_size_log2(Thread::current()); + SymbolTableHash* new_table = new SymbolTableHash(new_size, END_SIZE, REHASH_LEN); // Use alt hash from now on _alt_hash = true; if (!_local_table->try_move_nodes_to(Thread::current(), new_table)) { diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 6ca15a71879..6e7551cf2c9 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -77,7 +77,6 @@ gc/stress/gclocker/TestGCLockerWithParallel.java 8180622 generic-all gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8193639 solaris-all -gc/stress/TestReclaimStringsLeaksMemory.java 8224847 generic-all ############################################################################# diff --git a/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java b/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java index fc8b462c3dc..5de870302a1 100644 --- a/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java +++ b/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java @@ -57,7 +57,7 @@ public class TestReclaimStringsLeaksMemory { public static void main(String[] args) throws Exception { ArrayList baseargs = new ArrayList<>(Arrays.asList("-Xms256M", "-Xmx256M", - "-Xlog:gc*", + "-Xlog:gc*,stringtable*=debug:gc.log", "-XX:NativeMemoryTracking=summary", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintNMTStatistics" )); @@ -95,9 +95,19 @@ public class TestReclaimStringsLeaksMemory { lastString = (BaseName + i).intern(); } if (++iterations % 5 == 0) { - System.gc(); + System.gc(); } } + // Do one last GC and sleep to give ServiceThread a chance to run. + System.out.println("One last gc"); + System.gc(); + for (int i = 0; i < 100; i++) { + try { + Thread.sleep(10); + } catch (InterruptedException ex) { + } + } + System.out.println("End of test"); } } } From 83377c41fffc48ec216738c1f5e1efb91deaefa4 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Mon, 10 Jun 2019 10:11:42 +0100 Subject: [PATCH 026/109] 8225429: Regression in disassembly quality Reviewed-by: never --- src/hotspot/share/asm/codeBuffer.hpp | 1 + src/hotspot/share/compiler/abstractDisassembler.cpp | 8 ++++---- src/hotspot/share/compiler/disassembler.cpp | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/asm/codeBuffer.hpp b/src/hotspot/share/asm/codeBuffer.hpp index 0526a394c7e..1b7f1164d2d 100644 --- a/src/hotspot/share/asm/codeBuffer.hpp +++ b/src/hotspot/share/asm/codeBuffer.hpp @@ -413,6 +413,7 @@ class CodeBuffer: public StackObj { || PrintMethodHandleStubs || PrintInterpreter || PrintSignatureHandlers + || UnlockDiagnosticVMOptions ); } diff --git a/src/hotspot/share/compiler/abstractDisassembler.cpp b/src/hotspot/share/compiler/abstractDisassembler.cpp index 63d8825edac..4fe71179282 100644 --- a/src/hotspot/share/compiler/abstractDisassembler.cpp +++ b/src/hotspot/share/compiler/abstractDisassembler.cpp @@ -38,12 +38,12 @@ bool AbstractDisassembler::_show_data_hex = true; bool AbstractDisassembler::_show_data_int = false; bool AbstractDisassembler::_show_data_float = false; -bool AbstractDisassembler::_align_instr = false; +bool AbstractDisassembler::_align_instr = true; bool AbstractDisassembler::_show_pc = true; bool AbstractDisassembler::_show_offset = false; -bool AbstractDisassembler::_show_structs = false; -bool AbstractDisassembler::_show_comment = false; -bool AbstractDisassembler::_show_block_comment = false; +bool AbstractDisassembler::_show_structs = true; +bool AbstractDisassembler::_show_comment = true; +bool AbstractDisassembler::_show_block_comment = true; // set "true" to see what's in memory bit by bit // might prove cumbersome on platforms where instr_len is hard to find out diff --git a/src/hotspot/share/compiler/disassembler.cpp b/src/hotspot/share/compiler/disassembler.cpp index 49e7db404a7..f4d656c8f70 100644 --- a/src/hotspot/share/compiler/disassembler.cpp +++ b/src/hotspot/share/compiler/disassembler.cpp @@ -147,7 +147,10 @@ class decode_env { if (AbstractDisassembler::show_comment()) { if ((_nm != NULL) && _nm->has_code_comment(pc0, pc)) { - _nm->print_code_comment_on(st, _post_decode_alignment, pc0, pc); + _nm->print_code_comment_on + (st, + _post_decode_alignment ? _post_decode_alignment : COMMENT_COLUMN, + pc0, pc); // this calls reloc_string_for which calls oop::print_value_on } print_hook_comments(pc0, _nm != NULL); From 7fc422dd933266afbfc92c6a6ac5bf8939ffac9f Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Tue, 11 Jun 2019 11:01:22 +0530 Subject: [PATCH 027/109] 8225511: javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java fails in linux-x64 Reviewed-by: serb, prr --- .../swing/JWindow/ShapedAndTranslucentWindows/Common.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java b/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java index a79b62df432..b177ffc4e6e 100644 --- a/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java +++ b/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java @@ -367,13 +367,13 @@ public abstract class Common { // Drag Point location = window.getLocationOnScreen(); robot.dragAndDrop(location.x + 30, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl)); - robot.waitForIdle(delay); + robot.waitForIdle(2*delay); checkTranslucentShape(); // Resize location = window.getLocationOnScreen(); robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl); - robot.waitForIdle(delay); + robot.waitForIdle(2*delay); checkTranslucentShape(); EventQueue.invokeAndWait(this::dispose); From b99e9165f1bf539fd3b086ce4e233c64316aaa90 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Tue, 11 Jun 2019 15:46:26 +0100 Subject: [PATCH 028/109] 8225512: Replace wildcard address with loopback or local host in tests - part 15 Updates httpserver tests to use the loopback instead of the wildcard wherever possible. Reviewed-by: michaelm --- .../net/httpserver/MissingTrailingSpace.java | 17 ++++++++------ test/jdk/com/sun/net/httpserver/Test10.java | 9 +++++--- test/jdk/com/sun/net/httpserver/Test11.java | 19 +++++++++++----- test/jdk/com/sun/net/httpserver/Test12.java | 16 ++++++++++---- test/jdk/com/sun/net/httpserver/Test13.java | 17 ++++++++++---- test/jdk/com/sun/net/httpserver/Test14.java | 18 +++++++++++---- test/jdk/com/sun/net/httpserver/Test2.java | 19 ++++++++++++---- test/jdk/com/sun/net/httpserver/Test3.java | 9 +++++--- test/jdk/com/sun/net/httpserver/Test4.java | 9 +++++--- test/jdk/com/sun/net/httpserver/Test5.java | 9 +++++--- test/jdk/com/sun/net/httpserver/Test6.java | 19 ++++++++++++---- test/jdk/com/sun/net/httpserver/Test7.java | 18 +++++++++++---- test/jdk/com/sun/net/httpserver/Test7a.java | 19 +++++++++++----- test/jdk/com/sun/net/httpserver/Test8.java | 19 ++++++++++++---- test/jdk/com/sun/net/httpserver/Test8a.java | 19 +++++++++++----- test/jdk/com/sun/net/httpserver/Test9.java | 22 ++++++++++++++----- test/jdk/com/sun/net/httpserver/Test9a.java | 21 +++++++++++++----- .../com/sun/net/httpserver/TestLogging.java | 9 +++++--- .../com/sun/net/httpserver/bugs/B6339483.java | 18 +++++++++++---- .../com/sun/net/httpserver/bugs/B6341616.java | 18 +++++++++++---- .../com/sun/net/httpserver/bugs/B6393710.java | 9 +++++--- .../com/sun/net/httpserver/bugs/B6526158.java | 18 +++++++++++---- .../com/sun/net/httpserver/bugs/B6526913.java | 18 +++++++++++---- .../com/sun/net/httpserver/bugs/B6529200.java | 8 ++++--- .../com/sun/net/httpserver/bugs/B6744329.java | 19 ++++++++++++---- .../com/sun/net/httpserver/bugs/B6886436.java | 22 ++++++++++++++----- .../bugs/FixedLengthInputStream.java | 20 +++++++++++++---- .../com/sun/net/httpserver/bugs/HeadTest.java | 21 ++++++++++++++---- .../httpserver/bugs/TruncatedRequestBody.java | 7 +++--- 29 files changed, 346 insertions(+), 120 deletions(-) diff --git a/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java b/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java index 5ecb0745f01..6671105aac4 100644 --- a/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java +++ b/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,12 @@ * @test * @bug 8068795 * @summary HttpServer missing tailing space for some response codes + * @run main MissingTrailingSpace + * @run main/othervm -Djava.net.preferIPv6Addresses=true MissingTrailingSpace * @author lev.priima@oracle.com */ +import java.net.InetAddress; import java.net.InetSocketAddress; import java.io.InputStreamReader; import java.io.IOException; @@ -47,7 +50,8 @@ public class MissingTrailingSpace { private static final String someContext = "/context"; public static void main(String[] args) throws Exception { - HttpServer server = HttpServer.create(new InetSocketAddress(0), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + HttpServer server = HttpServer.create(new InetSocketAddress(loopback, 0), 0); try { server.setExecutor(Executors.newFixedThreadPool(1)); server.createContext(someContext, new HttpHandler() { @@ -68,7 +72,7 @@ public class MissingTrailingSpace { System.out.println("Server started at port " + server.getAddress().getPort()); - runRawSocketHttpClient("localhost", server.getAddress().getPort()); + runRawSocketHttpClient(loopback, server.getAddress().getPort()); } finally { ((ExecutorService)server.getExecutor()).shutdown(); server.stop(0); @@ -76,7 +80,7 @@ public class MissingTrailingSpace { System.out.println("Server finished."); } - static void runRawSocketHttpClient(String hostname, int port) + static void runRawSocketHttpClient(InetAddress address, int port) throws Exception { Socket socket = null; @@ -84,7 +88,7 @@ public class MissingTrailingSpace { BufferedReader reader = null; final String CRLF = "\r\n"; try { - socket = new Socket(hostname, port); + socket = new Socket(address, port); writer = new PrintWriter(new OutputStreamWriter( socket.getOutputStream())); System.out.println("Client connected by socket: " + socket); @@ -93,7 +97,7 @@ public class MissingTrailingSpace { writer.print("User-Agent: Java/" + System.getProperty("java.version") + CRLF); - writer.print("Host: " + hostname + CRLF); + writer.print("Host: " + address.getHostName() + CRLF); writer.print("Accept: */*" + CRLF); writer.print("Connection: keep-alive" + CRLF); writer.print(CRLF); // Important, else the server will expect that @@ -140,4 +144,3 @@ public class MissingTrailingSpace { System.out.println("Client finished." ); } } - diff --git a/test/jdk/com/sun/net/httpserver/Test10.java b/test/jdk/com/sun/net/httpserver/Test10.java index 36f2a80e09b..c15ddc48d6f 100644 --- a/test/jdk/com/sun/net/httpserver/Test10.java +++ b/test/jdk/com/sun/net/httpserver/Test10.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -26,6 +26,8 @@ * @bug 7005016 * @summary pit jdk7 b121 sqe test jhttp/HttpServer150013 failing * @run main/othervm -Dsun.net.httpserver.clockTick=1000 -Dsun.net.httpserver.idleInterval=3 Test10 + * @run main/othervm -Dsun.net.httpserver.clockTick=1000 -Dsun.net.httpserver.idleInterval=3 + * -Djava.net.preferIPv6Addresses Test10 */ import com.sun.net.httpserver.*; @@ -42,7 +44,8 @@ public class Test10 extends Test { public static void main (String[] args) throws Exception { System.out.print ("Test10: "); Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); int port = server.getAddress().getPort(); HttpContext c2 = server.createContext ("/test", handler); @@ -78,7 +81,7 @@ public class Test10 extends Test { public static void doClient (int port) throws Exception { String s = "GET /test/1.html HTTP/1.1\r\n\r\n"; - Socket socket = new Socket ("localhost", port); + Socket socket = new Socket (InetAddress.getLoopbackAddress(), port); OutputStream os = socket.getOutputStream(); os.write (s.getBytes()); socket.setSoTimeout (10 * 1000); diff --git a/test/jdk/com/sun/net/httpserver/Test11.java b/test/jdk/com/sun/net/httpserver/Test11.java index 67d3a6b65e4..d8a58bb36b0 100644 --- a/test/jdk/com/sun/net/httpserver/Test11.java +++ b/test/jdk/com/sun/net/httpserver/Test11.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,12 +25,16 @@ * @test * @bug 6270015 * @summary Light weight HTTP server + * @library /test/lib + * @run main Test11 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test11 */ import java.net.*; import java.util.concurrent.*; import java.io.*; import com.sun.net.httpserver.*; +import jdk.test.lib.net.URIBuilder; public class Test11 { static class Handler implements HttpHandler { @@ -51,7 +55,8 @@ public class Test11 { public static void main (String[] args) throws Exception { System.out.print ("Test 11: "); - HttpServer server = HttpServer.create(new InetSocketAddress(0), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + HttpServer server = HttpServer.create(new InetSocketAddress(loopback, 0), 0); ExecutorService s = Executors.newCachedThreadPool(); try { HttpContext ctx = server.createContext ( @@ -59,9 +64,13 @@ public class Test11 { ); s = Executors.newCachedThreadPool(); server.start (); - URL url = new URL ("http://localhost:" + server.getAddress().getPort()+ - "/Foo/bar/test.html"); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection(); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/Foo/bar/test.html") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); int r = urlc.getResponseCode(); if (r == 200) { throw new RuntimeException ("wrong response received"); diff --git a/test/jdk/com/sun/net/httpserver/Test12.java b/test/jdk/com/sun/net/httpserver/Test12.java index dd724c267ce..95e179db198 100644 --- a/test/jdk/com/sun/net/httpserver/Test12.java +++ b/test/jdk/com/sun/net/httpserver/Test12.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -27,6 +27,7 @@ * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext * @run main/othervm Test12 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test12 * @summary Light weight HTTP server */ @@ -37,6 +38,7 @@ import java.io.*; import java.net.*; import javax.net.ssl.*; import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; /* basic http/s connectivity test * Tests: @@ -56,7 +58,8 @@ public class Test12 extends Test { try { String root = System.getProperty ("test.src")+ "/docs"; System.out.print ("Test12: "); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); s1 = HttpServer.create (addr, 0); s2 = HttpsServer.create (addr, 0); HttpHandler h = new FileServerHandler (root); @@ -130,8 +133,13 @@ public class Test12 extends Test { public void run () { try { - URL url = new URL (protocol+"://localhost:"+port+"/test1/"+f); - HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); + URL url = URIBuilder.newBuilder() + .scheme(protocol) + .loopback() + .port(port) + .path("/test1/"+f) + .toURL(); + HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY); if (urlc instanceof HttpsURLConnection) { HttpsURLConnection urlcs = (HttpsURLConnection) urlc; urlcs.setHostnameVerifier (new HostnameVerifier () { diff --git a/test/jdk/com/sun/net/httpserver/Test13.java b/test/jdk/com/sun/net/httpserver/Test13.java index 6061cc0776c..138acd87105 100644 --- a/test/jdk/com/sun/net/httpserver/Test13.java +++ b/test/jdk/com/sun/net/httpserver/Test13.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -27,6 +27,7 @@ * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext * @run main/othervm Test13 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test13 * @summary Light weight HTTP server */ @@ -38,6 +39,7 @@ import java.io.*; import java.net.*; import javax.net.ssl.*; import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; /* basic http/s connectivity test * Tests: @@ -61,10 +63,12 @@ public class Test13 extends Test { ha.setLevel(Level.ALL); l.setLevel(Level.ALL); l.addHandler(ha); + InetAddress loopback = InetAddress.getLoopbackAddress(); + try { String root = System.getProperty ("test.src")+ "/docs"; System.out.print ("Test13: "); - InetSocketAddress addr = new InetSocketAddress (0); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); s1 = HttpServer.create (addr, 0); s2 = HttpsServer.create (addr, 0); HttpHandler h = new FileServerHandler (root); @@ -136,8 +140,13 @@ public class Test13 extends Test { public void run () { try { - URL url = new URL (protocol+"://localhost:"+port+"/test1/"+f); - HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); + URL url = URIBuilder.newBuilder() + .scheme(protocol) + .loopback() + .port(port) + .path("/test1/"+f) + .toURL(); + HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY); if (urlc instanceof HttpsURLConnection) { HttpsURLConnection urlcs = (HttpsURLConnection) urlc; urlcs.setHostnameVerifier (new HostnameVerifier () { diff --git a/test/jdk/com/sun/net/httpserver/Test14.java b/test/jdk/com/sun/net/httpserver/Test14.java index b969a558a97..8e023f9cd5a 100644 --- a/test/jdk/com/sun/net/httpserver/Test14.java +++ b/test/jdk/com/sun/net/httpserver/Test14.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,6 +25,9 @@ * @test * @bug 6270015 * @summary Light weight HTTP server + * @library /test/lib + * @run main Test14 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test14 */ import com.sun.net.httpserver.*; @@ -36,6 +39,7 @@ import java.net.*; import java.security.*; import javax.security.auth.callback.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; /** * Test filters @@ -77,7 +81,8 @@ public class Test14 extends Test { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); @@ -94,9 +99,14 @@ public class Test14 extends Test { server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); System.out.print ("Test14: " ); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); InputStream is = urlc.getInputStream(); int x = 0; String output=""; diff --git a/test/jdk/com/sun/net/httpserver/Test2.java b/test/jdk/com/sun/net/httpserver/Test2.java index 2bd0fc2288c..296d8b4b19d 100644 --- a/test/jdk/com/sun/net/httpserver/Test2.java +++ b/test/jdk/com/sun/net/httpserver/Test2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,6 +25,9 @@ * @test * @bug 6270015 * @summary Light weight HTTP server + * @library /test/lib + * @run main Test2 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test2 */ import com.sun.net.httpserver.*; @@ -36,6 +39,7 @@ import java.net.*; import java.security.*; import javax.security.auth.callback.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; /** * Test authentication @@ -45,7 +49,8 @@ public class Test2 extends Test { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); BasicAuthenticator a = new BasicAuthenticator ("foobar@test.realm") { @@ -60,9 +65,15 @@ public class Test2 extends Test { server.start (); java.net.Authenticator.setDefault (new MyAuthenticator()); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + System.out.print ("Test2: " ); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); InputStream is = urlc.getInputStream(); int c = 0; while (is.read()!= -1) { diff --git a/test/jdk/com/sun/net/httpserver/Test3.java b/test/jdk/com/sun/net/httpserver/Test3.java index 03486ec6a6f..7e40b9505fe 100644 --- a/test/jdk/com/sun/net/httpserver/Test3.java +++ b/test/jdk/com/sun/net/httpserver/Test3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -26,6 +26,8 @@ * @bug 6270015 * @summary Light weight HTTP server * @run main/othervm -Dsun.net.httpserver.idleInterval=4 Test3 + * @run main/othervm -Djava.net.preferIPv6Addresses=true + * -Dsun.net.httpserver.idleInterval=4 Test3 */ import com.sun.net.httpserver.*; @@ -48,7 +50,8 @@ public class Test3 extends Test { public static void main (String[] args) throws Exception { System.out.print ("Test3: "); Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); int port = server.getAddress().getPort(); HttpContext c2 = server.createContext ("/test", handler); @@ -135,7 +138,7 @@ public class Test3 extends Test { "GET /test/4.html HTTP/1.1\r\nContent-length: 10\r\n"+ "\r\n"+body4; - Socket socket = new Socket ("localhost", port); + Socket socket = new Socket (InetAddress.getLoopbackAddress(), port); OutputStream os = socket.getOutputStream(); os.write (s.getBytes()); InputStream is = socket.getInputStream(); diff --git a/test/jdk/com/sun/net/httpserver/Test4.java b/test/jdk/com/sun/net/httpserver/Test4.java index b91d256d6dd..e6527f272db 100644 --- a/test/jdk/com/sun/net/httpserver/Test4.java +++ b/test/jdk/com/sun/net/httpserver/Test4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -26,6 +26,8 @@ * @bug 6270015 * @summary Light weight HTTP server * @run main/othervm -Dsun.net.httpserver.idleInterval=4 Test4 + * @run main/othervm -Djava.net.preferIPv6Addresses=true + * -Dsun.net.httpserver.idleInterval=4 Test4 */ import com.sun.net.httpserver.*; @@ -46,7 +48,8 @@ public class Test4 extends Test { public static void main (String[] args) throws Exception { System.out.print ("Test4: "); Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); int port = server.getAddress().getPort(); HttpContext c2 = server.createContext ("/test", handler); @@ -133,7 +136,7 @@ public class Test4 extends Test { "GET /test/4.html HTTP/1.1\r\nContent-length: 10\r\n"+ "\r\n"+body4; - Socket socket = new Socket ("localhost", port); + Socket socket = new Socket (InetAddress.getLoopbackAddress(), port); OutputStream os = socket.getOutputStream(); os.write (s.getBytes()); InputStream is = socket.getInputStream(); diff --git a/test/jdk/com/sun/net/httpserver/Test5.java b/test/jdk/com/sun/net/httpserver/Test5.java index f704cf8ef42..31c42f12e72 100644 --- a/test/jdk/com/sun/net/httpserver/Test5.java +++ b/test/jdk/com/sun/net/httpserver/Test5.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -26,6 +26,8 @@ * @bug 6270015 * @summary Light weight HTTP server * @run main/othervm -Dsun.net.httpserver.idleInterval=4 Test5 + * @run main/othervm -Djava.net.preferIPv6Addresses=true + * -Dsun.net.httpserver.idleInterval=4 Test5 */ import com.sun.net.httpserver.*; @@ -47,7 +49,8 @@ public class Test5 extends Test { public static void main (String[] args) throws Exception { System.out.print ("Test5: "); Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); int port = server.getAddress().getPort(); HttpContext c2 = server.createContext ("/test", handler); @@ -132,7 +135,7 @@ public class Test5 extends Test { "GET /test/4.html HTTP/1.1\r\nContent-length: 10\r\n"+ "\r\n"+body4; - Socket socket = new Socket ("localhost", port); + Socket socket = new Socket (InetAddress.getLoopbackAddress(), port); OutputStream os = socket.getOutputStream(); os.write (s.getBytes()); InputStream is = socket.getInputStream(); diff --git a/test/jdk/com/sun/net/httpserver/Test6.java b/test/jdk/com/sun/net/httpserver/Test6.java index 2f502da61b1..f13277e4994 100644 --- a/test/jdk/com/sun/net/httpserver/Test6.java +++ b/test/jdk/com/sun/net/httpserver/Test6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,6 +25,9 @@ * @test * @bug 6270015 * @summary Light weight HTTP server + * @library /test/lib + * @run main Test6 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test6 */ import com.sun.net.httpserver.*; @@ -36,6 +39,7 @@ import java.net.*; import java.security.*; import javax.security.auth.callback.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; /** * Test POST large file via chunked encoding (unusually small chunks) @@ -45,16 +49,23 @@ public class Test6 extends Test { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); ExecutorService executor = Executors.newCachedThreadPool(); server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + System.out.print ("Test6: " ); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); urlc.setDoOutput (true); urlc.setRequestMethod ("POST"); urlc.setChunkedStreamingMode (32); // small chunks diff --git a/test/jdk/com/sun/net/httpserver/Test7.java b/test/jdk/com/sun/net/httpserver/Test7.java index 28ee0adae31..e022109578d 100644 --- a/test/jdk/com/sun/net/httpserver/Test7.java +++ b/test/jdk/com/sun/net/httpserver/Test7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -24,7 +24,10 @@ /** * @test * @bug 6270015 + * @library /test/lib * @summary Light weight HTTP server + * @run main Test7 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test7 */ import com.sun.net.httpserver.*; @@ -36,6 +39,7 @@ import java.net.*; import java.security.*; import javax.security.auth.callback.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; /** * Test POST large file via chunked encoding (large chunks) @@ -45,16 +49,22 @@ public class Test7 extends Test { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); ExecutorService executor = Executors.newCachedThreadPool(); server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); System.out.print ("Test7: " ); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); urlc.setDoOutput (true); urlc.setRequestMethod ("POST"); urlc.setChunkedStreamingMode (16 * 1024); // big chunks diff --git a/test/jdk/com/sun/net/httpserver/Test7a.java b/test/jdk/com/sun/net/httpserver/Test7a.java index b170cded2aa..65e8998f9d8 100644 --- a/test/jdk/com/sun/net/httpserver/Test7a.java +++ b/test/jdk/com/sun/net/httpserver/Test7a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,8 +25,9 @@ * @test * @bug 6270015 * @library /test/lib - * @build jdk.test.lib.net.SimpleSSLContext + * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.URIBuilder * @run main/othervm Test7a + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test7a * @summary Light weight HTTP server */ @@ -37,6 +38,7 @@ import java.io.*; import java.net.*; import javax.net.ssl.*; import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; /** * Test POST large file via chunked encoding (large chunks) @@ -51,7 +53,8 @@ public class Test7a extends Test { //h.setLevel (Level.ALL); //log.addHandler (h); Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpsServer server = HttpsServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); ExecutorService executor = Executors.newCachedThreadPool(); @@ -60,9 +63,15 @@ public class Test7a extends Test { server.setExecutor (executor); server.start (); - URL url = new URL ("https://localhost:"+server.getAddress().getPort()+"/test/foo.html"); + URL url = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + System.out.print ("Test7a: " ); - HttpsURLConnection urlc = (HttpsURLConnection)url.openConnection (); + HttpsURLConnection urlc = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); urlc.setDoOutput (true); urlc.setRequestMethod ("POST"); urlc.setChunkedStreamingMode (16 * 1024); // big chunks diff --git a/test/jdk/com/sun/net/httpserver/Test8.java b/test/jdk/com/sun/net/httpserver/Test8.java index a30ef00b62d..343421e8adc 100644 --- a/test/jdk/com/sun/net/httpserver/Test8.java +++ b/test/jdk/com/sun/net/httpserver/Test8.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -24,7 +24,10 @@ /** * @test * @bug 6270015 + * @library /test/lib * @summary Light weight HTTP server + * @run main Test8 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test8 */ import com.sun.net.httpserver.*; @@ -36,6 +39,7 @@ import java.net.*; import java.security.*; import javax.security.auth.callback.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; /** * Test POST large file via fixed len encoding @@ -45,16 +49,23 @@ public class Test8 extends Test { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); ExecutorService executor = Executors.newCachedThreadPool(); server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + System.out.print ("Test8: " ); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); urlc.setDoOutput (true); urlc.setRequestMethod ("POST"); OutputStream os = new BufferedOutputStream (urlc.getOutputStream()); diff --git a/test/jdk/com/sun/net/httpserver/Test8a.java b/test/jdk/com/sun/net/httpserver/Test8a.java index daf65e21fa7..06cffa913aa 100644 --- a/test/jdk/com/sun/net/httpserver/Test8a.java +++ b/test/jdk/com/sun/net/httpserver/Test8a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,8 +25,9 @@ * @test * @bug 6270015 * @library /test/lib - * @build jdk.test.lib.net.SimpleSSLContext + * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.URIBuilder * @run main/othervm Test8a + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test8a * @summary Light weight HTTP server */ @@ -37,6 +38,7 @@ import java.io.*; import java.net.*; import javax.net.ssl.*; import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; /** * Test POST large file via fixed len encoding @@ -54,7 +56,8 @@ public class Test8a extends Test { ExecutorService executor = null; try { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); server = HttpsServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); executor = Executors.newCachedThreadPool(); @@ -63,9 +66,15 @@ public class Test8a extends Test { server.setExecutor (executor); server.start (); - URL url = new URL ("https://localhost:"+server.getAddress().getPort()+"/test/foo.html"); + URL url = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + System.out.print ("Test8a: " ); - HttpsURLConnection urlc = (HttpsURLConnection)url.openConnection (); + HttpsURLConnection urlc = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY); urlc.setDoOutput (true); urlc.setRequestMethod ("POST"); urlc.setHostnameVerifier (new DummyVerifier()); diff --git a/test/jdk/com/sun/net/httpserver/Test9.java b/test/jdk/com/sun/net/httpserver/Test9.java index fa0588a91fc..d989d7d4d3c 100644 --- a/test/jdk/com/sun/net/httpserver/Test9.java +++ b/test/jdk/com/sun/net/httpserver/Test9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,8 +25,9 @@ * @test * @bug 6270015 * @library /test/lib - * @build jdk.test.lib.net.SimpleSSLContext + * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.URIBuilder * @run main/othervm Test9 + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test9 * @summary Light weight HTTP server */ @@ -37,6 +38,7 @@ import java.io.*; import java.net.*; import javax.net.ssl.*; import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; /* Same as Test1 but requests run in parallel. */ @@ -53,7 +55,8 @@ public class Test9 extends Test { try { String root = System.getProperty ("test.src")+ "/docs"; System.out.print ("Test9: "); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); s1 = HttpServer.create (addr, 0); s2 = HttpsServer.create (addr, 0); HttpHandler h = new FileServerHandler (root); @@ -137,8 +140,14 @@ public class Test9 extends Test { public void run () { try { - URL url = new URL (protocol+"://localhost:"+port+"/test1/"+f); - HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); + URL url = URIBuilder.newBuilder() + .scheme(protocol) + .loopback() + .port(port) + .path("/test1/" + f) + .toURL(); + + HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY); if (urlc instanceof HttpsURLConnection) { HttpsURLConnection urlcs = (HttpsURLConnection) urlc; urlcs.setHostnameVerifier (new HostnameVerifier () { @@ -185,7 +194,8 @@ public class Test9 extends Test { String orig = root + "/" + f; compare (new File(orig), temp); temp.delete(); - } catch (IOException e) { + } catch (Exception e) { + e.printStackTrace(); error = true; } } diff --git a/test/jdk/com/sun/net/httpserver/Test9a.java b/test/jdk/com/sun/net/httpserver/Test9a.java index ff5be52be0b..66b044e8d9a 100644 --- a/test/jdk/com/sun/net/httpserver/Test9a.java +++ b/test/jdk/com/sun/net/httpserver/Test9a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,8 +25,9 @@ * @test * @bug 6270015 * @library /test/lib - * @build jdk.test.lib.net.SimpleSSLContext + * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.URIBuilder * @run main/othervm Test9a + * @run main/othervm -Djava.net.preferIPv6Addresses=true Test9a * @summary Light weight HTTP server */ @@ -37,6 +38,7 @@ import java.io.*; import java.net.*; import javax.net.ssl.*; import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; /* Same as Test1 but requests run in parallel. */ @@ -53,7 +55,8 @@ public class Test9a extends Test { try { String root = System.getProperty ("test.src")+ "/docs"; System.out.print ("Test9a: "); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); server = HttpsServer.create (addr, 0); HttpHandler h = new FileServerHandler (root); HttpContext c1 = server.createContext ("/test1", h); @@ -131,8 +134,14 @@ public class Test9a extends Test { public void run () { try { - URL url = new URL (protocol+"://localhost:"+port+"/test1/"+f); - HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); + URL url = URIBuilder.newBuilder() + .scheme(protocol) + .loopback() + .port(port) + .path("/test1/" + f) + .toURL(); + + HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY); if (urlc instanceof HttpsURLConnection) { HttpsURLConnection urlcs = (HttpsURLConnection) urlc; urlcs.setHostnameVerifier (new HostnameVerifier () { @@ -179,7 +188,7 @@ public class Test9a extends Test { String orig = root + "/" + f; compare (new File(orig), temp); temp.delete(); - } catch (IOException e) { + } catch (Exception e) { e.printStackTrace(); error = true; } diff --git a/test/jdk/com/sun/net/httpserver/TestLogging.java b/test/jdk/com/sun/net/httpserver/TestLogging.java index 95399844087..4f45197872c 100644 --- a/test/jdk/com/sun/net/httpserver/TestLogging.java +++ b/test/jdk/com/sun/net/httpserver/TestLogging.java @@ -26,6 +26,8 @@ * @bug 6422914 * @library /test/lib * @summary change httpserver exception printouts + * @run main TestLogging + * @run main/othervm -Djava.net.preferIPv6Addresses=true TestLogging */ import com.sun.net.httpserver.*; @@ -49,7 +51,8 @@ public class TestLogging extends Test { try { System.out.print ("Test9: "); String root = System.getProperty ("test.src")+ "/docs"; - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); Logger logger = Logger.getLogger ("com.sun.net.httpserver"); logger.setLevel (Level.ALL); Handler h1 = new ConsoleHandler (); @@ -70,9 +73,9 @@ public class TestLogging extends Test { .loopback() .port(p1) .path("/test1/smallfile.txt") - .toURLUnchecked(); + .toURL(); System.out.println("URL: " + url); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); InputStream is = urlc.getInputStream(); while (is.read() != -1) ; is.close(); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6339483.java b/test/jdk/com/sun/net/httpserver/bugs/B6339483.java index 37febd31579..d2a62155a95 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6339483.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6339483.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,6 +25,9 @@ * @test * @bug 6339483 * @summary NullPointerException when creating a HttpContext with no handler + * @library /test/lib + * @run main B6339483 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6339483 */ import com.sun.net.httpserver.*; @@ -36,19 +39,26 @@ import java.net.*; import java.security.*; import java.security.cert.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; public class B6339483 { public static void main (String[] args) throws Exception { - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test"); ExecutorService executor = Executors.newCachedThreadPool(); server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); try { InputStream is = urlc.getInputStream(); int c = 0; diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6341616.java b/test/jdk/com/sun/net/httpserver/bugs/B6341616.java index 9b81a2d49f3..d8239481c3d 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6341616.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6341616.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -24,6 +24,9 @@ /** * @test * @bug 6341616 + * @library /test/lib + * @run main B6341616 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6341616 * @summary Server doesnt send response if there is a RuntimeException in validate of BasicAuthFilter */ @@ -36,12 +39,14 @@ import java.net.*; import java.security.*; import java.security.cert.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; public class B6341616 { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); BasicAuthenticator filter = new BasicAuthenticator ("foobar@test.realm") { @@ -56,8 +61,13 @@ public class B6341616 { server.start (); java.net.Authenticator.setDefault (new MyAuthenticator()); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); try { InputStream is = urlc.getInputStream(); int c = 0; diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6393710.java b/test/jdk/com/sun/net/httpserver/bugs/B6393710.java index 6eb5a04e296..bea0257295e 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6393710.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6393710.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -25,6 +25,8 @@ * @test * @bug 6393710 * @summary Non authenticated call followed by authenticated call never returns + * @run main B6393710 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6393710 */ import com.sun.net.httpserver.*; @@ -65,7 +67,8 @@ public class B6393710 { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); ctx.setAuthenticator (new BasicAuthenticator ("test") { @@ -76,7 +79,7 @@ public class B6393710 { server.start (); - Socket s = new Socket ("localhost", server.getAddress().getPort()); + Socket s = new Socket (loopback, server.getAddress().getPort()); s.setSoTimeout (5000); OutputStream os = s.getOutputStream(); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6526158.java b/test/jdk/com/sun/net/httpserver/bugs/B6526158.java index a7af2bbe161..5207d07e7cc 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6526158.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6526158.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -24,6 +24,9 @@ /** * @test * @bug 6526158 + * @library /test/lib + * @run main B6526158 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6526158 * @summary HttpExchange.getRequestBody().close() throws Exception */ @@ -36,6 +39,7 @@ import java.net.*; import java.security.*; import java.security.cert.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; public class B6526158 { @@ -44,7 +48,8 @@ public class B6526158 { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); @@ -52,8 +57,13 @@ public class B6526158 { server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); urlc.setDoOutput (true); try { OutputStream os = new BufferedOutputStream (urlc.getOutputStream()); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6526913.java b/test/jdk/com/sun/net/httpserver/bugs/B6526913.java index a8dccd261f0..a8c4fe64f12 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6526913.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6526913.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -24,7 +24,10 @@ /** * @test * @bug 6526913 + * @library /test/lib * @run main/othervm -Dhttp.keepAlive=false B6526913 + * @run main/othervm -Djava.net.preferIPv6Addresses=true + * -Dhttp.keepAlive=false B6526913 * @summary HttpExchange.getResponseBody().close() throws Exception */ @@ -37,12 +40,14 @@ import java.net.*; import java.security.*; import java.security.cert.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; public class B6526913 { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); @@ -50,8 +55,13 @@ public class B6526913 { server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection (Proxy.NO_PROXY); try { InputStream is = urlc.getInputStream(); int c ,count = 0; diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6529200.java b/test/jdk/com/sun/net/httpserver/bugs/B6529200.java index a5abb947b6f..8c86fc93daa 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6529200.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6529200.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -25,6 +25,7 @@ * @test * @bug 6529200 * @run main/othervm B6529200 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6529200 * @summary lightweight http server does not work with http1.0 clients */ @@ -42,7 +43,8 @@ public class B6529200 { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); @@ -52,7 +54,7 @@ public class B6529200 { /* test 1: keep-alive */ - Socket sock = new Socket ("localhost", server.getAddress().getPort()); + Socket sock = new Socket (loopback, server.getAddress().getPort()); OutputStream os = sock.getOutputStream(); System.out.println ("GET /test/foo HTTP/1.0\r\nConnection: keep-alive\r\n\r\n"); os.write ("GET /test/foo HTTP/1.0\r\nConnection: keep-alive\r\n\r\n".getBytes()); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6744329.java b/test/jdk/com/sun/net/httpserver/bugs/B6744329.java index c84e666f425..b0ecc4f480b 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6744329.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6744329.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -25,6 +25,9 @@ * @test * @bug 6744329 * @summary Exception in light weight Http server + * @library /test/lib + * @run main B6744329 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6744329 */ import com.sun.net.httpserver.*; @@ -36,20 +39,27 @@ import java.net.*; import java.security.*; import java.security.cert.*; import javax.net.ssl.*; +import jdk.test.lib.net.URIBuilder; public class B6744329 { public static void main (String[] args) throws Exception { Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); ExecutorService executor = Executors.newCachedThreadPool(); server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); try { InputStream is = urlc.getInputStream(); int c = 0; @@ -59,6 +69,7 @@ public class B6744329 { System.out.println ("OK"); } catch (IOException e) { System.out.println ("exception"); + e.printStackTrace(); error = true; } server.stop(2); diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6886436.java b/test/jdk/com/sun/net/httpserver/bugs/B6886436.java index 9af17eabcb4..710c27d4daa 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6886436.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6886436.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -24,7 +24,10 @@ /** * @test * @bug 6886436 - * @summary + * @summary HttpServer should not send a body with 204 response. + * @library /test/lib + * @run main B6886436 + * @run main/othervm -Djava.net.preferIPv6Addresses=true B6886436 */ import com.sun.net.httpserver.*; @@ -34,6 +37,7 @@ import java.util.concurrent.*; import java.util.logging.*; import java.io.*; import java.net.*; +import jdk.test.lib.net.URIBuilder; public class B6886436 { @@ -44,20 +48,26 @@ public class B6886436 { logger.addHandler (c); logger.setLevel (Level.WARNING); Handler handler = new Handler(); - InetSocketAddress addr = new InetSocketAddress (0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress (loopback, 0); HttpServer server = HttpServer.create (addr, 0); HttpContext ctx = server.createContext ("/test", handler); ExecutorService executor = Executors.newCachedThreadPool(); server.setExecutor (executor); server.start (); - URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html"); - HttpURLConnection urlc = (HttpURLConnection)url.openConnection (); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/test/foo.html") + .toURL(); + HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); try { InputStream is = urlc.getInputStream(); while (is.read()!= -1) ; is.close (); - urlc = (HttpURLConnection)url.openConnection (); + urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); urlc.setReadTimeout (3000); is = urlc.getInputStream(); while (is.read()!= -1); diff --git a/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java b/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java index f9791e007ae..7df66d8e15e 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java +++ b/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -25,20 +25,26 @@ * @test * @bug 6756771 6755625 * @summary com.sun.net.httpserver.HttpServer should handle POSTs larger than 2Gig + * @library /test/lib + * @run main FixedLengthInputStream + * @run main/othervm -Djava.net.preferIPv6Addresses=true FixedLengthInputStream */ import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.HttpURLConnection; +import java.net.Proxy; import java.net.URL; import java.net.Socket; import java.util.logging.*; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; +import jdk.test.lib.net.URIBuilder; public class FixedLengthInputStream { @@ -48,8 +54,13 @@ public class FixedLengthInputStream HttpServer httpServer = startHttpServer(); int port = httpServer.getAddress().getPort(); try { - URL url = new URL("http://localhost:" + port + "/flis/"); - HttpURLConnection uc = (HttpURLConnection)url.openConnection(); + URL url = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(port) + .path("/flis/") + .toURLUnchecked(); + HttpURLConnection uc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); uc.setDoOutput(true); uc.setRequestMethod("POST"); uc.setFixedLengthStreamingMode(POST_SIZE); @@ -90,7 +101,8 @@ public class FixedLengthInputStream logger.setLevel(Level.FINEST); logger.addHandler(outHandler); } - HttpServer httpServer = HttpServer.create(new InetSocketAddress(0), 0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + HttpServer httpServer = HttpServer.create(new InetSocketAddress(loopback, 0), 0); httpServer.createContext("/flis/", new MyHandler(POST_SIZE)); httpServer.start(); return httpServer; diff --git a/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java b/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java index b78649014f5..b20b786decf 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java +++ b/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -24,11 +24,16 @@ /** * @test * @bug 6886723 + * @library /test/lib + * @run main HeadTest + * @run main/othervm -Djava.net.preferIPv6Addresses=true HeadTest * @summary light weight http server doesn't return correct status code for HEAD requests */ +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.HttpURLConnection; +import java.net.Proxy; import java.net.URL; import java.io.IOException; import java.util.concurrent.ExecutorService; @@ -37,6 +42,7 @@ import com.sun.net.httpserver.HttpContext; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; +import jdk.test.lib.net.URIBuilder; public class HeadTest { @@ -45,7 +51,8 @@ public class HeadTest { } static void server() throws Exception { - InetSocketAddress inetAddress = new InetSocketAddress(0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress inetAddress = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create(inetAddress, 5); try { server.setExecutor(Executors.newFixedThreadPool(5)); @@ -88,7 +95,13 @@ public class HeadTest { } }); server.start(); - String urlStr = "http://localhost:" + server.getAddress().getPort() + "/"; + String urlStr = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(server.getAddress().getPort()) + .path("/") + .build() + .toString(); System.out.println("Server is at " + urlStr); // Run the chunked client @@ -107,7 +120,7 @@ public class HeadTest { } static void runClient(String urlStr) throws Exception { - HttpURLConnection conn = (HttpURLConnection) new URL(urlStr).openConnection(); + HttpURLConnection conn = (HttpURLConnection) new URL(urlStr).openConnection(Proxy.NO_PROXY); conn.setRequestMethod("HEAD"); int status = conn.getResponseCode(); if (status != 200) { diff --git a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java index f72c828e437..9ceb7108f5c 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java +++ b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java @@ -90,7 +90,8 @@ public class TruncatedRequestBody { logger.setLevel(Level.ALL); logger.addHandler(h); - InetSocketAddress addr = new InetSocketAddress(0); + InetAddress loopback = InetAddress.getLoopbackAddress(); + InetSocketAddress addr = new InetSocketAddress(loopback, 0); HttpServer server = HttpServer.create(addr, 10); HttpContext ct = server.createContext("/", new Handler()); ExecutorService ex = Executors.newCachedThreadPool(); @@ -101,7 +102,7 @@ public class TruncatedRequestBody { // Test 1: fixed length - Socket sock = new Socket(InetAddress.getLoopbackAddress(), port); + Socket sock = new Socket(loopback, port); String s1 = "POST /foo HTTP/1.1\r\nContent-length: 200000\r\n" + "\r\nfoo bar99"; @@ -115,7 +116,7 @@ public class TruncatedRequestBody { String s2 = "POST /foo HTTP/1.1\r\nTransfer-encoding: chunked\r\n\r\n" + "100\r\nFoo bar"; - sock = new Socket(InetAddress.getLoopbackAddress(), port); + sock = new Socket(loopback, port); os = sock.getOutputStream(); os.write(s2.getBytes(StandardCharsets.ISO_8859_1)); Thread.sleep(500); From 9115f920d2405d889f5a1176d3488aa77a0322d4 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Tue, 11 Jun 2019 13:04:36 -0400 Subject: [PATCH 029/109] 8225189: Multiple JNI calls within critical region in ZIP Library Reviewed-by: alanb --- src/java.base/share/native/libzip/Deflater.c | 77 ++++++++++++-------- src/java.base/share/native/libzip/Inflater.c | 61 ++++++++++------ 2 files changed, 85 insertions(+), 53 deletions(-) diff --git a/src/java.base/share/native/libzip/Deflater.c b/src/java.base/share/native/libzip/Deflater.c index bf204f1d68e..2a5791ec62d 100644 --- a/src/java.base/share/native/libzip/Deflater.c +++ b/src/java.base/share/native/libzip/Deflater.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -76,9 +76,8 @@ Java_java_util_zip_Deflater_init(JNIEnv *env, jclass cls, jint level, } } -static void doSetDictionary(JNIEnv *env, jlong addr, jbyte *buf, jint len) +static void checkSetDictionaryResult(JNIEnv *env, jlong addr, jint res) { - int res = deflateSetDictionary(jlong_to_ptr(addr), (Bytef *) buf, len); switch (res) { case Z_OK: break; @@ -95,30 +94,33 @@ JNIEXPORT void JNICALL Java_java_util_zip_Deflater_setDictionary(JNIEnv *env, jclass cls, jlong addr, jbyteArray b, jint off, jint len) { - jbyte *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0); + int res; + Bytef *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0); if (buf == NULL) /* out of memory */ return; - doSetDictionary(env, addr, buf + off, len); + res = deflateSetDictionary(jlong_to_ptr(addr), buf, len); (*env)->ReleasePrimitiveArrayCritical(env, b, buf, 0); + checkSetDictionaryResult(env, addr, res); } JNIEXPORT void JNICALL Java_java_util_zip_Deflater_setDictionaryBuffer(JNIEnv *env, jclass cls, jlong addr, jlong bufferAddr, jint len) { - jbyte *buf = jlong_to_ptr(bufferAddr); - doSetDictionary(env, addr, buf, len); + int res; + Bytef *buf = jlong_to_ptr(bufferAddr); + res = deflateSetDictionary(jlong_to_ptr(addr), buf, len); + checkSetDictionaryResult(env, addr, res); } -static jlong doDeflate(JNIEnv *env, jobject this, jlong addr, +static jint doDeflate(JNIEnv *env, jlong addr, jbyte *input, jint inputLen, jbyte *output, jint outputLen, jint flush, jint params) { z_stream *strm = jlong_to_ptr(addr); - jint inputUsed = 0, outputUsed = 0; - int finished = 0; int setParams = params & 1; + int res; strm->next_in = (Bytef *) input; strm->next_out = (Bytef *) output; @@ -128,7 +130,24 @@ static jlong doDeflate(JNIEnv *env, jobject this, jlong addr, if (setParams) { int strategy = (params >> 1) & 3; int level = params >> 3; - int res = deflateParams(strm, level, strategy); + res = deflateParams(strm, level, strategy); + } else { + res = deflate(strm, flush); + } + return res; +} + +static jlong checkDeflateStatus(JNIEnv *env, jlong addr, + jint inputLen, + jint outputLen, + jint params, int res) +{ + z_stream *strm = jlong_to_ptr(addr); + jint inputUsed = 0, outputUsed = 0; + int finished = 0; + int setParams = params & 1; + + if (setParams) { switch (res) { case Z_OK: setParams = 0; @@ -142,7 +161,6 @@ static jlong doDeflate(JNIEnv *env, jobject this, jlong addr, return 0; } } else { - int res = deflate(strm, flush); switch (res) { case Z_STREAM_END: finished = 1; @@ -169,6 +187,8 @@ Java_java_util_zip_Deflater_deflateBytesBytes(JNIEnv *env, jobject this, jlong a jbyte *input = (*env)->GetPrimitiveArrayCritical(env, inputArray, 0); jbyte *output; jlong retVal; + jint res; + if (input == NULL) { if (inputLen != 0 && (*env)->ExceptionOccurred(env) == NULL) JNU_ThrowOutOfMemoryError(env, 0); @@ -182,14 +202,13 @@ Java_java_util_zip_Deflater_deflateBytesBytes(JNIEnv *env, jobject this, jlong a return 0L; } - retVal = doDeflate(env, this, addr, - input + inputOff, inputLen, - output + outputOff, outputLen, - flush, params); + res = doDeflate(env, addr, input + inputOff, inputLen,output + outputOff, + outputLen, flush, params); (*env)->ReleasePrimitiveArrayCritical(env, outputArray, output, 0); (*env)->ReleasePrimitiveArrayCritical(env, inputArray, input, 0); + retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res); return retVal; } @@ -203,6 +222,7 @@ Java_java_util_zip_Deflater_deflateBytesBuffer(JNIEnv *env, jobject this, jlong jbyte *input = (*env)->GetPrimitiveArrayCritical(env, inputArray, 0); jbyte *output; jlong retVal; + jint res; if (input == NULL) { if (inputLen != 0 && (*env)->ExceptionOccurred(env) == NULL) JNU_ThrowOutOfMemoryError(env, 0); @@ -210,13 +230,12 @@ Java_java_util_zip_Deflater_deflateBytesBuffer(JNIEnv *env, jobject this, jlong } output = jlong_to_ptr(outputBuffer); - retVal = doDeflate(env, this, addr, - input + inputOff, inputLen, - output, outputLen, - flush, params); + res = doDeflate(env, addr, input + inputOff, inputLen, output, outputLen, + flush, params); (*env)->ReleasePrimitiveArrayCritical(env, inputArray, input, 0); + retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res); return retVal; } @@ -229,19 +248,18 @@ Java_java_util_zip_Deflater_deflateBufferBytes(JNIEnv *env, jobject this, jlong jbyte *input = jlong_to_ptr(inputBuffer); jbyte *output = (*env)->GetPrimitiveArrayCritical(env, outputArray, 0); jlong retVal; + jint res; if (output == NULL) { if (outputLen != 0 && (*env)->ExceptionOccurred(env) == NULL) JNU_ThrowOutOfMemoryError(env, 0); return 0L; } - retVal = doDeflate(env, this, addr, - input, inputLen, - output + outputOff, outputLen, - flush, params); - + res = doDeflate(env, addr, input, inputLen, output + outputOff, outputLen, + flush, params); (*env)->ReleasePrimitiveArrayCritical(env, outputArray, input, 0); + retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res); return retVal; } @@ -253,11 +271,12 @@ Java_java_util_zip_Deflater_deflateBufferBuffer(JNIEnv *env, jobject this, jlong { jbyte *input = jlong_to_ptr(inputBuffer); jbyte *output = jlong_to_ptr(outputBuffer); + jlong retVal; + jint res; - return doDeflate(env, this, addr, - input, inputLen, - output, outputLen, - flush, params); + res = doDeflate(env, addr, input, inputLen, output, outputLen, flush, params); + retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res); + return retVal; } JNIEXPORT jint JNICALL diff --git a/src/java.base/share/native/libzip/Inflater.c b/src/java.base/share/native/libzip/Inflater.c index 1b1040bd7fb..a41e9775bfa 100644 --- a/src/java.base/share/native/libzip/Inflater.c +++ b/src/java.base/share/native/libzip/Inflater.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -87,9 +87,8 @@ Java_java_util_zip_Inflater_init(JNIEnv *env, jclass cls, jboolean nowrap) } } -static void doSetDictionary(JNIEnv *env, jlong addr, jbyte *buf, jint len) +static void checkSetDictionaryResult(JNIEnv *env, jlong addr, int res) { - int res = inflateSetDictionary(jlong_to_ptr(addr), (Bytef *) buf, len); switch (res) { case Z_OK: break; @@ -107,30 +106,31 @@ JNIEXPORT void JNICALL Java_java_util_zip_Inflater_setDictionary(JNIEnv *env, jclass cls, jlong addr, jbyteArray b, jint off, jint len) { - jbyte *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0); + jint res; + Bytef *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0); if (buf == NULL) /* out of memory */ return; - doSetDictionary(env, addr, buf + off, len); + res = inflateSetDictionary(jlong_to_ptr(addr), buf + off, len); (*env)->ReleasePrimitiveArrayCritical(env, b, buf, 0); + checkSetDictionaryResult(env, addr, res); } JNIEXPORT void JNICALL Java_java_util_zip_Inflater_setDictionaryBuffer(JNIEnv *env, jclass cls, jlong addr, jlong bufferAddr, jint len) { - jbyte *buf = jlong_to_ptr(bufferAddr); - doSetDictionary(env, addr, buf, len); + jint res; + Bytef *buf = jlong_to_ptr(bufferAddr); + res = inflateSetDictionary(jlong_to_ptr(addr), buf, len); + checkSetDictionaryResult(env, addr, res); } -static jlong doInflate(JNIEnv *env, jobject this, jlong addr, +static jint doInflate(jlong addr, jbyte *input, jint inputLen, jbyte *output, jint outputLen) { + jint ret; z_stream *strm = jlong_to_ptr(addr); - jint inputUsed = 0, outputUsed = 0; - int finished = 0; - int needDict = 0; - int ret; strm->next_in = (Bytef *) input; strm->next_out = (Bytef *) output; @@ -138,6 +138,16 @@ static jlong doInflate(JNIEnv *env, jobject this, jlong addr, strm->avail_out = outputLen; ret = inflate(strm, Z_PARTIAL_FLUSH); + return ret; +} + +static jlong checkInflateStatus(JNIEnv *env, jobject this, jlong addr, + jint inputLen, jint outputLen, jint ret ) +{ + z_stream *strm = jlong_to_ptr(addr); + jint inputUsed = 0, outputUsed = 0; + int finished = 0; + int needDict = 0; switch (ret) { case Z_STREAM_END: @@ -180,6 +190,7 @@ Java_java_util_zip_Inflater_inflateBytesBytes(JNIEnv *env, jobject this, jlong a { jbyte *input = (*env)->GetPrimitiveArrayCritical(env, inputArray, 0); jbyte *output; + jint ret; jlong retVal; if (input == NULL) { @@ -195,13 +206,13 @@ Java_java_util_zip_Inflater_inflateBytesBytes(JNIEnv *env, jobject this, jlong a return 0L; } - retVal = doInflate(env, this, addr, - input + inputOff, inputLen, - output + outputOff, outputLen); + ret = doInflate(addr, input + inputOff, inputLen, output + outputOff, + outputLen); (*env)->ReleasePrimitiveArrayCritical(env, outputArray, output, 0); (*env)->ReleasePrimitiveArrayCritical(env, inputArray, input, 0); + retVal = checkInflateStatus(env, this, addr, inputLen, outputLen, ret ); return retVal; } @@ -212,6 +223,7 @@ Java_java_util_zip_Inflater_inflateBytesBuffer(JNIEnv *env, jobject this, jlong { jbyte *input = (*env)->GetPrimitiveArrayCritical(env, inputArray, 0); jbyte *output; + jint ret; jlong retVal; if (input == NULL) { @@ -221,11 +233,10 @@ Java_java_util_zip_Inflater_inflateBytesBuffer(JNIEnv *env, jobject this, jlong } output = jlong_to_ptr(outputBuffer); - retVal = doInflate(env, this, addr, - input + inputOff, inputLen, - output, outputLen); + ret = doInflate(addr, input + inputOff, inputLen, output, outputLen); (*env)->ReleasePrimitiveArrayCritical(env, inputArray, input, 0); + retVal = checkInflateStatus(env, this, addr, inputLen, outputLen, ret ); return retVal; } @@ -237,6 +248,7 @@ Java_java_util_zip_Inflater_inflateBufferBytes(JNIEnv *env, jobject this, jlong { jbyte *input = jlong_to_ptr(inputBuffer); jbyte *output = (*env)->GetPrimitiveArrayCritical(env, outputArray, 0); + jint ret; jlong retVal; if (output == NULL) { @@ -245,11 +257,10 @@ Java_java_util_zip_Inflater_inflateBufferBytes(JNIEnv *env, jobject this, jlong return 0L; } - retVal = doInflate(env, this, addr, - input, inputLen, - output + outputOff, outputLen); + ret = doInflate(addr, input, inputLen, output + outputOff, outputLen); (*env)->ReleasePrimitiveArrayCritical(env, outputArray, output, 0); + retVal = checkInflateStatus(env, this, addr, inputLen, outputLen, ret ); return retVal; } @@ -261,10 +272,12 @@ Java_java_util_zip_Inflater_inflateBufferBuffer(JNIEnv *env, jobject this, jlong { jbyte *input = jlong_to_ptr(inputBuffer); jbyte *output = jlong_to_ptr(outputBuffer); + jint ret; + jlong retVal; - return doInflate(env, this, addr, - input, inputLen, - output, outputLen); + ret = doInflate(addr, input, inputLen, output, outputLen); + retVal = checkInflateStatus(env, this, addr, inputLen, outputLen, ret); + return retVal; } JNIEXPORT jint JNICALL From 09efbc41eee291e46fd0e99c1f365c32a10e1eda Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 11 Jun 2019 10:15:30 -0700 Subject: [PATCH 030/109] 8225144: [macos] In Aqua L&F backspace key does not delete when Shift is pressed Reviewed-by: psadhukhan --- .../com/apple/laf/AquaKeyBindings.java | 3 +- .../JTextComponent/6361367/bug6361367.java | 132 ++++++++++++++++++ 2 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 test/jdk/javax/swing/text/JTextComponent/6361367/bug6361367.java diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java index cb32bfc7978..e8e84f4a7d8 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -67,6 +67,7 @@ public class AquaKeyBindings { "DELETE", DefaultEditorKit.deleteNextCharAction, "alt DELETE", "delete-next-word", "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, + "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction, "alt BACK_SPACE", "delete-previous-word", "LEFT", DefaultEditorKit.backwardAction, diff --git a/test/jdk/javax/swing/text/JTextComponent/6361367/bug6361367.java b/test/jdk/javax/swing/text/JTextComponent/6361367/bug6361367.java new file mode 100644 index 00000000000..153e6c7d655 --- /dev/null +++ b/test/jdk/javax/swing/text/JTextComponent/6361367/bug6361367.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2006, 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 + * 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 6361367 7109126 8225144 + @key headful + @summary Tests that backspace key does delete when Shift is pressed +*/ + +import java.awt.Robot; +import java.awt.event.KeyEvent; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.FutureTask; +import java.util.concurrent.atomic.AtomicReference; + +import javax.swing.JComponent; +import javax.swing.JEditorPane; +import javax.swing.JFormattedTextField; +import javax.swing.JFrame; +import javax.swing.JPasswordField; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.text.Caret; +import javax.swing.text.JTextComponent; + +public class bug6361367 { + final static String testString = "123 456 789"; + final static String resultString = "123 456 78"; + final static List> textClasses = Arrays.asList( + JTextArea.class, JEditorPane.class, JTextPane.class, + JTextField.class, JFormattedTextField.class, JPasswordField.class); + + public static void main(String[] args) throws Exception { + for(UIManager.LookAndFeelInfo info: UIManager.getInstalledLookAndFeels()) { + UIManager.setLookAndFeel(info.getClassName()); + System.out.println(info); + for (Class clazz : textClasses) { + boolean res = test(clazz); + if (! res) { + throw new RuntimeException("failed"); + } + } + } + } + + static boolean test(final Class textComponentClass) throws Exception { + final AtomicReference ref = new AtomicReference<>(); + final JTextComponent textComponent = invokeAndWait( + new Callable() { + public JTextComponent call() throws Exception { + return initialize(textComponentClass, ref); + } + }); + waitForFocus(textComponent); + Robot robot = new Robot(); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(250); + robot.keyPress(KeyEvent.VK_END); + robot.keyRelease(KeyEvent.VK_END); + robot.keyPress(KeyEvent.VK_SHIFT); + robot.keyPress(KeyEvent.VK_BACK_SPACE); + robot.keyRelease(KeyEvent.VK_BACK_SPACE); + robot.keyRelease(KeyEvent.VK_SHIFT); + String str = invokeAndWait( + new Callable() { + public String call() throws Exception { + JFrame frame = ref.get(); + if (frame != null) { + frame.dispose(); + } + return textComponent.getText(); + } + }); + return resultString.equals(str); + } + + static JTextComponent initialize( + Class textComponentClass, + AtomicReference ref) throws Exception { + JFrame frame = new JFrame("bug6361367"); + ref.set(frame); + JTextComponent textComponent = textComponentClass.newInstance(); + textComponent.setText(testString); + frame.add(textComponent); + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + textComponent.requestFocus(); + Caret caret = textComponent.getCaret(); + caret.setDot(textComponent.getDocument().getLength()); + return textComponent; + } + + static T invokeAndWait(Callable callable) throws Exception { + FutureTask future = new FutureTask(callable); + SwingUtilities.invokeLater(future); + return future.get(); + } + + static void waitForFocus(JComponent component) throws Exception { + synchronized (component) { + while(! component.isFocusOwner()) { + component.wait(100); + } + } + } +} From f9d8df72532891b2f74ff62b6ddeff6132450930 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Tue, 11 Jun 2019 10:34:42 -0700 Subject: [PATCH 031/109] 8217731: Font rendering and glyph spacing changed from jdk-8 to jdk-11 Reviewed-by: serb, neugens --- .../native/libfontmanager/freetypeScaler.c | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c index 25427a66644..42fd9e0b8d3 100644 --- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c +++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c @@ -29,7 +29,10 @@ #include "sunfontids.h" #include "sun_font_FreetypeFontScaler.h" -#include +#include +#if !defined(_WIN32) && !defined(__APPLE_) +#include +#endif #include #include "ft2build.h" #include FT_FREETYPE_H @@ -39,6 +42,7 @@ #include FT_OUTLINE_H #include FT_SYNTHESIS_H #include FT_LCD_FILTER_H +#include FT_MODULE_H #include "fontscaler.h" @@ -204,6 +208,52 @@ static unsigned long ReadTTFontFileFunc(FT_Stream stream, } } +typedef FT_Error (*FT_Prop_Set_Func)(FT_Library library, + const FT_String* module_name, + const FT_String* property_name, + const void* value ); + +/** + * Prefer the older v35 freetype byte code interpreter. + */ +static void setInterpreterVersion(FT_Library library) { + + char* props = getenv("FREETYPE_PROPERTIES"); + int version = 35; + const char* module = "truetype"; + const char* property = "interpreter-version"; + + /* If some one is setting this, don't override it */ + if (props != NULL && strstr(property, props)) { + return; + } + /* + * FT_Property_Set was introduced in 2.4.11. + * Some older supported Linux OSes may not include it so look + * this up dynamically. + * And if its not available it doesn't matter, since the reason + * we need it dates from 2.7. + * On Windows & Mac the library is always bundled so it is safe + * to use directly in those cases. + */ +#if defined(_WIN32) || defined(__APPLE__) + FT_Property_Set(library, module, property, (void*)(&version)); +#else + void *lib = dlopen("libfreetype.so", RTLD_LOCAL|RTLD_LAZY); + if (lib == NULL) { + lib = dlopen("libfreetype.so.6", RTLD_LOCAL|RTLD_LAZY); + if (lib == NULL) { + return; + } + } + FT_Prop_Set_Func func = (FT_Prop_Set_Func)dlsym(lib, "FT_Property_Set"); + if (func != NULL) { + func(library, module, property, (void*)(&version)); + } + dlclose(lib); +#endif +} + /* * Class: sun_font_FreetypeFontScaler * Method: initNativeScaler @@ -243,6 +293,7 @@ Java_sun_font_FreetypeFontScaler_initNativeScaler( free(scalerInfo); return 0; } + setInterpreterVersion(scalerInfo->library); #define TYPE1_FROM_JAVA 2 From 8813b93095b5ca339f5ee54732af00a0135426aa Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Tue, 11 Jun 2019 21:30:28 +0000 Subject: [PATCH 032/109] 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support Added support for GCM, PSS, and other mechanisms Reviewed-by: jnimeh --- .../sun/security/util/GCMParameters.java | 153 ++ .../sun/security/pkcs11/P11AEADCipher.java | 750 +++++++ .../sun/security/pkcs11/P11PSSSignature.java | 701 ++++++ .../sun/security/pkcs11/P11RSACipher.java | 9 +- .../sun/security/pkcs11/SunPKCS11.java | 85 +- .../pkcs11/wrapper/CK_CCM_PARAMS.java | 83 + .../pkcs11/wrapper/CK_GCM_PARAMS.java | 75 + .../security/pkcs11/wrapper/CK_MECHANISM.java | 55 +- .../wrapper/CK_RSA_PKCS_PSS_PARAMS.java | 141 +- .../security/pkcs11/wrapper/Functions.java | 289 ++- .../sun/security/pkcs11/wrapper/PKCS11.java | 118 +- .../pkcs11/wrapper/PKCS11Constants.java | 786 ++++--- .../pkcs11/wrapper/PKCS11Exception.java | 16 + .../share/legal/pkcs11cryptotoken.md | 42 +- .../share/native/libj2pkcs11/p11_convert.c | 1324 +++++------ .../share/native/libj2pkcs11/p11_crypt.c | 172 +- .../share/native/libj2pkcs11/p11_digest.c | 53 +- .../share/native/libj2pkcs11/p11_general.c | 26 +- .../share/native/libj2pkcs11/p11_keymgmt.c | 223 +- .../share/native/libj2pkcs11/p11_mutex.c | 4 +- .../share/native/libj2pkcs11/p11_sign.c | 221 +- .../share/native/libj2pkcs11/p11_util.c | 149 +- .../share/native/libj2pkcs11/pkcs-11v2-20a3.h | 124 -- .../share/native/libj2pkcs11/pkcs11.h | 82 +- .../share/native/libj2pkcs11/pkcs11f.h | 215 +- .../share/native/libj2pkcs11/pkcs11t.h | 1960 ++++++++++------- .../share/native/libj2pkcs11/pkcs11wrapper.h | 75 +- .../security/pkcs11/Cipher/Test4512704.java | 76 + .../pkcs11/Cipher/TestCICOWithGCM.java | 109 + .../pkcs11/Cipher/TestCICOWithGCMAndAAD.java | 122 + .../pkcs11/Cipher/TestGCMKeyAndIvCheck.java | 197 ++ .../security/pkcs11/Cipher/TestKATForGCM.java | 322 +++ .../pkcs11/MessageDigest/ByteBuffers.java | 55 +- .../pkcs11/Signature/InitAgainPSS.java | 87 + .../Signature/KeyAndParamCheckForPSS.java | 132 ++ .../pkcs11/Signature/SigInteropPSS.java | 121 + .../pkcs11/Signature/SignatureTestPSS.java | 147 ++ .../security/pkcs11/Signature/TestDSA2.java | 93 + 38 files changed, 6567 insertions(+), 2825 deletions(-) create mode 100644 src/java.base/share/classes/sun/security/util/GCMParameters.java create mode 100644 src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java create mode 100644 src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java create mode 100644 src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_CCM_PARAMS.java create mode 100644 src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_GCM_PARAMS.java delete mode 100644 src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs-11v2-20a3.h create mode 100644 test/jdk/sun/security/pkcs11/Cipher/Test4512704.java create mode 100644 test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCM.java create mode 100644 test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCMAndAAD.java create mode 100644 test/jdk/sun/security/pkcs11/Cipher/TestGCMKeyAndIvCheck.java create mode 100644 test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java create mode 100644 test/jdk/sun/security/pkcs11/Signature/InitAgainPSS.java create mode 100644 test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java create mode 100644 test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java create mode 100644 test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java create mode 100644 test/jdk/sun/security/pkcs11/Signature/TestDSA2.java diff --git a/src/java.base/share/classes/sun/security/util/GCMParameters.java b/src/java.base/share/classes/sun/security/util/GCMParameters.java new file mode 100644 index 00000000000..02390777a03 --- /dev/null +++ b/src/java.base/share/classes/sun/security/util/GCMParameters.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 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 + * 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. + */ + +package sun.security.util; + +import java.io.IOException; +import java.security.AlgorithmParametersSpi; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.InvalidParameterSpecException; +import javax.crypto.spec.GCMParameterSpec; +import sun.security.util.HexDumpEncoder; +import sun.security.util.*; + +/** + * This class implements the parameter set used with + * GCM encryption, which is defined in RFC 5084 as follows: + * + *

    + *    GCMParameters ::= SEQUENCE {
    + *      aes-iv      OCTET STRING, -- recommended size is 12 octets
    + *      aes-tLen    AES-GCM-ICVlen DEFAULT 12 }
    + *
    + *    AES-GCM-ICVlen ::= INTEGER (12 | 13 | 14 | 15 | 16)
    + *
    + * 
    + * + * @since 13 + */ +public final class GCMParameters extends AlgorithmParametersSpi { + + // the iv + private byte[] iv; + // the tag length in bytes + private int tLen; + + public GCMParameters() {} + + protected void engineInit(AlgorithmParameterSpec paramSpec) + throws InvalidParameterSpecException { + + if (!(paramSpec instanceof GCMParameterSpec)) { + throw new InvalidParameterSpecException + ("Inappropriate parameter specification"); + } + GCMParameterSpec gps = (GCMParameterSpec) paramSpec; + // need to convert from bits to bytes for ASN.1 encoding + this.tLen = gps.getTLen()/8; + if (this.tLen < 12 || this.tLen > 16 ) { + throw new InvalidParameterSpecException + ("GCM parameter parsing error: unsupported tag len: " + + this.tLen); + } + this.iv = gps.getIV(); + } + + protected void engineInit(byte[] encoded) throws IOException { + DerValue val = new DerValue(encoded); + // check if IV or params + if (val.tag == DerValue.tag_Sequence) { + byte[] iv = val.data.getOctetString(); + int tLen; + if (val.data.available() != 0) { + tLen = val.data.getInteger(); + if (tLen < 12 || tLen > 16 ) { + throw new IOException + ("GCM parameter parsing error: unsupported tag len: " + + tLen); + } + if (val.data.available() != 0) { + throw new IOException + ("GCM parameter parsing error: extra data"); + } + } else { + tLen = 12; + } + this.iv = iv.clone(); + this.tLen = tLen; + } else { + throw new IOException("GCM parameter parsing error: no SEQ tag"); + } + } + + protected void engineInit(byte[] encoded, String decodingMethod) + throws IOException { + engineInit(encoded); + } + + protected + T engineGetParameterSpec(Class paramSpec) + throws InvalidParameterSpecException { + + if (GCMParameterSpec.class.isAssignableFrom(paramSpec)) { + return paramSpec.cast(new GCMParameterSpec(tLen * 8, iv)); + } else { + throw new InvalidParameterSpecException + ("Inappropriate parameter specification"); + } + } + + protected byte[] engineGetEncoded() throws IOException { + DerOutputStream out = new DerOutputStream(); + DerOutputStream bytes = new DerOutputStream(); + + bytes.putOctetString(iv); + // Only put non-default values + if (tLen != 12) { + bytes.putInteger(tLen); + } + out.write(DerValue.tag_Sequence, bytes); + return out.toByteArray(); + } + + protected byte[] engineGetEncoded(String encodingMethod) + throws IOException { + return engineGetEncoded(); + } + + /* + * Returns a formatted string describing the parameters. + */ + protected String engineToString() { + String LINE_SEP = System.lineSeparator(); + HexDumpEncoder encoder = new HexDumpEncoder(); + StringBuilder sb + = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "[" + + encoder.encodeBuffer(iv) + "]"); + + sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP); + return sb.toString(); + } +} diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java new file mode 100644 index 00000000000..97a836cf36c --- /dev/null +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java @@ -0,0 +1,750 @@ +/* Copyright (c) 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 + * 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. + */ +package sun.security.pkcs11; + +import java.io.ByteArrayOutputStream; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.Locale; + +import java.security.*; +import java.security.spec.*; + +import javax.crypto.*; +import javax.crypto.spec.*; + +import sun.nio.ch.DirectBuffer; +import sun.security.jca.JCAUtil; +import sun.security.pkcs11.wrapper.*; +import static sun.security.pkcs11.wrapper.PKCS11Constants.*; + +/** + * P11 AEAD Cipher implementation class. This class currently supports + * AES with GCM mode. + * + * Note that AEAD modes do not use padding, so this class does not have + * its own padding impl. In addition, NSS CKM_AES_GCM only supports single-part + * encryption/decryption, thus the current impl uses PKCS#11 C_Encrypt/C_Decrypt + * calls and buffers data until doFinal is called. + * + * Note that PKCS#11 standard currently only supports GCM and CCM AEAD modes. + * There are no provisions for other AEAD modes yet. + * + * @since 13 + */ +final class P11AEADCipher extends CipherSpi { + + // mode constant for GCM mode + private static final int MODE_GCM = 10; + + // default constants for GCM + private static final int GCM_DEFAULT_TAG_LEN = 16; + private static final int GCM_DEFAULT_IV_LEN = 16; + + private static final String ALGO = "AES"; + + // token instance + private final Token token; + + // mechanism id + private final long mechanism; + + // mode, one of MODE_* above + private final int blockMode; + + // acceptable key size, -1 if more than 1 key sizes are accepted + private final int fixedKeySize; + + // associated session, if any + private Session session = null; + + // key, if init() was called + private P11Key p11Key = null; + + // flag indicating whether an operation is initialized + private boolean initialized = false; + + // falg indicating encrypt or decrypt mode + private boolean encrypt = true; + + // parameters + private byte[] iv = null; + private int tagLen = -1; + private SecureRandom random = JCAUtil.getSecureRandom(); + + // dataBuffer is cleared upon doFinal calls + private ByteArrayOutputStream dataBuffer = new ByteArrayOutputStream(); + // aadBuffer is cleared upon successful init calls + private ByteArrayOutputStream aadBuffer = new ByteArrayOutputStream(); + private boolean updateCalled = false; + + private boolean requireReinit = false; + private P11Key lastEncKey = null; + private byte[] lastEncIv = null; + + P11AEADCipher(Token token, String algorithm, long mechanism) + throws PKCS11Exception, NoSuchAlgorithmException { + super(); + this.token = token; + this.mechanism = mechanism; + + String[] algoParts = algorithm.split("/"); + if (algoParts.length != 3) { + throw new ProviderException("Unsupported Transformation format: " + + algorithm); + } + if (!algoParts[0].startsWith("AES")) { + throw new ProviderException("Only support AES for AEAD cipher mode"); + } + int index = algoParts[0].indexOf('_'); + if (index != -1) { + // should be well-formed since we specify what we support + fixedKeySize = Integer.parseInt(algoParts[0].substring(index+1)) >> 3; + } else { + fixedKeySize = -1; + } + this.blockMode = parseMode(algoParts[1]); + if (!algoParts[2].equals("NoPadding")) { + throw new ProviderException("Only NoPadding is supported for AEAD cipher mode"); + } + } + + protected void engineSetMode(String mode) throws NoSuchAlgorithmException { + // Disallow change of mode for now since currently it's explicitly + // defined in transformation strings + throw new NoSuchAlgorithmException("Unsupported mode " + mode); + } + + private int parseMode(String mode) throws NoSuchAlgorithmException { + mode = mode.toUpperCase(Locale.ENGLISH); + int result; + if (mode.equals("GCM")) { + result = MODE_GCM; + } else { + throw new NoSuchAlgorithmException("Unsupported mode " + mode); + } + return result; + } + + // see JCE spec + protected void engineSetPadding(String padding) + throws NoSuchPaddingException { + // Disallow change of padding for now since currently it's explicitly + // defined in transformation strings + throw new NoSuchPaddingException("Unsupported padding " + padding); + } + + // see JCE spec + protected int engineGetBlockSize() { + return 16; // constant; only AES is supported + } + + // see JCE spec + protected int engineGetOutputSize(int inputLen) { + return doFinalLength(inputLen); + } + + // see JCE spec + protected byte[] engineGetIV() { + return (iv == null) ? null : iv.clone(); + } + + // see JCE spec + protected AlgorithmParameters engineGetParameters() { + if (encrypt && iv == null && tagLen == -1) { + switch (blockMode) { + case MODE_GCM: + iv = new byte[GCM_DEFAULT_IV_LEN]; + tagLen = GCM_DEFAULT_TAG_LEN; + break; + default: + throw new ProviderException("Unsupported mode"); + } + random.nextBytes(iv); + } + try { + AlgorithmParameterSpec spec; + String apAlgo; + switch (blockMode) { + case MODE_GCM: + apAlgo = "GCM"; + spec = new GCMParameterSpec(tagLen << 3, iv); + break; + default: + throw new ProviderException("Unsupported mode"); + } + AlgorithmParameters params = + AlgorithmParameters.getInstance(apAlgo); + params.init(spec); + return params; + } catch (GeneralSecurityException e) { + // NoSuchAlgorithmException, NoSuchProviderException + // InvalidParameterSpecException + throw new ProviderException("Could not encode parameters", e); + } + } + + // see JCE spec + protected void engineInit(int opmode, Key key, SecureRandom sr) + throws InvalidKeyException { + if (opmode == Cipher.DECRYPT_MODE) { + throw new InvalidKeyException("Parameters required for decryption"); + } + updateCalled = false; + try { + implInit(opmode, key, null, -1, sr); + } catch (InvalidAlgorithmParameterException e) { + throw new InvalidKeyException("init() failed", e); + } + } + + // see JCE spec + protected void engineInit(int opmode, Key key, + AlgorithmParameterSpec params, SecureRandom sr) + throws InvalidKeyException, InvalidAlgorithmParameterException { + if (opmode == Cipher.DECRYPT_MODE && params == null) { + throw new InvalidAlgorithmParameterException + ("Parameters required for decryption"); + } + updateCalled = false; + byte[] ivValue = null; + int tagLen = -1; + if (params != null) { + switch (blockMode) { + case MODE_GCM: + if (!(params instanceof GCMParameterSpec)) { + throw new InvalidAlgorithmParameterException + ("Only GCMParameterSpec is supported"); + } + ivValue = ((GCMParameterSpec) params).getIV(); + tagLen = ((GCMParameterSpec) params).getTLen() >> 3; + break; + default: + throw new ProviderException("Unsupported mode"); + } + } + implInit(opmode, key, ivValue, tagLen, sr); + } + + // see JCE spec + protected void engineInit(int opmode, Key key, AlgorithmParameters params, + SecureRandom sr) + throws InvalidKeyException, InvalidAlgorithmParameterException { + if (opmode == Cipher.DECRYPT_MODE && params == null) { + throw new InvalidAlgorithmParameterException + ("Parameters required for decryption"); + } + updateCalled = false; + try { + AlgorithmParameterSpec paramSpec = null; + if (params != null) { + switch (blockMode) { + case MODE_GCM: + paramSpec = + params.getParameterSpec(GCMParameterSpec.class); + break; + default: + throw new ProviderException("Unsupported mode"); + } + } + engineInit(opmode, key, paramSpec, sr); + } catch (InvalidParameterSpecException ex) { + throw new InvalidAlgorithmParameterException(ex); + } + } + + // actual init() implementation + private void implInit(int opmode, Key key, byte[] iv, int tagLen, + SecureRandom sr) + throws InvalidKeyException, InvalidAlgorithmParameterException { + reset(true); + if (fixedKeySize != -1 && key.getEncoded().length != fixedKeySize) { + throw new InvalidKeyException("Key size is invalid"); + } + P11Key newKey = P11SecretKeyFactory.convertKey(token, key, ALGO); + switch (opmode) { + case Cipher.ENCRYPT_MODE: + encrypt = true; + requireReinit = Arrays.equals(iv, lastEncIv) && + (newKey == lastEncKey); + if (requireReinit) { + throw new InvalidAlgorithmParameterException + ("Cannot reuse iv for GCM encryption"); + } + break; + case Cipher.DECRYPT_MODE: + encrypt = false; + requireReinit = false; + break; + default: + throw new InvalidAlgorithmParameterException + ("Unsupported mode: " + opmode); + } + + // decryption without parameters is checked in all engineInit() calls + if (sr != null) { + this.random = sr; + } + if (iv == null && tagLen == -1) { + // generate default values + switch (blockMode) { + case MODE_GCM: + iv = new byte[GCM_DEFAULT_IV_LEN]; + this.random.nextBytes(iv); + tagLen = GCM_DEFAULT_TAG_LEN; + break; + default: + throw new ProviderException("Unsupported mode"); + } + } + this.iv = iv; + this.tagLen = tagLen; + this.p11Key = newKey; + try { + initialize(); + } catch (PKCS11Exception e) { + throw new InvalidKeyException("Could not initialize cipher", e); + } + } + + private void cancelOperation() { + try { + if (session.hasObjects() == false) { + session = token.killSession(session); + return; + } else { + // cancel operation by finishing it + int bufLen = doFinalLength(0); + byte[] buffer = new byte[bufLen]; + + if (encrypt) { + token.p11.C_Encrypt(session.id(), 0, buffer, 0, bufLen, + 0, buffer, 0, bufLen); + } else { + token.p11.C_Decrypt(session.id(), 0, buffer, 0, bufLen, + 0, buffer, 0, bufLen); + } + } + } catch (PKCS11Exception e) { + throw new ProviderException("Cancel failed", e); + } + } + + private void ensureInitialized() throws PKCS11Exception { + if (initialized && aadBuffer.size() > 0) { + // need to cancel first to avoid CKR_OPERATION_ACTIVE + reset(true); + } + if (!initialized) { + initialize(); + } + } + + private void initialize() throws PKCS11Exception { + if (p11Key == null) { + throw new ProviderException( + "Operation cannot be performed without" + + " calling engineInit first"); + } + if (requireReinit) { + throw new IllegalStateException + ("Must use either different key or iv for GCM encryption"); + } + + token.ensureValid(); + + byte[] aad = (aadBuffer.size() > 0? aadBuffer.toByteArray() : null); + + long p11KeyID = p11Key.getKeyID(); + try { + if (session == null) { + session = token.getOpSession(); + } + CK_MECHANISM mechWithParams; + switch (blockMode) { + case MODE_GCM: + mechWithParams = new CK_MECHANISM(mechanism, + new CK_GCM_PARAMS(tagLen << 3, iv, aad)); + break; + default: + throw new ProviderException("Unsupported mode: " + blockMode); + } + if (encrypt) { + token.p11.C_EncryptInit(session.id(), mechWithParams, + p11KeyID); + } else { + token.p11.C_DecryptInit(session.id(), mechWithParams, + p11KeyID); + } + } catch (PKCS11Exception e) { + //e.printStackTrace(); + p11Key.releaseKeyID(); + session = token.releaseSession(session); + throw e; + } finally { + dataBuffer.reset(); + aadBuffer.reset(); + } + initialized = true; + } + + // if doFinal(inLen) is called, how big does the output buffer have to be? + private int doFinalLength(int inLen) { + if (inLen < 0) { + throw new ProviderException("Invalid negative input length"); + } + + int result = inLen + dataBuffer.size(); + if (encrypt) { + result += tagLen; + } else { + // PKCS11Exception: CKR_BUFFER_TOO_SMALL + //result -= tagLen; + } + return result; + } + + // reset the states to the pre-initialized values + private void reset(boolean doCancel) { + if (!initialized) { + return; + } + try { + if (session == null) { + return; + } + if (doCancel && token.explicitCancel) { + cancelOperation(); + } + } finally { + p11Key.releaseKeyID(); + session = token.releaseSession(session); + } + initialized = false; + } + + // see JCE spec + protected byte[] engineUpdate(byte[] in, int inOfs, int inLen) { + updateCalled = true; + int n = implUpdate(in, inOfs, inLen); + return new byte[0]; + } + + // see JCE spec + protected int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out, + int outOfs) throws ShortBufferException { + updateCalled = true; + implUpdate(in, inOfs, inLen); + return 0; + } + + // see JCE spec + @Override + protected int engineUpdate(ByteBuffer inBuffer, ByteBuffer outBuffer) + throws ShortBufferException { + updateCalled = true; + implUpdate(inBuffer); + return 0; + } + + // see JCE spec + @Override + protected synchronized void engineUpdateAAD(byte[] src, int srcOfs, int srcLen) + throws IllegalStateException { + if ((src == null) || (srcOfs < 0) || (srcOfs + srcLen > src.length)) { + throw new IllegalArgumentException("Invalid AAD"); + } + if (requireReinit) { + throw new IllegalStateException + ("Must use either different key or iv for GCM encryption"); + } + if (p11Key == null) { + throw new IllegalStateException("Need to initialize Cipher first"); + } + if (updateCalled) { + throw new IllegalStateException + ("Update has been called; no more AAD data"); + } + aadBuffer.write(src, srcOfs, srcLen); + } + + // see JCE spec + @Override + protected void engineUpdateAAD(ByteBuffer src) + throws IllegalStateException { + if (src == null) { + throw new IllegalArgumentException("Invalid AAD"); + } + byte[] srcBytes = new byte[src.remaining()]; + src.get(srcBytes); + engineUpdateAAD(srcBytes, 0, srcBytes.length); + } + + // see JCE spec + protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen) + throws IllegalBlockSizeException, BadPaddingException { + int minOutLen = doFinalLength(inLen); + try { + byte[] out = new byte[minOutLen]; + int n = engineDoFinal(in, inOfs, inLen, out, 0); + return P11Util.convert(out, 0, n); + } catch (ShortBufferException e) { + // convert since the output length is calculated by doFinalLength() + throw new ProviderException(e); + } finally { + updateCalled = false; + } + } + // see JCE spec + protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out, + int outOfs) throws ShortBufferException, IllegalBlockSizeException, + BadPaddingException { + try { + return implDoFinal(in, inOfs, inLen, out, outOfs, out.length - outOfs); + } finally { + updateCalled = false; + } + } + + // see JCE spec + @Override + protected int engineDoFinal(ByteBuffer inBuffer, ByteBuffer outBuffer) + throws ShortBufferException, IllegalBlockSizeException, + BadPaddingException { + try { + return implDoFinal(inBuffer, outBuffer); + } finally { + updateCalled = false; + } + } + + private int implUpdate(byte[] in, int inOfs, int inLen) { + if (inLen > 0) { + updateCalled = true; + try { + ensureInitialized(); + } catch (PKCS11Exception e) { + //e.printStackTrace(); + reset(false); + throw new ProviderException("update() failed", e); + } + dataBuffer.write(in, inOfs, inLen); + } + // always 0 as NSS only supports single-part encryption/decryption + return 0; + } + + private int implUpdate(ByteBuffer inBuf) { + int inLen = inBuf.remaining(); + if (inLen > 0) { + try { + ensureInitialized(); + } catch (PKCS11Exception e) { + reset(false); + throw new ProviderException("update() failed", e); + } + byte[] data = new byte[inLen]; + inBuf.get(data); + dataBuffer.write(data, 0, data.length); + } + // always 0 as NSS only supports single-part encryption/decryption + return 0; + } + + private int implDoFinal(byte[] in, int inOfs, int inLen, + byte[] out, int outOfs, int outLen) + throws ShortBufferException, IllegalBlockSizeException, + BadPaddingException { + int requiredOutLen = doFinalLength(inLen); + if (outLen < requiredOutLen) { + throw new ShortBufferException(); + } + boolean doCancel = true; + try { + ensureInitialized(); + if (dataBuffer.size() > 0) { + if (in != null && inOfs > 0 && inLen > 0 && + inOfs < (in.length - inLen)) { + dataBuffer.write(in, inOfs, inLen); + } + in = dataBuffer.toByteArray(); + inOfs = 0; + inLen = in.length; + } + int k = 0; + if (encrypt) { + k = token.p11.C_Encrypt(session.id(), 0, in, inOfs, inLen, + 0, out, outOfs, outLen); + doCancel = false; + } else { + // Special handling to match SunJCE provider behavior + if (inLen == 0) { + return 0; + } + k = token.p11.C_Decrypt(session.id(), 0, in, inOfs, inLen, + 0, out, outOfs, outLen); + doCancel = false; + } + return k; + } catch (PKCS11Exception e) { + doCancel = false; + handleException(e); + throw new ProviderException("doFinal() failed", e); + } finally { + if (encrypt) { + lastEncKey = this.p11Key; + lastEncIv = this.iv; + requireReinit = true; + } + reset(doCancel); + } + } + + private int implDoFinal(ByteBuffer inBuffer, ByteBuffer outBuffer) + throws ShortBufferException, IllegalBlockSizeException, + BadPaddingException { + int outLen = outBuffer.remaining(); + int inLen = inBuffer.remaining(); + + int requiredOutLen = doFinalLength(inLen); + if (outLen < requiredOutLen) { + throw new ShortBufferException(); + } + + boolean doCancel = true; + try { + ensureInitialized(); + + long inAddr = 0; + byte[] in = null; + int inOfs = 0; + if (dataBuffer.size() > 0) { + if (inLen > 0) { + byte[] temp = new byte[inLen]; + inBuffer.get(temp); + dataBuffer.write(temp, 0, temp.length); + } + in = dataBuffer.toByteArray(); + inOfs = 0; + inLen = in.length; + } else { + if (inBuffer instanceof DirectBuffer) { + inAddr = ((DirectBuffer) inBuffer).address(); + inOfs = inBuffer.position(); + } else { + if (inBuffer.hasArray()) { + in = inBuffer.array(); + inOfs = inBuffer.position() + inBuffer.arrayOffset(); + } else { + in = new byte[inLen]; + inBuffer.get(in); + } + } + } + long outAddr = 0; + byte[] outArray = null; + int outOfs = 0; + if (outBuffer instanceof DirectBuffer) { + outAddr = ((DirectBuffer) outBuffer).address(); + outOfs = outBuffer.position(); + } else { + if (outBuffer.hasArray()) { + outArray = outBuffer.array(); + outOfs = outBuffer.position() + outBuffer.arrayOffset(); + } else { + outArray = new byte[outLen]; + } + } + + int k = 0; + if (encrypt) { + k = token.p11.C_Encrypt(session.id(), inAddr, in, inOfs, inLen, + outAddr, outArray, outOfs, outLen); + doCancel = false; + } else { + // Special handling to match SunJCE provider behavior + if (inLen == 0) { + return 0; + } + k = token.p11.C_Decrypt(session.id(), inAddr, in, inOfs, inLen, + outAddr, outArray, outOfs, outLen); + doCancel = false; + } + outBuffer.position(outBuffer.position() + k); + return k; + } catch (PKCS11Exception e) { + doCancel = false; + handleException(e); + throw new ProviderException("doFinal() failed", e); + } finally { + if (encrypt) { + lastEncKey = this.p11Key; + lastEncIv = this.iv; + requireReinit = true; + } + reset(doCancel); + } + } + + private void handleException(PKCS11Exception e) + throws ShortBufferException, IllegalBlockSizeException, + BadPaddingException { + long errorCode = e.getErrorCode(); + if (errorCode == CKR_BUFFER_TOO_SMALL) { + throw (ShortBufferException) + (new ShortBufferException().initCause(e)); + } else if (errorCode == CKR_DATA_LEN_RANGE || + errorCode == CKR_ENCRYPTED_DATA_LEN_RANGE) { + throw (IllegalBlockSizeException) + (new IllegalBlockSizeException(e.toString()).initCause(e)); + } else if (errorCode == CKR_ENCRYPTED_DATA_INVALID) { + throw (BadPaddingException) + (new BadPaddingException(e.toString()).initCause(e)); + } + } + + // see JCE spec + protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, + InvalidKeyException { + // XXX key wrapping + throw new UnsupportedOperationException("engineWrap()"); + } + + // see JCE spec + protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, + int wrappedKeyType) + throws InvalidKeyException, NoSuchAlgorithmException { + // XXX key unwrapping + throw new UnsupportedOperationException("engineUnwrap()"); + } + + // see JCE spec + @Override + protected int engineGetKeySize(Key key) throws InvalidKeyException { + int n = P11SecretKeyFactory.convertKey + (token, key, ALGO).length(); + return n; + } +} + diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java new file mode 100644 index 00000000000..c0f48715d80 --- /dev/null +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java @@ -0,0 +1,701 @@ +/* + * Copyright (c) 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 + * 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. + */ + +package sun.security.pkcs11; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import sun.nio.ch.DirectBuffer; + +import java.util.Hashtable; +import java.util.Arrays; +import java.security.*; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.MGF1ParameterSpec; +import java.security.spec.PSSParameterSpec; +import java.security.interfaces.*; +import sun.security.pkcs11.wrapper.*; +import static sun.security.pkcs11.wrapper.PKCS11Constants.*; + + +/** + * RSASSA-PSS Signature implementation class. This class currently supports the + * following algorithms: + * + * . RSA-PSS: + * . RSASSA-PSS + * . SHA1withRSASSA-PSS + * . SHA224withRSASSA-PSS + * . SHA256withRSASSA-PSS + * . SHA384withRSASSA-PSS + * . SHA512withRSASSA-PSS + * + * Note that the underlying PKCS#11 token may support complete signature + * algorithm (e.g. CKM__RSA_PKCS_PSS), or it may just + * implement the signature algorithm without hashing (i.e. CKM_RSA_PKCS_PSS). + * This class uses what is available and adds whatever extra processing + * is needed. + * + * @since 13 + */ +final class P11PSSSignature extends SignatureSpi { + + private final static boolean DEBUG = false; + + // mappings of digest algorithms and their output length in bytes + private static final Hashtable DIGEST_LENGTHS = + new Hashtable(); + + static { + DIGEST_LENGTHS.put("SHA-1", 20); + DIGEST_LENGTHS.put("SHA", 20); + DIGEST_LENGTHS.put("SHA1", 20); + DIGEST_LENGTHS.put("SHA-224", 28); + DIGEST_LENGTHS.put("SHA224", 28); + DIGEST_LENGTHS.put("SHA-256", 32); + DIGEST_LENGTHS.put("SHA256", 32); + DIGEST_LENGTHS.put("SHA-384", 48); + DIGEST_LENGTHS.put("SHA384", 48); + DIGEST_LENGTHS.put("SHA-512", 64); + DIGEST_LENGTHS.put("SHA512", 64); + DIGEST_LENGTHS.put("SHA-512/224", 28); + DIGEST_LENGTHS.put("SHA512/224", 28); + DIGEST_LENGTHS.put("SHA-512/256", 32); + DIGEST_LENGTHS.put("SHA512/256", 32); + } + + // utility method for comparing digest algorithms + // NOTE that first argument is assumed to be standard digest name + private static boolean isDigestEqual(String stdAlg, String givenAlg) { + if (stdAlg == null || givenAlg == null) return false; + + if (givenAlg.indexOf("-") != -1) { + return stdAlg.equalsIgnoreCase(givenAlg); + } else { + if (stdAlg.equals("SHA-1")) { + return (givenAlg.equalsIgnoreCase("SHA") + || givenAlg.equalsIgnoreCase("SHA1")); + } else { + StringBuilder sb = new StringBuilder(givenAlg); + // case-insensitive check + if (givenAlg.regionMatches(true, 0, "SHA", 0, 3)) { + givenAlg = sb.insert(3, "-").toString(); + return stdAlg.equalsIgnoreCase(givenAlg); + } else { + throw new ProviderException("Unsupported digest algorithm " + + givenAlg); + } + } + } + } + + // token instance + private final Token token; + + // algorithm name + private final String algorithm; + + // name of the key algorithm, currently just RSA + private static final String KEY_ALGO = "RSA"; + + // mechanism id + private final CK_MECHANISM mechanism; + + // type, one of T_* below + private final int type; + + // key instance used, if init*() was called + private P11Key p11Key = null; + + // PSS parameters and the flag controlling its access + private PSSParameterSpec sigParams = null; + private boolean isActive = false; + + // message digest alg, if implied by the algorithm name + private final String mdAlg; + + // message digest, if we do the digesting ourselves + private MessageDigest md = null; + + // associated session, if any + private Session session; + + // mode, one of M_* below + private int mode; + + // flag indicating whether an operation is initialized + private boolean initialized = false; + + // buffer, for update(byte) + private final byte[] buffer = new byte[1]; + + // total number of bytes processed in current operation + private int bytesProcessed = 0; + + // constant for signing mode + private final static int M_SIGN = 1; + // constant for verification mode + private final static int M_VERIFY = 2; + + // constant for type digesting, we do the hashing ourselves + private final static int T_DIGEST = 1; + // constant for type update, token does everything + private final static int T_UPDATE = 2; + + P11PSSSignature(Token token, String algorithm, long mechId) + throws NoSuchAlgorithmException, PKCS11Exception { + super(); + this.token = token; + this.algorithm = algorithm; + this.mechanism = new CK_MECHANISM(mechId); + int idx = algorithm.indexOf("with"); + this.mdAlg = (idx == -1? null : algorithm.substring(0, idx)); + switch ((int)mechId) { + case (int)CKM_SHA1_RSA_PKCS_PSS: + case (int)CKM_SHA224_RSA_PKCS_PSS: + case (int)CKM_SHA256_RSA_PKCS_PSS: + case (int)CKM_SHA384_RSA_PKCS_PSS: + case (int)CKM_SHA512_RSA_PKCS_PSS: + type = T_UPDATE; + break; + case (int)CKM_RSA_PKCS_PSS: + type = T_DIGEST; + break; + default: + throw new ProviderException("Unsupported mechanism: " + mechId); + } + this.md = null; + } + + private void ensureInitialized() throws SignatureException { + token.ensureValid(); + if (this.p11Key == null) { + throw new SignatureException("Missing key"); + } + if (this.sigParams == null) { + if (this.mdAlg == null) { + // PSS Parameters are required for signature verification + throw new SignatureException + ("Parameters required for RSASSA-PSS signature"); + } else { + int saltLen = DIGEST_LENGTHS.get(this.mdAlg).intValue(); + // generate default params for both sign and verify? + this.sigParams = new PSSParameterSpec(this.mdAlg, + "MGF1", new MGF1ParameterSpec(this.mdAlg), + saltLen, PSSParameterSpec.TRAILER_FIELD_BC); + this.mechanism.setParameter(new CK_RSA_PKCS_PSS_PARAMS( + this.mdAlg, "MGF1", this.mdAlg, + DIGEST_LENGTHS.get(this.mdAlg).intValue())); + } + } + + if (initialized == false) { + initialize(); + } + } + + // reset the states to the pre-initialized values + private void reset(boolean doCancel) { + if (!initialized) { + return; + } + initialized = false; + try { + if (session == null) { + return; + } + if (doCancel && token.explicitCancel) { + cancelOperation(); + } + } finally { + p11Key.releaseKeyID(); + mechanism.freeHandle(); + session = token.releaseSession(session); + isActive = false; + } + } + + private void cancelOperation() { + token.ensureValid(); + if (DEBUG) System.out.print("Cancelling operation"); + + if (session.hasObjects() == false) { + if (DEBUG) System.out.println(" by killing session"); + session = token.killSession(session); + return; + } + // "cancel" operation by finishing it + if (mode == M_SIGN) { + try { + if (type == T_UPDATE) { + if (DEBUG) System.out.println(" by C_SignFinal"); + token.p11.C_SignFinal(session.id(), 0); + } else { + byte[] digest = + (md == null? new byte[0] : md.digest()); + if (DEBUG) System.out.println(" by C_Sign"); + token.p11.C_Sign(session.id(), digest); + } + } catch (PKCS11Exception e) { + throw new ProviderException("cancel failed", e); + } + } else { // M_VERIFY + try { + byte[] signature = + new byte[(p11Key.length() + 7) >> 3]; + if (type == T_UPDATE) { + if (DEBUG) System.out.println(" by C_VerifyFinal"); + token.p11.C_VerifyFinal(session.id(), signature); + } else { + byte[] digest = + (md == null? new byte[0] : md.digest()); + if (DEBUG) System.out.println(" by C_Verify"); + token.p11.C_Verify(session.id(), digest, signature); + } + } catch (PKCS11Exception e) { + // will fail since the signature is incorrect + // XXX check error code + } + } + } + + // assumes current state is initialized == false + private void initialize() { + if (DEBUG) System.out.println("Initializing"); + + if (p11Key == null) { + throw new ProviderException( + "No Key found, call initSign/initVerify first"); + } + + long keyID = p11Key.getKeyID(); + try { + if (session == null) { + session = token.getOpSession(); + } + if (mode == M_SIGN) { + token.p11.C_SignInit(session.id(), mechanism, keyID); + } else { + token.p11.C_VerifyInit(session.id(), mechanism, keyID); + } + } catch (PKCS11Exception e) { + p11Key.releaseKeyID(); + session = token.releaseSession(session); + throw new ProviderException("Initialization failed", e); + } + if (bytesProcessed != 0) { + bytesProcessed = 0; + if (md != null) { + md.reset(); + } + } + initialized = true; + isActive = false; + if (DEBUG) System.out.println("Initialized"); + } + + private void checkKeySize(Key key) throws InvalidKeyException { + if (DEBUG) System.out.print("Checking Key"); + + if (!key.getAlgorithm().equals(KEY_ALGO)) { + throw new InvalidKeyException("Only " + KEY_ALGO + + " keys are supported"); + } + + CK_MECHANISM_INFO mechInfo = null; + try { + mechInfo = token.getMechanismInfo(mechanism.mechanism); + } catch (PKCS11Exception e) { + // should not happen, ignore for now + if (DEBUG) { + System.out.println("Unexpected exception"); + e.printStackTrace(); + } + } + + int keySize = 0; // in bytes + if (mechInfo != null) { + // check against available native info + int minKeySize = (int) mechInfo.ulMinKeySize; + int maxKeySize = (int) mechInfo.ulMaxKeySize; + if (key instanceof P11Key) { + keySize = (((P11Key) key).length() + 7) >> 3; + } else if (key instanceof RSAKey) { + keySize = ((RSAKey) key).getModulus().bitLength() >> 3; + } else { + throw new InvalidKeyException("Unrecognized key type " + key); + } + if ((minKeySize != -1) && (keySize < minKeySize)) { + throw new InvalidKeyException(KEY_ALGO + + " key must be at least " + minKeySize + " bytes"); + } + if ((maxKeySize != -1) && (keySize > maxKeySize)) { + throw new InvalidKeyException(KEY_ALGO + + " key must be at most " + maxKeySize + " bytes"); + } + } + if (this.sigParams != null) { + String digestAlg = this.sigParams.getDigestAlgorithm(); + int sLen = this.sigParams.getSaltLength(); + int hLen = DIGEST_LENGTHS.get(digestAlg).intValue(); + int minKeyLen = Math.addExact(Math.addExact(sLen, hLen), 2); + + if (keySize < minKeyLen) { + throw new InvalidKeyException + ("Key is too short for current params, need min " + minKeyLen); + } + } + } + + private void setSigParams(AlgorithmParameterSpec p) + throws InvalidAlgorithmParameterException { + if (p == null) { + throw new InvalidAlgorithmParameterException("PSS Parameter required"); + } + if (!(p instanceof PSSParameterSpec)) { + throw new InvalidAlgorithmParameterException + ("Only PSSParameterSpec is supported"); + } + // no need to validate again if same as current signature parameters + PSSParameterSpec params = (PSSParameterSpec) p; + if (params == this.sigParams) return; + + String digestAlgorithm = params.getDigestAlgorithm(); + if (this.mdAlg != null && !isDigestEqual(digestAlgorithm, this.mdAlg)) { + throw new InvalidAlgorithmParameterException + ("Digest algorithm in Signature parameters must be " + + this.mdAlg); + } + Integer digestLen = DIGEST_LENGTHS.get(digestAlgorithm); + if (digestLen == null) { + throw new InvalidAlgorithmParameterException + ("Unsupported digest algorithm in Signature parameters: " + + digestAlgorithm); + } + if (!(params.getMGFAlgorithm().equalsIgnoreCase("MGF1"))) { + throw new InvalidAlgorithmParameterException("Only supports MGF1"); + } + if (params.getTrailerField() != PSSParameterSpec.TRAILER_FIELD_BC) { + throw new InvalidAlgorithmParameterException + ("Only supports TrailerFieldBC(1)"); + } + int saltLen = params.getSaltLength(); + if (this.p11Key != null) { + int maxSaltLen = ((this.p11Key.length() + 7) >> 3) - digestLen.intValue() - 2; + + if (DEBUG) { + System.out.println("Max saltLen = " + maxSaltLen); + System.out.println("Curr saltLen = " + saltLen); + } + if (maxSaltLen < 0 || saltLen > maxSaltLen) { + throw new InvalidAlgorithmParameterException("Invalid with current key size"); + } + } else { + if (DEBUG) System.out.println("No key available for validating saltLen"); + } + + // validated, now try to store the parameter internally + try { + this.mechanism.setParameter( + new CK_RSA_PKCS_PSS_PARAMS(digestAlgorithm, "MGF1", + digestAlgorithm, saltLen)); + this.sigParams = params; + } catch (IllegalArgumentException iae) { + throw new InvalidAlgorithmParameterException(iae); + } + } + + // see JCA spec + @Override + protected void engineInitVerify(PublicKey publicKey) + throws InvalidKeyException { + + if (publicKey == null) { + throw new InvalidKeyException("Key must not be null"); + } + + // Need to check key length whenever a new key is set + if (publicKey != p11Key) { + checkKeySize(publicKey); + } + + reset(true); + mode = M_VERIFY; + p11Key = P11KeyFactory.convertKey(token, publicKey, KEY_ALGO); + + // For PSS, defer PKCS11 initialization calls to update/doFinal as it + // needs both key and params + } + + // see JCA spec + @Override + protected void engineInitSign(PrivateKey privateKey) + throws InvalidKeyException { + + if (privateKey == null) { + throw new InvalidKeyException("Key must not be null"); + } + + // Need to check RSA key length whenever a new key is set + if (privateKey != p11Key) { + checkKeySize(privateKey); + } + + reset(true); + mode = M_SIGN; + p11Key = P11KeyFactory.convertKey(token, privateKey, KEY_ALGO); + + // For PSS, defer PKCS11 initialization calls to update/doFinal as it + // needs both key and params + } + + // see JCA spec + @Override + protected void engineUpdate(byte b) throws SignatureException { + ensureInitialized(); + isActive = true; + buffer[0] = b; + engineUpdate(buffer, 0, 1); + } + + // see JCA spec + @Override + protected void engineUpdate(byte[] b, int ofs, int len) + throws SignatureException { + ensureInitialized(); + if (len == 0) { + return; + } + // check for overflow + if (len + bytesProcessed < 0) { + throw new ProviderException("Processed bytes limits exceeded."); + } + isActive = true; + switch (type) { + case T_UPDATE: + try { + if (mode == M_SIGN) { + System.out.println(this + ": Calling C_SignUpdate"); + token.p11.C_SignUpdate(session.id(), 0, b, ofs, len); + } else { + System.out.println(this + ": Calling C_VerfifyUpdate"); + token.p11.C_VerifyUpdate(session.id(), 0, b, ofs, len); + } + bytesProcessed += len; + } catch (PKCS11Exception e) { + reset(false); + throw new ProviderException(e); + } + break; + case T_DIGEST: + // should not happen as this should be covered by earlier checks + if (md == null) { + throw new ProviderException("PSS Parameters required"); + } + md.update(b, ofs, len); + bytesProcessed += len; + break; + default: + throw new ProviderException("Internal error"); + } + } + + // see JCA spec + @Override + protected void engineUpdate(ByteBuffer byteBuffer) { + try { + ensureInitialized(); + } catch (SignatureException se) { + throw new ProviderException(se); + } + int len = byteBuffer.remaining(); + if (len <= 0) { + return; + } + isActive = true; + switch (type) { + case T_UPDATE: + if (byteBuffer instanceof DirectBuffer == false) { + // cannot do better than default impl + super.engineUpdate(byteBuffer); + return; + } + long addr = ((DirectBuffer)byteBuffer).address(); + int ofs = byteBuffer.position(); + try { + if (mode == M_SIGN) { + System.out.println(this + ": Calling C_SignUpdate"); + token.p11.C_SignUpdate + (session.id(), addr + ofs, null, 0, len); + } else { + System.out.println(this + ": Calling C_VerifyUpdate"); + token.p11.C_VerifyUpdate + (session.id(), addr + ofs, null, 0, len); + } + bytesProcessed += len; + byteBuffer.position(ofs + len); + } catch (PKCS11Exception e) { + reset(false); + throw new ProviderException("Update failed", e); + } + break; + case T_DIGEST: + // should not happen as this should be covered by earlier checks + if (md == null) { + throw new ProviderException("PSS Parameters required"); + } + md.update(byteBuffer); + bytesProcessed += len; + break; + default: + reset(false); + throw new ProviderException("Internal error"); + } + } + + // see JCA spec + @Override + protected byte[] engineSign() throws SignatureException { + ensureInitialized(); + boolean doCancel = true; + if (DEBUG) System.out.print("Generating signature"); + try { + byte[] signature; + if (type == T_UPDATE) { + if (DEBUG) System.out.println(" by C_SignFinal"); + signature = token.p11.C_SignFinal(session.id(), 0); + } else { + if (md == null) { + throw new ProviderException("PSS Parameters required"); + } + byte[] digest = md.digest(); + if (DEBUG) System.out.println(" by C_Sign"); + signature = token.p11.C_Sign(session.id(), digest); + } + doCancel = false; + return signature; + } catch (PKCS11Exception pe) { + doCancel = false; + throw new ProviderException(pe); + } catch (ProviderException e) { + throw e; + } finally { + reset(doCancel); + } + } + + // see JCA spec + @Override + protected boolean engineVerify(byte[] signature) throws SignatureException { + ensureInitialized(); + boolean doCancel = true; + if (DEBUG) System.out.print("Verifying signature"); + try { + if (type == T_UPDATE) { + if (DEBUG) System.out.println(" by C_VerifyFinal"); + token.p11.C_VerifyFinal(session.id(), signature); + } else { + if (md == null) { + throw new ProviderException("PSS Parameters required"); + } + byte[] digest = md.digest(); + if (DEBUG) System.out.println(" by C_Verify"); + token.p11.C_Verify(session.id(), digest, signature); + } + doCancel = false; + return true; + } catch (PKCS11Exception pe) { + doCancel = false; + long errorCode = pe.getErrorCode(); + if (errorCode == CKR_SIGNATURE_INVALID) { + return false; + } + if (errorCode == CKR_SIGNATURE_LEN_RANGE) { + // return false rather than throwing an exception + return false; + } + // ECF bug? + if (errorCode == CKR_DATA_LEN_RANGE) { + return false; + } + throw new ProviderException(pe); + } catch (ProviderException e) { + throw e; + } finally { + reset(doCancel); + } + } + + // see JCA spec + @SuppressWarnings("deprecation") + @Override + protected void engineSetParameter(String param, Object value) + throws InvalidParameterException { + throw new UnsupportedOperationException("setParameter() not supported"); + } + + // see JCA spec + @Override + protected void engineSetParameter(AlgorithmParameterSpec params) + throws InvalidAlgorithmParameterException { + // disallow changing parameters when update has been called + if (isActive) { + throw new ProviderException + ("Cannot set parameters during operations"); + } + setSigParams(params); + if (type == T_DIGEST) { + try { + this.md = MessageDigest.getInstance(sigParams.getDigestAlgorithm()); + } catch (NoSuchAlgorithmException nsae) { + throw new InvalidAlgorithmParameterException(nsae); + } + } + } + + // see JCA spec + @SuppressWarnings("deprecation") + @Override + protected Object engineGetParameter(String param) + throws InvalidParameterException { + throw new UnsupportedOperationException("getParameter() not supported"); + } + + // see JCA spec + @Override + protected AlgorithmParameters engineGetParameters() { + if (this.sigParams != null) { + try { + AlgorithmParameters ap = AlgorithmParameters.getInstance("RSASSA-PSS"); + ap.init(this.sigParams); + return ap; + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + return null; + } +} diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java index aff8b34167f..2b8fc211d1b 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java @@ -275,10 +275,10 @@ final class P11RSACipher extends CipherSpi { long sessId = session.id(); switch (mode) { case MODE_ENCRYPT: - p11.C_Encrypt(sessId, buffer, 0, inLen, buffer, 0, outLen); + p11.C_Encrypt(sessId, 0, buffer, 0, inLen, 0, buffer, 0, outLen); break; case MODE_DECRYPT: - p11.C_Decrypt(sessId, buffer, 0, inLen, buffer, 0, outLen); + p11.C_Decrypt(sessId, 0, buffer, 0, inLen, 0, buffer, 0, outLen); break; case MODE_SIGN: byte[] tmpBuffer = new byte[maxInputSize]; @@ -372,11 +372,11 @@ final class P11RSACipher extends CipherSpi { switch (mode) { case MODE_ENCRYPT: n = p11.C_Encrypt - (session.id(), buffer, 0, bufOfs, out, outOfs, outLen); + (session.id(), 0, buffer, 0, bufOfs, 0, out, outOfs, outLen); break; case MODE_DECRYPT: n = p11.C_Decrypt - (session.id(), buffer, 0, bufOfs, out, outOfs, outLen); + (session.id(), 0, buffer, 0, bufOfs, 0, out, outOfs, outLen); break; case MODE_SIGN: byte[] tmpBuffer = new byte[bufOfs]; @@ -552,6 +552,7 @@ final class P11RSACipher extends CipherSpi { s = token.getObjSession(); long p11KeyType = P11SecretKeyFactory.getPKCS11KeyType(algorithm); + CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_CLASS, CKO_SECRET_KEY), new CK_ATTRIBUTE(CKA_KEY_TYPE, p11KeyType), diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java index 75db3c742c5..de82caa2da6 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, 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 @@ -516,7 +516,9 @@ public final class SunPKCS11 extends AuthProvider { String P11SecretKeyFactory = "sun.security.pkcs11.P11SecretKeyFactory"; String P11Cipher = "sun.security.pkcs11.P11Cipher"; String P11RSACipher = "sun.security.pkcs11.P11RSACipher"; + String P11AEADCipher = "sun.security.pkcs11.P11AEADCipher"; String P11Signature = "sun.security.pkcs11.P11Signature"; + String P11PSSSignature = "sun.security.pkcs11.P11PSSSignature"; // XXX register all aliases @@ -540,6 +542,12 @@ public final class SunPKCS11 extends AuthProvider { d(MD, "SHA-512", P11Digest, s("2.16.840.1.101.3.4.2.3", "OID.2.16.840.1.101.3.4.2.3"), m(CKM_SHA512)); + d(MD, "SHA-512/224", P11Digest, + s("2.16.840.1.101.3.4.2.5", "OID.2.16.840.1.101.3.4.2.5"), + m(CKM_SHA512_224)); + d(MD, "SHA-512/256", P11Digest, + s("2.16.840.1.101.3.4.2.6", "OID.2.16.840.1.101.3.4.2.6"), + m(CKM_SHA512_256)); d(MAC, "HmacMD5", P11MAC, m(CKM_MD5_HMAC)); @@ -558,13 +566,22 @@ public final class SunPKCS11 extends AuthProvider { d(MAC, "HmacSHA512", P11MAC, s("1.2.840.113549.2.11", "OID.1.2.840.113549.2.11"), m(CKM_SHA512_HMAC)); + d(MAC, "HmacSHA512/224", P11MAC, + s("1.2.840.113549.2.12", "OID.1.2.840.113549.2.12"), + m(CKM_SHA512_224_HMAC)); + d(MAC, "HmacSHA512/256", P11MAC, + s("1.2.840.113549.2.13", "OID.1.2.840.113549.2.13"), + m(CKM_SHA512_256_HMAC)); + d(MAC, "SslMacMD5", P11MAC, m(CKM_SSL3_MD5_MAC)); d(MAC, "SslMacSHA1", P11MAC, m(CKM_SSL3_SHA1_MAC)); d(KPG, "RSA", P11KeyPairGenerator, + s("1.2.840.113549.1.1", "OID.1.2.840.113549.1.1"), m(CKM_RSA_PKCS_KEY_PAIR_GEN)); + d(KPG, "DSA", P11KeyPairGenerator, s("1.3.14.3.2.12", "1.2.840.10040.4.1", "OID.1.2.840.10040.4.1"), m(CKM_DSA_KEY_PAIR_GEN)); @@ -587,6 +604,7 @@ public final class SunPKCS11 extends AuthProvider { // register (Secret)KeyFactories if there are any mechanisms // for a particular algorithm that we support d(KF, "RSA", P11RSAKeyFactory, + s("1.2.840.113549.1.1", "OID.1.2.840.113549.1.1"), m(CKM_RSA_PKCS_KEY_PAIR_GEN, CKM_RSA_PKCS, CKM_RSA_X_509)); d(KF, "DSA", P11DSAKeyFactory, s("1.3.14.3.2.12", "1.2.840.10040.4.1", "OID.1.2.840.10040.4.1"), @@ -600,10 +618,14 @@ public final class SunPKCS11 extends AuthProvider { // AlgorithmParameters for EC. // Only needed until we have an EC implementation in the SUN provider. d(AGP, "EC", "sun.security.util.ECParameters", - s("1.2.840.10045.2.1"), + s("1.2.840.10045.2.1"), m(CKM_EC_KEY_PAIR_GEN, CKM_ECDH1_DERIVE, CKM_ECDSA, CKM_ECDSA_SHA1)); + + d(AGP, "GCM", "sun.security.util.GCMParameters", + m(CKM_AES_GCM)); + d(KA, "DH", P11KeyAgreement, s("DiffieHellman"), m(CKM_DH_PKCS_DERIVE)); d(KA, "ECDH", "sun.security.pkcs11.P11ECDHKeyAgreement", @@ -669,12 +691,24 @@ public final class SunPKCS11 extends AuthProvider { m(CKM_AES_ECB)); d(CIP, "AES/CTR/NoPadding", P11Cipher, m(CKM_AES_CTR)); + + d(CIP, "AES/GCM/NoPadding", P11AEADCipher, + m(CKM_AES_GCM)); + d(CIP, "AES_128/GCM/NoPadding", P11AEADCipher, + s("2.16.840.1.101.3.4.1.6", "OID.2.16.840.1.101.3.4.1.6"), + m(CKM_AES_GCM)); + d(CIP, "AES_192/GCM/NoPadding", P11AEADCipher, + s("2.16.840.1.101.3.4.1.26", "OID.2.16.840.1.101.3.4.1.26"), + m(CKM_AES_GCM)); + d(CIP, "AES_256/GCM/NoPadding", P11AEADCipher, + s("2.16.840.1.101.3.4.1.46", "OID.2.16.840.1.101.3.4.1.46"), + m(CKM_AES_GCM)); + d(CIP, "Blowfish/CBC/NoPadding", P11Cipher, m(CKM_BLOWFISH_CBC)); d(CIP, "Blowfish/CBC/PKCS5Padding", P11Cipher, m(CKM_BLOWFISH_CBC)); - // XXX RSA_X_509, RSA_OAEP not yet supported d(CIP, "RSA/ECB/PKCS1Padding", P11RSACipher, s("RSA"), m(CKM_RSA_PKCS)); d(CIP, "RSA/ECB/NoPadding", P11RSACipher, @@ -686,12 +720,25 @@ public final class SunPKCS11 extends AuthProvider { s("SHA1withDSA", "1.3.14.3.2.13", "1.3.14.3.2.27", "1.2.840.10040.4.3", "OID.1.2.840.10040.4.3"), m(CKM_DSA_SHA1, CKM_DSA)); + d(SIG, "SHA224withDSA", P11Signature, + s("2.16.840.1.101.3.4.3.1", "OID.2.16.840.1.101.3.4.3.1"), + m(CKM_DSA_SHA224)); + d(SIG, "SHA256withDSA", P11Signature, + s("2.16.840.1.101.3.4.3.2", "OID.2.16.840.1.101.3.4.3.2"), + m(CKM_DSA_SHA256)); + d(SIG, "SHA384withDSA", P11Signature, + s("2.16.840.1.101.3.4.3.3", "OID.2.16.840.1.101.3.4.3.3"), + m(CKM_DSA_SHA384)); + d(SIG, "SHA512withDSA", P11Signature, + s("2.16.840.1.101.3.4.3.4", "OID.2.16.840.1.101.3.4.3.4"), + m(CKM_DSA_SHA512)); d(SIG, "RawDSAinP1363Format", P11Signature, s("NONEwithDSAinP1363Format"), m(CKM_DSA)); d(SIG, "DSAinP1363Format", P11Signature, s("SHA1withDSAinP1363Format"), m(CKM_DSA_SHA1, CKM_DSA)); + d(SIG, "NONEwithECDSA", P11Signature, m(CKM_ECDSA)); d(SIG, "SHA1withECDSA", P11Signature, @@ -743,6 +790,19 @@ public final class SunPKCS11 extends AuthProvider { d(SIG, "SHA512withRSA", P11Signature, s("1.2.840.113549.1.1.13", "OID.1.2.840.113549.1.1.13"), m(CKM_SHA512_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509)); + d(SIG, "RSASSA-PSS", P11PSSSignature, + s("1.2.840.113549.1.1.10", "OID.1.2.840.113549.1.1.10"), + m(CKM_RSA_PKCS_PSS)); + d(SIG, "SHA1withRSASSA-PSS", P11PSSSignature, + m(CKM_SHA1_RSA_PKCS_PSS)); + d(SIG, "SHA224withRSASSA-PSS", P11PSSSignature, + m(CKM_SHA224_RSA_PKCS_PSS)); + d(SIG, "SHA256withRSASSA-PSS", P11PSSSignature, + m(CKM_SHA256_RSA_PKCS_PSS)); + d(SIG, "SHA384withRSASSA-PSS", P11PSSSignature, + m(CKM_SHA384_RSA_PKCS_PSS)); + d(SIG, "SHA512withRSASSA-PSS", P11PSSSignature, + m(CKM_SHA512_RSA_PKCS_PSS)); d(KG, "SunTlsRsaPremasterSecret", "sun.security.pkcs11.P11TlsRsaPremasterSecretGenerator", @@ -1008,11 +1068,17 @@ public final class SunPKCS11 extends AuthProvider { } else if (type == CIP) { if (algorithm.startsWith("RSA")) { return new P11RSACipher(token, algorithm, mechanism); + } else if (algorithm.endsWith("GCM/NoPadding")) { + return new P11AEADCipher(token, algorithm, mechanism); } else { return new P11Cipher(token, algorithm, mechanism); } } else if (type == SIG) { - return new P11Signature(token, algorithm, mechanism); + if (algorithm.indexOf("RSASSA-PSS") != -1) { + return new P11PSSSignature(token, algorithm, mechanism); + } else { + return new P11Signature(token, algorithm, mechanism); + } } else if (type == MAC) { return new P11Mac(token, algorithm, mechanism); } else if (type == KPG) { @@ -1051,7 +1117,14 @@ public final class SunPKCS11 extends AuthProvider { } else if (type == KS) { return token.getKeyStore(); } else if (type == AGP) { - return new sun.security.util.ECParameters(); + if (algorithm == "EC") { + return new sun.security.util.ECParameters(); + } else if (algorithm == "GCM") { + return new sun.security.util.GCMParameters(); + } else { + throw new NoSuchAlgorithmException("Unsupported algorithm: " + + algorithm); + } } else { throw new NoSuchAlgorithmException("Unknown type: " + type); } @@ -1070,7 +1143,7 @@ public final class SunPKCS11 extends AuthProvider { String keyAlgorithm = key.getAlgorithm(); // RSA signatures and cipher if (((type == CIP) && algorithm.startsWith("RSA")) - || (type == SIG) && algorithm.endsWith("RSA")) { + || (type == SIG) && (algorithm.indexOf("RSA") != -1)) { if (keyAlgorithm.equals("RSA") == false) { return false; } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_CCM_PARAMS.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_CCM_PARAMS.java new file mode 100644 index 00000000000..e8748d425cd --- /dev/null +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_CCM_PARAMS.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 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. 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. + */ + +package sun.security.pkcs11.wrapper; + +/** + * This class represents the necessary parameters required by + * the CKM_AES_CCM mechanism as defined in CK_CCM_PARAMS structure.

    + * PKCS#11 structure: + *

    + * typedef struct CK_CCM_PARAMS {
    + *   CK_ULONG ulDataLen;
    + *   CK_BYTE_PTR pNonce;
    + *   CK_ULONG ulNonceLen;
    + *   CK_BYTE_PTR pAAD;
    + *   CK_ULONG ulAADLen;
    + *   CK_ULONG ulMACLen;
    + * } CK_CCM_PARAMS;
    + * 
    + * + * @since 13 + */ +public class CK_CCM_PARAMS { + + private final long dataLen; + private final byte[] nonce; + private final byte[] aad; + private final long macLen; + + public CK_CCM_PARAMS(int tagLen, byte[] iv, byte[] aad, int dataLen) { + this.dataLen = dataLen; + this.nonce = iv; + this.aad = aad; + this.macLen = tagLen; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + + sb.append(Constants.INDENT); + sb.append("ulDataLen: "); + sb.append(dataLen); + sb.append(Constants.NEWLINE); + + sb.append(Constants.INDENT); + sb.append("iv: "); + sb.append(Functions.toHexString(nonce)); + sb.append(Constants.NEWLINE); + + sb.append(Constants.INDENT); + sb.append("aad: "); + sb.append(Functions.toHexString(aad)); + sb.append(Constants.NEWLINE); + + sb.append(Constants.INDENT); + sb.append("tagLen: "); + sb.append(macLen); + + return sb.toString(); + } +} diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_GCM_PARAMS.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_GCM_PARAMS.java new file mode 100644 index 00000000000..0389dda2818 --- /dev/null +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_GCM_PARAMS.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 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 + * 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. + */ + +package sun.security.pkcs11.wrapper; + +/** + * This class represents the necessary parameters required by + * the CKM_AES_GCM mechanism as defined in CK_GCM_PARAMS structure.

    + * PKCS#11 structure: + *

    + * typedef struct CK_GCM_PARAMS {
    + *    CK_BYTE_PTR       pIv;
    + *    CK_ULONG          ulIvLen;
    + *    CK_BYTE_PTR       pAAD;
    + *    CK_ULONG          ulAADLen;
    + *    CK_ULONG          ulTagBits;
    + * } CK_GCM_PARAMS;
    + * 
    + * + * @since 10 + */ +public class CK_GCM_PARAMS { + + private final byte[] iv; + private final byte[] aad; + private final long tagBits; + + public CK_GCM_PARAMS(int tagLenInBits, byte[] iv, byte[] aad) { + this.iv = iv; + this.aad = aad; + this.tagBits = tagLenInBits; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + + sb.append(Constants.INDENT); + sb.append("iv: "); + sb.append(Functions.toHexString(iv)); + sb.append(Constants.NEWLINE); + + sb.append(Constants.INDENT); + sb.append("aad: "); + sb.append(Functions.toHexString(aad)); + sb.append(Constants.NEWLINE); + + sb.append(Constants.INDENT); + sb.append("tagLen(in bits): "); + sb.append(tagBits); + + return sb.toString(); + } +} diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java index 84f8508a3fd..1e546462163 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -82,11 +82,15 @@ public class CK_MECHANISM { * CK_ULONG ulParameterLen; * */ - public Object pParameter; + public Object pParameter = null; - public CK_MECHANISM() { - // empty - } + // pointer to native CK_MECHANISM structure + // For mechanisms which have only mechanism id, the native structure + // can be freed right after init and this field will not be used. However, + // for mechanisms which have both mechanism id and parameters, it can + // only be freed after operation is finished. Thus, the native pointer + // will be stored here and then be explicitly freed by caller. + private long pHandle = 0L; public CK_MECHANISM(long mechanism) { this.mechanism = mechanism; @@ -95,7 +99,6 @@ public class CK_MECHANISM { // We don't have a (long,Object) constructor to force type checking. // This makes sure we don't accidentally pass a class that the native // code cannot handle. - public CK_MECHANISM(long mechanism, byte[] pParameter) { init(mechanism, pParameter); } @@ -144,6 +147,33 @@ public class CK_MECHANISM { init(mechanism, params); } + public CK_MECHANISM(long mechanism, CK_GCM_PARAMS params) { + init(mechanism, params); + } + + public CK_MECHANISM(long mechanism, CK_CCM_PARAMS params) { + init(mechanism, params); + } + + // For PSS. the parameter may be set multiple times, use the + // CK_MECHANISM(long) constructor and setParameter(CK_RSA_PKCS_PSS_PARAMS) + // methods instead of creating yet another constructor + public void setParameter(CK_RSA_PKCS_PSS_PARAMS params) { + assert(this.mechanism == CKM_RSA_PKCS_PSS); + assert(params != null); + if (this.pParameter != null && this.pParameter.equals(params)) { + return; + } + freeHandle(); + this.pParameter = params; + } + + public void freeHandle() { + if (this.pHandle != 0L) { + this.pHandle = PKCS11.freeMechanism(pHandle); + } + } + private void init(long mechanism, Object pParameter) { this.mechanism = mechanism; this.pParameter = pParameter; @@ -167,12 +197,17 @@ public class CK_MECHANISM { sb.append(pParameter.toString()); sb.append(Constants.NEWLINE); + /* sb.append(Constants.INDENT); sb.append("ulParameterLen: ??"); - //buffer.append(pParameter.length); - //buffer.append(Constants.NEWLINE); - + sb.append(Constants.NEWLINE); + */ + if (pHandle != 0L) { + sb.append(Constants.INDENT); + sb.append("pHandle: "); + sb.append(pHandle); + sb.append(Constants.NEWLINE); + } return sb.toString() ; } - } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java index fd11493c827..7309f0d2e72 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java @@ -1,118 +1,105 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! - */ -/* Copyright (c) 2002 Graz University of Technology. All rights reserved. + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 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. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * 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). * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 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. * - * 3. The end-user documentation included with the redistribution, if any, must - * include the following acknowledgment: - * - * "This product includes software developed by IAIK of Graz University of - * Technology." - * - * Alternately, this acknowledgment may appear in the software itself, if - * and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Graz University of Technology" and "IAIK of Graz University of - * Technology" must not be used to endorse or promote products derived from - * this software without prior written permission. - * - * 5. Products derived from this software may not be called - * "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior - * written permission of Graz University of Technology. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 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 sun.security.pkcs11.wrapper; +import java.security.ProviderException; +import java.security.spec.PSSParameterSpec; +import java.security.spec.MGF1ParameterSpec; /** - * class CK_RSA_PKCS_PSS_PARAMS provides the parameters to the CKM_RSA_PKCS_OAEP - * mechanism.

    + * This class represents the necessary parameters required by the + * CKM_RSA_PKCS_PSS mechanism as defined in CK_RSA_PKCS_PSS_PARAMS structure.

    * PKCS#11 structure: *

      * typedef struct CK_RSA_PKCS_PSS_PARAMS {
    - *   CK_MECHANISM_TYPE hashAlg;
    - *   CK_RSA_PKCS_MGF_TYPE mgf;
    - *   CK_ULONG sLen;
    + *    CK_MECHANISM_TYPE    hashAlg;
    + *    CK_RSA_PKCS_MGF_TYPE mgf;
    + *    CK_ULONG             sLen;
      * } CK_RSA_PKCS_PSS_PARAMS;
      * 
    * - * @author Karl Scheibelhofer + * @since 13 */ public class CK_RSA_PKCS_PSS_PARAMS { - /** - * PKCS#11: - *
    -     *   CK_MECHANISM_TYPE hashAlg;
    -     * 
    - */ - public long hashAlg; + private final long hashAlg; + private final long mgf; + private final long sLen; - /** - * PKCS#11: - *
    -     *   CK_RSA_PKCS_MGF_TYPE mgf;
    -     * 
    - */ - public long mgf; + public CK_RSA_PKCS_PSS_PARAMS(String hashAlg, String mgfAlg, + String mgfHash, int sLen) { + this.hashAlg = Functions.getHashMechId(hashAlg); + if (!mgfAlg.equals("MGF1")) { + throw new ProviderException("Only MGF1 is supported"); + } + // no dash in PKCS#11 mechanism names + this.mgf = Functions.getMGFId("CKG_MGF1_" + hashAlg.replaceFirst("-", "")); + this.sLen = sLen; + } - /** - * PKCS#11: - *
    -     *   CK_ULONG sLen;
    -     * 
    - */ - public long sLen; + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } - /** - * Returns the string representation of CK_PKCS5_PBKD2_PARAMS. - * - * @return the string representation of CK_PKCS5_PBKD2_PARAMS - */ + if (!(o instanceof CK_RSA_PKCS_PSS_PARAMS)) { + return false; + } + + CK_RSA_PKCS_PSS_PARAMS other = (CK_RSA_PKCS_PSS_PARAMS) o; + return ((other.hashAlg == hashAlg) && + (other.mgf == mgf) && + (other.sLen == sLen)); + } + + @Override + public int hashCode() { + return (int)(hashAlg << 2 + mgf << 1 + sLen); + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(Constants.INDENT); - sb.append("hashAlg: 0x"); + sb.append("hashAlg: "); sb.append(Functions.toFullHexString(hashAlg)); sb.append(Constants.NEWLINE); sb.append(Constants.INDENT); - sb.append("mgf: 0x"); + sb.append("mgf: "); sb.append(Functions.toFullHexString(mgf)); sb.append(Constants.NEWLINE); sb.append(Constants.INDENT); - sb.append("sLen: "); + sb.append("sLen(in bytes): "); sb.append(sLen); - //buffer.append(Constants.NEWLINE); return sb.toString(); } - } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/Functions.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/Functions.java index b150a126d51..7e5593f8703 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/Functions.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/Functions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -97,6 +97,13 @@ public class Functions { private static final Map objectClassIds = new HashMap(); + // MGFs (CKG_*) + private static final Map mgfNames = + new HashMap(); + + private static final Map mgfIds = + new HashMap(); + /** * For converting numbers to their hex presentation. */ @@ -401,7 +408,11 @@ public class Functions { name = nameMap.get(Integer.valueOf((int)id)); } if (name == null) { - name = "Unknown 0x" + toFullHexString(id); + if ((id & CKM_VENDOR_DEFINED) != 0) { + name = "(Vendor-Specific) 0x" + toFullHexString(id); + } else { + name = "(Unknown) 0x" + toFullHexString(id); + } } return name; } @@ -450,6 +461,14 @@ public class Functions { return hashMechIds.get(name); } + public static String getMGFName(long id) { + return getName(mgfNames, id); + } + + public static long getMGFId(String name) { + return getId(mgfIds, name); + } + /** * Check the given arrays for equalitiy. This method considers both arrays as * equal, if both are null or both have the same length and @@ -595,8 +614,14 @@ public class Functions { addMapping(objectClassNames, objectClassIds, id, name); } - private static void addHashMech(long id, String name) { - hashMechIds.put(name, id); + private static void addHashMech(long id, String... names) { + for (String n : names) { + hashMechIds.put(n, id); + } + } + + private static void addMGF(long id, String name) { + addMapping(mgfNames, mgfIds, id, name); } static { @@ -618,16 +643,27 @@ public class Functions { addMech(CKM_DSA_KEY_PAIR_GEN, "CKM_DSA_KEY_PAIR_GEN"); addMech(CKM_DSA, "CKM_DSA"); addMech(CKM_DSA_SHA1, "CKM_DSA_SHA1"); + addMech(CKM_DSA_SHA224, "CKM_DSA_SHA224"); + addMech(CKM_DSA_SHA256, "CKM_DSA_SHA256"); + addMech(CKM_DSA_SHA384, "CKM_DSA_SHA384"); + addMech(CKM_DSA_SHA512, "CKM_DSA_SHA512"); + addMech(CKM_DH_PKCS_KEY_PAIR_GEN, "CKM_DH_PKCS_KEY_PAIR_GEN"); addMech(CKM_DH_PKCS_DERIVE, "CKM_DH_PKCS_DERIVE"); addMech(CKM_X9_42_DH_KEY_PAIR_GEN, "CKM_X9_42_DH_KEY_PAIR_GEN"); addMech(CKM_X9_42_DH_DERIVE, "CKM_X9_42_DH_DERIVE"); addMech(CKM_X9_42_DH_HYBRID_DERIVE, "CKM_X9_42_DH_HYBRID_DERIVE"); addMech(CKM_X9_42_MQV_DERIVE, "CKM_X9_42_MQV_DERIVE"); - addMech(CKM_SHA224_RSA_PKCS, "CKM_SHA224_RSA_PKCS"); + addMech(CKM_SHA256_RSA_PKCS, "CKM_SHA256_RSA_PKCS"); addMech(CKM_SHA384_RSA_PKCS, "CKM_SHA384_RSA_PKCS"); addMech(CKM_SHA512_RSA_PKCS, "CKM_SHA512_RSA_PKCS"); + addMech(CKM_SHA256_RSA_PKCS_PSS, "CKM_SHA256_RSA_PKCS_PSS"); + addMech(CKM_SHA384_RSA_PKCS_PSS, "CKM_SHA384_RSA_PKCS_PSS"); + addMech(CKM_SHA512_RSA_PKCS_PSS, "CKM_SHA512_RSA_PKCS_PSS"); + addMech(CKM_SHA224_RSA_PKCS, "CKM_SHA224_RSA_PKCS"); + addMech(CKM_SHA224_RSA_PKCS_PSS, "CKM_SHA224_RSA_PKCS_PSS"); + addMech(CKM_RC2_KEY_GEN, "CKM_RC2_KEY_GEN"); addMech(CKM_RC2_ECB, "CKM_RC2_ECB"); addMech(CKM_RC2_CBC, "CKM_RC2_CBC"); @@ -649,12 +685,21 @@ public class Functions { addMech(CKM_DES3_MAC, "CKM_DES3_MAC"); addMech(CKM_DES3_MAC_GENERAL, "CKM_DES3_MAC_GENERAL"); addMech(CKM_DES3_CBC_PAD, "CKM_DES3_CBC_PAD"); + addMech(CKM_DES3_CMAC_GENERAL, "CKM_DES3_CMAC_GENERAL"); + addMech(CKM_DES3_CMAC, "CKM_DES3_CMAC"); + addMech(CKM_CDMF_KEY_GEN, "CKM_CDMF_KEY_GEN"); addMech(CKM_CDMF_ECB, "CKM_CDMF_ECB"); addMech(CKM_CDMF_CBC, "CKM_CDMF_CBC"); addMech(CKM_CDMF_MAC, "CKM_CDMF_MAC"); addMech(CKM_CDMF_MAC_GENERAL, "CKM_CDMF_MAC_GENERAL"); addMech(CKM_CDMF_CBC_PAD, "CKM_CDMF_CBC_PAD"); + + addMech(CKM_DES_OFB64, "CKM_DES_OFB64"); + addMech(CKM_DES_OFB8, "CKM_DES_OFB8"); + addMech(CKM_DES_CFB64, "CKM_DES_CFB64"); + addMech(CKM_DES_CFB8, "CKM_DES_CFB8"); + addMech(CKM_MD2, "CKM_MD2"); addMech(CKM_MD2_HMAC, "CKM_MD2_HMAC"); addMech(CKM_MD2_HMAC_GENERAL, "CKM_MD2_HMAC_GENERAL"); @@ -682,6 +727,26 @@ public class Functions { addMech(CKM_SHA512, "CKM_SHA512"); addMech(CKM_SHA512_HMAC, "CKM_SHA512_HMAC"); addMech(CKM_SHA512_HMAC_GENERAL, "CKM_SHA512_HMAC_GENERAL"); + addMech(CKM_SHA512_224, "CKM_SHA512_224"); + addMech(CKM_SHA512_224_HMAC, "CKM_SHA512_224_HMAC"); + addMech(CKM_SHA512_224_HMAC_GENERAL, "CKM_SHA512_224_HMAC_GENERAL"); + addMech(CKM_SHA512_224_KEY_DERIVATION, "CKM_SHA512_224_KEY_DERIVATION"); + addMech(CKM_SHA512_256, "CKM_SHA512_256"); + addMech(CKM_SHA512_256_HMAC, "CKM_SHA512_256_HMAC"); + addMech(CKM_SHA512_256_HMAC_GENERAL, "CKM_SHA512_256_HMAC_GENERAL"); + addMech(CKM_SHA512_256_KEY_DERIVATION, "CKM_SHA512_256_KEY_DERIVATION"); + addMech(CKM_SHA512_T, "CKM_SHA512_T"); + addMech(CKM_SHA512_T_HMAC, "CKM_SHA512_T_HMAC"); + addMech(CKM_SHA512_T_HMAC_GENERAL, "CKM_SHA512_T_HMAC_GENERAL"); + addMech(CKM_SHA512_T_KEY_DERIVATION, "CKM_SHA512_T_KEY_DERIVATION"); + + addMech(CKM_SECURID_KEY_GEN, "CKM_SECURID_KEY_GEN"); + addMech(CKM_SECURID, "CKM_SECURID"); + addMech(CKM_HOTP_KEY_GEN, "CKM_HOTP_KEY_GEN"); + addMech(CKM_HOTP, "CKM_HOTP"); + addMech(CKM_ACTI, "CKM_ACTI"); + addMech(CKM_ACTI_KEY_GEN, "CKM_ACTI_KEY_GEN"); + addMech(CKM_CAST_KEY_GEN, "CKM_CAST_KEY_GEN"); addMech(CKM_CAST_ECB, "CKM_CAST_ECB"); addMech(CKM_CAST_CBC, "CKM_CAST_CBC"); @@ -729,10 +794,7 @@ public class Functions { addMech(CKM_TLS_PRF, "CKM_TLS_PRF"); addMech(CKM_SSL3_MD5_MAC, "CKM_SSL3_MD5_MAC"); addMech(CKM_SSL3_SHA1_MAC, "CKM_SSL3_SHA1_MAC"); - addMech(CKM_TLS12_MASTER_KEY_DERIVE, "CKM_TLS12_MASTER_KEY_DERIVE"); - addMech(CKM_TLS12_KEY_AND_MAC_DERIVE, "CKM_TLS12_KEY_AND_MAC_DERIVE"); - addMech(CKM_TLS12_MASTER_KEY_DERIVE_DH, "CKM_TLS12_MASTER_KEY_DERIVE_DH"); - addMech(CKM_TLS_MAC, "CKM_TLS_MAC"); + addMech(CKM_MD5_KEY_DERIVATION, "CKM_MD5_KEY_DERIVATION"); addMech(CKM_MD2_KEY_DERIVATION, "CKM_MD2_KEY_DERIVATION"); addMech(CKM_SHA1_KEY_DERIVATION, "CKM_SHA1_KEY_DERIVATION"); @@ -754,8 +816,62 @@ public class Functions { addMech(CKM_PBE_SHA1_RC2_40_CBC, "CKM_PBE_SHA1_RC2_40_CBC"); addMech(CKM_PKCS5_PBKD2, "CKM_PKCS5_PBKD2"); addMech(CKM_PBA_SHA1_WITH_SHA1_HMAC, "CKM_PBA_SHA1_WITH_SHA1_HMAC"); + + addMech(CKM_WTLS_PRE_MASTER_KEY_GEN, "CKM_WTLS_PRE_MASTER_KEY_GEN"); + addMech(CKM_WTLS_MASTER_KEY_DERIVE, "CKM_WTLS_MASTER_KEY_DERIVE"); + addMech(CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC, + "CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC"); + addMech(CKM_WTLS_PRF, "CKM_WTLS_PRF"); + addMech(CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE, + "CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE"); + addMech(CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE, + "CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE"); + addMech(CKM_TLS10_MAC_SERVER, "CKM_TLS10_MAC_SERVER"); + addMech(CKM_TLS10_MAC_CLIENT, "CKM_TLS10_MAC_CLIENT"); + addMech(CKM_TLS12_MAC, "CKM_TLS12_MAC"); + addMech(CKM_TLS12_KDF, "CKM_TLS12_KDF"); + addMech(CKM_TLS12_MASTER_KEY_DERIVE, "CKM_TLS12_MASTER_KEY_DERIVE"); + addMech(CKM_TLS12_KEY_AND_MAC_DERIVE, "CKM_TLS12_KEY_AND_MAC_DERIVE"); + addMech(CKM_TLS12_MASTER_KEY_DERIVE_DH, "CKM_TLS12_MASTER_KEY_DERIVE_DH"); + addMech(CKM_TLS12_KEY_SAFE_DERIVE, "CKM_TLS12_KEY_SAFE_DERIVE"); + addMech(CKM_TLS_MAC, "CKM_TLS_MAC"); + addMech(CKM_TLS_KDF, "CKM_TLS_KDF"); + addMech(CKM_KEY_WRAP_LYNKS, "CKM_KEY_WRAP_LYNKS"); addMech(CKM_KEY_WRAP_SET_OAEP, "CKM_KEY_WRAP_SET_OAEP"); + + addMech(CKM_CMS_SIG, "CKM_CMS_SIG"); + addMech(CKM_KIP_DERIVE, "CKM_KIP_DERIVE"); + addMech(CKM_KIP_WRAP, "CKM_KIP_WRAP"); + addMech(CKM_KIP_MAC, "CKM_KIP_MAC"); + addMech(CKM_CAMELLIA_KEY_GEN, "CKM_CAMELLIA_KEY_GEN"); + addMech(CKM_CAMELLIA_ECB, "CKM_CAMELLIA_ECB"); + addMech(CKM_CAMELLIA_CBC, "CKM_CAMELLIA_CBC"); + addMech(CKM_CAMELLIA_MAC, "CKM_CAMELLIA_MAC"); + addMech(CKM_CAMELLIA_MAC_GENERAL, "CKM_CAMELLIA_MAC_GENERAL"); + addMech(CKM_CAMELLIA_CBC_PAD, "CKM_CAMELLIA_CBC_PAD"); + addMech(CKM_CAMELLIA_ECB_ENCRYPT_DATA, "CKM_CAMELLIA_ECB_ENCRYPT_DATA"); + addMech(CKM_CAMELLIA_CBC_ENCRYPT_DATA, "CKM_CAMELLIA_CBC_ENCRYPT_DATA"); + addMech(CKM_CAMELLIA_CTR, "CKM_CAMELLIA_CTR"); + + addMech(CKM_ARIA_KEY_GEN, "CKM_ARIA_KEY_GEN"); + addMech(CKM_ARIA_ECB, "CKM_ARIA_ECB"); + addMech(CKM_ARIA_CBC, "CKM_ARIA_CBC"); + addMech(CKM_ARIA_MAC, "CKM_ARIA_MAC"); + addMech(CKM_ARIA_MAC_GENERAL, "CKM_ARIA_MAC_GENERAL"); + addMech(CKM_ARIA_CBC_PAD, "CKM_ARIA_CBC_PAD"); + addMech(CKM_ARIA_ECB_ENCRYPT_DATA, "CKM_ARIA_ECB_ENCRYPT_DATA"); + addMech(CKM_ARIA_CBC_ENCRYPT_DATA, "CKM_ARIA_CBC_ENCRYPT_DATA"); + + addMech(CKM_SEED_KEY_GEN, "CKM_SEED_KEY_GEN"); + addMech(CKM_SEED_ECB, "CKM_SEED_ECB"); + addMech(CKM_SEED_CBC, "CKM_SEED_CBC"); + addMech(CKM_SEED_MAC, "CKM_SEED_MAC"); + addMech(CKM_SEED_MAC_GENERAL, "CKM_SEED_MAC_GENERAL"); + addMech(CKM_SEED_CBC_PAD, "CKM_SEED_CBC_PAD"); + addMech(CKM_SEED_ECB_ENCRYPT_DATA, "CKM_SEED_ECB_ENCRYPT_DATA"); + addMech(CKM_SEED_CBC_ENCRYPT_DATA, "CKM_SEED_CBC_ENCRYPT_DATA"); + addMech(CKM_SKIPJACK_KEY_GEN, "CKM_SKIPJACK_KEY_GEN"); addMech(CKM_SKIPJACK_ECB64, "CKM_SKIPJACK_ECB64"); addMech(CKM_SKIPJACK_CBC64, "CKM_SKIPJACK_CBC64"); @@ -780,9 +896,17 @@ public class Functions { addMech(CKM_EC_KEY_PAIR_GEN, "CKM_EC_KEY_PAIR_GEN"); addMech(CKM_ECDSA, "CKM_ECDSA"); addMech(CKM_ECDSA_SHA1, "CKM_ECDSA_SHA1"); + addMech(CKM_ECDSA_SHA224, "CKM_ECDSA_SHA224"); + addMech(CKM_ECDSA_SHA256, "CKM_ECDSA_SHA256"); + addMech(CKM_ECDSA_SHA384, "CKM_ECDSA_SHA384"); + addMech(CKM_ECDSA_SHA512, "CKM_ECDSA_SHA512"); + addMech(CKM_ECDH1_DERIVE, "CKM_ECDH1_DERIVE"); addMech(CKM_ECDH1_COFACTOR_DERIVE, "CKM_ECDH1_COFACTOR_DERIVE"); addMech(CKM_ECMQV_DERIVE, "CKM_ECMQV_DERIVE"); + addMech(CKM_ECDH_AES_KEY_WRAP, "CKM_ECDH_AES_KEY_WRAP"); + addMech(CKM_RSA_AES_KEY_WRAP, "CKM_RSA_AES_KEY_WRAP"); + addMech(CKM_JUNIPER_KEY_GEN, "CKM_JUNIPER_KEY_GEN"); addMech(CKM_JUNIPER_ECB128, "CKM_JUNIPER_ECB128"); addMech(CKM_JUNIPER_CBC128, "CKM_JUNIPER_CBC128"); @@ -796,11 +920,61 @@ public class Functions { addMech(CKM_AES_MAC, "CKM_AES_MAC"); addMech(CKM_AES_MAC_GENERAL, "CKM_AES_MAC_GENERAL"); addMech(CKM_AES_CBC_PAD, "CKM_AES_CBC_PAD"); + addMech(CKM_AES_CTR, "CKM_AES_CTR"); + addMech(CKM_AES_GCM, "CKM_AES_GCM"); + addMech(CKM_AES_CCM, "CKM_AES_CCM"); + addMech(CKM_AES_CTS, "CKM_AES_CTS"); + addMech(CKM_AES_CMAC, "CKM_AES_CMAC"); + addMech(CKM_AES_CMAC_GENERAL, "CKM_AES_CMAC_GENERAL"); + addMech(CKM_AES_XCBC_MAC, "CKM_AES_XCBC_MAC"); + addMech(CKM_AES_XCBC_MAC_96, "CKM_AES_XCBC_MAC_96"); + addMech(CKM_AES_GMAC, "CKM_AES_GMAC"); + addMech(CKM_BLOWFISH_KEY_GEN, "CKM_BLOWFISH_KEY_GEN"); addMech(CKM_BLOWFISH_CBC, "CKM_BLOWFISH_CBC"); + addMech(CKM_TWOFISH_KEY_GEN, "CKM_TWOFISH_KEY_GEN"); + addMech(CKM_TWOFISH_CBC, "CKM_TWOFISH_CBC"); + addMech(CKM_BLOWFISH_CBC_PAD, "CKM_BLOWFISH_CBC_PAD"); + addMech(CKM_TWOFISH_CBC_PAD, "CKM_TWOFISH_CBC_PAD"); + + addMech(CKM_DES_ECB_ENCRYPT_DATA, "CKM_DES_ECB_ENCRYPT_DATA"); + addMech(CKM_DES_CBC_ENCRYPT_DATA, "CKM_DES_CBC_ENCRYPT_DATA"); + addMech(CKM_DES3_ECB_ENCRYPT_DATA, "CKM_DES3_ECB_ENCRYPT_DATA"); + addMech(CKM_DES3_CBC_ENCRYPT_DATA, "CKM_DES3_CBC_ENCRYPT_DATA"); + addMech(CKM_AES_ECB_ENCRYPT_DATA, "CKM_AES_ECB_ENCRYPT_DATA"); + addMech(CKM_AES_CBC_ENCRYPT_DATA, "CKM_AES_CBC_ENCRYPT_DATA"); + + addMech(CKM_GOSTR3410_KEY_PAIR_GEN, "CKM_GOSTR3410_KEY_PAIR_GEN"); + addMech(CKM_GOSTR3410, "CKM_GOSTR3410"); + addMech(CKM_GOSTR3410_WITH_GOSTR3411, "CKM_GOSTR3410_WITH_GOSTR3411"); + addMech(CKM_GOSTR3410_KEY_WRAP, "CKM_GOSTR3410_KEY_WRAP"); + addMech(CKM_GOSTR3410_DERIVE, "CKM_GOSTR3410_DERIVE"); + addMech(CKM_GOSTR3411, "CKM_GOSTR3411"); + addMech(CKM_GOSTR3411_HMAC, "CKM_GOSTR3411_HMAC"); + addMech(CKM_GOST28147_KEY_GEN, "CKM_GOST28147_KEY_GEN"); + addMech(CKM_GOST28147_ECB, "CKM_GOST28147_ECB"); + addMech(CKM_GOST28147, "CKM_GOST28147"); + addMech(CKM_GOST28147_MAC, "CKM_GOST28147_MAC"); + addMech(CKM_GOST28147_KEY_WRAP, "CKM_GOST28147_KEY_WRAP"); + addMech(CKM_DSA_PARAMETER_GEN, "CKM_DSA_PARAMETER_GEN"); addMech(CKM_DH_PKCS_PARAMETER_GEN, "CKM_DH_PKCS_PARAMETER_GEN"); addMech(CKM_X9_42_DH_PARAMETER_GEN, "CKM_X9_42_DH_PARAMETER_GEN"); + addMech(CKM_DSA_PROBABLISTIC_PARAMETER_GEN, + "CKM_DSA_PROBABLISTIC_PARAMETER_GEN"); + addMech(CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN, + "CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN"); + addMech(CKM_AES_OFB, "CKM_AES_OFB"); + addMech(CKM_AES_CFB64, "CKM_AES_CFB64"); + addMech(CKM_AES_CFB8, "CKM_AES_CFB8"); + addMech(CKM_AES_CFB128, "CKM_AES_CFB128"); + addMech(CKM_AES_CFB1, "CKM_AES_CFB1"); + addMech(CKM_AES_KEY_WRAP, "CKM_AES_KEY_WRAP"); + addMech(CKM_AES_KEY_WRAP_PAD, "CKM_AES_KEY_WRAP_PAD"); + + addMech(CKM_RSA_PKCS_TPM_1_1, "CKM_RSA_PKCS_TPM_1_1"); + addMech(CKM_RSA_PKCS_OAEP_TPM_1_1, "CKM_RSA_PKCS_OAEP_TPM_1_1"); + addMech(CKM_VENDOR_DEFINED, "CKM_VENDOR_DEFINED"); addMech(CKM_NSS_TLS_PRF_GENERAL, "CKM_NSS_TLS_PRF_GENERAL"); @@ -808,11 +982,13 @@ public class Functions { addMech(PCKM_SECURERANDOM, "SecureRandom"); addMech(PCKM_KEYSTORE, "KeyStore"); - addHashMech(CKM_SHA_1, "SHA-1"); - addHashMech(CKM_SHA224, "SHA-224"); - addHashMech(CKM_SHA256, "SHA-256"); - addHashMech(CKM_SHA384, "SHA-384"); - addHashMech(CKM_SHA512, "SHA-512"); + addHashMech(CKM_SHA_1, "SHA-1", "SHA", "SHA1"); + addHashMech(CKM_SHA224, "SHA-224", "SHA224"); + addHashMech(CKM_SHA256, "SHA-256", "SHA256"); + addHashMech(CKM_SHA384, "SHA-384", "SHA384"); + addHashMech(CKM_SHA512, "SHA-512", "SHA512"); + addHashMech(CKM_SHA512_224, "SHA-512/224", "SHA512/224"); + addHashMech(CKM_SHA512_256, "SHA-512/256", "SHA512/256"); addKeyType(CKK_RSA, "CKK_RSA"); addKeyType(CKK_DSA, "CKK_DSA"); @@ -837,6 +1013,25 @@ public class Functions { addKeyType(CKK_CDMF, "CKK_CDMF"); addKeyType(CKK_AES, "CKK_AES"); addKeyType(CKK_BLOWFISH, "CKK_BLOWFISH"); + addKeyType(CKK_TWOFISH, "CKK_TWOFISH"); + addKeyType(CKK_SECURID, "CKK_SECURID"); + addKeyType(CKK_HOTP, "CKK_HOTP"); + addKeyType(CKK_ACTI, "CKK_ACTI"); + addKeyType(CKK_CAMELLIA, "CKK_CAMELLIA"); + addKeyType(CKK_ARIA, "CKK_ARIA"); + addKeyType(CKK_MD5_HMAC, "CKK_MD5_HMAC"); + addKeyType(CKK_SHA_1_HMAC, "CKK_SHA_1_HMAC"); + addKeyType(CKK_RIPEMD128_HMAC, "CKK_RIPEMD128_HMAC"); + addKeyType(CKK_RIPEMD160_HMAC, "CKK_RIPEMD160_HMAC"); + addKeyType(CKK_SHA256_HMAC, "CKK_SHA256_HMAC"); + addKeyType(CKK_SHA384_HMAC, "CKK_SHA384_HMAC"); + addKeyType(CKK_SHA512_HMAC, "CKK_SHA512_HMAC"); + addKeyType(CKK_SHA224_HMAC, "CKK_SHA224_HMAC"); + addKeyType(CKK_SEED, "CKK_SEED"); + addKeyType(CKK_GOSTR3410, "CKK_GOSTR3410"); + addKeyType(CKK_GOSTR3411, "CKK_GOSTR3411"); + addKeyType(CKK_GOST28147, "CKK_GOST28147"); + addKeyType(CKK_VENDOR_DEFINED, "CKK_VENDOR_DEFINED"); addKeyType(PCKK_ANY, "*"); @@ -855,6 +1050,16 @@ public class Functions { addAttribute(CKA_OWNER, "CKA_OWNER"); addAttribute(CKA_ATTR_TYPES, "CKA_ATTR_TYPES"); addAttribute(CKA_TRUSTED, "CKA_TRUSTED"); + addAttribute(CKA_CERTIFICATE_CATEGORY, "CKA_CERTIFICATE_CATEGORY"); + addAttribute(CKA_JAVA_MIDP_SECURITY_DOMAIN, + "CKA_JAVA_MIDP_SECURITY_DOMAIN"); + addAttribute(CKA_URL, "CKA_URL"); + addAttribute(CKA_HASH_OF_SUBJECT_PUBLIC_KEY, + "CKA_HASH_OF_SUBJECT_PUBLIC_KEY"); + addAttribute(CKA_HASH_OF_ISSUER_PUBLIC_KEY, + "CKA_HASH_OF_ISSUER_PUBLIC_KEY"); + addAttribute(CKA_NAME_HASH_ALGORITHM, "CKA_NAME_HASH_ALGORITHM"); + addAttribute(CKA_CHECK_VALUE, "CKA_CHECK_VALUE"); addAttribute(CKA_KEY_TYPE, "CKA_KEY_TYPE"); addAttribute(CKA_SUBJECT, "CKA_SUBJECT"); addAttribute(CKA_ID, "CKA_ID"); @@ -879,6 +1084,7 @@ public class Functions { addAttribute(CKA_EXPONENT_1, "CKA_EXPONENT_1"); addAttribute(CKA_EXPONENT_2, "CKA_EXPONENT_2"); addAttribute(CKA_COEFFICIENT, "CKA_COEFFICIENT"); + addAttribute(CKA_PUBLIC_KEY_INFO, "CKA_PUBLIC_KEY_INFO"); addAttribute(CKA_PRIME, "CKA_PRIME"); addAttribute(CKA_SUBPRIME, "CKA_SUBPRIME"); addAttribute(CKA_BASE, "CKA_BASE"); @@ -886,19 +1092,69 @@ public class Functions { addAttribute(CKA_SUB_PRIME_BITS, "CKA_SUB_PRIME_BITS"); addAttribute(CKA_VALUE_BITS, "CKA_VALUE_BITS"); addAttribute(CKA_VALUE_LEN, "CKA_VALUE_LEN"); + addAttribute(CKA_EXTRACTABLE, "CKA_EXTRACTABLE"); addAttribute(CKA_LOCAL, "CKA_LOCAL"); addAttribute(CKA_NEVER_EXTRACTABLE, "CKA_NEVER_EXTRACTABLE"); addAttribute(CKA_ALWAYS_SENSITIVE, "CKA_ALWAYS_SENSITIVE"); + addAttribute(CKA_KEY_GEN_MECHANISM, "CKA_KEY_GEN_MECHANISM"); addAttribute(CKA_MODIFIABLE, "CKA_MODIFIABLE"); + addAttribute(CKA_COPYABLE, "CKA_COPYABLE"); + addAttribute(CKA_DESTROYABLE, "CKA_DESTROYABLE"); + addAttribute(CKA_EC_PARAMS, "CKA_EC_PARAMS"); addAttribute(CKA_EC_POINT, "CKA_EC_POINT"); + addAttribute(CKA_SECONDARY_AUTH, "CKA_SECONDARY_AUTH"); addAttribute(CKA_AUTH_PIN_FLAGS, "CKA_AUTH_PIN_FLAGS"); + addAttribute(CKA_ALWAYS_AUTHENTICATE, "CKA_ALWAYS_AUTHENTICATE"); + addAttribute(CKA_WRAP_WITH_TRUSTED, "CKA_WRAP_WITH_TRUSTED"); + addAttribute(CKA_WRAP_TEMPLATE, "CKA_WRAP_TEMPLATE"); + addAttribute(CKA_UNWRAP_TEMPLATE, "CKA_UNWRAP_TEMPLATE"); + addAttribute(CKA_DERIVE_TEMPLATE, "CKA_DERIVE_TEMPLATE"); + addAttribute(CKA_OTP_FORMAT, "CKA_OTP_FORMAT"); + addAttribute(CKA_OTP_LENGTH, "CKA_OTP_LENGTH"); + addAttribute(CKA_OTP_TIME_INTERVAL, "CKA_OTP_TIME_INTERVAL"); + addAttribute(CKA_OTP_USER_FRIENDLY_MODE,"CKA_OTP_USER_FRIENDLY_MODE"); + addAttribute(CKA_OTP_CHALLENGE_REQUIREMENT, + "CKA_OTP_CHALLENGE_REQUIREMENT"); + addAttribute(CKA_OTP_TIME_REQUIREMENT, "CKA_OTP_TIME_REQUIREMENT"); + addAttribute(CKA_OTP_COUNTER_REQUIREMENT, + "CKA_OTP_COUNTER_REQUIREMENT"); + addAttribute(CKA_OTP_PIN_REQUIREMENT, "CKA_OTP_PIN_REQUIREMENT"); + addAttribute(CKA_OTP_COUNTER, "CKA_OTP_COUNTER"); + addAttribute(CKA_OTP_TIME, "CKA_OTP_TIME"); + addAttribute(CKA_OTP_USER_IDENTIFIER, "CKA_OTP_USER_IDENTIFIER"); + addAttribute(CKA_OTP_SERVICE_IDENTIFIER,"CKA_OTP_SERVICE_IDENTIFIER"); + addAttribute(CKA_OTP_SERVICE_LOGO, "CKA_OTP_SERVICE_LOGO"); + addAttribute(CKA_OTP_SERVICE_LOGO_TYPE, "CKA_OTP_SERVICE_LOGO_TYPE"); + addAttribute(CKA_GOSTR3410_PARAMS, "CKA_GOSTR3410_PARAMS"); + addAttribute(CKA_GOSTR3411_PARAMS, "CKA_GOSTR3411_PARAMS"); + addAttribute(CKA_GOST28147_PARAMS, "CKA_GOST28147_PARAMS"); + addAttribute(CKA_HW_FEATURE_TYPE, "CKA_HW_FEATURE_TYPE"); addAttribute(CKA_RESET_ON_INIT, "CKA_RESET_ON_INIT"); addAttribute(CKA_HAS_RESET, "CKA_HAS_RESET"); + + addAttribute(CKA_PIXEL_X, "CKA_PIXEL_X"); + addAttribute(CKA_PIXEL_Y, "CKA_PIXEL_Y"); + addAttribute(CKA_RESOLUTION, "CKA_RESOLUTION"); + addAttribute(CKA_CHAR_ROWS, "CKA_CHAR_ROWS"); + addAttribute(CKA_CHAR_COLUMNS, "CKA_CHAR_COLUMNS"); + addAttribute(CKA_COLOR, "CKA_COLOR"); + addAttribute(CKA_BITS_PER_PIXEL, "CKA_BITS_PER_PIXEL"); + addAttribute(CKA_CHAR_SETS, "CKA_CHAR_SETS"); + addAttribute(CKA_ENCODING_METHODS, "CKA_ENCODING_METHODS"); + addAttribute(CKA_MIME_TYPES, "CKA_MIME_TYPES"); + addAttribute(CKA_MECHANISM_TYPE, "CKA_MECHANISM_TYPE"); + addAttribute(CKA_REQUIRED_CMS_ATTRIBUTES, + "CKA_REQUIRED_CMS_ATTRIBUTES"); + addAttribute(CKA_DEFAULT_CMS_ATTRIBUTES,"CKA_DEFAULT_CMS_ATTRIBUTES"); + addAttribute(CKA_SUPPORTED_CMS_ATTRIBUTES, + "CKA_SUPPORTED_CMS_ATTRIBUTES"); + addAttribute(CKA_ALLOWED_MECHANISMS, "CKA_ALLOWED_MECHANISMS"); + addAttribute(CKA_VENDOR_DEFINED, "CKA_VENDOR_DEFINED"); addAttribute(CKA_NETSCAPE_DB, "CKA_NETSCAPE_DB"); @@ -920,6 +1176,11 @@ public class Functions { addObjectClass(PCKO_ANY, "*"); + addMGF(CKG_MGF1_SHA1, "CKG_MGF1_SHA1"); + addMGF(CKG_MGF1_SHA256, "CKG_MGF1_SHA256"); + addMGF(CKG_MGF1_SHA384, "CKG_MGF1_SHA384"); + addMGF(CKG_MGF1_SHA512, "CKG_MGF1_SHA512"); + addMGF(CKG_MGF1_SHA224, "CKG_MGF1_SHA224"); } } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java index d93fa3cbb27..04a369f453c 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -97,6 +97,12 @@ public class PKCS11 { // static initializer, hence this method is empty. } + /* ***************************************************************************** + * Utility, Resource Clean up + ******************************************************************************/ + // always return 0L + public static native long freeMechanism(long hMechanism); + /** * The PKCS#11 module to connect to. This is the PKCS#11 driver of the token; * e.g. pk2priv.dll. @@ -729,17 +735,25 @@ public class PKCS11 { * * @param hSession the session's handle * (PKCS#11 param: CK_SESSION_HANDLE hSession) - * @param pData the data to get encrypted and the data's length + * @param directIn the address of the to-be-encrypted data + * @param in buffer containing the to-be-encrypted data + * @param inOfs buffer offset of the to-be-encrypted data + * @param inLen length of the to-be-encrypted data * (PKCS#11 param: CK_BYTE_PTR pData, CK_ULONG ulDataLen) - * @return the encrypted data and the encrypted data's length + * @param directOut the address for the encrypted data + * @param out buffer for the encrypted data + * @param outOfs buffer offset for the encrypted data + * @param outLen buffer size for the encrypted data + * @return the length of encrypted data * (PKCS#11 param: CK_BYTE_PTR pEncryptedData, * CK_ULONG_PTR pulEncryptedDataLen) * @exception PKCS11Exception If function returns other value than CKR_OK. - * @preconditions (pData <> null) - * @postconditions (result <> null) + * @preconditions + * @postconditions */ - public native int C_Encrypt(long hSession, byte[] in, int inOfs, int inLen, - byte[] out, int outOfs, int outLen) throws PKCS11Exception; + public native int C_Encrypt(long hSession, long directIn, byte[] in, + int inOfs, int inLen, long directOut, byte[] out, int outOfs, + int outLen) throws PKCS11Exception; /** @@ -749,13 +763,20 @@ public class PKCS11 { * * @param hSession the session's handle * (PKCS#11 param: CK_SESSION_HANDLE hSession) - * @param pPart the data part to get encrypted and the data part's length + * @param directIn the address of the to-be-encrypted data + * @param in buffer containing the to-be-encrypted data + * @param inOfs buffer offset of the to-be-encrypted data + * @param inLen length of the to-be-encrypted data * (PKCS#11 param: CK_BYTE_PTR pPart, CK_ULONG ulPartLen) - * @return the encrypted data part and the encrypted data part's length + * @param directOut the address for the encrypted data + * @param out buffer for the encrypted data + * @param outOfs buffer offset for the encrypted data + * @param outLen buffer size for the encrypted data + * @return the length of encrypted data for this update * (PKCS#11 param: CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen) * @exception PKCS11Exception If function returns other value than CKR_OK. - * @preconditions (pPart <> null) + * @preconditions * @postconditions */ public native int C_EncryptUpdate(long hSession, long directIn, byte[] in, @@ -770,12 +791,16 @@ public class PKCS11 { * * @param hSession the session's handle * (PKCS#11 param: CK_SESSION_HANDLE hSession) - * @return the last encrypted data part and the last data part's length + * @param directOut the address for the encrypted data + * @param out buffer for the encrypted data + * @param outOfs buffer offset for the encrypted data + * @param outLen buffer size for the encrypted data + * @return the length of the last part of the encrypted data * (PKCS#11 param: CK_BYTE_PTR pLastEncryptedPart, CK_ULONG_PTR pulLastEncryptedPartLen) * @exception PKCS11Exception If function returns other value than CKR_OK. * @preconditions - * @postconditions (result <> null) + * @postconditions */ public native int C_EncryptFinal(long hSession, long directOut, byte[] out, int outOfs, int outLen) throws PKCS11Exception; @@ -805,18 +830,25 @@ public class PKCS11 { * * @param hSession the session's handle * (PKCS#11 param: CK_SESSION_HANDLE hSession) - * @param pEncryptedData the encrypted data to get decrypted and the - * encrypted data's length - * (PKCS#11 param: CK_BYTE_PTR pEncryptedData, - * CK_ULONG ulEncryptedDataLen) - * @return the decrypted data and the data's length + * @param directIn the address of the to-be-decrypted data + * @param in buffer containing the to-be-decrypted data + * @param inOfs buffer offset of the to-be-decrypted data + * @param inLen length of the to-be-decrypted data + * (PKCS#11 param: CK_BYTE_PTR pDecryptedData, + * CK_ULONG ulDecryptedDataLen) + * @param directOut the address for the decrypted data + * @param out buffer for the decrypted data + * @param outOfs buffer offset for the decrypted data + * @param outLen buffer size for the decrypted data + * @return the length of decrypted data * (PKCS#11 param: CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen) * @exception PKCS11Exception If function returns other value than CKR_OK. - * @preconditions (pEncryptedPart <> null) - * @postconditions (result <> null) + * @preconditions + * @postconditions */ - public native int C_Decrypt(long hSession, byte[] in, int inOfs, int inLen, - byte[] out, int outOfs, int outLen) throws PKCS11Exception; + public native int C_Decrypt(long hSession, long directIn, byte[] in, + int inOfs, int inLen, long directOut, byte[] out, int outOfs, + int outLen) throws PKCS11Exception; /** @@ -826,14 +858,20 @@ public class PKCS11 { * * @param hSession the session's handle * (PKCS#11 param: CK_SESSION_HANDLE hSession) - * @param pEncryptedPart the encrypted data part to get decrypted and the - * encrypted data part's length - * (PKCS#11 param: CK_BYTE_PTR pEncryptedPart, - * CK_ULONG ulEncryptedPartLen) - * @return the decrypted data part and the data part's length + * @param directIn the address of the to-be-decrypted data + * @param in buffer containing the to-be-decrypted data + * @param inOfs buffer offset of the to-be-decrypted data + * @param inLen length of the to-be-decrypted data + * (PKCS#11 param: CK_BYTE_PTR pDecryptedPart, + * CK_ULONG ulDecryptedPartLen) + * @param directOut the address for the decrypted data + * @param out buffer for the decrypted data + * @param outOfs buffer offset for the decrypted data + * @param outLen buffer size for the decrypted data + * @return the length of decrypted data for this update * (PKCS#11 param: CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) * @exception PKCS11Exception If function returns other value than CKR_OK. - * @preconditions (pEncryptedPart <> null) + * @preconditions * @postconditions */ public native int C_DecryptUpdate(long hSession, long directIn, byte[] in, @@ -848,12 +886,16 @@ public class PKCS11 { * * @param hSession the session's handle * (PKCS#11 param: CK_SESSION_HANDLE hSession) - * @return the last decrypted data part and the last data part's length + * @param directOut the address for the decrypted data + * @param out buffer for the decrypted data + * @param outOfs buffer offset for the decrypted data + * @param outLen buffer size for the decrypted data + * @return the length of this last part of decrypted data * (PKCS#11 param: CK_BYTE_PTR pLastPart, * CK_ULONG_PTR pulLastPartLen) * @exception PKCS11Exception If function returns other value than CKR_OK. * @preconditions - * @postconditions (result <> null) + * @postconditions */ public native int C_DecryptFinal(long hSession, long directOut, byte[] out, int outOfs, int outLen) throws PKCS11Exception; @@ -1027,6 +1069,7 @@ public class PKCS11 { * * @param hSession the session's handle * (PKCS#11 param: CK_SESSION_HANDLE hSession) + * @param expectedLen expected signature length, can be 0 if unknown * @return the signature and the signature's length * (PKCS#11 param: CK_BYTE_PTR pSignature, * CK_ULONG_PTR pulSignatureLen) @@ -1285,7 +1328,6 @@ public class PKCS11 { // byte[] pEncryptedPart) throws PKCS11Exception; - /* ***************************************************************************** * Key management ******************************************************************************/ @@ -1692,10 +1734,11 @@ static class SynchronizedPKCS11 extends PKCS11 { super.C_EncryptInit(hSession, pMechanism, hKey); } - public synchronized int C_Encrypt(long hSession, byte[] in, int inOfs, - int inLen, byte[] out, int outOfs, int outLen) + public synchronized int C_Encrypt(long hSession, long directIn, byte[] in, + int inOfs, int inLen, long directOut, byte[] out, int outOfs, int outLen) throws PKCS11Exception { - return super.C_Encrypt(hSession, in, inOfs, inLen, out, outOfs, outLen); + return super.C_Encrypt(hSession, directIn, in, inOfs, inLen, + directOut, out, outOfs, outLen); } public synchronized int C_EncryptUpdate(long hSession, long directIn, @@ -1715,10 +1758,11 @@ static class SynchronizedPKCS11 extends PKCS11 { super.C_DecryptInit(hSession, pMechanism, hKey); } - public synchronized int C_Decrypt(long hSession, byte[] in, int inOfs, - int inLen, byte[] out, int outOfs, int outLen) - throws PKCS11Exception { - return super.C_Decrypt(hSession, in, inOfs, inLen, out, outOfs, outLen); + public synchronized int C_Decrypt(long hSession, long directIn, + byte[] in, int inOfs, int inLen, long directOut, byte[] out, + int outOfs, int outLen) throws PKCS11Exception { + return super.C_Decrypt(hSession, directIn, in, inOfs, inLen, + directOut, out, outOfs, outLen); } public synchronized int C_DecryptUpdate(long hSession, long directIn, diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java index 4d44317a454..f36b0534083 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Constants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -144,98 +144,46 @@ public interface PKCS11Constants { /* normal user's PIN is set */ public static final long CKF_USER_PIN_INITIALIZED = 0x00000008L; - /* CKF_RESTORE_KEY_NOT_NEEDED is new for v2.0. If it is set, - * that means that *every* time the state of cryptographic - * operations of a session is successfully saved, all keys - * needed to continue those operations are stored in the state */ public static final long CKF_RESTORE_KEY_NOT_NEEDED = 0x00000020L; - /* CKF_CLOCK_ON_TOKEN is new for v2.0. If it is set, that means - * that the token has some sort of clock. The time on that - * clock is returned in the token info structure */ public static final long CKF_CLOCK_ON_TOKEN = 0x00000040L; - /* CKF_PROTECTED_AUTHENTICATION_PATH is new for v2.0. If it is - * set, that means that there is some way for the user to login - * without sending a PIN through the Cryptoki library itself */ public static final long CKF_PROTECTED_AUTHENTICATION_PATH = 0x00000100L; - /* CKF_DUAL_CRYPTO_OPERATIONS is new for v2.0. If it is true, - * that means that a single session with the token can perform - * dual simultaneous cryptographic operations (digest and - * encrypt; decrypt and digest; sign and encrypt; and decrypt - * and sign) */ public static final long CKF_DUAL_CRYPTO_OPERATIONS = 0x00000200L; - /* CKF_TOKEN_INITIALIZED if new for v2.10. If it is true, the - * token has been initialized using C_InitializeToken or an - * equivalent mechanism outside the scope of PKCS #11. - * Calling C_InitializeToken when this flag is set will cause - * the token to be reinitialized. */ public static final long CKF_TOKEN_INITIALIZED = 0x00000400L; - /* CKF_SECONDARY_AUTHENTICATION if new for v2.10. If it is - * true, the token supports secondary authentication for - * private key objects. */ public static final long CKF_SECONDARY_AUTHENTICATION = 0x00000800L; - /* CKF_USER_PIN_COUNT_LOW if new for v2.10. If it is true, an - * incorrect user login PIN has been entered at least once - * since the last successful authentication. */ public static final long CKF_USER_PIN_COUNT_LOW = 0x00010000L; - /* CKF_USER_PIN_FINAL_TRY if new for v2.10. If it is true, - * supplying an incorrect user PIN will it to become locked. */ public static final long CKF_USER_PIN_FINAL_TRY = 0x00020000L; - /* CKF_USER_PIN_LOCKED if new for v2.10. If it is true, the - * user PIN has been locked. User login to the token is not - * possible. */ public static final long CKF_USER_PIN_LOCKED = 0x00040000L; - /* CKF_USER_PIN_TO_BE_CHANGED if new for v2.10. If it is true, - * the user PIN value is the default value set by token - * initialization or manufacturing. */ public static final long CKF_USER_PIN_TO_BE_CHANGED = 0x00080000L; - /* CKF_SO_PIN_COUNT_LOW if new for v2.10. If it is true, an - * incorrect SO login PIN has been entered at least once since - * the last successful authentication. */ public static final long CKF_SO_PIN_COUNT_LOW = 0x00100000L; - /* CKF_SO_PIN_FINAL_TRY if new for v2.10. If it is true, - * supplying an incorrect SO PIN will it to become locked. */ public static final long CKF_SO_PIN_FINAL_TRY = 0x00200000L; - /* CKF_SO_PIN_LOCKED if new for v2.10. If it is true, the SO - * PIN has been locked. SO login to the token is not possible. - */ public static final long CKF_SO_PIN_LOCKED = 0x00400000L; - /* CKF_SO_PIN_TO_BE_CHANGED if new for v2.10. If it is true, - * the SO PIN value is the default value set by token - * initialization or manufacturing. */ public static final long CKF_SO_PIN_TO_BE_CHANGED = 0x00800000L; - - /* CK_USER_TYPE enumerates the types of Cryptoki users */ - /* CK_USER_TYPE has been changed from an enum to a CK_ULONG for - * v2.0 */ /* Security Officer */ public static final long CKU_SO = 0L; /* Normal user */ public static final long CKU_USER = 1L; /* CK_STATE enumerates the session states */ - /* CK_STATE has been changed from an enum to a CK_ULONG for - * v2.0 */ public static final long CKS_RO_PUBLIC_SESSION = 0L; public static final long CKS_RO_USER_FUNCTIONS = 1L; public static final long CKS_RW_PUBLIC_SESSION = 2L; public static final long CKS_RW_USER_FUNCTIONS = 3L; public static final long CKS_RW_SO_FUNCTIONS = 4L; - /* The flags are defined in the following table: * Bit Flag Mask Meaning */ @@ -246,8 +194,6 @@ public interface PKCS11Constants { /* The following classes of objects are defined: */ - /* CKO_HW_FEATURE is new for v2.10 */ - /* CKO_DOMAIN_PARAMETERS is new for v2.11 */ public static final long CKO_DATA = 0x00000000L; public static final long CKO_CERTIFICATE = 0x00000001L; public static final long CKO_PUBLIC_KEY = 0x00000002L; @@ -267,62 +213,73 @@ public interface PKCS11Constants { public static final long CKH_VENDOR_DEFINED = 0x80000000L; /* the following key types are defined: */ - public static final long CKK_RSA = 0x00000000L; - public static final long CKK_DSA = 0x00000001L; - public static final long CKK_DH = 0x00000002L; + public static final long CKK_RSA = 0x00000000L; + public static final long CKK_DSA = 0x00000001L; + public static final long CKK_DH = 0x00000002L; + public static final long CKK_ECDSA /*deprecated*/ = 0x00000003L; + public static final long CKK_EC = 0x00000003L; + public static final long CKK_X9_42_DH = 0x00000004L; + public static final long CKK_KEA = 0x00000005L; + public static final long CKK_GENERIC_SECRET = 0x00000010L; + public static final long CKK_RC2 = 0x00000011L; + public static final long CKK_RC4 = 0x00000012L; + public static final long CKK_DES = 0x00000013L; + public static final long CKK_DES2 = 0x00000014L; + public static final long CKK_DES3 = 0x00000015L; - /* CKK_ECDSA and CKK_KEA are new for v2.0 */ - /* CKK_ECDSA is deprecated in v2.11, CKK_EC is preferred. */ - public static final long CKK_ECDSA = 0x00000003L; - public static final long CKK_EC = 0x00000003L; - public static final long CKK_X9_42_DH = 0x00000004L; - public static final long CKK_KEA = 0x00000005L; + public static final long CKK_CAST = 0x00000016L; + public static final long CKK_CAST3 = 0x00000017L; + public static final long CKK_CAST5 /*deprecated*/ = 0x00000018L; + public static final long CKK_CAST128 = 0x00000018L; + public static final long CKK_RC5 = 0x00000019L; + public static final long CKK_IDEA = 0x0000001AL; + public static final long CKK_SKIPJACK = 0x0000001BL; + public static final long CKK_BATON = 0x0000001CL; + public static final long CKK_JUNIPER = 0x0000001DL; + public static final long CKK_CDMF = 0x0000001EL; + public static final long CKK_AES = 0x0000001FL; + public static final long CKK_BLOWFISH = 0x00000020L; + public static final long CKK_TWOFISH = 0x00000021L; + public static final long CKK_SECURID = 0x00000022L; + public static final long CKK_HOTP = 0x00000023L; + public static final long CKK_ACTI = 0x00000024L; + public static final long CKK_CAMELLIA = 0x00000025L; + public static final long CKK_ARIA = 0x00000026L; - public static final long CKK_GENERIC_SECRET = 0x00000010L; - public static final long CKK_RC2 = 0x00000011L; - public static final long CKK_RC4 = 0x00000012L; - public static final long CKK_DES = 0x00000013L; - public static final long CKK_DES2 = 0x00000014L; - public static final long CKK_DES3 = 0x00000015L; + public static final long CKK_MD5_HMAC = 0x00000027L; + public static final long CKK_SHA_1_HMAC = 0x00000028L; + public static final long CKK_RIPEMD128_HMAC = 0x00000029L; + public static final long CKK_RIPEMD160_HMAC = 0x0000002AL; + public static final long CKK_SHA256_HMAC = 0x0000002BL; + public static final long CKK_SHA384_HMAC = 0x0000002CL; + public static final long CKK_SHA512_HMAC = 0x0000002DL; + public static final long CKK_SHA224_HMAC = 0x0000002EL; - /* all these key types are new for v2.0 */ - public static final long CKK_CAST = 0x00000016L; - public static final long CKK_CAST3 = 0x00000017L; - /* CKK_CAST5 is deprecated in v2.11, CKK_CAST128 is preferred. */ - public static final long CKK_CAST5 = 0x00000018L; - /* CAST128=CAST5 */ - public static final long CKK_CAST128 = 0x00000018L; - public static final long CKK_RC5 = 0x00000019L; - public static final long CKK_IDEA = 0x0000001AL; - public static final long CKK_SKIPJACK = 0x0000001BL; - public static final long CKK_BATON = 0x0000001CL; - public static final long CKK_JUNIPER = 0x0000001DL; - public static final long CKK_CDMF = 0x0000001EL; - public static final long CKK_AES = 0x0000001FL; - // v2.20 - public static final long CKK_BLOWFISH = 0x00000020L; - - public static final long CKK_VENDOR_DEFINED = 0x80000000L; - - // new for v2.20 amendment 3 - //public static final long CKK_CAMELLIA = 0x00000025L; - //public static final long CKK_ARIA = 0x00000026L; + public static final long CKK_SEED = 0x0000002FL; + public static final long CKK_GOSTR3410 = 0x00000030L; + public static final long CKK_GOSTR3411 = 0x00000031L; + public static final long CKK_GOST28147 = 0x00000032L; +; + public static final long CKK_VENDOR_DEFINED = 0x80000000L; // pseudo key type ANY (for template manager) - public static final long PCKK_ANY = 0x7FFFFF22L; + public static final long PCKK_ANY = 0x7FFFFF22L; - public static final long PCKK_HMAC = 0x7FFFFF23L; - public static final long PCKK_SSLMAC = 0x7FFFFF24L; - public static final long PCKK_TLSPREMASTER = 0x7FFFFF25L; - public static final long PCKK_TLSRSAPREMASTER = 0x7FFFFF26L; - public static final long PCKK_TLSMASTER = 0x7FFFFF27L; + public static final long PCKK_HMAC = 0x7FFFFF23L; + public static final long PCKK_SSLMAC = 0x7FFFFF24L; + public static final long PCKK_TLSPREMASTER = 0x7FFFFF25L; + public static final long PCKK_TLSRSAPREMASTER = 0x7FFFFF26L; + public static final long PCKK_TLSMASTER = 0x7FFFFF27L; /* The following certificate types are defined: */ - /* CKC_X_509_ATTR_CERT is new for v2.10 */ - public static final long CKC_X_509 = 0x00000000L; - public static final long CKC_X_509_ATTR_CERT = 0x00000001L; - public static final long CKC_VENDOR_DEFINED = 0x80000000L; + public static final long CKC_X_509 = 0x00000000L; + public static final long CKC_X_509_ATTR_CERT = 0x00000001L; + public static final long CKC_VENDOR_DEFINED = 0x80000000L; + /* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which + * consists of an array of values. + */ + public static final long CKF_ARRAY_ATTRIBUTE = 0x40000000L; /* The following attribute types are defined: */ public static final long CKA_CLASS = 0x00000000L; @@ -331,22 +288,26 @@ public interface PKCS11Constants { public static final long CKA_LABEL = 0x00000003L; public static final long CKA_APPLICATION = 0x00000010L; public static final long CKA_VALUE = 0x00000011L; - - /* CKA_OBJECT_ID is new for v2.10 */ public static final long CKA_OBJECT_ID = 0x00000012L; - public static final long CKA_CERTIFICATE_TYPE = 0x00000080L; public static final long CKA_ISSUER = 0x00000081L; public static final long CKA_SERIAL_NUMBER = 0x00000082L; - - /* CKA_AC_ISSUER, CKA_OWNER, and CKA_ATTR_TYPES are new L; - * for v2.10 */ public static final long CKA_AC_ISSUER = 0x00000083L; public static final long CKA_OWNER = 0x00000084L; public static final long CKA_ATTR_TYPES = 0x00000085L; - - /* CKA_TRUSTED is new for v2.11 */ public static final long CKA_TRUSTED = 0x00000086L; + public static final long CKA_CERTIFICATE_CATEGORY + = 0x00000087L; + public static final long CKA_JAVA_MIDP_SECURITY_DOMAIN + = 0x00000088L; + public static final long CKA_URL = 0x00000089L; + public static final long CKA_HASH_OF_SUBJECT_PUBLIC_KEY + = 0x0000008AL; + public static final long CKA_HASH_OF_ISSUER_PUBLIC_KEY + = 0x0000008BL; + public static final long CKA_NAME_HASH_ALGORITHM + = 0x0000008CL; + public static final long CKA_CHECK_VALUE = 0x00000090L; public static final long CKA_KEY_TYPE = 0x00000100L; public static final long CKA_SUBJECT = 0x00000101L; @@ -372,45 +333,79 @@ public interface PKCS11Constants { public static final long CKA_EXPONENT_1 = 0x00000126L; public static final long CKA_EXPONENT_2 = 0x00000127L; public static final long CKA_COEFFICIENT = 0x00000128L; + public static final long CKA_PUBLIC_KEY_INFO = 0x00000129L; public static final long CKA_PRIME = 0x00000130L; public static final long CKA_SUBPRIME = 0x00000131L; public static final long CKA_BASE = 0x00000132L; - /* CKA_PRIME_BITS and CKA_SUB_PRIME_BITS are new for v2.11 */ public static final long CKA_PRIME_BITS = 0x00000133L; public static final long CKA_SUB_PRIME_BITS = 0x00000134L; public static final long CKA_VALUE_BITS = 0x00000160L; public static final long CKA_VALUE_LEN = 0x00000161L; - /* CKA_EXTRACTABLE, CKA_LOCAL, CKA_NEVER_EXTRACTABLE, - * CKA_ALWAYS_SENSITIVE, CKA_MODIFIABLE, CKA_ECDSA_PARAMS, - * and CKA_EC_POINT are new for v2.0 */ public static final long CKA_EXTRACTABLE = 0x00000162L; public static final long CKA_LOCAL = 0x00000163L; public static final long CKA_NEVER_EXTRACTABLE = 0x00000164L; public static final long CKA_ALWAYS_SENSITIVE = 0x00000165L; - /* CKA_KEY_GEN_MECHANISM is new for v2.11 */ public static final long CKA_KEY_GEN_MECHANISM = 0x00000166L; public static final long CKA_MODIFIABLE = 0x00000170L; + public static final long CKA_COPYABLE = 0x00000171L; + public static final long CKA_DESTROYABLE = 0x00000172L; - /* CKA_ECDSA_PARAMS is deprecated in v2.11, - * CKA_EC_PARAMS is preferred. */ - public static final long CKA_ECDSA_PARAMS = 0x00000180L; - public static final long CKA_EC_PARAMS = 0x00000180L; - public static final long CKA_EC_POINT = 0x00000181L; + public static final long CKA_ECDSA_PARAMS /*deprecated*/ = 0x00000180L; + public static final long CKA_EC_PARAMS = 0x00000180L; + public static final long CKA_EC_POINT = 0x00000181L; + + public static final long CKA_SECONDARY_AUTH /*deprecated*/= 0x00000200L; + public static final long CKA_AUTH_PIN_FLAGS /*deprecated*/= 0x00000201L; + public static final long CKA_ALWAYS_AUTHENTICATE = 0x00000202L; + public static final long CKA_WRAP_WITH_TRUSTED = 0x00000210L; + public static final long CKA_WRAP_TEMPLATE = (CKF_ARRAY_ATTRIBUTE|0x00000211L); + public static final long CKA_UNWRAP_TEMPLATE = (CKF_ARRAY_ATTRIBUTE|0x00000212L); + public static final long CKA_DERIVE_TEMPLATE = (CKF_ARRAY_ATTRIBUTE|0x00000213L); + + public static final long CKA_OTP_FORMAT = 0x00000220L; + public static final long CKA_OTP_LENGTH = 0x00000221L; + public static final long CKA_OTP_TIME_INTERVAL = 0x00000222L; + public static final long CKA_OTP_USER_FRIENDLY_MODE = 0x00000223L; + public static final long CKA_OTP_CHALLENGE_REQUIREMENT = 0x00000224L; + public static final long CKA_OTP_TIME_REQUIREMENT = 0x00000225L; + public static final long CKA_OTP_COUNTER_REQUIREMENT = 0x00000226L; + public static final long CKA_OTP_PIN_REQUIREMENT = 0x00000227L; + public static final long CKA_OTP_COUNTER = 0x0000022EL; + public static final long CKA_OTP_TIME = 0x0000022FL; + public static final long CKA_OTP_USER_IDENTIFIER = 0x0000022AL; + public static final long CKA_OTP_SERVICE_IDENTIFIER = 0x0000022BL; + public static final long CKA_OTP_SERVICE_LOGO = 0x0000022CL; + public static final long CKA_OTP_SERVICE_LOGO_TYPE = 0x0000022DL; + + public static final long CKA_GOSTR3410_PARAMS = 0x00000250L; + public static final long CKA_GOSTR3411_PARAMS = 0x00000251L; + public static final long CKA_GOST28147_PARAMS = 0x00000252L; - /* CKA_SECONDARY_AUTH, CKA_AUTH_PIN_FLAGS, - * CKA_HW_FEATURE_TYPE, CKA_RESET_ON_INIT, and CKA_HAS_RESET - * are new for v2.10 */ - public static final long CKA_SECONDARY_AUTH = 0x00000200L; - public static final long CKA_AUTH_PIN_FLAGS = 0x00000201L; public static final long CKA_HW_FEATURE_TYPE = 0x00000300L; public static final long CKA_RESET_ON_INIT = 0x00000301L; public static final long CKA_HAS_RESET = 0x00000302L; + public static final long CKA_PIXEL_X = 0x00000400L; + public static final long CKA_PIXEL_Y = 0x00000401L; + public static final long CKA_RESOLUTION = 0x00000402L; + public static final long CKA_CHAR_ROWS = 0x00000403L; + public static final long CKA_CHAR_COLUMNS = 0x00000404L; + public static final long CKA_COLOR = 0x00000405L; + public static final long CKA_BITS_PER_PIXEL = 0x00000406L; + public static final long CKA_CHAR_SETS = 0x00000480L; + public static final long CKA_ENCODING_METHODS = 0x00000481L; + public static final long CKA_MIME_TYPES = 0x00000482L; + public static final long CKA_MECHANISM_TYPE = 0x00000500L; + public static final long CKA_REQUIRED_CMS_ATTRIBUTES = 0x00000501L; + public static final long CKA_DEFAULT_CMS_ATTRIBUTES = 0x00000502L; + public static final long CKA_SUPPORTED_CMS_ATTRIBUTES = 0x00000503L; + public static final long CKA_ALLOWED_MECHANISMS = (CKF_ARRAY_ATTRIBUTE|0x00000600L); + public static final long CKA_VENDOR_DEFINED = 0x80000000L; /* the following mechanism types are defined: */ @@ -419,20 +414,14 @@ public interface PKCS11Constants { public static final long CKM_RSA_9796 = 0x00000002L; public static final long CKM_RSA_X_509 = 0x00000003L; - /* CKM_MD2_RSA_PKCS, CKM_MD5_RSA_PKCS, and CKM_SHA1_RSA_PKCS - * are new for v2.0. They are mechanisms which hash and sign */ public static final long CKM_MD2_RSA_PKCS = 0x00000004L; public static final long CKM_MD5_RSA_PKCS = 0x00000005L; public static final long CKM_SHA1_RSA_PKCS = 0x00000006L; - /* CKM_RIPEMD128_RSA_PKCS, CKM_RIPEMD160_RSA_PKCS, and - * CKM_RSA_PKCS_OAEP are new for v2.10 */ public static final long CKM_RIPEMD128_RSA_PKCS = 0x00000007L; public static final long CKM_RIPEMD160_RSA_PKCS = 0x00000008L; public static final long CKM_RSA_PKCS_OAEP = 0x00000009L; - /* CKM_RSA_X9_31_KEY_PAIR_GEN, CKM_RSA_X9_31, CKM_SHA1_RSA_X9_31, - * CKM_RSA_PKCS_PSS, and CKM_SHA1_RSA_PKCS_PSS are new for v2.11 */ public static final long CKM_RSA_X9_31_KEY_PAIR_GEN = 0x0000000AL; public static final long CKM_RSA_X9_31 = 0x0000000BL; public static final long CKM_SHA1_RSA_X9_31 = 0x0000000CL; @@ -442,28 +431,48 @@ public interface PKCS11Constants { public static final long CKM_DSA_KEY_PAIR_GEN = 0x00000010L; public static final long CKM_DSA = 0x00000011L; public static final long CKM_DSA_SHA1 = 0x00000012L; + public static final long CKM_DSA_SHA224 = 0x00000013L; + public static final long CKM_DSA_SHA256 = 0x00000014L; + public static final long CKM_DSA_SHA384 = 0x00000015L; + public static final long CKM_DSA_SHA512 = 0x00000016L; + public static final long CKM_DH_PKCS_KEY_PAIR_GEN = 0x00000020L; public static final long CKM_DH_PKCS_DERIVE = 0x00000021L; - /* CKM_X9_42_DH_KEY_PAIR_GEN, CKM_X9_42_DH_DERIVE, - * CKM_X9_42_DH_HYBRID_DERIVE, and CKM_X9_42_MQV_DERIVE are new for - * v2.11 */ public static final long CKM_X9_42_DH_KEY_PAIR_GEN = 0x00000030L; public static final long CKM_X9_42_DH_DERIVE = 0x00000031L; public static final long CKM_X9_42_DH_HYBRID_DERIVE = 0x00000032L; public static final long CKM_X9_42_MQV_DERIVE = 0x00000033L; - // v2.20 public static final long CKM_SHA256_RSA_PKCS = 0x00000040L; public static final long CKM_SHA384_RSA_PKCS = 0x00000041L; public static final long CKM_SHA512_RSA_PKCS = 0x00000042L; + public static final long CKM_SHA256_RSA_PKCS_PSS = 0x00000043L; + public static final long CKM_SHA384_RSA_PKCS_PSS = 0x00000044L; + public static final long CKM_SHA512_RSA_PKCS_PSS = 0x00000045L; + + public static final long CKM_SHA224_RSA_PKCS = 0x00000046L; + public static final long CKM_SHA224_RSA_PKCS_PSS = 0x00000047L; + + public static final long CKM_SHA512_224 = 0x00000048L; + public static final long CKM_SHA512_224_HMAC = 0x00000049L; + public static final long CKM_SHA512_224_HMAC_GENERAL = 0x0000004AL; + public static final long CKM_SHA512_224_KEY_DERIVATION = 0x0000004BL; + public static final long CKM_SHA512_256 = 0x0000004CL; + public static final long CKM_SHA512_256_HMAC = 0x0000004DL; + public static final long CKM_SHA512_256_HMAC_GENERAL = 0x0000004EL; + public static final long CKM_SHA512_256_KEY_DERIVATION = 0x0000004FL; + + public static final long CKM_SHA512_T = 0x00000050L; + public static final long CKM_SHA512_T_HMAC = 0x00000051L; + public static final long CKM_SHA512_T_HMAC_GENERAL = 0x00000052L; + public static final long CKM_SHA512_T_KEY_DERIVATION = 0x00000053L; public static final long CKM_RC2_KEY_GEN = 0x00000100L; public static final long CKM_RC2_ECB = 0x00000101L; public static final long CKM_RC2_CBC = 0x00000102L; public static final long CKM_RC2_MAC = 0x00000103L; - /* CKM_RC2_MAC_GENERAL and CKM_RC2_CBC_PAD are new for v2.0 */ public static final long CKM_RC2_MAC_GENERAL = 0x00000104L; public static final long CKM_RC2_CBC_PAD = 0x00000105L; @@ -474,7 +483,6 @@ public interface PKCS11Constants { public static final long CKM_DES_CBC = 0x00000122L; public static final long CKM_DES_MAC = 0x00000123L; - /* CKM_DES_MAC_GENERAL and CKM_DES_CBC_PAD are new for v2.0 */ public static final long CKM_DES_MAC_GENERAL = 0x00000124L; public static final long CKM_DES_CBC_PAD = 0x00000125L; @@ -484,11 +492,10 @@ public interface PKCS11Constants { public static final long CKM_DES3_CBC = 0x00000133L; public static final long CKM_DES3_MAC = 0x00000134L; - /* CKM_DES3_MAC_GENERAL, CKM_DES3_CBC_PAD, CKM_CDMF_KEY_GEN, - * CKM_CDMF_ECB, CKM_CDMF_CBC, CKM_CDMF_MAC, - * CKM_CDMF_MAC_GENERAL, and CKM_CDMF_CBC_PAD are new for v2.0 */ public static final long CKM_DES3_MAC_GENERAL = 0x00000135L; public static final long CKM_DES3_CBC_PAD = 0x00000136L; + public static final long CKM_DES3_CMAC_GENERAL = 0x00000137L; + public static final long CKM_DES3_CMAC = 0x00000138L; public static final long CKM_CDMF_KEY_GEN = 0x00000140L; public static final long CKM_CDMF_ECB = 0x00000141L; public static final long CKM_CDMF_CBC = 0x00000142L; @@ -496,27 +503,26 @@ public interface PKCS11Constants { public static final long CKM_CDMF_MAC_GENERAL = 0x00000144L; public static final long CKM_CDMF_CBC_PAD = 0x00000145L; + public static final long CKM_DES_OFB64 = 0x00000150L; + public static final long CKM_DES_OFB8 = 0x00000151L; + public static final long CKM_DES_CFB64 = 0x00000152L; + public static final long CKM_DES_CFB8 = 0x00000153L; + public static final long CKM_MD2 = 0x00000200L; - /* CKM_MD2_HMAC and CKM_MD2_HMAC_GENERAL are new for v2.0 */ public static final long CKM_MD2_HMAC = 0x00000201L; public static final long CKM_MD2_HMAC_GENERAL = 0x00000202L; public static final long CKM_MD5 = 0x00000210L; - /* CKM_MD5_HMAC and CKM_MD5_HMAC_GENERAL are new for v2.0 */ public static final long CKM_MD5_HMAC = 0x00000211L; public static final long CKM_MD5_HMAC_GENERAL = 0x00000212L; public static final long CKM_SHA_1 = 0x00000220L; - /* CKM_SHA_1_HMAC and CKM_SHA_1_HMAC_GENERAL are new for v2.0 */ public static final long CKM_SHA_1_HMAC = 0x00000221L; public static final long CKM_SHA_1_HMAC_GENERAL = 0x00000222L; - /* CKM_RIPEMD128, CKM_RIPEMD128_HMAC, - * CKM_RIPEMD128_HMAC_GENERAL, CKM_RIPEMD160, CKM_RIPEMD160_HMAC, - * and CKM_RIPEMD160_HMAC_GENERAL are new for v2.10 */ public static final long CKM_RIPEMD128 = 0x00000230L; public static final long CKM_RIPEMD128_HMAC = 0x00000231L; public static final long CKM_RIPEMD128_HMAC_GENERAL = 0x00000232L; @@ -524,11 +530,12 @@ public interface PKCS11Constants { public static final long CKM_RIPEMD160_HMAC = 0x00000241L; public static final long CKM_RIPEMD160_HMAC_GENERAL = 0x00000242L; - // v2.20 public static final long CKM_SHA256 = 0x00000250L; public static final long CKM_SHA256_HMAC = 0x00000251L; public static final long CKM_SHA256_HMAC_GENERAL = 0x00000252L; - + public static final long CKM_SHA224 = 0x00000255L; + public static final long CKM_SHA224_HMAC = 0x00000256L; + public static final long CKM_SHA224_HMAC_GENERAL = 0x00000257L; public static final long CKM_SHA384 = 0x00000260L; public static final long CKM_SHA384_HMAC = 0x00000261L; public static final long CKM_SHA384_HMAC_GENERAL = 0x00000262L; @@ -537,8 +544,13 @@ public interface PKCS11Constants { public static final long CKM_SHA512_HMAC = 0x00000271L; public static final long CKM_SHA512_HMAC_GENERAL = 0x00000272L; - /* All of the following mechanisms are new for v2.0 */ - /* Note that CAST128 and CAST5 are the same algorithm */ + public static final long CKM_SECURID_KEY_GEN = 0x00000280L; + public static final long CKM_SECURID = 0x00000282L; + public static final long CKM_HOTP_KEY_GEN = 0x00000290L; + public static final long CKM_HOTP = 0x00000291L; + public static final long CKM_ACTI = 0x000002A0L; + public static final long CKM_ACTI_KEY_GEN = 0x000002A1L; + public static final long CKM_CAST_KEY_GEN = 0x00000300L; public static final long CKM_CAST_ECB = 0x00000301L; public static final long CKM_CAST_CBC = 0x00000302L; @@ -551,18 +563,20 @@ public interface PKCS11Constants { public static final long CKM_CAST3_MAC = 0x00000313L; public static final long CKM_CAST3_MAC_GENERAL = 0x00000314L; public static final long CKM_CAST3_CBC_PAD = 0x00000315L; - public static final long CKM_CAST5_KEY_GEN = 0x00000320L; - public static final long CKM_CAST128_KEY_GEN = 0x00000320L; - public static final long CKM_CAST5_ECB = 0x00000321L; - public static final long CKM_CAST128_ECB = 0x00000321L; - public static final long CKM_CAST5_CBC = 0x00000322L; - public static final long CKM_CAST128_CBC = 0x00000322L; - public static final long CKM_CAST5_MAC = 0x00000323L; - public static final long CKM_CAST128_MAC = 0x00000323L; - public static final long CKM_CAST5_MAC_GENERAL = 0x00000324L; - public static final long CKM_CAST128_MAC_GENERAL = 0x00000324L; - public static final long CKM_CAST5_CBC_PAD = 0x00000325L; - public static final long CKM_CAST128_CBC_PAD = 0x00000325L; + /* Note that CAST128 and CAST5 are the same algorithm */ + public static final long CKM_CAST5_KEY_GEN = 0x00000320L; + public static final long CKM_CAST128_KEY_GEN = 0x00000320L; + public static final long CKM_CAST5_ECB = 0x00000321L; + public static final long CKM_CAST128_ECB = 0x00000321L; + public static final long CKM_CAST5_CBC /*deprecated*/ = 0x00000322L; + public static final long CKM_CAST128_CBC = 0x00000322L; + public static final long CKM_CAST5_MAC /*deprecated*/ = 0x00000323L; + public static final long CKM_CAST128_MAC = 0x00000323L; + public static final long CKM_CAST5_MAC_GENERAL /*deprecated*/ + = 0x00000324L; + public static final long CKM_CAST128_MAC_GENERAL = 0x00000324L; + public static final long CKM_CAST5_CBC_PAD /*deprecated*/ = 0x00000325L; + public static final long CKM_CAST128_CBC_PAD = 0x00000325L; public static final long CKM_RC5_KEY_GEN = 0x00000330L; public static final long CKM_RC5_ECB = 0x00000331L; public static final long CKM_RC5_CBC = 0x00000332L; @@ -585,9 +599,6 @@ public interface PKCS11Constants { public static final long CKM_SSL3_MASTER_KEY_DERIVE = 0x00000371L; public static final long CKM_SSL3_KEY_AND_MAC_DERIVE = 0x00000372L; - /* CKM_SSL3_MASTER_KEY_DERIVE_DH, CKM_TLS_PRE_MASTER_KEY_GEN, - * CKM_TLS_MASTER_KEY_DERIVE, CKM_TLS_KEY_AND_MAC_DERIVE, and - * CKM_TLS_MASTER_KEY_DERIVE_DH are new for v2.11 */ public static final long CKM_SSL3_MASTER_KEY_DERIVE_DH = 0x00000373L; public static final long CKM_TLS_PRE_MASTER_KEY_GEN = 0x00000374L; public static final long CKM_TLS_MASTER_KEY_DERIVE = 0x00000375L; @@ -601,10 +612,10 @@ public interface PKCS11Constants { public static final long CKM_MD2_KEY_DERIVATION = 0x00000391L; public static final long CKM_SHA1_KEY_DERIVATION = 0x00000392L; - // v2.20 public static final long CKM_SHA256_KEY_DERIVATION = 0x00000393L; public static final long CKM_SHA384_KEY_DERIVATION = 0x00000394L; public static final long CKM_SHA512_KEY_DERIVATION = 0x00000395L; + public static final long CKM_SHA224_KEY_DERIVATION = 0x00000396L; public static final long CKM_PBE_MD2_DES_CBC = 0x000003A0L; public static final long CKM_PBE_MD5_DES_CBC = 0x000003A1L; @@ -621,22 +632,65 @@ public interface PKCS11Constants { public static final long CKM_PBE_SHA1_RC2_128_CBC = 0x000003AAL; public static final long CKM_PBE_SHA1_RC2_40_CBC = 0x000003ABL; - /* CKM_PKCS5_PBKD2 is new for v2.10 */ public static final long CKM_PKCS5_PBKD2 = 0x000003B0L; public static final long CKM_PBA_SHA1_WITH_SHA1_HMAC = 0x000003C0L; - /* CKM_TLS12_MASTER_KEY_DERIVE, CKM_TLS12_KEY_AND_MAC_DERIVE, - * CKM_TLS12_MASTER_KEY_DERIVE_DH and CKM_TLS_MAC are new for v2.40 */ + public static final long CKM_WTLS_PRE_MASTER_KEY_GEN = 0x000003D0L; + public static final long CKM_WTLS_MASTER_KEY_DERIVE = 0x000003D1L; + public static final long CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC = 0x000003D2L; + public static final long CKM_WTLS_PRF = 0x000003D3L; + public static final long CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE = 0x000003D4L; + public static final long CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE = 0x000003D5L; + + public static final long CKM_TLS10_MAC_SERVER = 0x000003D6L; + public static final long CKM_TLS10_MAC_CLIENT = 0x000003D7L; + public static final long CKM_TLS12_MAC = 0x000003D8L; + public static final long CKM_TLS12_KDF = 0x000003D9L; + public static final long CKM_TLS12_MASTER_KEY_DERIVE = 0x000003E0L; public static final long CKM_TLS12_KEY_AND_MAC_DERIVE = 0x000003E1L; public static final long CKM_TLS12_MASTER_KEY_DERIVE_DH = 0x000003E2L; + public static final long CKM_TLS12_KEY_SAFE_DERIVE = 0x000003E3L; public static final long CKM_TLS_MAC = 0x000003E4L; + public static final long CKM_TLS_KDF = 0x000003E5L; public static final long CKM_KEY_WRAP_LYNKS = 0x00000400L; public static final long CKM_KEY_WRAP_SET_OAEP = 0x00000401L; - /* Fortezza mechanisms */ + public static final long CKM_CMS_SIG = 0x00000500L; + public static final long CKM_KIP_DERIVE = 0x00000510L; + public static final long CKM_KIP_WRAP = 0x00000511L; + public static final long CKM_KIP_MAC = 0x00000512L; + + public static final long CKM_CAMELLIA_KEY_GEN = 0x00000550L; + public static final long CKM_CAMELLIA_ECB = 0x00000551L; + public static final long CKM_CAMELLIA_CBC = 0x00000552L; + public static final long CKM_CAMELLIA_MAC = 0x00000553L; + public static final long CKM_CAMELLIA_MAC_GENERAL = 0x00000554L; + public static final long CKM_CAMELLIA_CBC_PAD = 0x00000555L; + public static final long CKM_CAMELLIA_ECB_ENCRYPT_DATA = 0x00000556L; + public static final long CKM_CAMELLIA_CBC_ENCRYPT_DATA = 0x00000557L; + public static final long CKM_CAMELLIA_CTR = 0x00000558L; + + public static final long CKM_ARIA_KEY_GEN = 0x00000560L; + public static final long CKM_ARIA_ECB = 0x00000561L; + public static final long CKM_ARIA_CBC = 0x00000562L; + public static final long CKM_ARIA_MAC = 0x00000563L; + public static final long CKM_ARIA_MAC_GENERAL = 0x00000564L; + public static final long CKM_ARIA_CBC_PAD = 0x00000565L; + public static final long CKM_ARIA_ECB_ENCRYPT_DATA = 0x00000566L; + public static final long CKM_ARIA_CBC_ENCRYPT_DATA = 0x00000567L; + + public static final long CKM_SEED_KEY_GEN = 0x00000650L; + public static final long CKM_SEED_ECB = 0x00000651L; + public static final long CKM_SEED_CBC = 0x00000652L; + public static final long CKM_SEED_MAC = 0x00000653L; + public static final long CKM_SEED_MAC_GENERAL = 0x00000654L; + public static final long CKM_SEED_CBC_PAD = 0x00000655L; + public static final long CKM_SEED_ECB_ENCRYPT_DATA = 0x00000656L; + public static final long CKM_SEED_CBC_ENCRYPT_DATA = 0x00000657L; + public static final long CKM_SKIPJACK_KEY_GEN = 0x00001000L; public static final long CKM_SKIPJACK_ECB64 = 0x00001001L; public static final long CKM_SKIPJACK_CBC64 = 0x00001002L; @@ -650,6 +704,7 @@ public interface PKCS11Constants { public static final long CKM_SKIPJACK_RELAYX = 0x0000100AL; public static final long CKM_KEA_KEY_PAIR_GEN = 0x00001010L; public static final long CKM_KEA_KEY_DERIVE = 0x00001011L; + public static final long CKM_KEA_DERIVE = 0x00001012L; public static final long CKM_FORTEZZA_TIMESTAMP = 0x00001020L; public static final long CKM_BATON_KEY_GEN = 0x00001030L; public static final long CKM_BATON_ECB128 = 0x00001031L; @@ -659,20 +714,24 @@ public interface PKCS11Constants { public static final long CKM_BATON_SHUFFLE = 0x00001035L; public static final long CKM_BATON_WRAP = 0x00001036L; - /* CKM_ECDSA_KEY_PAIR_GEN is deprecated in v2.11, - * CKM_EC_KEY_PAIR_GEN is preferred */ - public static final long CKM_ECDSA_KEY_PAIR_GEN = 0x00001040L; + public static final long CKM_ECDSA_KEY_PAIR_GEN /*deprecated*/ + = 0x00001040L; public static final long CKM_EC_KEY_PAIR_GEN = 0x00001040L; public static final long CKM_ECDSA = 0x00001041L; public static final long CKM_ECDSA_SHA1 = 0x00001042L; + public static final long CKM_ECDSA_SHA224 = 0x00001043L; + public static final long CKM_ECDSA_SHA256 = 0x00001044L; + public static final long CKM_ECDSA_SHA384 = 0x00001045L; + public static final long CKM_ECDSA_SHA512 = 0x00001046L; - /* CKM_ECDH1_DERIVE, CKM_ECDH1_COFACTOR_DERIVE, and CKM_ECMQV_DERIVE - * are new for v2.11 */ public static final long CKM_ECDH1_DERIVE = 0x00001050L; public static final long CKM_ECDH1_COFACTOR_DERIVE = 0x00001051L; public static final long CKM_ECMQV_DERIVE = 0x00001052L; + public static final long CKM_ECDH_AES_KEY_WRAP = 0x00001053L; + public static final long CKM_RSA_AES_KEY_WRAP = 0x00001054L; + public static final long CKM_JUNIPER_KEY_GEN = 0x00001060L; public static final long CKM_JUNIPER_ECB128 = 0x00001061L; public static final long CKM_JUNIPER_CBC128 = 0x00001062L; @@ -681,70 +740,79 @@ public interface PKCS11Constants { public static final long CKM_JUNIPER_WRAP = 0x00001065L; public static final long CKM_FASTHASH = 0x00001070L; - /* CKM_AES_KEY_GEN, CKM_AES_ECB, CKM_AES_CBC, CKM_AES_MAC, - * CKM_AES_MAC_GENERAL, CKM_AES_CBC_PAD, CKM_DSA_PARAMETER_GEN, - * CKM_DH_PKCS_PARAMETER_GEN, and CKM_X9_42_DH_PARAMETER_GEN are - * new for v2.11 */ public static final long CKM_AES_KEY_GEN = 0x00001080L; public static final long CKM_AES_ECB = 0x00001081L; public static final long CKM_AES_CBC = 0x00001082L; public static final long CKM_AES_MAC = 0x00001083L; public static final long CKM_AES_MAC_GENERAL = 0x00001084L; public static final long CKM_AES_CBC_PAD = 0x00001085L; - // v2.20 + public static final long CKM_AES_CTR = 0x00001086L; + public static final long CKM_AES_GCM = 0x00001087L; + public static final long CKM_AES_CCM = 0x00001088L; + public static final long CKM_AES_CTS = 0x00001089L; + public static final long CKM_AES_CMAC = 0x0000108AL; + public static final long CKM_AES_CMAC_GENERAL = 0x0000108BL; + + public static final long CKM_AES_XCBC_MAC = 0x0000108CL; + public static final long CKM_AES_XCBC_MAC_96 = 0x0000108DL; + public static final long CKM_AES_GMAC = 0x0000108EL; + public static final long CKM_BLOWFISH_KEY_GEN = 0x00001090L; public static final long CKM_BLOWFISH_CBC = 0x00001091L; + public static final long CKM_TWOFISH_KEY_GEN = 0x00001092L; + public static final long CKM_TWOFISH_CBC = 0x00001093L; + public static final long CKM_BLOWFISH_CBC_PAD = 0x00001094L; + public static final long CKM_TWOFISH_CBC_PAD = 0x00001095L; + + public static final long CKM_DES_ECB_ENCRYPT_DATA = 0x00001100L; + public static final long CKM_DES_CBC_ENCRYPT_DATA = 0x00001101L; + public static final long CKM_DES3_ECB_ENCRYPT_DATA = 0x00001102L; + public static final long CKM_DES3_CBC_ENCRYPT_DATA = 0x00001103L; + public static final long CKM_AES_ECB_ENCRYPT_DATA = 0x00001104L; + public static final long CKM_AES_CBC_ENCRYPT_DATA = 0x00001105L; + + public static final long CKM_GOSTR3410_KEY_PAIR_GEN = 0x00001200L; + public static final long CKM_GOSTR3410 = 0x00001201L; + public static final long CKM_GOSTR3410_WITH_GOSTR3411 = 0x00001202L; + public static final long CKM_GOSTR3410_KEY_WRAP = 0x00001203L; + public static final long CKM_GOSTR3410_DERIVE = 0x00001204L; + public static final long CKM_GOSTR3411 = 0x00001210L; + public static final long CKM_GOSTR3411_HMAC = 0x00001211L; + public static final long CKM_GOST28147_KEY_GEN = 0x00001220L; + public static final long CKM_GOST28147_ECB = 0x00001221L; + public static final long CKM_GOST28147 = 0x00001222L; + public static final long CKM_GOST28147_MAC = 0x00001223L; + public static final long CKM_GOST28147_KEY_WRAP = 0x00001224L; + public static final long CKM_DSA_PARAMETER_GEN = 0x00002000L; public static final long CKM_DH_PKCS_PARAMETER_GEN = 0x00002001L; public static final long CKM_X9_42_DH_PARAMETER_GEN = 0x00002002L; + public static final long CKM_DSA_PROBABLISTIC_PARAMETER_GEN = 0x00002003L; + public static final long CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN = 0x00002004L; + + public static final long CKM_AES_OFB = 0x00002104L; + public static final long CKM_AES_CFB64 = 0x00002105L; + public static final long CKM_AES_CFB8 = 0x00002106L; + public static final long CKM_AES_CFB128 = 0x00002107L; + public static final long CKM_AES_CFB1 = 0x00002108L; + public static final long CKM_AES_KEY_WRAP = 0x00002109L; + public static final long CKM_AES_KEY_WRAP_PAD = 0x0000210AL; + + public static final long CKM_RSA_PKCS_TPM_1_1 = 0x00004001L; + public static final long CKM_RSA_PKCS_OAEP_TPM_1_1 = 0x00004002L; public static final long CKM_VENDOR_DEFINED = 0x80000000L; - // new for v2.20 amendment 3 - public static final long CKM_SHA224 = 0x00000255L; - public static final long CKM_SHA224_HMAC = 0x00000256L; - public static final long CKM_SHA224_HMAC_GENERAL = 0x00000257L; - public static final long CKM_SHA224_KEY_DERIVATION = 0x00000396L; - public static final long CKM_SHA224_RSA_PKCS = 0x00000046L; - public static final long CKM_SHA224_RSA_PKCS_PSS = 0x00000047L; - public static final long CKM_AES_CTR = 0x00001086L; - /* - public static final long CKM_CAMELLIA_KEY_GEN = 0x00000550L; - public static final long CKM_CAMELLIA_ECB = 0x00000551L; - public static final long CKM_CAMELLIA_CBC = 0x00000552L; - public static final long CKM_CAMELLIA_MAC = 0x00000553L; - public static final long CKM_CAMELLIA_MAC_GENERAL = 0x00000554L; - public static final long CKM_CAMELLIA_CBC_PAD = 0x00000555L; - public static final long CKM_CAMELLIA_ECB_ENCRYPT_DATA = 0x00000556L; - public static final long CKM_CAMELLIA_CBC_ENCRYPT_DATA = 0x00000557L; - public static final long CKM_CAMELLIA_CTR = 0x00000558L; - public static final long CKM_ARIA_KEY_GEN = 0x00000560L; - public static final long CKM_ARIA_ECB = 0x00000561L; - public static final long CKM_ARIA_CBC = 0x00000562L; - public static final long CKM_ARIA_MAC = 0x00000563L; - public static final long CKM_ARIA_MAC_GENERAL = 0x00000564L; - public static final long CKM_ARIA_CBC_PAD = 0x00000565L; - public static final long CKM_ARIA_ECB_ENCRYPT_DATA = 0x00000566L; - public static final long CKM_ARIA_CBC_ENCRYPT_DATA = 0x00000567L; - */ - // NSS private public static final long CKM_NSS_TLS_PRF_GENERAL = 0x80000373L; - // ids for our pseudo mechanisms SecureRandom and KeyStore + // internal ids for our pseudo mechanisms SecureRandom and KeyStore public static final long PCKM_SECURERANDOM = 0x7FFFFF20L; public static final long PCKM_KEYSTORE = 0x7FFFFF21L; - /* The flags are defined as follows: - * Bit Flag Mask Meaning */ - /* performed by HW */ + /* The flags specify whether or not a mechanism can be used for a + * particular task */ public static final long CKF_HW = 0x00000001L; - - /* The flags CKF_ENCRYPT, CKF_DECRYPT, CKF_DIGEST, CKF_SIGN, - * CKG_SIGN_RECOVER, CKF_VERIFY, CKF_VERIFY_RECOVER, - * CKF_GENERATE, CKF_GENERATE_KEY_PAIR, CKF_WRAP, CKF_UNWRAP, - * and CKF_DERIVE are new for v2.0. They specify whether or not - * a mechanism can be used for a particular task */ public static final long CKF_ENCRYPT = 0x00000100L; public static final long CKF_DECRYPT = 0x00000200L; public static final long CKF_DIGEST = 0x00000400L; @@ -758,152 +826,141 @@ public interface PKCS11Constants { public static final long CKF_UNWRAP = 0x00040000L; public static final long CKF_DERIVE = 0x00080000L; - /* CKF_EC_F_P, CKF_EC_F_2M, CKF_EC_ECPARAMETERS, CKF_EC_NAMEDCURVE, - * CKF_EC_UNCOMPRESS, and CKF_EC_COMPRESS are new for v2.11. They - * describe a token's EC capabilities not available in mechanism - * information. */ - public static final long CKF_EC_F_P = 0x00100000L; - public static final long CKF_EC_F_2M = 0x00200000L; - public static final long CKF_EC_ECPARAMETERS = 0x00400000L; - public static final long CKF_EC_NAMEDCURVE = 0x00800000L; - public static final long CKF_EC_UNCOMPRESS = 0x01000000L; - public static final long CKF_EC_COMPRESS = 0x02000000L; + /* Describe a token's EC capabilities not available in mechanism + * information. + */ + public static final long CKF_EC_F_P = 0x00100000L; + public static final long CKF_EC_F_2M = 0x00200000L; + public static final long CKF_EC_ECPARAMETERS = 0x00400000L; + public static final long CKF_EC_NAMEDCURVE = 0x00800000L; + public static final long CKF_EC_UNCOMPRESS = 0x01000000L; + public static final long CKF_EC_COMPRESS = 0x02000000L; - /* FALSE for 2.01 */ public static final long CKF_EXTENSION = 0x80000000L; - /* CK_RV is a value that identifies the return value of a - * Cryptoki function */ - /* CK_RV was changed from CK_USHORT to CK_ULONG for v2.0 */ - public static final long CKR_OK = 0x00000000L; - public static final long CKR_CANCEL = 0x00000001L; - public static final long CKR_HOST_MEMORY = 0x00000002L; - public static final long CKR_SLOT_ID_INVALID = 0x00000003L; + /* Identifies the return value of a Cryptoki function */ + public static final long CKR_OK = 0x00000000L; + public static final long CKR_CANCEL = 0x00000001L; + public static final long CKR_HOST_MEMORY = 0x00000002L; + public static final long CKR_SLOT_ID_INVALID = 0x00000003L; - /* CKR_FLAGS_INVALID was removed for v2.0 */ + public static final long CKR_GENERAL_ERROR = 0x00000005L; + public static final long CKR_FUNCTION_FAILED = 0x00000006L; - /* CKR_GENERAL_ERROR and CKR_FUNCTION_FAILED are new for v2.0 */ - public static final long CKR_GENERAL_ERROR = 0x00000005L; - public static final long CKR_FUNCTION_FAILED = 0x00000006L; + public static final long CKR_ARGUMENTS_BAD = 0x00000007L; + public static final long CKR_NO_EVENT = 0x00000008L; + public static final long CKR_NEED_TO_CREATE_THREADS + = 0x00000009L; + public static final long CKR_CANT_LOCK = 0x0000000AL; - /* CKR_ARGUMENTS_BAD, CKR_NO_EVENT, CKR_NEED_TO_CREATE_THREADS, - * and CKR_CANT_LOCK are new for v2.01 */ - public static final long CKR_ARGUMENTS_BAD = 0x00000007L; - public static final long CKR_NO_EVENT = 0x00000008L; - public static final long CKR_NEED_TO_CREATE_THREADS = 0x00000009L; - public static final long CKR_CANT_LOCK = 0x0000000AL; + public static final long CKR_ATTRIBUTE_READ_ONLY = 0x00000010L; + public static final long CKR_ATTRIBUTE_SENSITIVE = 0x00000011L; + public static final long CKR_ATTRIBUTE_TYPE_INVALID = 0x00000012L; + public static final long CKR_ATTRIBUTE_VALUE_INVALID = 0x00000013L; + public static final long CKR_ACTION_PROHIBITED = 0x0000001BL; - public static final long CKR_ATTRIBUTE_READ_ONLY = 0x00000010L; - public static final long CKR_ATTRIBUTE_SENSITIVE = 0x00000011L; - public static final long CKR_ATTRIBUTE_TYPE_INVALID = 0x00000012L; - public static final long CKR_ATTRIBUTE_VALUE_INVALID = 0x00000013L; - public static final long CKR_DATA_INVALID = 0x00000020L; - public static final long CKR_DATA_LEN_RANGE = 0x00000021L; - public static final long CKR_DEVICE_ERROR = 0x00000030L; - public static final long CKR_DEVICE_MEMORY = 0x00000031L; - public static final long CKR_DEVICE_REMOVED = 0x00000032L; - public static final long CKR_ENCRYPTED_DATA_INVALID = 0x00000040L; - public static final long CKR_ENCRYPTED_DATA_LEN_RANGE = 0x00000041L; - public static final long CKR_FUNCTION_CANCELED = 0x00000050L; - public static final long CKR_FUNCTION_NOT_PARALLEL = 0x00000051L; + public static final long CKR_DATA_INVALID = 0x00000020L; + public static final long CKR_DATA_LEN_RANGE = 0x00000021L; + public static final long CKR_DEVICE_ERROR = 0x00000030L; + public static final long CKR_DEVICE_MEMORY = 0x00000031L; + public static final long CKR_DEVICE_REMOVED = 0x00000032L; + public static final long CKR_ENCRYPTED_DATA_INVALID = 0x00000040L; + public static final long CKR_ENCRYPTED_DATA_LEN_RANGE = 0x00000041L; + public static final long CKR_FUNCTION_CANCELED = 0x00000050L; + public static final long CKR_FUNCTION_NOT_PARALLEL = 0x00000051L; - /* CKR_FUNCTION_NOT_SUPPORTED is new for v2.0 */ - public static final long CKR_FUNCTION_NOT_SUPPORTED = 0x00000054L; + public static final long CKR_FUNCTION_NOT_SUPPORTED = 0x00000054L; - public static final long CKR_KEY_HANDLE_INVALID = 0x00000060L; + public static final long CKR_KEY_HANDLE_INVALID = 0x00000060L; - /* CKR_KEY_SENSITIVE was removed for v2.0 */ + public static final long CKR_KEY_SIZE_RANGE = 0x00000062L; + public static final long CKR_KEY_TYPE_INCONSISTENT = 0x00000063L; - public static final long CKR_KEY_SIZE_RANGE = 0x00000062L; - public static final long CKR_KEY_TYPE_INCONSISTENT = 0x00000063L; + public static final long CKR_KEY_NOT_NEEDED = 0x00000064L; + public static final long CKR_KEY_CHANGED = 0x00000065L; + public static final long CKR_KEY_NEEDED = 0x00000066L; + public static final long CKR_KEY_INDIGESTIBLE = 0x00000067L; + public static final long CKR_KEY_FUNCTION_NOT_PERMITTED = 0x00000068L; + public static final long CKR_KEY_NOT_WRAPPABLE = 0x00000069L; + public static final long CKR_KEY_UNEXTRACTABLE = 0x0000006AL; - /* CKR_KEY_NOT_NEEDED, CKR_KEY_CHANGED, CKR_KEY_NEEDED, - * CKR_KEY_INDIGESTIBLE, CKR_KEY_FUNCTION_NOT_PERMITTED, - * CKR_KEY_NOT_WRAPPABLE, and CKR_KEY_UNEXTRACTABLE are new for - * v2.0 */ - public static final long CKR_KEY_NOT_NEEDED = 0x00000064L; - public static final long CKR_KEY_CHANGED = 0x00000065L; - public static final long CKR_KEY_NEEDED = 0x00000066L; - public static final long CKR_KEY_INDIGESTIBLE = 0x00000067L; - public static final long CKR_KEY_FUNCTION_NOT_PERMITTED = 0x00000068L; - public static final long CKR_KEY_NOT_WRAPPABLE = 0x00000069L; - public static final long CKR_KEY_UNEXTRACTABLE = 0x0000006AL; + public static final long CKR_MECHANISM_INVALID = 0x00000070L; + public static final long CKR_MECHANISM_PARAM_INVALID = 0x00000071L; - public static final long CKR_MECHANISM_INVALID = 0x00000070L; - public static final long CKR_MECHANISM_PARAM_INVALID = 0x00000071L; + public static final long CKR_OBJECT_HANDLE_INVALID = 0x00000082L; + public static final long CKR_OPERATION_ACTIVE = 0x00000090L; + public static final long CKR_OPERATION_NOT_INITIALIZED = 0x00000091L; + public static final long CKR_PIN_INCORRECT = 0x000000A0L; + public static final long CKR_PIN_INVALID = 0x000000A1L; + public static final long CKR_PIN_LEN_RANGE = 0x000000A2L; - /* CKR_OBJECT_CLASS_INCONSISTENT and CKR_OBJECT_CLASS_INVALID - * were removed for v2.0 */ - public static final long CKR_OBJECT_HANDLE_INVALID = 0x00000082L; - public static final long CKR_OPERATION_ACTIVE = 0x00000090L; - public static final long CKR_OPERATION_NOT_INITIALIZED = 0x00000091L; - public static final long CKR_PIN_INCORRECT = 0x000000A0L; - public static final long CKR_PIN_INVALID = 0x000000A1L; - public static final long CKR_PIN_LEN_RANGE = 0x000000A2L; + public static final long CKR_PIN_EXPIRED = 0x000000A3L; + public static final long CKR_PIN_LOCKED = 0x000000A4L; - /* CKR_PIN_EXPIRED and CKR_PIN_LOCKED are new for v2.0 */ - public static final long CKR_PIN_EXPIRED = 0x000000A3L; - public static final long CKR_PIN_LOCKED = 0x000000A4L; + public static final long CKR_SESSION_CLOSED = 0x000000B0L; + public static final long CKR_SESSION_COUNT = 0x000000B1L; + public static final long CKR_SESSION_HANDLE_INVALID = 0x000000B3L; + public static final long CKR_SESSION_PARALLEL_NOT_SUPPORTED = 0x000000B4L; + public static final long CKR_SESSION_READ_ONLY = 0x000000B5L; + public static final long CKR_SESSION_EXISTS = 0x000000B6L; - public static final long CKR_SESSION_CLOSED = 0x000000B0L; - public static final long CKR_SESSION_COUNT = 0x000000B1L; - public static final long CKR_SESSION_HANDLE_INVALID = 0x000000B3L; - public static final long CKR_SESSION_PARALLEL_NOT_SUPPORTED = 0x000000B4L; - public static final long CKR_SESSION_READ_ONLY = 0x000000B5L; - public static final long CKR_SESSION_EXISTS = 0x000000B6L; + public static final long CKR_SESSION_READ_ONLY_EXISTS = 0x000000B7L; + public static final long CKR_SESSION_READ_WRITE_SO_EXISTS = 0x000000B8L; - /* CKR_SESSION_READ_ONLY_EXISTS and - * CKR_SESSION_READ_WRITE_SO_EXISTS are new for v2.0 */ - public static final long CKR_SESSION_READ_ONLY_EXISTS = 0x000000B7L; - public static final long CKR_SESSION_READ_WRITE_SO_EXISTS = 0x000000B8L; + public static final long CKR_SIGNATURE_INVALID = 0x000000C0L; + public static final long CKR_SIGNATURE_LEN_RANGE = 0x000000C1L; + public static final long CKR_TEMPLATE_INCOMPLETE = 0x000000D0L; + public static final long CKR_TEMPLATE_INCONSISTENT = 0x000000D1L; + public static final long CKR_TOKEN_NOT_PRESENT = 0x000000E0L; + public static final long CKR_TOKEN_NOT_RECOGNIZED = 0x000000E1L; + public static final long CKR_TOKEN_WRITE_PROTECTED = 0x000000E2L; + public static final long CKR_UNWRAPPING_KEY_HANDLE_INVALID = 0x000000F0L; + public static final long CKR_UNWRAPPING_KEY_SIZE_RANGE = 0x000000F1L; + public static final long CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT + = 0x000000F2L; + public static final long CKR_USER_ALREADY_LOGGED_IN = 0x00000100L; + public static final long CKR_USER_NOT_LOGGED_IN = 0x00000101L; + public static final long CKR_USER_PIN_NOT_INITIALIZED = 0x00000102L; + public static final long CKR_USER_TYPE_INVALID = 0x00000103L; - public static final long CKR_SIGNATURE_INVALID = 0x000000C0L; - public static final long CKR_SIGNATURE_LEN_RANGE = 0x000000C1L; - public static final long CKR_TEMPLATE_INCOMPLETE = 0x000000D0L; - public static final long CKR_TEMPLATE_INCONSISTENT = 0x000000D1L; - public static final long CKR_TOKEN_NOT_PRESENT = 0x000000E0L; - public static final long CKR_TOKEN_NOT_RECOGNIZED = 0x000000E1L; - public static final long CKR_TOKEN_WRITE_PROTECTED = 0x000000E2L; - public static final long CKR_UNWRAPPING_KEY_HANDLE_INVALID = 0x000000F0L; - public static final long CKR_UNWRAPPING_KEY_SIZE_RANGE = 0x000000F1L; - public static final long CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT = 0x000000F2L; - public static final long CKR_USER_ALREADY_LOGGED_IN = 0x00000100L; - public static final long CKR_USER_NOT_LOGGED_IN = 0x00000101L; - public static final long CKR_USER_PIN_NOT_INITIALIZED = 0x00000102L; - public static final long CKR_USER_TYPE_INVALID = 0x00000103L; + public static final long CKR_USER_ANOTHER_ALREADY_LOGGED_IN = 0x00000104L; + public static final long CKR_USER_TOO_MANY_TYPES = 0x00000105L; - /* CKR_USER_ANOTHER_ALREADY_LOGGED_IN and CKR_USER_TOO_MANY_TYPES - * are new to v2.01 */ - public static final long CKR_USER_ANOTHER_ALREADY_LOGGED_IN = 0x00000104L; - public static final long CKR_USER_TOO_MANY_TYPES = 0x00000105L; + public static final long CKR_WRAPPED_KEY_INVALID = 0x00000110L; + public static final long CKR_WRAPPED_KEY_LEN_RANGE = 0x00000112L; + public static final long CKR_WRAPPING_KEY_HANDLE_INVALID = 0x00000113L; + public static final long CKR_WRAPPING_KEY_SIZE_RANGE = 0x00000114L; + public static final long CKR_WRAPPING_KEY_TYPE_INCONSISTENT = 0x00000115L; + public static final long CKR_RANDOM_SEED_NOT_SUPPORTED = 0x00000120L; - public static final long CKR_WRAPPED_KEY_INVALID = 0x00000110L; - public static final long CKR_WRAPPED_KEY_LEN_RANGE = 0x00000112L; - public static final long CKR_WRAPPING_KEY_HANDLE_INVALID = 0x00000113L; - public static final long CKR_WRAPPING_KEY_SIZE_RANGE = 0x00000114L; - public static final long CKR_WRAPPING_KEY_TYPE_INCONSISTENT = 0x00000115L; - public static final long CKR_RANDOM_SEED_NOT_SUPPORTED = 0x00000120L; + public static final long CKR_RANDOM_NO_RNG = 0x00000121L; - /* These are new to v2.0 */ - public static final long CKR_RANDOM_NO_RNG = 0x00000121L; + public static final long CKR_DOMAIN_PARAMS_INVALID = 0x00000130L; - /* These are new to v2.11 */ - public static final long CKR_DOMAIN_PARAMS_INVALID = 0x00000130L; + public static final long CKR_CURVE_NOT_SUPPORTED = 0x00000140L; - /* These are new to v2.0 */ - public static final long CKR_BUFFER_TOO_SMALL = 0x00000150L; - public static final long CKR_SAVED_STATE_INVALID = 0x00000160L; - public static final long CKR_INFORMATION_SENSITIVE = 0x00000170L; - public static final long CKR_STATE_UNSAVEABLE = 0x00000180L; + public static final long CKR_BUFFER_TOO_SMALL = 0x00000150L; + public static final long CKR_SAVED_STATE_INVALID = 0x00000160L; + public static final long CKR_INFORMATION_SENSITIVE = 0x00000170L; + public static final long CKR_STATE_UNSAVEABLE = 0x00000180L; - /* These are new to v2.01 */ - public static final long CKR_CRYPTOKI_NOT_INITIALIZED = 0x00000190L; - public static final long CKR_CRYPTOKI_ALREADY_INITIALIZED = 0x00000191L; - public static final long CKR_MUTEX_BAD = 0x000001A0L; - public static final long CKR_MUTEX_NOT_LOCKED = 0x000001A1L; + public static final long CKR_CRYPTOKI_NOT_INITIALIZED = 0x00000190L; + public static final long CKR_CRYPTOKI_ALREADY_INITIALIZED = 0x00000191L; + public static final long CKR_MUTEX_BAD = 0x000001A0L; + public static final long CKR_MUTEX_NOT_LOCKED = 0x000001A1L; - public static final long CKR_VENDOR_DEFINED = 0x80000000L; + public static final long CKR_NEW_PIN_MODE = 0x000001B0L; + public static final long CKR_NEXT_OTP = 0x000001B1L; + + public static final long CKR_EXCEEDED_MAX_ITERATIONS = 0x000001B5L; + public static final long CKR_FIPS_SELF_TEST_FAILED = 0x000001B6L; + public static final long CKR_LIBRARY_LOAD_FAILED = 0x000001B7L; + public static final long CKR_PIN_TOO_WEAK = 0x000001B8L; + public static final long CKR_PUBLIC_KEY_INVALID = 0x000001B9L; + public static final long CKR_FUNCTION_REJECTED = 0x00000200L; + + public static final long CKR_VENDOR_DEFINED = 0x80000000L; /* flags: bit flags that provide capabilities of the slot @@ -916,31 +973,56 @@ public interface PKCS11Constants { /* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ public static final long CKF_DONT_BLOCK = 1L; - /* The following MGFs are defined */ - public static final long CKG_MGF1_SHA1 = 0x00000001L; - // new for v2.20 amendment 3 + public static final long CKG_MGF1_SHA1 = 0x00000001L; + public static final long CKG_MGF1_SHA256 = 0x00000002L; + public static final long CKG_MGF1_SHA384 = 0x00000003L; + public static final long CKG_MGF1_SHA512 = 0x00000004L; public static final long CKG_MGF1_SHA224 = 0x00000005L; /* The following encoding parameter sources are defined */ public static final long CKZ_DATA_SPECIFIED = 0x00000001L; - /* The following PRFs are defined in PKCS #5 v2.0. */ - public static final long CKP_PKCS5_PBKD2_HMAC_SHA1 = 0x00000001L; - - - /* The following salt value sources are defined in PKCS #5 v2.0. */ - public static final long CKZ_SALT_SPECIFIED = 0x00000001L; - /* the following EC Key Derivation Functions are defined */ - public static final long CKD_NULL = 0x00000001L; - public static final long CKD_SHA1_KDF = 0x00000002L; + public static final long CKD_NULL = 0x00000001L; + public static final long CKD_SHA1_KDF = 0x00000002L; /* the following X9.42 Diffie-Hellman Key Derivation Functions are defined */ - public static final long CKD_SHA1_KDF_ASN1 = 0x00000003L; - public static final long CKD_SHA1_KDF_CONCATENATE = 0x00000004L; + public static final long CKD_SHA1_KDF_ASN1 = 0x00000003L; + public static final long CKD_SHA1_KDF_CONCATENATE = 0x00000004L; + public static final long CKD_SHA224_KDF = 0x00000005L; + public static final long CKD_SHA256_KDF = 0x00000006L; + public static final long CKD_SHA384_KDF = 0x00000007L; + public static final long CKD_SHA512_KDF = 0x00000008L; + public static final long CKD_CPDIVERSIFY_KDF = 0x00000009L; + public static final long CKP_PKCS5_PBKD2_HMAC_SHA1 = 0x00000001L; + public static final long CKP_PKCS5_PBKD2_HMAC_GOSTR3411 = 0x00000002L; + public static final long CKP_PKCS5_PBKD2_HMAC_SHA224 = 0x00000003L; + public static final long CKP_PKCS5_PBKD2_HMAC_SHA256 = 0x00000004L; + public static final long CKP_PKCS5_PBKD2_HMAC_SHA384 = 0x00000005L; + public static final long CKP_PKCS5_PBKD2_HMAC_SHA512 = 0x00000006L; + public static final long CKP_PKCS5_PBKD2_HMAC_SHA512_224 = 0x00000007L; + public static final long CKP_PKCS5_PBKD2_HMAC_SHA512_256 = 0x00000008L; + + public static final long CKZ_SALT_SPECIFIED = 0x00000001L; + + public static final long CK_OTP_VALUE = 0x00000000L; + public static final long CK_OTP_PIN = 0x00000001L; + public static final long CK_OTP_CHALLENGE = 0x00000002L; + public static final long CK_OTP_TIME = 0x00000003L; + public static final long CK_OTP_COUNTER = 0x00000004L; + public static final long CK_OTP_FLAGS = 0x00000005L; + public static final long CK_OTP_OUTPUT_LENGTH = 0x00000006L; + public static final long CK_OTP_OUTPUT_FORMAT = 0x00000007L; + + public static final long CKF_NEXT_OTP = 0x00000001L; + public static final long CKF_EXCLUDE_TIME = 0x00000002L; + public static final long CKF_EXCLUDE_COUNTER = 0x00000004L; + public static final long CKF_EXCLUDE_CHALLENGE = 0x00000008L; + public static final long CKF_EXCLUDE_PIN = 0x00000010L; + public static final long CKF_USER_FRIENDLY_OTP = 0x00000020L; // private NSS attribute (for DSA and DH private keys) public static final long CKA_NETSCAPE_DB = 0xD5A0DB00L; diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java index 68163a0491f..8791b4b84d8 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java @@ -88,6 +88,7 @@ public class PKCS11Exception extends Exception { 0x00000011, 0x00000012, 0x00000013, + 0x0000001B, 0x00000020, 0x00000021, 0x00000030, @@ -158,6 +159,13 @@ public class PKCS11Exception extends Exception { 0x00000191, 0x000001A0, 0x000001A1, + 0x000001B0, + 0x000001B1, + 0x000001B5, + 0x000001B6, + 0x000001B7, + 0x000001B8, + 0x000001B9, 0x00000200, 0x80000000, }; @@ -176,6 +184,7 @@ public class PKCS11Exception extends Exception { "CKR_ATTRIBUTE_SENSITIVE", "CKR_ATTRIBUTE_TYPE_INVALID", "CKR_ATTRIBUTE_VALUE_INVALID", + "CKR_ACTION_PROHIBITED", "CKR_DATA_INVALID", "CKR_DATA_LEN_RANGE", "CKR_DEVICE_ERROR", @@ -246,6 +255,13 @@ public class PKCS11Exception extends Exception { "CKR_CRYPTOKI_ALREADY_INITIALIZED", "CKR_MUTEX_BAD", "CKR_MUTEX_NOT_LOCKED", + "CKR_NEW_PIN_MODE", + "CKR_NEXT_OTP", + "CKR_EXCEEDED_MAX_ITERATIONS", + "CKR_FIPS_SELF_TEST_FAILED", + "CKR_LIBRARY_LOAD_FAILED", + "CKR_PIN_TOO_WEAK", + "CKR_PUBLIC_KEY_INVALID", "CKR_FUNCTION_REJECTED", "CKR_VENDOR_DEFINED", }; diff --git a/src/jdk.crypto.cryptoki/share/legal/pkcs11cryptotoken.md b/src/jdk.crypto.cryptoki/share/legal/pkcs11cryptotoken.md index 9f786fa3f50..d5e93ae437b 100644 --- a/src/jdk.crypto.cryptoki/share/legal/pkcs11cryptotoken.md +++ b/src/jdk.crypto.cryptoki/share/legal/pkcs11cryptotoken.md @@ -1,20 +1,32 @@ -## PKCS #11 Cryptographic Token Interface v2.20 Amendment 3 Header Files +ASIS PKCS #11 Cryptographic Token Interface v2.40 -### PKCS #11 Cryptographic Token Interface License -
    +### OASIS PKCS #11 Cryptographic Token Interface License
    +```
     
    -License to copy and use this software is granted provided that it is
    -identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
    -(Cryptoki)" in all material mentioning or referencing this software.
    +Copyright (c) OASIS Open 2016. All Rights Reserved.
     
    -License is also granted to make and use derivative works provided that
    -such works are identified as "derived from the RSA Security Inc. PKCS #11
    -Cryptographic Token Interface (Cryptoki)" in all material mentioning or
    -referencing the derived work.
    +All capitalized terms in the following text have the meanings assigned to them in the OASIS
    +Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the
    +OASIS website: [http://www.oasis-open.org/policies-guidelines/ipr]
     
    -RSA Security Inc. makes no representations concerning either the
    -merchantability of this software or the suitability of this software for
    -any particular purpose. It is provided "as is" without express or implied
    -warranty of any kind.
    +This document and translations of it may be copied and furnished to others, and derivative works
    +that comment on or otherwise explain it or assist in its implementation may be prepared, copied,
    +published, and distributed, in whole or in part, without restriction of any kind, provided that
    +the above copyright notice and this section are included on all such copies and derivative works.
    +However, this document itself may not be modified in any way, including by removing the copyright
    +notice or references to OASIS, except as needed for the purpose of developing any document or
    +deliverable produced by an OASIS Technical Committee (in which case the rules applicable to
    +copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it
    +into languages other than English.
     
    -
    +The limited permissions granted above are perpetual and will not be revoked by OASIS or its +successors or assigns. + +This document and the information contained herein is provided on an "AS IS" basis and OASIS +DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE +USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS AND ITS MEMBERS WILL NOT BE LIABLE FOR +ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THIS DOCUMENT OR +ANY PART THEREOF. + +``` diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c index b21b6deaf29..462b9a5393a 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -68,7 +68,8 @@ /* declare file private functions */ -void jMechanismParameterToCKMechanismParameterSlow(JNIEnv *env, jobject jParam, CK_VOID_PTR *ckpParamPtr, CK_ULONG *ckpLength); +CK_VOID_PTR jMechParamToCKMechParamPtrSlow(JNIEnv *env, jobject jParam, + CK_MECHANISM_TYPE ckMech, CK_ULONG *ckpLength); /* @@ -425,8 +426,8 @@ CK_ATTRIBUTE jAttributeToCKAttribute(JNIEnv *env, jobject jAttribute) memset(&ckAttribute, 0, sizeof(CK_ATTRIBUTE)); // TBD: what if jAttribute == NULL?! - TRACE0("\nDEBUG: jAttributeToCKAttribute"); + /* get CK_ATTRIBUTE class */ TRACE0(", getting attribute object class"); jAttributeClass = (*env)->GetObjectClass(env, jAttribute); @@ -437,7 +438,7 @@ CK_ATTRIBUTE jAttributeToCKAttribute(JNIEnv *env, jobject jAttribute) jFieldID = (*env)->GetFieldID(env, jAttributeClass, "type", "J"); if (jFieldID == NULL) { return ckAttribute; } jType = (*env)->GetLongField(env, jAttribute, jFieldID); - TRACE1(", type=0x%X", jType); + TRACE1(", type=0x%lX", jType); /* get pValue */ TRACE0(", getting pValue field"); @@ -450,9 +451,9 @@ CK_ATTRIBUTE jAttributeToCKAttribute(JNIEnv *env, jobject jAttribute) TRACE0(", converting pValue to primitive object"); /* convert the Java pValue object to a CK-type pValue pointer */ - jObjectToPrimitiveCKObjectPtrPtr(env, jPValue, &(ckAttribute.pValue), &(ckAttribute.ulValueLen)); + ckAttribute.pValue = jObjectToPrimitiveCKObjectPtr(env, jPValue, &(ckAttribute.ulValueLen)); - TRACE0("\nFINISHED\n"); + TRACE0("\nDEBUG: jAttributeToCKAttribute FINISHED\n"); return ckAttribute ; } @@ -515,22 +516,19 @@ void masterKeyDeriveParamToCKMasterKeyDeriveParam(JNIEnv *env, jobject jParam, * * @param env - used to call JNI functions to get the Java classes and objects * @param jParam - the Java CK_SSL3_MASTER_KEY_DERIVE_PARAMS object to convert - * @return - the new CK_SSL3_MASTER_KEY_DERIVE_PARAMS structure + * @param ckParamPtr - pointer to the new CK_SSL3_MASTER_KEY_DERIVE_PARAMS structure */ -CK_SSL3_MASTER_KEY_DERIVE_PARAMS -jSsl3MasterKeyDeriveParamToCKSsl3MasterKeyDeriveParam(JNIEnv *env, - jobject jParam) +void jSsl3MasterKeyDeriveParamToCKSsl3MasterKeyDeriveParam(JNIEnv *env, + jobject jParam, CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR ckParamPtr) { - CK_SSL3_MASTER_KEY_DERIVE_PARAMS ckParam; jclass jSsl3MasterKeyDeriveParamsClass; - memset(&ckParam, 0, sizeof(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)); jSsl3MasterKeyDeriveParamsClass = (*env)->FindClass(env, CLASS_SSL3_MASTER_KEY_DERIVE_PARAMS); - if (jSsl3MasterKeyDeriveParamsClass == NULL) { return ckParam; } + if (jSsl3MasterKeyDeriveParamsClass == NULL) { return; } masterKeyDeriveParamToCKMasterKeyDeriveParam(env, jParam, jSsl3MasterKeyDeriveParamsClass, - &ckParam.pVersion, &ckParam.RandomInfo); - return ckParam; + &(ckParamPtr->pVersion), &(ckParamPtr->RandomInfo)); } /* @@ -539,123 +537,116 @@ jSsl3MasterKeyDeriveParamToCKSsl3MasterKeyDeriveParam(JNIEnv *env, * * @param env - used to call JNI functions to get the Java classes and objects * @param jParam - the Java CK_TLS12_MASTER_KEY_DERIVE_PARAMS object to convert - * @return - the new CK_TLS12_MASTER_KEY_DERIVE_PARAMS structure + * @param ckParamPtr - pointer to the new CK_TLS12_MASTER_KEY_DERIVE_PARAMS structure */ -CK_TLS12_MASTER_KEY_DERIVE_PARAMS -jTls12MasterKeyDeriveParamToCKTls12MasterKeyDeriveParam(JNIEnv *env, - jobject jParam) +void jTls12MasterKeyDeriveParamToCKTls12MasterKeyDeriveParam(JNIEnv *env, + jobject jParam, CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR ckParamPtr) { - CK_TLS12_MASTER_KEY_DERIVE_PARAMS ckParam; jclass jTls12MasterKeyDeriveParamsClass; jfieldID fieldID; - memset(&ckParam, 0, sizeof(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)); jTls12MasterKeyDeriveParamsClass = (*env)->FindClass(env, CLASS_TLS12_MASTER_KEY_DERIVE_PARAMS); - if (jTls12MasterKeyDeriveParamsClass == NULL) { return ckParam; } + if (jTls12MasterKeyDeriveParamsClass == NULL) { return; } masterKeyDeriveParamToCKMasterKeyDeriveParam(env, jParam, - jTls12MasterKeyDeriveParamsClass, &ckParam.pVersion, - &ckParam.RandomInfo); + jTls12MasterKeyDeriveParamsClass, &ckParamPtr->pVersion, + &ckParamPtr->RandomInfo); fieldID = (*env)->GetFieldID(env, jTls12MasterKeyDeriveParamsClass, "prfHashMechanism", "J"); if (fieldID != NULL) { jlong prfHashMechanism = (*env)->GetLongField(env, jParam, fieldID); - ckParam.prfHashMechanism = (CK_MECHANISM_TYPE)prfHashMechanism; + ckParamPtr->prfHashMechanism = (CK_MECHANISM_TYPE)prfHashMechanism; } - return ckParam; } /* * converts the Java CK_TLS_PRF_PARAMS object to a CK_TLS_PRF_PARAMS structure */ -CK_TLS_PRF_PARAMS jTlsPrfParamsToCKTlsPrfParam(JNIEnv *env, jobject jParam) +void jTlsPrfParamsToCKTlsPrfParam(JNIEnv *env, jobject jParam, +CK_TLS_PRF_PARAMS_PTR ckParamPtr) { jclass jTlsPrfParamsClass; - CK_TLS_PRF_PARAMS ckParam; jfieldID fieldID; jobject jSeed, jLabel, jOutput; - memset(&ckParam, 0, sizeof(CK_TLS_PRF_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_TLS_PRF_PARAMS)); // TBD: what if jParam == NULL?! /* get pSeed */ jTlsPrfParamsClass = (*env)->FindClass(env, CLASS_TLS_PRF_PARAMS); - if (jTlsPrfParamsClass == NULL) { return ckParam; } + if (jTlsPrfParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jTlsPrfParamsClass, "pSeed", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSeed = (*env)->GetObjectField(env, jParam, fieldID); /* get pLabel */ fieldID = (*env)->GetFieldID(env, jTlsPrfParamsClass, "pLabel", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jLabel = (*env)->GetObjectField(env, jParam, fieldID); /* get pOutput */ fieldID = (*env)->GetFieldID(env, jTlsPrfParamsClass, "pOutput", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jOutput = (*env)->GetObjectField(env, jParam, fieldID); /* populate java values */ - jByteArrayToCKByteArray(env, jSeed, &(ckParam.pSeed), &(ckParam.ulSeedLen)); - if ((*env)->ExceptionCheck(env)) { return ckParam; } - jByteArrayToCKByteArray(env, jLabel, &(ckParam.pLabel), &(ckParam.ulLabelLen)); + jByteArrayToCKByteArray(env, jSeed, &(ckParamPtr->pSeed), &(ckParamPtr->ulSeedLen)); + if ((*env)->ExceptionCheck(env)) { return; } + jByteArrayToCKByteArray(env, jLabel, &(ckParamPtr->pLabel), &(ckParamPtr->ulLabelLen)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pSeed); - return ckParam; + free(ckParamPtr->pSeed); + return; } - ckParam.pulOutputLen = malloc(sizeof(CK_ULONG)); - if (ckParam.pulOutputLen == NULL) { - free(ckParam.pSeed); - free(ckParam.pLabel); + ckParamPtr->pulOutputLen = malloc(sizeof(CK_ULONG)); + if (ckParamPtr->pulOutputLen == NULL) { + free(ckParamPtr->pSeed); + free(ckParamPtr->pLabel); throwOutOfMemoryError(env, 0); - return ckParam; + return; } - jByteArrayToCKByteArray(env, jOutput, &(ckParam.pOutput), ckParam.pulOutputLen); + jByteArrayToCKByteArray(env, jOutput, &(ckParamPtr->pOutput), ckParamPtr->pulOutputLen); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pSeed); - free(ckParam.pLabel); - free(ckParam.pulOutputLen); - return ckParam; + free(ckParamPtr->pSeed); + free(ckParamPtr->pLabel); + free(ckParamPtr->pOutput); + return; } - - return ckParam ; } /* * converts the Java CK_TLS_MAC_PARAMS object to a CK_TLS_MAC_PARAMS structure */ -CK_TLS_MAC_PARAMS jTlsMacParamsToCKTlsMacParam(JNIEnv *env, jobject jParam) +void jTlsMacParamsToCKTlsMacParam(JNIEnv *env, jobject jParam, + CK_TLS_MAC_PARAMS_PTR ckParamPtr) { jclass jTlsMacParamsClass; - CK_TLS_MAC_PARAMS ckParam; jfieldID fieldID; jlong jPrfMechanism, jUlMacLength, jUlServerOrClient; - memset(&ckParam, 0, sizeof(CK_TLS_MAC_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_TLS_MAC_PARAMS)); jTlsMacParamsClass = (*env)->FindClass(env, CLASS_TLS_MAC_PARAMS); - if (jTlsMacParamsClass == NULL) { return ckParam; } + if (jTlsMacParamsClass == NULL) { return; } /* get prfMechanism */ fieldID = (*env)->GetFieldID(env, jTlsMacParamsClass, "prfMechanism", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPrfMechanism = (*env)->GetLongField(env, jParam, fieldID); /* get ulMacLength */ fieldID = (*env)->GetFieldID(env, jTlsMacParamsClass, "ulMacLength", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jUlMacLength = (*env)->GetLongField(env, jParam, fieldID); /* get ulServerOrClient */ fieldID = (*env)->GetFieldID(env, jTlsMacParamsClass, "ulServerOrClient", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jUlServerOrClient = (*env)->GetLongField(env, jParam, fieldID); /* populate java values */ - ckParam.prfMechanism = jLongToCKULong(jPrfMechanism); - ckParam.ulMacLength = jLongToCKULong(jUlMacLength); - ckParam.ulServerOrClient = jLongToCKULong(jUlServerOrClient); - - return ckParam; + ckParamPtr->prfMechanism = jLongToCKULong(jPrfMechanism); + ckParamPtr->ulMacLength = jLongToCKULong(jUlMacLength); + ckParamPtr->ulServerOrClient = jLongToCKULong(jUlServerOrClient); } void keyMatParamToCKKeyMatParam(JNIEnv *env, jobject jParam, @@ -747,7 +738,7 @@ void keyMatParamToCKKeyMatParam(JNIEnv *env, jobject jParam, free(cKKeyMatParamRandomInfo->pClientRandom); return; } - /* allocate memory for pRetrunedKeyMaterial */ + /* allocate memory for pReturnedKeyMaterial */ *cKKeyMatParamPReturnedKeyMaterial = (CK_SSL3_KEY_MAT_OUT_PTR)malloc(sizeof(CK_SSL3_KEY_MAT_OUT)); if (*cKKeyMatParamPReturnedKeyMaterial == NULL) { @@ -789,22 +780,20 @@ void keyMatParamToCKKeyMatParam(JNIEnv *env, jobject jParam, * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_SSL3_KEY_MAT_PARAMS object to convert - * @return - the new CK_SSL3_KEY_MAT_PARAMS structure + * @param ckParamPtr - pointer to the new CK_SSL3_KEY_MAT_PARAMS structure */ -CK_SSL3_KEY_MAT_PARAMS -jSsl3KeyMatParamToCKSsl3KeyMatParam(JNIEnv *env, jobject jParam) +void jSsl3KeyMatParamToCKSsl3KeyMatParam(JNIEnv *env, jobject jParam, + CK_SSL3_KEY_MAT_PARAMS_PTR ckParamPtr) { - CK_SSL3_KEY_MAT_PARAMS ckParam; jclass jSsl3KeyMatParamsClass; - memset(&ckParam, 0, sizeof(CK_SSL3_KEY_MAT_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_SSL3_KEY_MAT_PARAMS)); jSsl3KeyMatParamsClass = (*env)->FindClass(env, CLASS_SSL3_KEY_MAT_PARAMS); - if (jSsl3KeyMatParamsClass == NULL) { return ckParam; } + if (jSsl3KeyMatParamsClass == NULL) { return; } keyMatParamToCKKeyMatParam(env, jParam, jSsl3KeyMatParamsClass, - &ckParam.ulMacSizeInBits, &ckParam.ulKeySizeInBits, - &ckParam.ulIVSizeInBits, &ckParam.bIsExport, - &ckParam.RandomInfo, &ckParam.pReturnedKeyMaterial); - return ckParam; + &(ckParamPtr->ulMacSizeInBits), &(ckParamPtr->ulKeySizeInBits), + &(ckParamPtr->ulIVSizeInBits), &(ckParamPtr->bIsExport), + &(ckParamPtr->RandomInfo), &(ckParamPtr->pReturnedKeyMaterial)); } /* @@ -813,29 +802,27 @@ jSsl3KeyMatParamToCKSsl3KeyMatParam(JNIEnv *env, jobject jParam) * * @param env - used to call JNI functions to get the Java classes and objects * @param jParam - the Java CK_TLS12_KEY_MAT_PARAMS object to convert - * @return - the new CK_TLS12_KEY_MAT_PARAMS structure + * @param ckParamPtr - pointer to the new CK_TLS12_KEY_MAT_PARAMS structure */ -CK_TLS12_KEY_MAT_PARAMS jTls12KeyMatParamToCKTls12KeyMatParam(JNIEnv *env, - jobject jParam) +void jTls12KeyMatParamToCKTls12KeyMatParam(JNIEnv *env, + jobject jParam, CK_TLS12_KEY_MAT_PARAMS_PTR ckParamPtr) { - CK_TLS12_KEY_MAT_PARAMS ckParam; jclass jTls12KeyMatParamsClass; jfieldID fieldID; - memset(&ckParam, 0, sizeof(CK_TLS12_KEY_MAT_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_TLS12_KEY_MAT_PARAMS)); jTls12KeyMatParamsClass = (*env)->FindClass(env, CLASS_TLS12_KEY_MAT_PARAMS); - if (jTls12KeyMatParamsClass == NULL) { return ckParam; } + if (jTls12KeyMatParamsClass == NULL) { return; } keyMatParamToCKKeyMatParam(env, jParam, jTls12KeyMatParamsClass, - &ckParam.ulMacSizeInBits, &ckParam.ulKeySizeInBits, - &ckParam.ulIVSizeInBits, &ckParam.bIsExport, - &ckParam.RandomInfo, &ckParam.pReturnedKeyMaterial); + &(ckParamPtr->ulMacSizeInBits), &(ckParamPtr->ulKeySizeInBits), + &(ckParamPtr->ulIVSizeInBits), &(ckParamPtr->bIsExport), + &(ckParamPtr->RandomInfo), &(ckParamPtr->pReturnedKeyMaterial)); fieldID = (*env)->GetFieldID(env, jTls12KeyMatParamsClass, "prfHashMechanism", "J"); if (fieldID != NULL) { jlong prfHashMechanism = (*env)->GetLongField(env, jParam, fieldID); - ckParam.prfHashMechanism = (CK_MECHANISM_TYPE)prfHashMechanism; + ckParamPtr->prfHashMechanism = (CK_MECHANISM_TYPE)prfHashMechanism; } - return ckParam; } /* @@ -843,10 +830,10 @@ CK_TLS12_KEY_MAT_PARAMS jTls12KeyMatParamToCKTls12KeyMatParam(JNIEnv *env, * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_AES_CTR_PARAMS object to convert - * @param ckpParam - pointer to the new CK_AES_CTR_PARAMS structure + * @param ckParamPtr - pointer to the new CK_AES_CTR_PARAMS structure */ void jAesCtrParamsToCKAesCtrParam(JNIEnv *env, jobject jParam, - CK_AES_CTR_PARAMS_PTR ckpParam) { + CK_AES_CTR_PARAMS_PTR ckParamPtr) { jclass jAesCtrParamsClass; jfieldID fieldID; jlong jCounterBits; @@ -857,6 +844,9 @@ void jAesCtrParamsToCKAesCtrParam(JNIEnv *env, jobject jParam, /* get ulCounterBits */ jAesCtrParamsClass = (*env)->FindClass(env, CLASS_AES_CTR_PARAMS); if (jAesCtrParamsClass == NULL) { return; } + if (!(*env)->IsInstanceOf(env, jParam, jAesCtrParamsClass)) { + return; + } fieldID = (*env)->GetFieldID(env, jAesCtrParamsClass, "ulCounterBits", "J"); if (fieldID == NULL) { return; } jCounterBits = (*env)->GetLongField(env, jParam, fieldID); @@ -867,40 +857,147 @@ void jAesCtrParamsToCKAesCtrParam(JNIEnv *env, jobject jParam, jCb = (*env)->GetObjectField(env, jParam, fieldID); /* populate java values */ - ckpParam->ulCounterBits = jLongToCKULong(jCounterBits); + ckParamPtr->ulCounterBits = jLongToCKULong(jCounterBits); jByteArrayToCKByteArray(env, jCb, &ckBytes, &ckTemp); if ((*env)->ExceptionCheck(env)) { return; } if (ckTemp != 16) { - TRACE1("ERROR: WRONG CTR IV LENGTH %d", ckTemp); + TRACE1("\nERROR: WRONG CTR IV LENGTH %lu", ckTemp); } else { - memcpy(ckpParam->cb, ckBytes, ckTemp); + memcpy(ckParamPtr->cb, ckBytes, ckTemp); free(ckBytes); } } /* - * converts a Java CK_MECHANISM object into a CK_MECHANISM structure + * converts the Java CK_GCM_PARAMS object to a CK_GCM_PARAMS structure + * + * @param env - used to call JNI funktions to get the Java classes and objects + * @param jParam - the Java CK_GCM_PARAMS object to convert + * @param ckpParam - pointer to the new CK_GCM_PARAMS structure + */ +void jGCMParamsToCKGCMParam(JNIEnv *env, jobject jParam, + CK_GCM_PARAMS_PTR ckpParam) { + jclass jGcmParamsClass; + jfieldID fieldID; + jobject jIv, jAad; + jlong jTagLen; + + /* get iv */ + jGcmParamsClass = (*env)->FindClass(env, CLASS_GCM_PARAMS); + if (jGcmParamsClass == NULL) { return; } + if (!(*env)->IsInstanceOf(env, jParam, jGcmParamsClass)) { + return; + } + + fieldID = (*env)->GetFieldID(env, jGcmParamsClass, "iv", "[B"); + if (fieldID == NULL) { return; } + jIv = (*env)->GetObjectField(env, jParam, fieldID); + + /* get aad */ + fieldID = (*env)->GetFieldID(env, jGcmParamsClass, "aad", "[B"); + if (fieldID == NULL) { return; } + jAad = (*env)->GetObjectField(env, jParam, fieldID); + + /* get tagLength */ + fieldID = (*env)->GetFieldID(env, jGcmParamsClass, "tagBits", "J"); + if (fieldID == NULL) { return; } + jTagLen = (*env)->GetLongField(env, jParam, fieldID); + + + /* populate java values */ + jByteArrayToCKByteArray(env, jIv, &(ckpParam->pIv), &(ckpParam->ulIvLen)); + if ((*env)->ExceptionCheck(env)) { return; } + + jByteArrayToCKByteArray(env, jAad, &(ckpParam->pAAD), &(ckpParam->ulAADLen)); + if ((*env)->ExceptionCheck(env)) { return; } + + ckpParam->ulTagBits = jLongToCKULong(jTagLen); +} + +/* + * converts the Java CK_CCM_PARAMS object to a CK_CCM_PARAMS structure + * + * @param env - used to call JNI functions to get the Java classes and objects + * @param jParam - the Java CK_CCM_PARAMS object to convert + * @param ckpParam - pointer to the new CK_CCM_PARAMS structure + */ +void jCCMParamsToCKCCMParam(JNIEnv *env, jobject jParam, + CK_CCM_PARAMS_PTR ckpParam) { + jclass jCcmParamsClass; + jfieldID fieldID; + jobject jNonce, jAad; + jlong jDataLen, jMacLen; + + /* get iv */ + jCcmParamsClass = (*env)->FindClass(env, CLASS_CCM_PARAMS); + if (jCcmParamsClass == NULL) { return; } + + if (!(*env)->IsInstanceOf(env, jParam, jCcmParamsClass)) { + return; + } + fieldID = (*env)->GetFieldID(env, jCcmParamsClass, "dataLen", "J"); + if (fieldID == NULL) { return; } + jDataLen = (*env)->GetLongField(env, jParam, fieldID); + + fieldID = (*env)->GetFieldID(env, jCcmParamsClass, "nonce", "[B"); + if (fieldID == NULL) { return; } + jNonce = (*env)->GetObjectField(env, jParam, fieldID); + + /* get aad */ + fieldID = (*env)->GetFieldID(env, jCcmParamsClass, "aad", "[B"); + if (fieldID == NULL) { return; } + jAad = (*env)->GetObjectField(env, jParam, fieldID); + + /* get macLen */ + fieldID = (*env)->GetFieldID(env, jCcmParamsClass, "macLen", "J"); + if (fieldID == NULL) { return; } + jMacLen = (*env)->GetLongField(env, jParam, fieldID); + + /* populate java values */ + ckpParam->ulDataLen = jLongToCKULong(jDataLen); + jByteArrayToCKByteArray(env, jNonce, &(ckpParam->pNonce), + &(ckpParam->ulNonceLen)); + jByteArrayToCKByteArray(env, jAad, &(ckpParam->pAAD), + &(ckpParam->ulAADLen)); + ckpParam->ulMACLen = jLongToCKULong(jMacLen); + if ((*env)->ExceptionCheck(env)) { return; } +} + +/* + * converts a Java CK_MECHANISM object into a pointer to a CK_MECHANISM + * structure. NOTE: CALLER IS RESPONSIBLE FOR FREEING THE RETURNED POINTER * * @param env - used to call JNI funktions to get the values out of the Java object * @param jMechanism - the Java CK_MECHANISM object to convert - * @return - the new CK_MECHANISM structure + * @return - pointer to the new CK_MECHANISM structure */ -void jMechanismToCKMechanism(JNIEnv *env, jobject jMechanism, CK_MECHANISM_PTR ckMechanismPtr) +CK_MECHANISM_PTR jMechanismToCKMechanismPtr(JNIEnv *env, jobject jMech) { - jlong jMechanismType = (*env)->GetLongField(env, jMechanism, mech_mechanismID); - jobject jParameter = (*env)->GetObjectField(env, jMechanism, mech_pParameterID); + CK_MECHANISM_PTR ckpMech; + jlong jMechType = (*env)->GetLongField(env, jMech, mech_mechanismID); + jobject jParam = (*env)->GetObjectField(env, jMech, mech_pParameterID); - (*ckMechanismPtr).mechanism = jLongToCKULong(jMechanismType); - - /* convert the specific Java mechanism parameter object to a pointer to a CK-type mechanism - * structure - */ - if (jParameter == NULL) { - (*ckMechanismPtr).pParameter = NULL; - (*ckMechanismPtr).ulParameterLen = 0; - } else { - jMechanismParameterToCKMechanismParameter(env, jParameter, &(*ckMechanismPtr).pParameter, &(*ckMechanismPtr).ulParameterLen); + /* allocate memory for CK_MECHANISM_PTR */ + ckpMech = (CK_MECHANISM_PTR) malloc(sizeof(CK_MECHANISM)); + if (ckpMech == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; } + TRACE1("DEBUG jMechanismToCKMechanismPtr: allocated mech 0x%lX\n", ckpMech); + + ckpMech->mechanism = jLongToCKULong(jMechType); + + /* convert the specific Java mechanism parameter object to a pointer to a + * CK-type mechanism structure + */ + if (jParam == NULL) { + ckpMech->pParameter = NULL; + ckpMech->ulParameterLen = 0; + } else { + ckpMech->pParameter = jMechParamToCKMechParamPtr(env, jParam, + ckpMech->mechanism, &(ckpMech->ulParameterLen)); + } + return ckpMech; } /* @@ -909,15 +1006,14 @@ void jMechanismToCKMechanism(JNIEnv *env, jobject jMechanism, CK_MECHANISM_PTR c * jobject ckAttributeValueToJObject(JNIEnv *env, * const CK_ATTRIBUTE_PTR ckpAttribute); * - * void jObjectToPrimitiveCKObjectPtrPtr(JNIEnv *env, + * CK_VOID_PTR jObjectToPrimitiveCKObjectPtr(JNIEnv *env, * jobject jObject, - * CK_VOID_PTR *ckpObjectPtr, * CK_ULONG *pLength); * - * void jMechanismParameterToCKMechanismParameter(JNIEnv *env, - * jobject jParam, - * CK_VOID_PTR *ckpParamPtr, - * CK_ULONG *ckpLength); + * CK_VOID_PTR jMechParamToCKMechParamPtr(JNIEnv *env, + * jobject jParam, + * CK_MECHANISM_TYPE ckMech, + * CK_ULONG *ckpLength); * * These functions are used if a PKCS#11 mechanism or attribute structure gets * convertet to a Java attribute or mechanism object or vice versa. @@ -927,22 +1023,21 @@ void jMechanismToCKMechanism(JNIEnv *env, jobject jMechanism, CK_MECHANISM_PTR c * be a CK_ULONG, CK_BYTE[], CK_CHAR[], big integer, CK_BBOOL, CK_UTF8CHAR[], * CK_DATE or CK_FLAGS that gets converted to a corresponding Java object. * - * jObjectToPrimitiveCKObjectPtrPtr is used by jAttributeToCKAttributePtr for + * jObjectToPrimitiveCKObjectPtr is used by jAttributeToCKAttributePtr for * converting the Java attribute value to a PKCS#11 attribute value pointer. * For now only primitive datatypes and arrays of primitive datatypes can get * converted. Otherwise this function throws a PKCS#11Exception with the * errorcode CKR_VENDOR_DEFINED. * - * jMechanismParameterToCKMechanismParameter converts a Java mechanism parameter - * to a PKCS#11 mechanism parameter. First this function determines what mechanism - * parameter the Java object is, then it allocates the memory for the new PKCS#11 - * structure and calls the corresponding function to convert the Java object to - * a PKCS#11 mechanism parameter structure. + * jMechParamToCKMechParamPtr converts a Java mechanism parameter to a PKCS#11 + * mechanism parameter. Based on the specified PKCS#11 mechanism type, this + * function will allocate memory for a PKCS#11 parameter structure and + * populate its field using the Java object. */ /* - * converts the pValue of a CK_ATTRIBUTE structure into a Java Object by checking the type - * of the attribute. + * converts the pValue of a CK_ATTRIBUTE structure into a Java Object by + * checking the type of the attribute. * * @param env - used to call JNI funktions to create the new Java object * @param ckpAttribute - the pointer to the CK_ATTRIBUTE structure that contains the type @@ -1096,474 +1191,283 @@ jobject ckAttributeValueToJObject(JNIEnv *env, const CK_ATTRIBUTE_PTR ckpAttribu * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java mechanism parameter object to convert - * @param ckpParamPtr - the reference of the new pointer to the new CK mechanism parameter - * structure + * @param ckMech - the PKCS#11 mechanism type * @param ckpLength - the reference of the length in bytes of the new CK mechanism parameter * structure + * @return pointer to the new CK mechanism parameter structure */ -void jMechanismParameterToCKMechanismParameter(JNIEnv *env, jobject jParam, CK_VOID_PTR *ckpParamPtr, CK_ULONG *ckpLength) +CK_VOID_PTR jMechParamToCKMechParamPtr(JNIEnv *env, jobject jParam, + CK_MECHANISM_TYPE ckMech, CK_ULONG *ckpLength) { + CK_VOID_PTR ckpParamPtr; if (jParam == NULL) { - *ckpParamPtr = NULL; + ckpParamPtr = NULL; *ckpLength = 0; } else if ((*env)->IsInstanceOf(env, jParam, jByteArrayClass)) { - jByteArrayToCKByteArray(env, jParam, (CK_BYTE_PTR *)ckpParamPtr, ckpLength); + jByteArrayToCKByteArray(env, jParam, (CK_BYTE_PTR *) &ckpParamPtr, ckpLength); } else if ((*env)->IsInstanceOf(env, jParam, jLongClass)) { - *ckpParamPtr = jLongObjectToCKULongPtr(env, jParam); + ckpParamPtr = jLongObjectToCKULongPtr(env, jParam); *ckpLength = sizeof(CK_ULONG); } else { - TRACE0("\nSLOW PATH jMechanismParameterToCKMechanismParameter\n"); - jMechanismParameterToCKMechanismParameterSlow(env, jParam, ckpParamPtr, ckpLength); + ckpParamPtr = jMechParamToCKMechParamPtrSlow(env, jParam, ckMech, ckpLength); } + return ckpParamPtr; } -void jMechanismParameterToCKMechanismParameterSlow(JNIEnv *env, jobject jParam, CK_VOID_PTR *ckpParamPtr, CK_ULONG *ckpLength) +CK_VOID_PTR jMechParamToCKMechParamPtrSlow(JNIEnv *env, jobject jParam, + CK_MECHANISM_TYPE ckMech, CK_ULONG *ckpLength) { - /* get all Java mechanism parameter classes */ - jclass jVersionClass, jSsl3MasterKeyDeriveParamsClass; - jclass jTls12MasterKeyDeriveParamsClass, jSsl3KeyMatParamsClass; - jclass jTls12KeyMatParamsClass; - jclass jTlsPrfParamsClass, jTlsMacParamsClass, jAesCtrParamsClass; - jclass jRsaPkcsOaepParamsClass; - jclass jPbeParamsClass, jPkcs5Pbkd2ParamsClass, jRsaPkcsPssParamsClass; - jclass jEcdh1DeriveParamsClass, jEcdh2DeriveParamsClass; - jclass jX942Dh1DeriveParamsClass, jX942Dh2DeriveParamsClass; - TRACE0("\nDEBUG: jMechanismParameterToCKMechanismParameter"); + CK_VOID_PTR ckpParamPtr = NULL; - /* most common cases, i.e. NULL/byte[]/long, are already handled by - * jMechanismParameterToCKMechanismParameter before calling this method. + /* + * Most common cases, i.e. NULL/byte[]/long, are already handled by + * jMechParamToCKMechParam before calling this method. */ - jVersionClass = (*env)->FindClass(env, CLASS_VERSION); - if (jVersionClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jVersionClass)) { - /* - * CK_VERSION used by CKM_SSL3_PRE_MASTER_KEY_GEN - */ - CK_VERSION_PTR ckpParam; + TRACE1("\nDEBUG: jMechParamToCKMechParamPtrSlow, mech=0x%lX", ckMech); - /* convert jParameter to CKParameter */ - ckpParam = jVersionToCKVersionPtr(env, jParam); + switch (ckMech) { + case CKM_SSL3_PRE_MASTER_KEY_GEN: + case CKM_TLS_PRE_MASTER_KEY_GEN: + *ckpLength = sizeof(CK_VERSION); + ckpParamPtr = jVersionToCKVersionPtr(env, jParam); + break; + case CKM_SSL3_MASTER_KEY_DERIVE: + case CKM_TLS_MASTER_KEY_DERIVE: + case CKM_SSL3_MASTER_KEY_DERIVE_DH: + case CKM_TLS_MASTER_KEY_DERIVE_DH: + ckpParamPtr = + malloc(sizeof(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_SSL3_MASTER_KEY_DERIVE_PARAMS); - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_VERSION); - *ckpParamPtr = ckpParam; - return; + jSsl3MasterKeyDeriveParamToCKSsl3MasterKeyDeriveParam(env, jParam, + (CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR) ckpParamPtr); + break; + case CKM_SSL3_KEY_AND_MAC_DERIVE: + case CKM_TLS_KEY_AND_MAC_DERIVE: + ckpParamPtr = + malloc(sizeof(CK_SSL3_KEY_MAT_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_SSL3_KEY_MAT_PARAMS); + + jSsl3KeyMatParamToCKSsl3KeyMatParam(env, jParam, + (CK_SSL3_KEY_MAT_PARAMS_PTR) ckpParamPtr); + break; + case CKM_TLS12_KEY_AND_MAC_DERIVE: + ckpParamPtr = + malloc(sizeof(CK_TLS12_KEY_MAT_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_TLS12_KEY_MAT_PARAMS); + + jTls12KeyMatParamToCKTls12KeyMatParam(env, jParam, + (CK_TLS12_KEY_MAT_PARAMS_PTR) ckpParamPtr); + break; + case CKM_TLS12_MASTER_KEY_DERIVE: + case CKM_TLS12_MASTER_KEY_DERIVE_DH: + ckpParamPtr = + malloc(sizeof(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_TLS12_MASTER_KEY_DERIVE_PARAMS); + + jTls12MasterKeyDeriveParamToCKTls12MasterKeyDeriveParam(env, jParam, + (CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR) ckpParamPtr); + break; + case CKM_TLS_PRF: + case CKM_NSS_TLS_PRF_GENERAL: + ckpParamPtr = malloc(sizeof(CK_TLS_PRF_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_TLS_PRF_PARAMS); + + jTlsPrfParamsToCKTlsPrfParam(env, jParam, + (CK_TLS_PRF_PARAMS_PTR) ckpParamPtr); + break; + case CKM_TLS_MAC: + ckpParamPtr = malloc(sizeof(CK_TLS_MAC_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_TLS_MAC_PARAMS); + + jTlsMacParamsToCKTlsMacParam(env, jParam, + (CK_TLS_MAC_PARAMS_PTR) ckpParamPtr); + break; + case CKM_AES_CTR: + ckpParamPtr = malloc(sizeof(CK_AES_CTR_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_AES_CTR_PARAMS); + + jAesCtrParamsToCKAesCtrParam(env, jParam, + (CK_AES_CTR_PARAMS_PTR) ckpParamPtr); + break; + case CKM_AES_GCM: + ckpParamPtr = malloc(sizeof(CK_GCM_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_GCM_PARAMS); + + jGCMParamsToCKGCMParam(env, jParam, (CK_GCM_PARAMS_PTR) ckpParamPtr); + break; + case CKM_AES_CCM: + ckpParamPtr = malloc(sizeof(CK_CCM_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_CCM_PARAMS); + + jCCMParamsToCKCCMParam(env, jParam, + (CK_CCM_PARAMS_PTR) ckpParamPtr); + break; + case CKM_RSA_PKCS_OAEP: + ckpParamPtr = malloc(sizeof(CK_RSA_PKCS_OAEP_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_RSA_PKCS_OAEP_PARAMS); + + jRsaPkcsOaepParamToCKRsaPkcsOaepParam(env, jParam, + (CK_RSA_PKCS_OAEP_PARAMS_PTR) ckpParamPtr); + break; + case CKM_PBE_SHA1_DES3_EDE_CBC: + case CKM_PBE_SHA1_DES2_EDE_CBC: + case CKM_PBA_SHA1_WITH_SHA1_HMAC: + ckpParamPtr = malloc(sizeof(CK_PBE_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + + *ckpLength = sizeof(CK_PBE_PARAMS); + + jPbeParamToCKPbeParam(env, jParam, (CK_PBE_PARAMS_PTR) ckpParamPtr); + break; + case CKM_PKCS5_PBKD2: + ckpParamPtr = malloc(sizeof(CK_PKCS5_PBKD2_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_PKCS5_PBKD2_PARAMS); + + jPkcs5Pbkd2ParamToCKPkcs5Pbkd2Param(env, jParam, + (CK_PKCS5_PBKD2_PARAMS_PTR) ckpParamPtr); + break; + case CKM_RSA_PKCS_PSS: + case CKM_SHA1_RSA_PKCS_PSS: + case CKM_SHA256_RSA_PKCS_PSS: + case CKM_SHA384_RSA_PKCS_PSS: + case CKM_SHA512_RSA_PKCS_PSS: + case CKM_SHA224_RSA_PKCS_PSS: + ckpParamPtr = malloc(sizeof(CK_RSA_PKCS_PSS_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_RSA_PKCS_PSS_PARAMS); + + jRsaPkcsPssParamToCKRsaPkcsPssParam(env, jParam, + (CK_RSA_PKCS_PSS_PARAMS_PTR) ckpParamPtr); + break; + case CKM_ECDH1_DERIVE: + case CKM_ECDH1_COFACTOR_DERIVE: + ckpParamPtr = malloc(sizeof(CK_ECDH1_DERIVE_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_ECDH1_DERIVE_PARAMS); + + jEcdh1DeriveParamToCKEcdh1DeriveParam(env, jParam, + (CK_ECDH1_DERIVE_PARAMS_PTR) ckpParamPtr); + break; + case CKM_ECMQV_DERIVE: + ckpParamPtr = malloc(sizeof(CK_ECDH2_DERIVE_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_ECDH2_DERIVE_PARAMS); + + jEcdh2DeriveParamToCKEcdh2DeriveParam(env, jParam, + (CK_ECDH2_DERIVE_PARAMS_PTR) ckpParamPtr); + break; + case CKM_X9_42_DH_DERIVE: + ckpParamPtr = malloc(sizeof(CK_X9_42_DH1_DERIVE_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_X9_42_DH1_DERIVE_PARAMS); + + /* convert jParameter to CKParameter */ + jX942Dh1DeriveParamToCKX942Dh1DeriveParam(env, jParam, + (CK_X9_42_DH1_DERIVE_PARAMS_PTR) ckpParamPtr); + break; + case CKM_X9_42_DH_HYBRID_DERIVE: + case CKM_X9_42_MQV_DERIVE: + ckpParamPtr = malloc(sizeof(CK_X9_42_DH2_DERIVE_PARAMS)); + if (ckpParamPtr == NULL) { + throwOutOfMemoryError(env, 0); + return NULL; + } + *ckpLength = sizeof(CK_X9_42_DH2_DERIVE_PARAMS); + + jX942Dh2DeriveParamToCKX942Dh2DeriveParam(env, jParam, + (CK_X9_42_DH2_DERIVE_PARAMS_PTR) ckpParamPtr); + break; + // defined by pkcs11.h but we don't support + case CKM_KEA_DERIVE: // CK_KEA_DERIVE_PARAMS + case CKM_RC2_CBC: // CK_RC2_CBC_PARAMS + case CKM_RC2_MAC_GENERAL: // CK_RC2_MAC_GENERAL_PARAMS + case CKM_RC5_ECB: // CK_RC5_PARAMS + case CKM_RC5_MAC: // CK_RC5_PARAMS + case CKM_RC5_CBC: // CK_RC5_CBC_PARAMS + case CKM_RC5_MAC_GENERAL: // CK_RC5_MAC_GENERAL_PARAMS + case CKM_SKIPJACK_PRIVATE_WRAP: // CK_SKIPJACK_PRIVATE_WRAP_PARAMS + case CKM_SKIPJACK_RELAYX: // CK_SKIPJACK_RELAYX_PARAMS + case CKM_KEY_WRAP_SET_OAEP: // CK_KEY_WRAP_SET_OAEP_PARAMS + throwPKCS11RuntimeException(env, "No parameter support for this mchanism"); + break; + default: + /* if everything faild up to here */ + /* try if the parameter is a primitive Java type */ + ckpParamPtr = jObjectToPrimitiveCKObjectPtr(env, jParam, ckpLength); + /* *ckpParamPtr = jObjectToCKVoidPtr(jParam); */ + /* *ckpLength = 1; */ + } + TRACE0("\nDEBUG: jMechParamToCKMechParamPtrSlow FINISHED\n"); + + if ((*env)->ExceptionCheck(env)) { + free(ckpParamPtr); + *ckpLength = 0; + return NULL; } - jSsl3MasterKeyDeriveParamsClass = (*env)->FindClass(env, CLASS_SSL3_MASTER_KEY_DERIVE_PARAMS); - if (jSsl3MasterKeyDeriveParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jSsl3MasterKeyDeriveParamsClass)) { - /* - * CK_SSL3_MASTER_KEY_DERIVE_PARAMS - */ - CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR ckpParam; - - ckpParam = (CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR) malloc(sizeof(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jSsl3MasterKeyDeriveParamToCKSsl3MasterKeyDeriveParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_SSL3_MASTER_KEY_DERIVE_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jSsl3KeyMatParamsClass = (*env)->FindClass(env, CLASS_SSL3_KEY_MAT_PARAMS); - if (jSsl3KeyMatParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jSsl3KeyMatParamsClass)) { - /* - * CK_SSL3_KEY_MAT_PARAMS - */ - CK_SSL3_KEY_MAT_PARAMS_PTR ckpParam; - - ckpParam = (CK_SSL3_KEY_MAT_PARAMS_PTR) malloc(sizeof(CK_SSL3_KEY_MAT_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jSsl3KeyMatParamToCKSsl3KeyMatParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_SSL3_KEY_MAT_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jTls12KeyMatParamsClass = (*env)->FindClass(env, CLASS_TLS12_KEY_MAT_PARAMS); - if (jTls12KeyMatParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jTls12KeyMatParamsClass)) { - /* - * CK_TLS12_KEY_MAT_PARAMS - */ - CK_TLS12_KEY_MAT_PARAMS_PTR ckpParam; - - ckpParam = (CK_TLS12_KEY_MAT_PARAMS_PTR) malloc(sizeof(CK_TLS12_KEY_MAT_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jTls12KeyMatParamToCKTls12KeyMatParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_TLS12_KEY_MAT_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jTls12MasterKeyDeriveParamsClass = - (*env)->FindClass(env, CLASS_TLS12_MASTER_KEY_DERIVE_PARAMS); - if (jTls12MasterKeyDeriveParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jTls12MasterKeyDeriveParamsClass)) { - /* - * CK_TLS12_MASTER_KEY_DERIVE_PARAMS - */ - CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR ckpParam; - - ckpParam = (CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR)malloc( - sizeof(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jTls12MasterKeyDeriveParamToCKTls12MasterKeyDeriveParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_TLS12_MASTER_KEY_DERIVE_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jTlsPrfParamsClass = (*env)->FindClass(env, CLASS_TLS_PRF_PARAMS); - if (jTlsPrfParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jTlsPrfParamsClass)) { - /* - * CK_TLS_PRF_PARAMS - */ - CK_TLS_PRF_PARAMS_PTR ckpParam; - - ckpParam = (CK_TLS_PRF_PARAMS_PTR) malloc(sizeof(CK_TLS_PRF_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jTlsPrfParamsToCKTlsPrfParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_TLS_PRF_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jTlsMacParamsClass = (*env)->FindClass(env, CLASS_TLS_MAC_PARAMS); - if (jTlsMacParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jTlsMacParamsClass)) { - CK_TLS_MAC_PARAMS_PTR ckpParam; - - ckpParam = (CK_TLS_MAC_PARAMS_PTR) malloc(sizeof(CK_TLS_MAC_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jTlsMacParamsToCKTlsMacParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_TLS_MAC_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jAesCtrParamsClass = (*env)->FindClass(env, CLASS_AES_CTR_PARAMS); - if (jAesCtrParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jAesCtrParamsClass)) { - /* - * CK_AES_CTR_PARAMS - */ - CK_AES_CTR_PARAMS_PTR ckpParam; - - ckpParam = (CK_AES_CTR_PARAMS_PTR) malloc(sizeof(CK_AES_CTR_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - jAesCtrParamsToCKAesCtrParam(env, jParam, ckpParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_AES_CTR_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jRsaPkcsOaepParamsClass = (*env)->FindClass(env, CLASS_RSA_PKCS_OAEP_PARAMS); - if (jRsaPkcsOaepParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jRsaPkcsOaepParamsClass)) { - /* - * CK_RSA_PKCS_OAEP_PARAMS - */ - CK_RSA_PKCS_OAEP_PARAMS_PTR ckpParam; - - ckpParam = (CK_RSA_PKCS_OAEP_PARAMS_PTR) malloc(sizeof(CK_RSA_PKCS_OAEP_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jRsaPkcsOaepParamToCKRsaPkcsOaepParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_RSA_PKCS_OAEP_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jPbeParamsClass = (*env)->FindClass(env, CLASS_PBE_PARAMS); - if (jPbeParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jPbeParamsClass)) { - /* - * CK_PBE_PARAMS - */ - CK_PBE_PARAMS_PTR ckpParam; - - ckpParam = (CK_PBE_PARAMS_PTR) malloc(sizeof(CK_PBE_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jPbeParamToCKPbeParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_PBE_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jPkcs5Pbkd2ParamsClass = (*env)->FindClass(env, CLASS_PKCS5_PBKD2_PARAMS); - if (jPkcs5Pbkd2ParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jPkcs5Pbkd2ParamsClass)) { - /* - * CK_PKCS5_PBKD2_PARAMS - */ - CK_PKCS5_PBKD2_PARAMS_PTR ckpParam; - - ckpParam = (CK_PKCS5_PBKD2_PARAMS_PTR) malloc(sizeof(CK_PKCS5_PBKD2_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jPkcs5Pbkd2ParamToCKPkcs5Pbkd2Param(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_PKCS5_PBKD2_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jRsaPkcsPssParamsClass = (*env)->FindClass(env, CLASS_RSA_PKCS_PSS_PARAMS); - if (jRsaPkcsPssParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jRsaPkcsPssParamsClass)) { - /* - * CK_RSA_PKCS_PSS_PARAMS - */ - CK_RSA_PKCS_PSS_PARAMS_PTR ckpParam; - - ckpParam = (CK_RSA_PKCS_PSS_PARAMS_PTR) malloc(sizeof(CK_RSA_PKCS_PSS_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jRsaPkcsPssParamToCKRsaPkcsPssParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_RSA_PKCS_PSS_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jEcdh1DeriveParamsClass = (*env)->FindClass(env, CLASS_ECDH1_DERIVE_PARAMS); - if (jEcdh1DeriveParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jEcdh1DeriveParamsClass)) { - /* - * CK_ECDH1_DERIVE_PARAMS - */ - CK_ECDH1_DERIVE_PARAMS_PTR ckpParam; - - ckpParam = (CK_ECDH1_DERIVE_PARAMS_PTR) malloc(sizeof(CK_ECDH1_DERIVE_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jEcdh1DeriveParamToCKEcdh1DeriveParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_ECDH1_DERIVE_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jEcdh2DeriveParamsClass = (*env)->FindClass(env, CLASS_ECDH2_DERIVE_PARAMS); - if (jEcdh2DeriveParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jEcdh2DeriveParamsClass)) { - /* - * CK_ECDH2_DERIVE_PARAMS - */ - CK_ECDH2_DERIVE_PARAMS_PTR ckpParam; - - ckpParam = (CK_ECDH2_DERIVE_PARAMS_PTR) malloc(sizeof(CK_ECDH2_DERIVE_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jEcdh2DeriveParamToCKEcdh2DeriveParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_ECDH2_DERIVE_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jX942Dh1DeriveParamsClass = (*env)->FindClass(env, CLASS_X9_42_DH1_DERIVE_PARAMS); - if (jX942Dh1DeriveParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jX942Dh1DeriveParamsClass)) { - /* - * CK_X9_42_DH1_DERIVE_PARAMS - */ - CK_X9_42_DH1_DERIVE_PARAMS_PTR ckpParam; - - ckpParam = (CK_X9_42_DH1_DERIVE_PARAMS_PTR) malloc(sizeof(CK_X9_42_DH1_DERIVE_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jX942Dh1DeriveParamToCKX942Dh1DeriveParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_X9_42_DH1_DERIVE_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - jX942Dh2DeriveParamsClass = (*env)->FindClass(env, CLASS_X9_42_DH2_DERIVE_PARAMS); - if (jX942Dh2DeriveParamsClass == NULL) { return; } - if ((*env)->IsInstanceOf(env, jParam, jX942Dh2DeriveParamsClass)) { - /* - * CK_X9_42_DH2_DERIVE_PARAMS - */ - CK_X9_42_DH2_DERIVE_PARAMS_PTR ckpParam; - - ckpParam = (CK_X9_42_DH2_DERIVE_PARAMS_PTR) malloc(sizeof(CK_X9_42_DH2_DERIVE_PARAMS)); - if (ckpParam == NULL) { - throwOutOfMemoryError(env, 0); - return; - } - - /* convert jParameter to CKParameter */ - *ckpParam = jX942Dh2DeriveParamToCKX942Dh2DeriveParam(env, jParam); - if ((*env)->ExceptionCheck(env)) { - free(ckpParam); - return; - } - - /* get length and pointer of parameter */ - *ckpLength = sizeof(CK_X9_42_DH2_DERIVE_PARAMS); - *ckpParamPtr = ckpParam; - return; - } - - /* if everything faild up to here */ - /* try if the parameter is a primitive Java type */ - jObjectToPrimitiveCKObjectPtrPtr(env, jParam, ckpParamPtr, ckpLength); - /* *ckpParamPtr = jObjectToCKVoidPtr(jParam); */ - /* *ckpLength = 1; */ - - TRACE0("FINISHED\n"); + return ckpParamPtr; } - /* the mechanism parameter convertion functions: */ /* @@ -1573,47 +1477,45 @@ void jMechanismParameterToCKMechanismParameterSlow(JNIEnv *env, jobject jParam, * @param jParam - the Java CK_RSA_PKCS_OAEP_PARAMS object to convert * @return - the new CK_RSA_PKCS_OAEP_PARAMS structure */ -CK_RSA_PKCS_OAEP_PARAMS jRsaPkcsOaepParamToCKRsaPkcsOaepParam(JNIEnv *env, jobject jParam) +void jRsaPkcsOaepParamToCKRsaPkcsOaepParam(JNIEnv *env, jobject jParam, +CK_RSA_PKCS_OAEP_PARAMS_PTR ckParamPtr) { jclass jRsaPkcsOaepParamsClass; - CK_RSA_PKCS_OAEP_PARAMS ckParam; jfieldID fieldID; jlong jHashAlg, jMgf, jSource; jobject jSourceData; CK_BYTE_PTR ckpByte; - memset(&ckParam, 0, sizeof(CK_RSA_PKCS_OAEP_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_RSA_PKCS_OAEP_PARAMS)); /* get hashAlg */ jRsaPkcsOaepParamsClass = (*env)->FindClass(env, CLASS_RSA_PKCS_OAEP_PARAMS); - if (jRsaPkcsOaepParamsClass == NULL) { return ckParam; } + if (jRsaPkcsOaepParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jRsaPkcsOaepParamsClass, "hashAlg", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jHashAlg = (*env)->GetLongField(env, jParam, fieldID); /* get mgf */ fieldID = (*env)->GetFieldID(env, jRsaPkcsOaepParamsClass, "mgf", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jMgf = (*env)->GetLongField(env, jParam, fieldID); /* get source */ fieldID = (*env)->GetFieldID(env, jRsaPkcsOaepParamsClass, "source", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSource = (*env)->GetLongField(env, jParam, fieldID); /* get sourceData and sourceDataLength */ fieldID = (*env)->GetFieldID(env, jRsaPkcsOaepParamsClass, "pSourceData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSourceData = (*env)->GetObjectField(env, jParam, fieldID); /* populate java values */ - ckParam.hashAlg = jLongToCKULong(jHashAlg); - ckParam.mgf = jLongToCKULong(jMgf); - ckParam.source = jLongToCKULong(jSource); - jByteArrayToCKByteArray(env, jSourceData, & ckpByte, &(ckParam.ulSourceDataLen)); - if ((*env)->ExceptionCheck(env)) { return ckParam; } - ckParam.pSourceData = (CK_VOID_PTR) ckpByte; - - return ckParam ; + ckParamPtr->hashAlg = jLongToCKULong(jHashAlg); + ckParamPtr->mgf = jLongToCKULong(jMgf); + ckParamPtr->source = jLongToCKULong(jSource); + jByteArrayToCKByteArray(env, jSourceData, & ckpByte, &(ckParamPtr->ulSourceDataLen)); + if ((*env)->ExceptionCheck(env)) { return; } + ckParamPtr->pSourceData = (CK_VOID_PTR) ckpByte; } /* @@ -1621,57 +1523,55 @@ CK_RSA_PKCS_OAEP_PARAMS jRsaPkcsOaepParamToCKRsaPkcsOaepParam(JNIEnv *env, jobje * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_PBE_PARAMS object to convert - * @return - the new CK_PBE_PARAMS structure + * @param ckParamPtr pointer to the new CK_PBE_PARAMS structure */ -CK_PBE_PARAMS jPbeParamToCKPbeParam(JNIEnv *env, jobject jParam) +void jPbeParamToCKPbeParam(JNIEnv *env, jobject jParam, +CK_PBE_PARAMS_PTR ckParamPtr) { jclass jPbeParamsClass; - CK_PBE_PARAMS ckParam; jfieldID fieldID; jlong jIteration; jobject jInitVector, jPassword, jSalt; CK_ULONG ckTemp; - memset(&ckParam, 0, sizeof(CK_PBE_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_PBE_PARAMS)); /* get pInitVector */ jPbeParamsClass = (*env)->FindClass(env, CLASS_PBE_PARAMS); - if (jPbeParamsClass == NULL) { return ckParam; } + if (jPbeParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jPbeParamsClass, "pInitVector", "[C"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jInitVector = (*env)->GetObjectField(env, jParam, fieldID); /* get pPassword and ulPasswordLength */ fieldID = (*env)->GetFieldID(env, jPbeParamsClass, "pPassword", "[C"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPassword = (*env)->GetObjectField(env, jParam, fieldID); /* get pSalt and ulSaltLength */ fieldID = (*env)->GetFieldID(env, jPbeParamsClass, "pSalt", "[C"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSalt = (*env)->GetObjectField(env, jParam, fieldID); /* get ulIteration */ fieldID = (*env)->GetFieldID(env, jPbeParamsClass, "ulIteration", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jIteration = (*env)->GetLongField(env, jParam, fieldID); /* populate java values */ - ckParam.ulIteration = jLongToCKULong(jIteration); - jCharArrayToCKCharArray(env, jInitVector, &(ckParam.pInitVector), &ckTemp); - if ((*env)->ExceptionCheck(env)) { return ckParam; } - jCharArrayToCKCharArray(env, jPassword, &(ckParam.pPassword), &(ckParam.ulPasswordLen)); + ckParamPtr->ulIteration = jLongToCKULong(jIteration); + jCharArrayToCKCharArray(env, jInitVector, &(ckParamPtr->pInitVector), &ckTemp); + if ((*env)->ExceptionCheck(env)) { return; } + jCharArrayToCKCharArray(env, jPassword, &(ckParamPtr->pPassword), &(ckParamPtr->ulPasswordLen)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pInitVector); - return ckParam; + free(ckParamPtr->pInitVector); + return; } - jCharArrayToCKCharArray(env, jSalt, &(ckParam.pSalt), &(ckParam.ulSaltLen)); + jCharArrayToCKCharArray(env, jSalt, &(ckParamPtr->pSalt), &(ckParamPtr->ulSaltLen)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pInitVector); - free(ckParam.pPassword); - return ckParam; + free(ckParamPtr->pInitVector); + free(ckParamPtr->pPassword); + return; } - - return ckParam ; } /* @@ -1741,57 +1641,55 @@ void copyBackPBEInitializationVector(JNIEnv *env, CK_MECHANISM *ckMechanism, job * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_PKCS5_PBKD2_PARAMS object to convert - * @return - the new CK_PKCS5_PBKD2_PARAMS structure + * @param ckParamPtr - pointer to the new CK_PKCS5_PBKD2_PARAMS structure */ -CK_PKCS5_PBKD2_PARAMS jPkcs5Pbkd2ParamToCKPkcs5Pbkd2Param(JNIEnv *env, jobject jParam) +void jPkcs5Pbkd2ParamToCKPkcs5Pbkd2Param(JNIEnv *env, jobject jParam, +CK_PKCS5_PBKD2_PARAMS_PTR ckParamPtr) { jclass jPkcs5Pbkd2ParamsClass; - CK_PKCS5_PBKD2_PARAMS ckParam; jfieldID fieldID; jlong jSaltSource, jIteration, jPrf; jobject jSaltSourceData, jPrfData; - memset(&ckParam, 0, sizeof(CK_PKCS5_PBKD2_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_PKCS5_PBKD2_PARAMS)); /* get saltSource */ jPkcs5Pbkd2ParamsClass = (*env)->FindClass(env, CLASS_PKCS5_PBKD2_PARAMS); - if (jPkcs5Pbkd2ParamsClass == NULL) { return ckParam; } + if (jPkcs5Pbkd2ParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jPkcs5Pbkd2ParamsClass, "saltSource", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSaltSource = (*env)->GetLongField(env, jParam, fieldID); /* get pSaltSourceData */ fieldID = (*env)->GetFieldID(env, jPkcs5Pbkd2ParamsClass, "pSaltSourceData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSaltSourceData = (*env)->GetObjectField(env, jParam, fieldID); /* get iterations */ fieldID = (*env)->GetFieldID(env, jPkcs5Pbkd2ParamsClass, "iterations", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jIteration = (*env)->GetLongField(env, jParam, fieldID); /* get prf */ fieldID = (*env)->GetFieldID(env, jPkcs5Pbkd2ParamsClass, "prf", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPrf = (*env)->GetLongField(env, jParam, fieldID); /* get pPrfData and ulPrfDataLength in byte */ fieldID = (*env)->GetFieldID(env, jPkcs5Pbkd2ParamsClass, "pPrfData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPrfData = (*env)->GetObjectField(env, jParam, fieldID); /* populate java values */ - ckParam.saltSource = jLongToCKULong(jSaltSource); - jByteArrayToCKByteArray(env, jSaltSourceData, (CK_BYTE_PTR *) &(ckParam.pSaltSourceData), &(ckParam.ulSaltSourceDataLen)); - if ((*env)->ExceptionCheck(env)) { return ckParam; } - ckParam.iterations = jLongToCKULong(jIteration); - ckParam.prf = jLongToCKULong(jPrf); - jByteArrayToCKByteArray(env, jPrfData, (CK_BYTE_PTR *) &(ckParam.pPrfData), &(ckParam.ulPrfDataLen)); + ckParamPtr->saltSource = jLongToCKULong(jSaltSource); + jByteArrayToCKByteArray(env, jSaltSourceData, (CK_BYTE_PTR *) &(ckParamPtr->pSaltSourceData), &(ckParamPtr->ulSaltSourceDataLen)); + if ((*env)->ExceptionCheck(env)) { return; } + ckParamPtr->iterations = jLongToCKULong(jIteration); + ckParamPtr->prf = jLongToCKULong(jPrf); + jByteArrayToCKByteArray(env, jPrfData, (CK_BYTE_PTR *) &(ckParamPtr->pPrfData), &(ckParamPtr->ulPrfDataLen)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pSaltSourceData); - return ckParam; + free(ckParamPtr->pSaltSourceData); + return; } - - return ckParam ; } /* @@ -1799,39 +1697,40 @@ CK_PKCS5_PBKD2_PARAMS jPkcs5Pbkd2ParamToCKPkcs5Pbkd2Param(JNIEnv *env, jobject j * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_RSA_PKCS_PSS_PARAMS object to convert - * @return - the new CK_RSA_PKCS_PSS_PARAMS structure + * @param ckParamPtr - pointer to the new CK_RSA_PKCS_PSS_PARAMS structure */ -CK_RSA_PKCS_PSS_PARAMS jRsaPkcsPssParamToCKRsaPkcsPssParam(JNIEnv *env, jobject jParam) +void jRsaPkcsPssParamToCKRsaPkcsPssParam(JNIEnv *env, jobject jParam, +CK_RSA_PKCS_PSS_PARAMS_PTR ckParamPtr) { jclass jRsaPkcsPssParamsClass; - CK_RSA_PKCS_PSS_PARAMS ckParam; jfieldID fieldID; jlong jHashAlg, jMgf, jSLen; - memset(&ckParam, 0, sizeof(CK_RSA_PKCS_PSS_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_RSA_PKCS_PSS_PARAMS)); /* get hashAlg */ jRsaPkcsPssParamsClass = (*env)->FindClass(env, CLASS_RSA_PKCS_PSS_PARAMS); - if (jRsaPkcsPssParamsClass == NULL) { return ckParam; } + if (jRsaPkcsPssParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jRsaPkcsPssParamsClass, "hashAlg", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jHashAlg = (*env)->GetLongField(env, jParam, fieldID); /* get mgf */ fieldID = (*env)->GetFieldID(env, jRsaPkcsPssParamsClass, "mgf", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jMgf = (*env)->GetLongField(env, jParam, fieldID); /* get sLen */ fieldID = (*env)->GetFieldID(env, jRsaPkcsPssParamsClass, "sLen", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSLen = (*env)->GetLongField(env, jParam, fieldID); /* populate java values */ - ckParam.hashAlg = jLongToCKULong(jHashAlg); - ckParam.mgf = jLongToCKULong(jMgf); - ckParam.sLen = jLongToCKULong(jSLen); - - return ckParam ; + ckParamPtr->hashAlg = jLongToCKULong(jHashAlg); + ckParamPtr->mgf = jLongToCKULong(jMgf); + ckParamPtr->sLen = jLongToCKULong(jSLen); + TRACE1("DEBUG: jRsaPkcsPssParamToCKRsaPkcsPssParam, hashAlg=0x%lX\n", ckParamPtr->hashAlg); + TRACE1("DEBUG: jRsaPkcsPssParamToCKRsaPkcsPssParam, mgf=0x%lX\n", ckParamPtr->mgf); + TRACE1("DEBUG: jRsaPkcsPssParamToCKRsaPkcsPssParam, sLen=%lu\n", ckParamPtr->sLen); } /* @@ -1839,46 +1738,44 @@ CK_RSA_PKCS_PSS_PARAMS jRsaPkcsPssParamToCKRsaPkcsPssParam(JNIEnv *env, jobject * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_ECDH1_DERIVE_PARAMS object to convert - * @return - the new CK_ECDH1_DERIVE_PARAMS structure + * @param ckParamPtr - the new CK_ECDH1_DERIVE_PARAMS structure */ -CK_ECDH1_DERIVE_PARAMS jEcdh1DeriveParamToCKEcdh1DeriveParam(JNIEnv *env, jobject jParam) +void jEcdh1DeriveParamToCKEcdh1DeriveParam(JNIEnv *env, jobject jParam, +CK_ECDH1_DERIVE_PARAMS_PTR ckParamPtr) { jclass jEcdh1DeriveParamsClass; - CK_ECDH1_DERIVE_PARAMS ckParam; jfieldID fieldID; jlong jLong; jobject jSharedData, jPublicData; - memset(&ckParam, 0, sizeof(CK_ECDH1_DERIVE_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_ECDH1_DERIVE_PARAMS)); /* get kdf */ jEcdh1DeriveParamsClass = (*env)->FindClass(env, CLASS_ECDH1_DERIVE_PARAMS); - if (jEcdh1DeriveParamsClass == NULL) { return ckParam; } + if (jEcdh1DeriveParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jEcdh1DeriveParamsClass, "kdf", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jLong = (*env)->GetLongField(env, jParam, fieldID); - ckParam.kdf = jLongToCKULong(jLong); + ckParamPtr->kdf = jLongToCKULong(jLong); /* get pSharedData and ulSharedDataLen */ fieldID = (*env)->GetFieldID(env, jEcdh1DeriveParamsClass, "pSharedData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSharedData = (*env)->GetObjectField(env, jParam, fieldID); /* get pPublicData and ulPublicDataLen */ fieldID = (*env)->GetFieldID(env, jEcdh1DeriveParamsClass, "pPublicData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPublicData = (*env)->GetObjectField(env, jParam, fieldID); /* populate java values */ - ckParam.kdf = jLongToCKULong(jLong); - jByteArrayToCKByteArray(env, jSharedData, &(ckParam.pSharedData), &(ckParam.ulSharedDataLen)); - if ((*env)->ExceptionCheck(env)) { return ckParam; } - jByteArrayToCKByteArray(env, jPublicData, &(ckParam.pPublicData), &(ckParam.ulPublicDataLen)); + ckParamPtr->kdf = jLongToCKULong(jLong); + jByteArrayToCKByteArray(env, jSharedData, &(ckParamPtr->pSharedData), &(ckParamPtr->ulSharedDataLen)); + if ((*env)->ExceptionCheck(env)) { return; } + jByteArrayToCKByteArray(env, jPublicData, &(ckParamPtr->pPublicData), &(ckParamPtr->ulPublicDataLen)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pSharedData); - return ckParam; + free(ckParamPtr->pSharedData); + return; } - - return ckParam ; } /* @@ -1886,67 +1783,66 @@ CK_ECDH1_DERIVE_PARAMS jEcdh1DeriveParamToCKEcdh1DeriveParam(JNIEnv *env, jobjec * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_ECDH2_DERIVE_PARAMS object to convert - * @return - the new CK_ECDH2_DERIVE_PARAMS structure + * @param ckParamPtr - pointer to the new CK_ECDH2_DERIVE_PARAMS structure */ -CK_ECDH2_DERIVE_PARAMS jEcdh2DeriveParamToCKEcdh2DeriveParam(JNIEnv *env, jobject jParam) +void jEcdh2DeriveParamToCKEcdh2DeriveParam(JNIEnv *env, jobject jParam, +CK_ECDH2_DERIVE_PARAMS_PTR ckParamPtr) { jclass jEcdh2DeriveParamsClass; - CK_ECDH2_DERIVE_PARAMS ckParam; jfieldID fieldID; jlong jKdf, jPrivateDataLen, jPrivateData; jobject jSharedData, jPublicData, jPublicData2; - memset(&ckParam, 0, sizeof(CK_ECDH2_DERIVE_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_ECDH2_DERIVE_PARAMS)); /* get kdf */ jEcdh2DeriveParamsClass = (*env)->FindClass(env, CLASS_ECDH2_DERIVE_PARAMS); - if (jEcdh2DeriveParamsClass == NULL) { return ckParam; } + if (jEcdh2DeriveParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jEcdh2DeriveParamsClass, "kdf", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jKdf = (*env)->GetLongField(env, jParam, fieldID); /* get pSharedData and ulSharedDataLen */ fieldID = (*env)->GetFieldID(env, jEcdh2DeriveParamsClass, "pSharedData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jSharedData = (*env)->GetObjectField(env, jParam, fieldID); /* get pPublicData and ulPublicDataLen */ fieldID = (*env)->GetFieldID(env, jEcdh2DeriveParamsClass, "pPublicData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPublicData = (*env)->GetObjectField(env, jParam, fieldID); /* get ulPrivateDataLen */ fieldID = (*env)->GetFieldID(env, jEcdh2DeriveParamsClass, "ulPrivateDataLen", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPrivateDataLen = (*env)->GetLongField(env, jParam, fieldID); /* get hPrivateData */ fieldID = (*env)->GetFieldID(env, jEcdh2DeriveParamsClass, "hPrivateData", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPrivateData = (*env)->GetLongField(env, jParam, fieldID); /* get pPublicData2 and ulPublicDataLen2 */ fieldID = (*env)->GetFieldID(env, jEcdh2DeriveParamsClass, "pPublicData2", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPublicData2 = (*env)->GetObjectField(env, jParam, fieldID); /* populate java values */ - ckParam.kdf = jLongToCKULong(jKdf); - jByteArrayToCKByteArray(env, jSharedData, &(ckParam.pSharedData), &(ckParam.ulSharedDataLen)); - if ((*env)->ExceptionCheck(env)) { return ckParam; } - jByteArrayToCKByteArray(env, jPublicData, &(ckParam.pPublicData), &(ckParam.ulPublicDataLen)); + ckParamPtr->kdf = jLongToCKULong(jKdf); + jByteArrayToCKByteArray(env, jSharedData, &(ckParamPtr->pSharedData), &(ckParamPtr->ulSharedDataLen)); + if ((*env)->ExceptionCheck(env)) { return; } + jByteArrayToCKByteArray(env, jPublicData, &(ckParamPtr->pPublicData), &(ckParamPtr->ulPublicDataLen)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pSharedData); - return ckParam; + free(ckParamPtr->pSharedData); + return; } - ckParam.ulPrivateDataLen = jLongToCKULong(jPrivateDataLen); - ckParam.hPrivateData = jLongToCKULong(jPrivateData); - jByteArrayToCKByteArray(env, jPublicData2, &(ckParam.pPublicData2), &(ckParam.ulPublicDataLen2)); + ckParamPtr->ulPrivateDataLen = jLongToCKULong(jPrivateDataLen); + ckParamPtr->hPrivateData = jLongToCKULong(jPrivateData); + jByteArrayToCKByteArray(env, jPublicData2, &(ckParamPtr->pPublicData2), &(ckParamPtr->ulPublicDataLen2)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pSharedData); - free(ckParam.pPublicData); - return ckParam; + free(ckParamPtr->pSharedData); + free(ckParamPtr->pPublicData); + return; } - return ckParam ; } /* @@ -1954,45 +1850,43 @@ CK_ECDH2_DERIVE_PARAMS jEcdh2DeriveParamToCKEcdh2DeriveParam(JNIEnv *env, jobjec * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_X9_42_DH1_DERIVE_PARAMS object to convert - * @return - the new CK_X9_42_DH1_DERIVE_PARAMS structure + * @param ckParamPtr - pointer to the new CK_X9_42_DH1_DERIVE_PARAMS structure */ -CK_X9_42_DH1_DERIVE_PARAMS jX942Dh1DeriveParamToCKX942Dh1DeriveParam(JNIEnv *env, jobject jParam) +void jX942Dh1DeriveParamToCKX942Dh1DeriveParam(JNIEnv *env, jobject jParam, + CK_X9_42_DH1_DERIVE_PARAMS_PTR ckParamPtr) { jclass jX942Dh1DeriveParamsClass; - CK_X9_42_DH1_DERIVE_PARAMS ckParam; jfieldID fieldID; jlong jKdf; jobject jOtherInfo, jPublicData; - memset(&ckParam, 0, sizeof(CK_X9_42_DH1_DERIVE_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_X9_42_DH1_DERIVE_PARAMS)); /* get kdf */ jX942Dh1DeriveParamsClass = (*env)->FindClass(env, CLASS_X9_42_DH1_DERIVE_PARAMS); - if (jX942Dh1DeriveParamsClass == NULL) { return ckParam; } + if (jX942Dh1DeriveParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jX942Dh1DeriveParamsClass, "kdf", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jKdf = (*env)->GetLongField(env, jParam, fieldID); /* get pOtherInfo and ulOtherInfoLen */ fieldID = (*env)->GetFieldID(env, jX942Dh1DeriveParamsClass, "pOtherInfo", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jOtherInfo = (*env)->GetObjectField(env, jParam, fieldID); /* get pPublicData and ulPublicDataLen */ fieldID = (*env)->GetFieldID(env, jX942Dh1DeriveParamsClass, "pPublicData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPublicData = (*env)->GetObjectField(env, jParam, fieldID); /* populate java values */ - ckParam.kdf = jLongToCKULong(jKdf); - jByteArrayToCKByteArray(env, jOtherInfo, &(ckParam.pOtherInfo), &(ckParam.ulOtherInfoLen)); - if ((*env)->ExceptionCheck(env)) { return ckParam; } - jByteArrayToCKByteArray(env, jPublicData, &(ckParam.pPublicData), &(ckParam.ulPublicDataLen)); + ckParamPtr->kdf = jLongToCKULong(jKdf); + jByteArrayToCKByteArray(env, jOtherInfo, &(ckParamPtr->pOtherInfo), &(ckParamPtr->ulOtherInfoLen)); + if ((*env)->ExceptionCheck(env)) { return; } + jByteArrayToCKByteArray(env, jPublicData, &(ckParamPtr->pPublicData), &(ckParamPtr->ulPublicDataLen)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pOtherInfo); - return ckParam; + free(ckParamPtr->pOtherInfo); + return; } - - return ckParam ; } /* @@ -2000,66 +1894,64 @@ CK_X9_42_DH1_DERIVE_PARAMS jX942Dh1DeriveParamToCKX942Dh1DeriveParam(JNIEnv *env * * @param env - used to call JNI funktions to get the Java classes and objects * @param jParam - the Java CK_X9_42_DH2_DERIVE_PARAMS object to convert - * @return - the new CK_X9_42_DH2_DERIVE_PARAMS structure + * @param ckParamPtr - pointer to the new CK_X9_42_DH2_DERIVE_PARAMS structure */ -CK_X9_42_DH2_DERIVE_PARAMS jX942Dh2DeriveParamToCKX942Dh2DeriveParam(JNIEnv *env, jobject jParam) +void jX942Dh2DeriveParamToCKX942Dh2DeriveParam(JNIEnv *env, jobject jParam, + CK_X9_42_DH2_DERIVE_PARAMS_PTR ckParamPtr) { jclass jX942Dh2DeriveParamsClass; - CK_X9_42_DH2_DERIVE_PARAMS ckParam; jfieldID fieldID; jlong jKdf, jPrivateDataLen, jPrivateData; jobject jOtherInfo, jPublicData, jPublicData2; - memset(&ckParam, 0, sizeof(CK_X9_42_DH2_DERIVE_PARAMS)); + memset(ckParamPtr, 0, sizeof(CK_X9_42_DH2_DERIVE_PARAMS)); /* get kdf */ jX942Dh2DeriveParamsClass = (*env)->FindClass(env, CLASS_X9_42_DH2_DERIVE_PARAMS); - if (jX942Dh2DeriveParamsClass == NULL) { return ckParam; } + if (jX942Dh2DeriveParamsClass == NULL) { return; } fieldID = (*env)->GetFieldID(env, jX942Dh2DeriveParamsClass, "kdf", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jKdf = (*env)->GetLongField(env, jParam, fieldID); /* get pOtherInfo and ulOtherInfoLen */ fieldID = (*env)->GetFieldID(env, jX942Dh2DeriveParamsClass, "pOtherInfo", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jOtherInfo = (*env)->GetObjectField(env, jParam, fieldID); /* get pPublicData and ulPublicDataLen */ fieldID = (*env)->GetFieldID(env, jX942Dh2DeriveParamsClass, "pPublicData", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPublicData = (*env)->GetObjectField(env, jParam, fieldID); /* get ulPrivateDataLen */ fieldID = (*env)->GetFieldID(env, jX942Dh2DeriveParamsClass, "ulPrivateDataLen", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPrivateDataLen = (*env)->GetLongField(env, jParam, fieldID); /* get hPrivateData */ fieldID = (*env)->GetFieldID(env, jX942Dh2DeriveParamsClass, "hPrivateData", "J"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPrivateData = (*env)->GetLongField(env, jParam, fieldID); /* get pPublicData2 and ulPublicDataLen2 */ fieldID = (*env)->GetFieldID(env, jX942Dh2DeriveParamsClass, "pPublicData2", "[B"); - if (fieldID == NULL) { return ckParam; } + if (fieldID == NULL) { return; } jPublicData2 = (*env)->GetObjectField(env, jParam, fieldID); /* populate java values */ - ckParam.kdf = jLongToCKULong(jKdf); - jByteArrayToCKByteArray(env, jOtherInfo, &(ckParam.pOtherInfo), &(ckParam.ulOtherInfoLen)); - if ((*env)->ExceptionCheck(env)) { return ckParam; } - jByteArrayToCKByteArray(env, jPublicData, &(ckParam.pPublicData), &(ckParam.ulPublicDataLen)); + ckParamPtr->kdf = jLongToCKULong(jKdf); + jByteArrayToCKByteArray(env, jOtherInfo, &(ckParamPtr->pOtherInfo), &(ckParamPtr->ulOtherInfoLen)); + if ((*env)->ExceptionCheck(env)) { return; } + jByteArrayToCKByteArray(env, jPublicData, &(ckParamPtr->pPublicData), &(ckParamPtr->ulPublicDataLen)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pOtherInfo); - return ckParam; + free(ckParamPtr->pOtherInfo); + return; } - ckParam.ulPrivateDataLen = jLongToCKULong(jPrivateDataLen); - ckParam.hPrivateData = jLongToCKULong(jPrivateData); - jByteArrayToCKByteArray(env, jPublicData2, &(ckParam.pPublicData2), &(ckParam.ulPublicDataLen2)); + ckParamPtr->ulPrivateDataLen = jLongToCKULong(jPrivateDataLen); + ckParamPtr->hPrivateData = jLongToCKULong(jPrivateData); + jByteArrayToCKByteArray(env, jPublicData2, &(ckParamPtr->pPublicData2), &(ckParamPtr->ulPublicDataLen2)); if ((*env)->ExceptionCheck(env)) { - free(ckParam.pOtherInfo); - free(ckParam.pPublicData); - return ckParam; + free(ckParamPtr->pOtherInfo); + free(ckParamPtr->pPublicData); + return; } - - return ckParam ; } diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c index 2696483f730..bc424e76400 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -71,7 +71,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptInit jobject jMechanism, jlong jKeyHandle) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckKeyHandle; CK_RV rv; @@ -80,15 +80,14 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptInit ckSessionHandle = jLongToCKULong(jSessionHandle); ckKeyHandle = jLongToCKULong(jKeyHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return; } - rv = (*ckpFunctions->C_EncryptInit)(ckSessionHandle, &ckMechanism, + rv = (*ckpFunctions->C_EncryptInit)(ckSessionHandle, ckpMechanism, ckKeyHandle); - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } + // if OAEP, then cannot free here + freeCKMechanismPtr(ckpMechanism); if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } } @@ -98,54 +97,67 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptInit /* * Class: sun_security_pkcs11_wrapper_PKCS11 * Method: C_Encrypt - * Signature: (J[BII[BII)I + * Signature: (JJ[BIIJ[BII)I * Parametermapping: *PKCS11* * @param jlong jSessionHandle CK_SESSION_HANDLE hSession + * @param jlong directIn CK_BYTE_PTR pData * @param jbyteArray jData CK_BYTE_PTR pData * CK_ULONG ulDataLen - * @return jbyteArray jEncryptedData CK_BYTE_PTR pEncryptedData + * @param jlong directOut CK_BYTE_PTR pEncryptedData + * @return jint encryptedDataLen CK_BYTE_PTR pEncryptedData * CK_ULONG_PTR pulEncryptedDataLen */ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Encrypt (JNIEnv *env, jobject obj, jlong jSessionHandle, - jbyteArray jIn, jint jInOfs, jint jInLen, - jbyteArray jOut, jint jOutOfs, jint jOutLen) + jlong directIn, jbyteArray jIn, jint jInOfs, jint jInLen, + jlong directOut, jbyteArray jOut, jint jOutOfs, jint jOutLen) { CK_SESSION_HANDLE ckSessionHandle; CK_RV rv; CK_BYTE_PTR inBufP; CK_BYTE_PTR outBufP; - CK_ULONG ckEncryptedPartLen; + CK_ULONG ckEncryptedLen = 0; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return 0; } ckSessionHandle = jLongToCKULong(jSessionHandle); - inBufP = (*env)->GetPrimitiveArrayCritical(env, jIn, NULL); - if (inBufP == NULL) { return 0; } - - outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL); - if (outBufP == NULL) { - // Make sure to release inBufP - (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); - return 0; + if (directIn != 0) { + inBufP = (CK_BYTE_PTR) jlong_to_ptr(directIn); + } else { + inBufP = (*env)->GetPrimitiveArrayCritical(env, jIn, NULL); + if (inBufP == NULL) { return 0; } } - ckEncryptedPartLen = jOutLen; + if (directOut != 0) { + outBufP = (CK_BYTE_PTR) jlong_to_ptr(directOut); + } else { + outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL); + if (outBufP == NULL) { + goto cleanup; + } + } + + ckEncryptedLen = jOutLen; rv = (*ckpFunctions->C_Encrypt)(ckSessionHandle, (CK_BYTE_PTR)(inBufP + jInOfs), jInLen, (CK_BYTE_PTR)(outBufP + jOutOfs), - &ckEncryptedPartLen); - - (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); - (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); + &ckEncryptedLen); ckAssertReturnValueOK(env, rv); - return ckEncryptedPartLen; + +cleanup: + if (directIn == 0 && inBufP != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); + } + if (directOut == 0 && outBufP != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); + } + return ckEncryptedLen; } #endif @@ -172,7 +184,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptUpdate CK_BYTE_PTR inBufP; CK_BYTE_PTR outBufP; - CK_ULONG ckEncryptedPartLen; + CK_ULONG ckEncryptedPartLen = 0; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return 0; } @@ -191,34 +203,26 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptUpdate } else { outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL); if (outBufP == NULL) { - // Make sure to release inBufP - (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); - return 0; + goto cleanup; } } ckEncryptedPartLen = jOutLen; - //printf("EU: inBufP=%i, jInOfs=%i, jInLen=%i, outBufP=%i\n", - // inBufP, jInOfs, jInLen, outBufP); - rv = (*ckpFunctions->C_EncryptUpdate)(ckSessionHandle, (CK_BYTE_PTR)(inBufP + jInOfs), jInLen, (CK_BYTE_PTR)(outBufP + jOutOfs), &ckEncryptedPartLen); - //printf("EU: ckEncryptedPartLen=%i\n", ckEncryptedPartLen); - - if (directIn == 0) { - (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); - } - - if (directOut == 0) { - (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); - } - ckAssertReturnValueOK(env, rv); +cleanup: + if (directIn == 0 && inBufP != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); + } + if (directOut == 0 && outBufP != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); + } return ckEncryptedPartLen; } #endif @@ -257,14 +261,10 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptFinal ckLastEncryptedPartLen = jOutLen; - //printf("EF: outBufP=%i\n", outBufP); - rv = (*ckpFunctions->C_EncryptFinal)(ckSessionHandle, (CK_BYTE_PTR)(outBufP + jOutOfs), &ckLastEncryptedPartLen); - //printf("EF: ckLastEncryptedPartLen=%i", ckLastEncryptedPartLen); - if (directOut == 0) { (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); } @@ -291,7 +291,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptInit jobject jMechanism, jlong jKeyHandle) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckKeyHandle; CK_RV rv; @@ -300,15 +300,14 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptInit ckSessionHandle = jLongToCKULong(jSessionHandle); ckKeyHandle = jLongToCKULong(jKeyHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return; } - rv = (*ckpFunctions->C_DecryptInit)(ckSessionHandle, &ckMechanism, + rv = (*ckpFunctions->C_DecryptInit)(ckSessionHandle, ckpMechanism, ckKeyHandle); - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } + // if OAEP, then cannot free here + freeCKMechanismPtr(ckpMechanism); if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } } @@ -318,7 +317,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptInit /* * Class: sun_security_pkcs11_wrapper_PKCS11 * Method: C_Decrypt - * Signature: (J[BII[BII)I + * Signature: (JJ[BIIJ[BII)I * Parametermapping: *PKCS11* * @param jlong jSessionHandle CK_SESSION_HANDLE hSession * @param jbyteArray jEncryptedData CK_BYTE_PTR pEncryptedData @@ -329,44 +328,53 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptInit JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Decrypt (JNIEnv *env, jobject obj, jlong jSessionHandle, - jbyteArray jIn, jint jInOfs, jint jInLen, - jbyteArray jOut, jint jOutOfs, jint jOutLen) + jlong directIn, jbyteArray jIn, jint jInOfs, jint jInLen, + jlong directOut, jbyteArray jOut, jint jOutOfs, jint jOutLen) { CK_SESSION_HANDLE ckSessionHandle; CK_RV rv; CK_BYTE_PTR inBufP; CK_BYTE_PTR outBufP; - CK_ULONG ckPartLen; + CK_ULONG ckOutLen = 0; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return 0; } ckSessionHandle = jLongToCKULong(jSessionHandle); - inBufP = (*env)->GetPrimitiveArrayCritical(env, jIn, NULL); - if (inBufP == NULL) { return 0; } - - outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL); - if (outBufP == NULL) { - // Make sure to release inBufP - (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); - return 0; + if (directIn != 0) { + inBufP = (CK_BYTE_PTR) jlong_to_ptr(directIn); + } else { + inBufP = (*env)->GetPrimitiveArrayCritical(env, jIn, NULL); + if (inBufP == NULL) { return 0; } } - ckPartLen = jOutLen; + if (directOut != 0) { + outBufP = (CK_BYTE_PTR) jlong_to_ptr(directOut); + } else { + outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL); + if (outBufP == NULL) { + goto cleanup; + } + } + ckOutLen = jOutLen; rv = (*ckpFunctions->C_Decrypt)(ckSessionHandle, (CK_BYTE_PTR)(inBufP + jInOfs), jInLen, (CK_BYTE_PTR)(outBufP + jOutOfs), - &ckPartLen); - - (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); - (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); + &ckOutLen); ckAssertReturnValueOK(env, rv); - return ckPartLen; +cleanup: + if (directIn == 0 && inBufP != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); + } + if (directOut == 0 && outBufP != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); + } + return ckOutLen; } #endif @@ -393,7 +401,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptUpdate CK_BYTE_PTR inBufP; CK_BYTE_PTR outBufP; - CK_ULONG ckDecryptedPartLen; + CK_ULONG ckDecryptedPartLen = 0; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return 0; } @@ -412,28 +420,24 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptUpdate } else { outBufP = (*env)->GetPrimitiveArrayCritical(env, jOut, NULL); if (outBufP == NULL) { - // Make sure to release inBufP - (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); - return 0; + goto cleanup; } } ckDecryptedPartLen = jOutLen; - rv = (*ckpFunctions->C_DecryptUpdate)(ckSessionHandle, (CK_BYTE_PTR)(inBufP + jInOfs), jInLen, (CK_BYTE_PTR)(outBufP + jOutOfs), &ckDecryptedPartLen); - if (directIn == 0) { - (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); - } - - if (directOut == 0) { - (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); - } - ckAssertReturnValueOK(env, rv); +cleanup: + if (directIn == 0 && inBufP != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT); + } + if (directOut == 0 && outBufP != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT); + } return ckDecryptedPartLen; } diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_digest.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_digest.c index 68e4ff5e65f..77b9eb11cfe 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_digest.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_digest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -68,21 +68,19 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestInit (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_RV rv; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return; } ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return; } - rv = (*ckpFunctions->C_DigestInit)(ckSessionHandle, &ckMechanism); + rv = (*ckpFunctions->C_DigestInit)(ckSessionHandle, ckpMechanism); - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } + freeCKMechanismPtr(ckpMechanism); if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } } @@ -101,53 +99,50 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestInit * CK_ULONG_PTR pulDigestLen */ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestSingle - (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, jbyteArray jIn, jint jInOfs, jint jInLen, jbyteArray jDigest, jint jDigestOfs, jint jDigestLen) + (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, + jbyteArray jIn, jint jInOfs, jint jInLen, jbyteArray jDigest, + jint jDigestOfs, jint jDigestLen) { CK_SESSION_HANDLE ckSessionHandle; CK_RV rv; - CK_BYTE_PTR bufP; CK_BYTE BUF[MAX_STACK_BUFFER_LEN]; + CK_BYTE_PTR bufP = BUF; CK_BYTE DIGESTBUF[MAX_DIGEST_LEN]; - CK_ULONG ckDigestLength = min(MAX_DIGEST_LEN, jDigestLen); - CK_MECHANISM ckMechanism; + CK_ULONG ckDigestLength = 0; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return 0; } ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return 0; } - rv = (*ckpFunctions->C_DigestInit)(ckSessionHandle, &ckMechanism); + rv = (*ckpFunctions->C_DigestInit)(ckSessionHandle, ckpMechanism); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { goto cleanup; } - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } - - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return 0; } - - if (jInLen <= MAX_STACK_BUFFER_LEN) { - bufP = BUF; - } else { + if (jInLen > MAX_STACK_BUFFER_LEN) { /* always use single part op, even for large data */ bufP = (CK_BYTE_PTR) malloc((size_t)jInLen); if (bufP == NULL) { throwOutOfMemoryError(env, 0); - return 0; + goto cleanup; } } (*env)->GetByteArrayRegion(env, jIn, jInOfs, jInLen, (jbyte *)bufP); if ((*env)->ExceptionCheck(env)) { - if (bufP != BUF) { free(bufP); } - return 0; + goto cleanup; } + ckDigestLength = min(MAX_DIGEST_LEN, jDigestLen); + rv = (*ckpFunctions->C_Digest)(ckSessionHandle, bufP, jInLen, DIGESTBUF, &ckDigestLength); if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) { (*env)->SetByteArrayRegion(env, jDigest, jDigestOfs, ckDigestLength, (jbyte *)DIGESTBUF); } - +cleanup: + freeCKMechanismPtr(ckpMechanism); if (bufP != BUF) { free(bufP); } return ckDigestLength; @@ -165,7 +160,8 @@ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestSingle * CK_ULONG ulDataLen */ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestUpdate - (JNIEnv *env, jobject obj, jlong jSessionHandle, jlong directIn, jbyteArray jIn, jint jInOfs, jint jInLen) + (JNIEnv *env, jobject obj, jlong jSessionHandle, jlong directIn, jbyteArray jIn, + jint jInOfs, jint jInLen) { CK_SESSION_HANDLE ckSessionHandle; CK_RV rv; @@ -256,7 +252,8 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestKey * CK_ULONG_PTR pulDigestLen */ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestFinal - (JNIEnv *env, jobject obj, jlong jSessionHandle, jbyteArray jDigest, jint jDigestOfs, jint jDigestLen) + (JNIEnv *env, jobject obj, jlong jSessionHandle, jbyteArray jDigest, + jint jDigestOfs, jint jDigestLen) { CK_SESSION_HANDLE ckSessionHandle; CK_RV rv; diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c index ea7fd1704eb..ad4857d8d59 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c @@ -67,6 +67,7 @@ jobject ckMechanismInfoPtrToJMechanismInfo(JNIEnv *env, const CK_MECHANISM_INFO_ jfieldID pNativeDataID; jfieldID mech_mechanismID; jfieldID mech_pParameterID; +jfieldID mech_pHandleID; jclass jByteArrayClass; jclass jLongClass; @@ -84,6 +85,23 @@ JNIEXPORT jint JNICALL DEF_JNI_OnLoad(JavaVM *vm, void *reserved) { /* The native implementation of the methods of the PKCS11Implementation class */ /* ************************************************************************** */ +/* + * This method is used to do free the memory allocated for CK_MECHANISM structure. + * + * Class: sun_security_pkcs11_wrapper_PKCS11 + * Method: freeMechanism + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL +Java_sun_security_pkcs11_wrapper_PKCS11_freeMechanism +(JNIEnv *env, jclass thisClass, jlong ckpMechanism) { + if (ckpMechanism != 0L) { + freeCKMechanismPtr((CK_MECHANISM_PTR) ckpMechanism); + TRACE1("DEBUG PKCS11_freeMechanism: free pMech = %x\n", (jlong)ckpMechanism); + } + return 0L; +} + /* * This method is used to do static initialization. This method is static and * synchronized. Summary: use this method like a static initialization block. @@ -115,11 +133,11 @@ jclass fetchClass(JNIEnv *env, const char *name) { void prefetchFields(JNIEnv *env, jclass thisClass) { jclass tmpClass; - /* PKCS11 */ + /* PKCS11 - pNativeData */ pNativeDataID = (*env)->GetFieldID(env, thisClass, "pNativeData", "J"); if (pNativeDataID == NULL) { return; } - /* CK_MECHANISM */ + /* CK_MECHANISM - mechanism, pParameter, pHandle */ tmpClass = (*env)->FindClass(env, CLASS_MECHANISM); if (tmpClass == NULL) { return; } mech_mechanismID = (*env)->GetFieldID(env, tmpClass, "mechanism", "J"); @@ -127,6 +145,10 @@ void prefetchFields(JNIEnv *env, jclass thisClass) { mech_pParameterID = (*env)->GetFieldID(env, tmpClass, "pParameter", "Ljava/lang/Object;"); if (mech_pParameterID == NULL) { return; } + mech_pHandleID = (*env)->GetFieldID(env, tmpClass, "pHandle", "J"); + if (mech_pHandleID == NULL) { return; } + + /* java classes for primitive types - byte[], long */ jByteArrayClass = fetchClass(env, "[B"); if (jByteArrayClass == NULL) { return; } jLongClass = fetchClass(env, "java/lang/Long"); diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c index 5a4fa0022e0..89fd033c29d 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c @@ -155,7 +155,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo jbyte* nativeKeyInfoArrayRawCkAttributes = NULL; jbyte* nativeKeyInfoArrayRawCkAttributesPtr = NULL; jbyte* nativeKeyInfoArrayRawDataPtr = NULL; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; char iv[16] = {0x0}; CK_ULONG ckWrappedKeyLength = 0U; jbyte* wrappedKeySizeWrappedKeyArrayPtr = NULL; @@ -310,8 +310,8 @@ Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo // Key is sensitive. Need to extract it wrapped. if (jWrappingKeyHandle != 0) { - jMechanismToCKMechanism(env, jWrappingMech, &ckMechanism); - rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, &ckMechanism, + ckpMechanism = jMechanismToCKMechanismPtr(env, jWrappingMech); + rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, ckpMechanism, jLongToCKULong(jWrappingKeyHandle), ckObjectHandle, NULL_PTR, &ckWrappedKeyLength); if (ckWrappedKeyLength != 0) { @@ -339,7 +339,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo wrappedKeyBufferPtr = (CK_BYTE_PTR) (wrappedKeySizeWrappedKeyArrayPtr + sizeof(unsigned long)); - rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, &ckMechanism, + rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, ckpMechanism, jLongToCKULong(jWrappingKeyHandle),ckObjectHandle, wrappedKeyBufferPtr, &ckWrappedKeyLength); if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { @@ -382,6 +382,7 @@ cleanup: && returnValue != nativeKeyInfoWrappedKeyArray) { (*env)->DeleteLocalRef(env, nativeKeyInfoWrappedKeyArray); } + freeCKMechanismPtr(ckpMechanism); return returnValue; } @@ -417,7 +418,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_createNativeKey unsigned long totalDataSize = 0UL; jbyte* wrappedKeySizePtr = NULL; unsigned int i = 0U; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; char iv[16] = {0x0}; CK_ULONG ckWrappedKeyLength = 0UL; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); @@ -468,8 +469,8 @@ Java_sun_security_pkcs11_wrapper_PKCS11_createNativeKey jLongToCKULong(nativeKeyInfoCkAttributesCount), &ckObjectHandle); } else { // Wrapped key - jMechanismToCKMechanism(env, jWrappingMech, &ckMechanism); - rv = (*ckpFunctions->C_UnwrapKey)(ckSessionHandle, &ckMechanism, + ckpMechanism = jMechanismToCKMechanismPtr(env, jWrappingMech); + rv = (*ckpFunctions->C_UnwrapKey)(ckSessionHandle, ckpMechanism, jLongToCKULong(jWrappingKeyHandle), (CK_BYTE_PTR)(wrappedKeySizePtr + sizeof(unsigned long)), ckWrappedKeyLength, @@ -490,6 +491,7 @@ cleanup: nativeKeyInfoArrayRaw, JNI_ABORT); } + freeCKMechanismPtr(ckpMechanism); return jObjectHandle; } #endif @@ -510,9 +512,9 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1GenerateKey (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, jobjectArray jTemplate) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR; - CK_ULONG ckAttributesLength; + CK_ULONG ckAttributesLength = 0; CK_OBJECT_HANDLE ckKeyHandle = 0; jlong jKeyHandle = 0L; CK_RV rv; @@ -521,24 +523,21 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1GenerateKey if (ckpFunctions == NULL) { return 0L; } ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return 0L ; } jAttributeArrayToCKAttributeArray(env, jTemplate, &ckpAttributes, &ckAttributesLength); if ((*env)->ExceptionCheck(env)) { - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } - return 0L; + goto cleanup; } - rv = (*ckpFunctions->C_GenerateKey)(ckSessionHandle, &ckMechanism, ckpAttributes, ckAttributesLength, &ckKeyHandle); + rv = (*ckpFunctions->C_GenerateKey)(ckSessionHandle, ckpMechanism, ckpAttributes, ckAttributesLength, &ckKeyHandle); if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) { jKeyHandle = ckULongToJLong(ckKeyHandle); /* cheack, if we must give a initialization vector back to Java */ - switch (ckMechanism.mechanism) { + switch (ckpMechanism->mechanism) { case CKM_PBE_MD2_DES_CBC: case CKM_PBE_MD5_DES_CBC: case CKM_PBE_MD5_CAST_CBC: @@ -548,14 +547,12 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1GenerateKey case CKM_PBE_SHA1_CAST128_CBC: /* case CKM_PBE_SHA1_CAST5_CBC: the same as CKM_PBE_SHA1_CAST128_CBC */ /* we must copy back the initialization vector to the jMechanism object */ - copyBackPBEInitializationVector(env, &ckMechanism, jMechanism); + copyBackPBEInitializationVector(env, ckpMechanism, jMechanism); break; } } - - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } +cleanup: + freeCKMechanismPtr(ckpMechanism); freeCKAttributeArray(ckpAttributes, ckAttributesLength); return jKeyHandle ; @@ -582,14 +579,14 @@ JNIEXPORT jlongArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Generate jobjectArray jPublicKeyTemplate, jobjectArray jPrivateKeyTemplate) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_ATTRIBUTE_PTR ckpPublicKeyAttributes = NULL_PTR; CK_ATTRIBUTE_PTR ckpPrivateKeyAttributes = NULL_PTR; - CK_ULONG ckPublicKeyAttributesLength; - CK_ULONG ckPrivateKeyAttributesLength; + CK_ULONG ckPublicKeyAttributesLength = 0; + CK_ULONG ckPrivateKeyAttributesLength = 0; CK_OBJECT_HANDLE_PTR ckpPublicKeyHandle; /* pointer to Public Key */ CK_OBJECT_HANDLE_PTR ckpPrivateKeyHandle; /* pointer to Private Key */ - CK_OBJECT_HANDLE_PTR ckpKeyHandles; /* pointer to array with Public and Private Key */ + CK_OBJECT_HANDLE_PTR ckpKeyHandles = NULL; /* pointer to array with Public and Private Key */ jlongArray jKeyHandles = NULL; CK_RV rv; int attempts; @@ -599,37 +596,25 @@ JNIEXPORT jlongArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Generate if (ckpFunctions == NULL) { return NULL; } ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return NULL; } ckpKeyHandles = (CK_OBJECT_HANDLE_PTR) malloc(2 * sizeof(CK_OBJECT_HANDLE)); if (ckpKeyHandles == NULL) { - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } throwOutOfMemoryError(env, 0); - return NULL; + goto cleanup; } ckpPublicKeyHandle = ckpKeyHandles; /* first element of array is Public Key */ ckpPrivateKeyHandle = (ckpKeyHandles + 1); /* second element of array is Private Key */ jAttributeArrayToCKAttributeArray(env, jPublicKeyTemplate, &ckpPublicKeyAttributes, &ckPublicKeyAttributesLength); if ((*env)->ExceptionCheck(env)) { - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } - free(ckpKeyHandles); - return NULL; + goto cleanup; } jAttributeArrayToCKAttributeArray(env, jPrivateKeyTemplate, &ckpPrivateKeyAttributes, &ckPrivateKeyAttributesLength); if ((*env)->ExceptionCheck(env)) { - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } - free(ckpKeyHandles); - freeCKAttributeArray(ckpPublicKeyAttributes, ckPublicKeyAttributesLength); - return NULL; + goto cleanup; } /* @@ -650,7 +635,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Generate * Call C_GenerateKeyPair() several times if CKR_FUNCTION_FAILED occurs. */ for (attempts = 0; attempts < MAX_ATTEMPTS; attempts++) { - rv = (*ckpFunctions->C_GenerateKeyPair)(ckSessionHandle, &ckMechanism, + rv = (*ckpFunctions->C_GenerateKeyPair)(ckSessionHandle, ckpMechanism, ckpPublicKeyAttributes, ckPublicKeyAttributesLength, ckpPrivateKeyAttributes, ckPrivateKeyAttributesLength, ckpPublicKeyHandle, ckpPrivateKeyHandle); @@ -666,13 +651,11 @@ JNIEXPORT jlongArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Generate jKeyHandles = ckULongArrayToJLongArray(env, ckpKeyHandles, 2); } - if(ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } +cleanup: + freeCKMechanismPtr(ckpMechanism); free(ckpKeyHandles); freeCKAttributeArray(ckpPublicKeyAttributes, ckPublicKeyAttributesLength); freeCKAttributeArray(ckpPrivateKeyAttributes, ckPrivateKeyAttributesLength); - return jKeyHandles ; } #endif @@ -694,7 +677,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1WrapKey (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, jlong jWrappingKeyHandle, jlong jKeyHandle) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckWrappingKeyHandle; CK_OBJECT_HANDLE ckKeyHandle; jbyteArray jWrappedKey = NULL; @@ -707,33 +690,30 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1WrapKey if (ckpFunctions == NULL) { return NULL; } ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return NULL; } ckWrappingKeyHandle = jLongToCKULong(jWrappingKeyHandle); ckKeyHandle = jLongToCKULong(jKeyHandle); - rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, &ckMechanism, ckWrappingKeyHandle, ckKeyHandle, ckpWrappedKey, &ckWrappedKeyLength); + rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, ckpMechanism, ckWrappingKeyHandle, ckKeyHandle, ckpWrappedKey, &ckWrappedKeyLength); if (rv == CKR_BUFFER_TOO_SMALL) { ckpWrappedKey = (CK_BYTE_PTR) malloc(ckWrappedKeyLength); if (ckpWrappedKey == NULL) { - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } throwOutOfMemoryError(env, 0); - return NULL; + goto cleanup; } - rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, &ckMechanism, ckWrappingKeyHandle, ckKeyHandle, ckpWrappedKey, &ckWrappedKeyLength); + rv = (*ckpFunctions->C_WrapKey)(ckSessionHandle, ckpMechanism, ckWrappingKeyHandle, ckKeyHandle, ckpWrappedKey, &ckWrappedKeyLength); } if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) { jWrappedKey = ckByteArrayToJByteArray(env, ckpWrappedKey, ckWrappedKeyLength); } +cleanup: if (ckpWrappedKey != BUF) { free(ckpWrappedKey); } - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } + freeCKMechanismPtr(ckpMechanism); + return jWrappedKey ; } #endif @@ -758,12 +738,12 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1UnwrapKey jbyteArray jWrappedKey, jobjectArray jTemplate) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckUnwrappingKeyHandle; CK_BYTE_PTR ckpWrappedKey = NULL_PTR; CK_ULONG ckWrappedKeyLength; CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR; - CK_ULONG ckAttributesLength; + CK_ULONG ckAttributesLength = 0; CK_OBJECT_HANDLE ckKeyHandle = 0; jlong jKeyHandle = 0L; CK_RV rv; @@ -772,29 +752,22 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1UnwrapKey if (ckpFunctions == NULL) { return 0L; } ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return 0L; } ckUnwrappingKeyHandle = jLongToCKULong(jUnwrappingKeyHandle); jByteArrayToCKByteArray(env, jWrappedKey, &ckpWrappedKey, &ckWrappedKeyLength); if ((*env)->ExceptionCheck(env)) { - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } - return 0L; + goto cleanup; } jAttributeArrayToCKAttributeArray(env, jTemplate, &ckpAttributes, &ckAttributesLength); if ((*env)->ExceptionCheck(env)) { - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } - free(ckpWrappedKey); - return 0L; + goto cleanup; } - rv = (*ckpFunctions->C_UnwrapKey)(ckSessionHandle, &ckMechanism, ckUnwrappingKeyHandle, + rv = (*ckpFunctions->C_UnwrapKey)(ckSessionHandle, ckpMechanism, ckUnwrappingKeyHandle, ckpWrappedKey, ckWrappedKeyLength, ckpAttributes, ckAttributesLength, &ckKeyHandle); @@ -803,16 +776,14 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1UnwrapKey #if 0 /* cheack, if we must give a initialization vector back to Java */ - if (ckMechanism.mechanism == CKM_KEY_WRAP_SET_OAEP) { + if (ckpMechanism->mechanism == CKM_KEY_WRAP_SET_OAEP) { /* we must copy back the unwrapped key info to the jMechanism object */ - copyBackSetUnwrappedKey(env, &ckMechanism, jMechanism); + copyBackSetUnwrappedKey(env, ckpMechanism, jMechanism); } #endif } - - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } +cleanup: + freeCKMechanismPtr(ckpMechanism); freeCKAttributeArray(ckpAttributes, ckAttributesLength); free(ckpWrappedKey); @@ -834,26 +805,27 @@ static void freeMasterKeyDeriveParams(CK_SSL3_RANDOM_DATA *RandomInfo, CK_VERSIO } } -void ssl3FreeMasterKeyDeriveParams(CK_MECHANISM_PTR ckMechanism) { - CK_SSL3_MASTER_KEY_DERIVE_PARAMS *params = (CK_SSL3_MASTER_KEY_DERIVE_PARAMS *) ckMechanism->pParameter; +void ssl3FreeMasterKeyDeriveParams(CK_MECHANISM_PTR ckpMechanism) { + CK_SSL3_MASTER_KEY_DERIVE_PARAMS *params = + (CK_SSL3_MASTER_KEY_DERIVE_PARAMS *) ckpMechanism->pParameter; if (params == NULL) { return; } freeMasterKeyDeriveParams(&(params->RandomInfo), params->pVersion); } -void tls12FreeMasterKeyDeriveParams(CK_MECHANISM_PTR ckMechanism) { +void tls12FreeMasterKeyDeriveParams(CK_MECHANISM_PTR ckpMechanism) { CK_TLS12_MASTER_KEY_DERIVE_PARAMS *params = - (CK_TLS12_MASTER_KEY_DERIVE_PARAMS *)ckMechanism->pParameter; + (CK_TLS12_MASTER_KEY_DERIVE_PARAMS *)ckpMechanism->pParameter; if (params == NULL) { return; } freeMasterKeyDeriveParams(&(params->RandomInfo), params->pVersion); } -void freeEcdh1DeriveParams(CK_MECHANISM_PTR ckMechanism) { +void freeEcdh1DeriveParams(CK_MECHANISM_PTR ckpMechanism) { CK_ECDH1_DERIVE_PARAMS *params = - (CK_ECDH1_DERIVE_PARAMS *)ckMechanism->pParameter; + (CK_ECDH1_DERIVE_PARAMS *)ckpMechanism->pParameter; if (params == NULL) { return; } @@ -869,7 +841,7 @@ void freeEcdh1DeriveParams(CK_MECHANISM_PTR ckMechanism) { /* * Copy back the PRF output to Java. */ -void copyBackTLSPrfParams(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism) +void copyBackTLSPrfParams(JNIEnv *env, CK_MECHANISM_PTR ckpMechanism, jobject jMechanism) { jclass jMechanismClass, jTLSPrfParamsClass; CK_TLS_PRF_PARAMS *ckTLSPrfParams; @@ -890,13 +862,13 @@ void copyBackTLSPrfParams(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMecha if (fieldID == NULL) { return; } jMechanismType = (*env)->GetLongField(env, jMechanism, fieldID); ckMechanismType = jLongToCKULong(jMechanismType); - if (ckMechanismType != ckMechanism->mechanism) { + if (ckMechanismType != ckpMechanism->mechanism) { /* we do not have maching types, this should not occur */ return; } /* get the native CK_TLS_PRF_PARAMS */ - ckTLSPrfParams = (CK_TLS_PRF_PARAMS *) ckMechanism->pParameter; + ckTLSPrfParams = (CK_TLS_PRF_PARAMS *) ckpMechanism->pParameter; if (ckTLSPrfParams != NULL_PTR) { /* get the Java CK_TLS_PRF_PARAMS object (pParameter) */ fieldID = (*env)->GetFieldID(env, jMechanismClass, "pParameter", "Ljava/lang/Object;"); @@ -950,10 +922,10 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DeriveKey (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, jlong jBaseKeyHandle, jobjectArray jTemplate) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckBaseKeyHandle; CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR; - CK_ULONG ckAttributesLength; + CK_ULONG ckAttributesLength = 0; CK_OBJECT_HANDLE ckKeyHandle = 0; jlong jKeyHandle = 0L; CK_RV rv; @@ -963,19 +935,16 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DeriveKey if (ckpFunctions == NULL) { return 0L; } ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return 0L; } ckBaseKeyHandle = jLongToCKULong(jBaseKeyHandle); jAttributeArrayToCKAttributeArray(env, jTemplate, &ckpAttributes, &ckAttributesLength); if ((*env)->ExceptionCheck(env)) { - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); - } - return 0L; + goto cleanup; } - switch (ckMechanism.mechanism) { + switch (ckpMechanism->mechanism) { case CKM_SSL3_KEY_AND_MAC_DERIVE: case CKM_TLS_KEY_AND_MAC_DERIVE: case CKM_TLS12_KEY_AND_MAC_DERIVE: @@ -989,60 +958,60 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DeriveKey break; } - rv = (*ckpFunctions->C_DeriveKey)(ckSessionHandle, &ckMechanism, ckBaseKeyHandle, + rv = (*ckpFunctions->C_DeriveKey)(ckSessionHandle, ckpMechanism, ckBaseKeyHandle, ckpAttributes, ckAttributesLength, phKey); jKeyHandle = ckLongToJLong(ckKeyHandle); - freeCKAttributeArray(ckpAttributes, ckAttributesLength); - - switch (ckMechanism.mechanism) { + switch (ckpMechanism->mechanism) { case CKM_SSL3_MASTER_KEY_DERIVE: case CKM_TLS_MASTER_KEY_DERIVE: /* we must copy back the client version */ - ssl3CopyBackClientVersion(env, &ckMechanism, jMechanism); - ssl3FreeMasterKeyDeriveParams(&ckMechanism); + ssl3CopyBackClientVersion(env, ckpMechanism, jMechanism); + ssl3FreeMasterKeyDeriveParams(ckpMechanism); break; case CKM_TLS12_MASTER_KEY_DERIVE: - tls12CopyBackClientVersion(env, &ckMechanism, jMechanism); - tls12FreeMasterKeyDeriveParams(&ckMechanism); + tls12CopyBackClientVersion(env, ckpMechanism, jMechanism); + tls12FreeMasterKeyDeriveParams(ckpMechanism); break; case CKM_SSL3_MASTER_KEY_DERIVE_DH: case CKM_TLS_MASTER_KEY_DERIVE_DH: - ssl3FreeMasterKeyDeriveParams(&ckMechanism); + ssl3FreeMasterKeyDeriveParams(ckpMechanism); break; case CKM_TLS12_MASTER_KEY_DERIVE_DH: - tls12FreeMasterKeyDeriveParams(&ckMechanism); + tls12FreeMasterKeyDeriveParams(ckpMechanism); break; case CKM_SSL3_KEY_AND_MAC_DERIVE: case CKM_TLS_KEY_AND_MAC_DERIVE: /* we must copy back the unwrapped key info to the jMechanism object */ - ssl3CopyBackKeyMatParams(env, &ckMechanism, jMechanism); + ssl3CopyBackKeyMatParams(env, ckpMechanism, jMechanism); break; case CKM_TLS12_KEY_AND_MAC_DERIVE: /* we must copy back the unwrapped key info to the jMechanism object */ - tls12CopyBackKeyMatParams(env, &ckMechanism, jMechanism); + tls12CopyBackKeyMatParams(env, ckpMechanism, jMechanism); break; case CKM_TLS_PRF: - copyBackTLSPrfParams(env, &ckMechanism, jMechanism); + copyBackTLSPrfParams(env, ckpMechanism, jMechanism); break; case CKM_ECDH1_DERIVE: - freeEcdh1DeriveParams(&ckMechanism); + freeEcdh1DeriveParams(ckpMechanism); break; default: // empty break; } - - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { + jKeyHandle =0L; } - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return 0L ; } + +cleanup: + freeCKMechanismPtr(ckpMechanism); + freeCKAttributeArray(ckpAttributes, ckAttributesLength); return jKeyHandle ; } -static void copyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism, +static void copyBackClientVersion(JNIEnv *env, CK_MECHANISM_PTR ckpMechanism, jobject jMechanism, CK_VERSION *ckVersion, const char *class_master_key_derive_params) { jclass jMasterKeyDeriveParamsClass, jMechanismClass, jVersionClass; @@ -1059,7 +1028,7 @@ static void copyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, jobjec if (fieldID == NULL) { return; } jMechanismType = (*env)->GetLongField(env, jMechanism, fieldID); ckMechanismType = jLongToCKULong(jMechanismType); - if (ckMechanismType != ckMechanism->mechanism) { + if (ckMechanismType != ckpMechanism->mechanism) { /* we do not have maching types, this should not occur */ return; } @@ -1102,14 +1071,14 @@ static void copyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, jobjec * mechanisms when used for deriving a key. * */ -void ssl3CopyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, +void ssl3CopyBackClientVersion(JNIEnv *env, CK_MECHANISM_PTR ckpMechanism, jobject jMechanism) { CK_SSL3_MASTER_KEY_DERIVE_PARAMS *ckSSL3MasterKeyDeriveParams; ckSSL3MasterKeyDeriveParams = - (CK_SSL3_MASTER_KEY_DERIVE_PARAMS *)ckMechanism->pParameter; + (CK_SSL3_MASTER_KEY_DERIVE_PARAMS *)ckpMechanism->pParameter; if (ckSSL3MasterKeyDeriveParams != NULL_PTR) { - copyBackClientVersion(env, ckMechanism, jMechanism, + copyBackClientVersion(env, ckpMechanism, jMechanism, ckSSL3MasterKeyDeriveParams->pVersion, CLASS_SSL3_MASTER_KEY_DERIVE_PARAMS); } @@ -1121,20 +1090,20 @@ void ssl3CopyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, * CKM_TLS12_MASTER_KEY_DERIVE mechanism when used for deriving a key. * */ -void tls12CopyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, +void tls12CopyBackClientVersion(JNIEnv *env, CK_MECHANISM_PTR ckpMechanism, jobject jMechanism) { CK_TLS12_MASTER_KEY_DERIVE_PARAMS *ckTLS12MasterKeyDeriveParams; ckTLS12MasterKeyDeriveParams = - (CK_TLS12_MASTER_KEY_DERIVE_PARAMS *)ckMechanism->pParameter; + (CK_TLS12_MASTER_KEY_DERIVE_PARAMS *)ckpMechanism->pParameter; if (ckTLS12MasterKeyDeriveParams != NULL_PTR) { - copyBackClientVersion(env, ckMechanism, jMechanism, + copyBackClientVersion(env, ckpMechanism, jMechanism, ckTLS12MasterKeyDeriveParams->pVersion, CLASS_TLS12_MASTER_KEY_DERIVE_PARAMS); } } -static void copyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, +static void copyBackKeyMatParams(JNIEnv *env, CK_MECHANISM_PTR ckpMechanism, jobject jMechanism, CK_SSL3_RANDOM_DATA *RandomInfo, CK_SSL3_KEY_MAT_OUT_PTR ckSSL3KeyMatOut, const char *class_key_mat_params) { @@ -1157,7 +1126,7 @@ static void copyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, if (fieldID == NULL) { return; } jMechanismType = (*env)->GetLongField(env, jMechanism, fieldID); ckMechanismType = jLongToCKULong(jMechanismType); - if (ckMechanismType != ckMechanism->mechanism) { + if (ckMechanismType != ckpMechanism->mechanism) { /* we do not have maching types, this should not occur */ return; } @@ -1264,13 +1233,13 @@ static void copyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, * when used for deriving a key. * */ -void ssl3CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, +void ssl3CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM_PTR ckpMechanism, jobject jMechanism) { CK_SSL3_KEY_MAT_PARAMS *ckSSL3KeyMatParam; - ckSSL3KeyMatParam = (CK_SSL3_KEY_MAT_PARAMS *)ckMechanism->pParameter; + ckSSL3KeyMatParam = (CK_SSL3_KEY_MAT_PARAMS *)ckpMechanism->pParameter; if (ckSSL3KeyMatParam != NULL_PTR) { - copyBackKeyMatParams(env, ckMechanism, jMechanism, + copyBackKeyMatParams(env, ckpMechanism, jMechanism, &(ckSSL3KeyMatParam->RandomInfo), ckSSL3KeyMatParam->pReturnedKeyMaterial, CLASS_SSL3_KEY_MAT_PARAMS); @@ -1283,13 +1252,13 @@ void ssl3CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, * CKM_TLS12_KEY_AND_MAC_DERIVE mechanism when used for deriving a key. * */ -void tls12CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, +void tls12CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM_PTR ckpMechanism, jobject jMechanism) { CK_TLS12_KEY_MAT_PARAMS *ckTLS12KeyMatParam; - ckTLS12KeyMatParam = (CK_TLS12_KEY_MAT_PARAMS *) ckMechanism->pParameter; + ckTLS12KeyMatParam = (CK_TLS12_KEY_MAT_PARAMS *)ckpMechanism->pParameter; if (ckTLS12KeyMatParam != NULL_PTR) { - copyBackKeyMatParams(env, ckMechanism, jMechanism, + copyBackKeyMatParams(env, ckpMechanism, jMechanism, &(ckTLS12KeyMatParam->RandomInfo), ckTLS12KeyMatParam->pReturnedKeyMaterial, CLASS_TLS12_KEY_MAT_PARAMS); diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_mutex.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_mutex.c index 452b4f5d041..8c1f1fa4afd 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_mutex.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_mutex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -181,7 +181,7 @@ CK_C_INITIALIZE_ARGS_PTR makeCKInitArgsAdapter(JNIEnv *env, jobject jInitArgs) jReserved = (*env)->GetObjectField(env, jInitArgs, fieldID); /* we try to convert the reserved parameter also */ - jObjectToPrimitiveCKObjectPtrPtr(env, jReserved, &(ckpInitArgs->pReserved), &ckReservedLength); + ckpInitArgs->pReserved = jObjectToPrimitiveCKObjectPtr(env, jReserved, &ckReservedLength); return ckpInitArgs ; } diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c index 8fbcde06d44..83bf3936dc8 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -63,31 +63,38 @@ * Parametermapping: *PKCS11* * @param jlong jSessionHandle CK_SESSION_HANDLE hSession * @param jobject jMechanism CK_MECHANISM_PTR pMechanism - * @return jlong jKeyHandle CK_OBJECT_HANDLE hKey + * @param jlong jKeyHandle CK_OBJECT_HANDLE hKey */ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignInit (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, jlong jKeyHandle) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckKeyHandle; CK_RV rv; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return; } + TRACE0("DEBUG: C_SignInit\n"); + ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return; } + ckKeyHandle = jLongToCKULong(jKeyHandle); - rv = (*ckpFunctions->C_SignInit)(ckSessionHandle, &ckMechanism, ckKeyHandle); + rv = (*ckpFunctions->C_SignInit)(ckSessionHandle, ckpMechanism, ckKeyHandle); - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK || + (ckpMechanism->pParameter == NULL)) { + freeCKMechanismPtr(ckpMechanism); + } else { + (*env)->SetLongField(env, jMechanism, mech_pHandleID, (jlong)ckpMechanism); + TRACE1("DEBUG C_SignInit: stored pMech = 0x%lX\n", (jlong)ckpMechanism); } - - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + TRACE0("FINISHED\n"); } #endif @@ -95,7 +102,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignInit /* * Class: sun_security_pkcs11_wrapper_PKCS11 * Method: C_Sign - * Signature: (J[B)[B + * Signature: (J[BI)[B * Parametermapping: *PKCS11* * @param jlong jSessionHandle CK_SESSION_HANDLE hSession * @param jbyteArray jData CK_BYTE_PTR pData @@ -108,69 +115,45 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Sign { CK_SESSION_HANDLE ckSessionHandle; CK_BYTE_PTR ckpData = NULL_PTR; - CK_BYTE_PTR ckpSignature; CK_ULONG ckDataLength; - CK_ULONG ckSignatureLength = 0; + CK_BYTE_PTR bufP; + CK_ULONG ckSignatureLength; + CK_BYTE BUF[MAX_STACK_BUFFER_LEN]; jbyteArray jSignature = NULL; CK_RV rv; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return NULL; } + TRACE0("DEBUG: C_Sign\n"); + ckSessionHandle = jLongToCKULong(jSessionHandle); jByteArrayToCKByteArray(env, jData, &ckpData, &ckDataLength); - if ((*env)->ExceptionCheck(env)) { return NULL; } - - /* START standard code */ - - /* first determine the length of the signature */ - rv = (*ckpFunctions->C_Sign)(ckSessionHandle, ckpData, ckDataLength, NULL_PTR, &ckSignatureLength); - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { - free(ckpData); + if ((*env)->ExceptionCheck(env)) { return NULL; } - ckpSignature = (CK_BYTE_PTR) malloc(ckSignatureLength * sizeof(CK_BYTE)); - if (ckpSignature == NULL) { - free(ckpData); - throwOutOfMemoryError(env, 0); - return NULL; - } + TRACE1("DEBUG C_Sign: data length = %lu\n", ckDataLength); - /* now get the signature */ - rv = (*ckpFunctions->C_Sign)(ckSessionHandle, ckpData, ckDataLength, ckpSignature, &ckSignatureLength); - /* END standard code */ + // unknown signature length + bufP = BUF; + ckSignatureLength = MAX_STACK_BUFFER_LEN; + rv = (*ckpFunctions->C_Sign)(ckSessionHandle, ckpData, ckDataLength, + bufP, &ckSignatureLength); - /* START workaround code for operation abort bug in pkcs#11 of Datakey and iButton */ -/* - ckpSignature = (CK_BYTE_PTR) malloc(256 * sizeof(CK_BYTE)); - if (ckpSignature == NULL) { - free(ckpData); - throwOutOfMemoryError(env, 0); - return NULL; - } - rv = (*ckpFunctions->C_Sign)(ckSessionHandle, ckpData, ckDataLength, ckpSignature, &ckSignatureLength); + TRACE1("DEBUG C_Sign: ret rv=0x%lX\n", rv); - if (rv == CKR_BUFFER_TOO_SMALL) { - free(ckpSignature); - ckpSignature = (CK_BYTE_PTR) malloc(ckSignatureLength * sizeof(CK_BYTE)); - if (ckpSignature == NULL) { - free(ckpData); - throwOutOfMemoryError(env, 0); - return NULL; - } - rv = (*ckpFunctions->C_Sign)(ckSessionHandle, ckpData, ckDataLength, ckpSignature, &ckSignatureLength); - } - */ - /* END workaround code */ if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) { - jSignature = ckByteArrayToJByteArray(env, ckpSignature, ckSignatureLength); + jSignature = ckByteArrayToJByteArray(env, bufP, ckSignatureLength); + TRACE1("DEBUG C_Sign: signature length = %lu\n", ckSignatureLength); } - free(ckpData); - free(ckpSignature); - return jSignature ; + free(ckpData); + if (bufP != BUF) { free(bufP); } + + TRACE0("FINISHED\n"); + return jSignature; } #endif @@ -220,21 +203,20 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignUpdate jsize chunkLen = min(bufLen, jInLen); (*env)->GetByteArrayRegion(env, jIn, jInOfs, chunkLen, (jbyte *)bufP); if ((*env)->ExceptionCheck(env)) { - if (bufP != BUF) { free(bufP); } - return; + goto cleanup; } rv = (*ckpFunctions->C_SignUpdate)(ckSessionHandle, bufP, chunkLen); if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { - if (bufP != BUF) { - free(bufP); - } - return; + goto cleanup; } jInOfs += chunkLen; jInLen -= chunkLen; } +cleanup: if (bufP != BUF) { free(bufP); } + + return; } #endif @@ -294,32 +276,37 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignFina * Parametermapping: *PKCS11* * @param jlong jSessionHandle CK_SESSION_HANDLE hSession * @param jobject jMechanism CK_MECHANISM_PTR pMechanism - * @return jlong jKeyHandle CK_OBJECT_HANDLE hKey + * @param jlong jKeyHandle CK_OBJECT_HANDLE hKey */ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignRecoverInit (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, jlong jKeyHandle) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckKeyHandle; CK_RV rv; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return; } + TRACE0("DEBUG: C_SignRecoverInit\n"); + ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return; } ckKeyHandle = jLongToCKULong(jKeyHandle); - rv = (*ckpFunctions->C_SignRecoverInit)(ckSessionHandle, &ckMechanism, ckKeyHandle); + rv = (*ckpFunctions->C_SignRecoverInit)(ckSessionHandle, ckpMechanism, ckKeyHandle); - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK || + (ckpMechanism->pParameter == NULL)) { + freeCKMechanismPtr(ckpMechanism); + } else { + (*env)->SetLongField(env, jMechanism, mech_pHandleID, (jlong)ckpMechanism); + TRACE1("DEBUG C_SignRecoverInit, stored pMech = 0x%lX\n", (jlong)ckpMechanism); } - - if(ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + TRACE0("FINISHED\n"); } #endif @@ -344,7 +331,7 @@ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignRecover CK_BYTE OUTBUF[MAX_STACK_BUFFER_LEN]; CK_BYTE_PTR inBufP; CK_BYTE_PTR outBufP = OUTBUF; - CK_ULONG ckSignatureLength = MAX_STACK_BUFFER_LEN; + CK_ULONG ckSignatureLength = 0; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return 0; } @@ -353,36 +340,35 @@ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignRecover if (jInLen <= MAX_STACK_BUFFER_LEN) { inBufP = INBUF; + ckSignatureLength = MAX_STACK_BUFFER_LEN; } else { inBufP = (CK_BYTE_PTR) malloc((size_t)jInLen); if (inBufP == NULL) { throwOutOfMemoryError(env, 0); return 0; } + ckSignatureLength = jInLen; } (*env)->GetByteArrayRegion(env, jIn, jInOfs, jInLen, (jbyte *)inBufP); if ((*env)->ExceptionCheck(env)) { - if (inBufP != INBUF) { free(inBufP); } - return 0; + goto cleanup; } + rv = (*ckpFunctions->C_SignRecover)(ckSessionHandle, inBufP, jInLen, outBufP, &ckSignatureLength); /* re-alloc larger buffer if it fits into our Java buffer */ if ((rv == CKR_BUFFER_TOO_SMALL) && (ckSignatureLength <= jIntToCKULong(jOutLen))) { outBufP = (CK_BYTE_PTR) malloc(ckSignatureLength); if (outBufP == NULL) { - if (inBufP != INBUF) { - free(inBufP); - } throwOutOfMemoryError(env, 0); - return 0; + goto cleanup; } rv = (*ckpFunctions->C_SignRecover)(ckSessionHandle, inBufP, jInLen, outBufP, &ckSignatureLength); } if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) { (*env)->SetByteArrayRegion(env, jOut, jOutOfs, ckSignatureLength, (jbyte *)outBufP); } - +cleanup: if (inBufP != INBUF) { free(inBufP); } if (outBufP != OUTBUF) { free(outBufP); } @@ -398,32 +384,39 @@ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignRecover * Parametermapping: *PKCS11* * @param jlong jSessionHandle CK_SESSION_HANDLE hSession * @param jobject jMechanism CK_MECHANISM_PTR pMechanism - * @return jlong jKeyHandle CK_OBJECT_HANDLE hKey + * @param jlong jKeyHandle CK_OBJECT_HANDLE hKey */ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyInit (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, jlong jKeyHandle) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckKeyHandle; CK_RV rv; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return; } + TRACE0("DEBUG: C_VerifyInit\n"); + ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); - if ((*env)->ExceptionCheck(env)) { return; } + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); + if ((*env)->ExceptionCheck(env)) { + return; + } ckKeyHandle = jLongToCKULong(jKeyHandle); - rv = (*ckpFunctions->C_VerifyInit)(ckSessionHandle, &ckMechanism, ckKeyHandle); + rv = (*ckpFunctions->C_VerifyInit)(ckSessionHandle, ckpMechanism, ckKeyHandle); - if(ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK || + (ckpMechanism->pParameter == NULL)) { + freeCKMechanismPtr(ckpMechanism); + } else { + (*env)->SetLongField(env, jMechanism, mech_pHandleID, (jlong)ckpMechanism); + TRACE1("DEBUG C_VerifyInit: stored pMech = 0x%lX\n", (jlong)ckpMechanism); } - - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + TRACE0("FINISHED\n"); } #endif @@ -447,28 +440,31 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Verify CK_BYTE_PTR ckpSignature = NULL_PTR; CK_ULONG ckDataLength; CK_ULONG ckSignatureLength; - CK_RV rv; + CK_RV rv = 0; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return; } ckSessionHandle = jLongToCKULong(jSessionHandle); + jByteArrayToCKByteArray(env, jData, &ckpData, &ckDataLength); - if ((*env)->ExceptionCheck(env)) { return; } + if ((*env)->ExceptionCheck(env)) { + return; + } jByteArrayToCKByteArray(env, jSignature, &ckpSignature, &ckSignatureLength); if ((*env)->ExceptionCheck(env)) { - free(ckpData); - return; + goto cleanup; } /* verify the signature */ rv = (*ckpFunctions->C_Verify)(ckSessionHandle, ckpData, ckDataLength, ckpSignature, ckSignatureLength); +cleanup: free(ckpData); free(ckpSignature); - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + ckAssertReturnValueOK(env, rv); } #endif @@ -510,7 +506,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyUpdate bufP = (CK_BYTE_PTR) malloc((size_t)bufLen); if (bufP == NULL) { throwOutOfMemoryError(env, 0); - return; + goto cleanup; } } @@ -518,19 +514,18 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyUpdate jsize chunkLen = min(bufLen, jInLen); (*env)->GetByteArrayRegion(env, jIn, jInOfs, chunkLen, (jbyte *)bufP); if ((*env)->ExceptionCheck(env)) { - if (bufP != BUF) { free(bufP); } - return; + goto cleanup; } rv = (*ckpFunctions->C_VerifyUpdate)(ckSessionHandle, bufP, chunkLen); if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { - if (bufP != BUF) { free(bufP); } - return; + goto cleanup; } jInOfs += chunkLen; jInLen -= chunkLen; } +cleanup: if (bufP != BUF) { free(bufP); } } #endif @@ -558,14 +553,16 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyFinal ckSessionHandle = jLongToCKULong(jSessionHandle); jByteArrayToCKByteArray(env, jSignature, &ckpSignature, &ckSignatureLength); - if ((*env)->ExceptionCheck(env)) { return; } + if ((*env)->ExceptionCheck(env)) { + return; + } /* verify the signature */ rv = (*ckpFunctions->C_VerifyFinal)(ckSessionHandle, ckpSignature, ckSignatureLength); free(ckpSignature); - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + ckAssertReturnValueOK(env, rv); } #endif @@ -583,26 +580,31 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyRecoverI (JNIEnv *env, jobject obj, jlong jSessionHandle, jobject jMechanism, jlong jKeyHandle) { CK_SESSION_HANDLE ckSessionHandle; - CK_MECHANISM ckMechanism; + CK_MECHANISM_PTR ckpMechanism = NULL; CK_OBJECT_HANDLE ckKeyHandle; CK_RV rv; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return; } + TRACE0("DEBUG: C_VerifyRecoverInit\n"); + ckSessionHandle = jLongToCKULong(jSessionHandle); - jMechanismToCKMechanism(env, jMechanism, &ckMechanism); + ckpMechanism = jMechanismToCKMechanismPtr(env, jMechanism); if ((*env)->ExceptionCheck(env)) { return; } ckKeyHandle = jLongToCKULong(jKeyHandle); - rv = (*ckpFunctions->C_VerifyRecoverInit)(ckSessionHandle, &ckMechanism, ckKeyHandle); + rv = (*ckpFunctions->C_VerifyRecoverInit)(ckSessionHandle, ckpMechanism, ckKeyHandle); - if (ckMechanism.pParameter != NULL_PTR) { - free(ckMechanism.pParameter); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK || + (ckpMechanism->pParameter == NULL)) { + freeCKMechanismPtr(ckpMechanism); + } else { + (*env)->SetLongField(env, jMechanism, mech_pHandleID, (jlong)ckpMechanism); + TRACE1("DEBUG C_VerifyRecoverInit: stored pMech = 0x%lX\n", (jlong)ckpMechanism); } - - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + TRACE0("FINISHED\n"); } #endif @@ -627,7 +629,7 @@ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyRecover CK_BYTE OUTBUF[MAX_STACK_BUFFER_LEN]; CK_BYTE_PTR inBufP; CK_BYTE_PTR outBufP = OUTBUF; - CK_ULONG ckDataLength = MAX_STACK_BUFFER_LEN; + CK_ULONG ckDataLength = 0; CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); if (ckpFunctions == NULL) { return 0; } @@ -636,18 +638,19 @@ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyRecover if (jInLen <= MAX_STACK_BUFFER_LEN) { inBufP = INBUF; + ckDataLength = MAX_STACK_BUFFER_LEN; } else { inBufP = (CK_BYTE_PTR) malloc((size_t)jInLen); if (inBufP == NULL) { throwOutOfMemoryError(env, 0); return 0; } + ckDataLength = jInLen; } (*env)->GetByteArrayRegion(env, jIn, jInOfs, jInLen, (jbyte *)inBufP); if ((*env)->ExceptionCheck(env)) { - if (inBufP != INBUF) { free(inBufP); } - return 0; + goto cleanup; } rv = (*ckpFunctions->C_VerifyRecover)(ckSessionHandle, inBufP, jInLen, outBufP, &ckDataLength); @@ -656,9 +659,8 @@ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyRecover if ((rv == CKR_BUFFER_TOO_SMALL) && (ckDataLength <= jIntToCKULong(jOutLen))) { outBufP = (CK_BYTE_PTR) malloc(ckDataLength); if (outBufP == NULL) { - if (inBufP != INBUF) { free(inBufP); } throwOutOfMemoryError(env, 0); - return 0; + goto cleanup; } rv = (*ckpFunctions->C_VerifyRecover)(ckSessionHandle, inBufP, jInLen, outBufP, &ckDataLength); } @@ -666,6 +668,7 @@ JNIEXPORT jint JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyRecover (*env)->SetByteArrayRegion(env, jOut, jOutOfs, ckDataLength, (jbyte *)outBufP); } +cleanup: if (inBufP != INBUF) { free(inBufP); } if (outBufP != OUTBUF) { free(outBufP); } diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c index 87d34543731..683f2fce2ca 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -277,16 +277,32 @@ void throwDisconnectedRuntimeException(JNIEnv *env) * @param attrPtr pointer to the to-be-freed CK_ATTRIBUTE array. * @param len the length of the array */ -void freeCKAttributeArray(CK_ATTRIBUTE_PTR attrPtr, int len) -{ - int i; - - for (i=0; ipParameter); + free(mechPtr); + } } /* @@ -964,165 +980,164 @@ CK_CHAR_PTR jCharObjectToCKCharPtr(JNIEnv *env, jobject jObject) /* * converts a Java object into a pointer to CK-type or a CK-structure with the length in Bytes. - * The memory of *ckpObjectPtr to be freed after use! This function is only used by - * jAttributeToCKAttribute by now. + * The memory of the returned pointer MUST BE FREED BY CALLER! * * @param env - used to call JNI funktions to get the Java classes and objects * @param jObject - the Java object to convert - * @param ckpObjectPtr - the reference of the new pointer to the new CK-value or CK-structure - * @param ckpLength - the reference of the length in bytes of the new CK-value or CK-structure + * @param ckpLength - pointer to the length (bytes) of the newly-allocated CK-value or CK-structure + * @return ckpObject - pointer to the newly-allocated CK-value or CK-structure */ -void jObjectToPrimitiveCKObjectPtrPtr(JNIEnv *env, jobject jObject, CK_VOID_PTR *ckpObjectPtr, CK_ULONG *ckpLength) +CK_VOID_PTR jObjectToPrimitiveCKObjectPtr(JNIEnv *env, jobject jObject, CK_ULONG *ckpLength) { jclass jLongClass, jBooleanClass, jByteArrayClass, jCharArrayClass; jclass jByteClass, jDateClass, jCharacterClass, jIntegerClass; jclass jBooleanArrayClass, jIntArrayClass, jLongArrayClass; jclass jStringClass; jclass jObjectClass, jClassClass; - CK_VOID_PTR ckpVoid = *ckpObjectPtr; + CK_VOID_PTR ckpObject; jmethodID jMethod; jobject jClassObject; jstring jClassNameString; char *classNameString, *exceptionMsgPrefix, *exceptionMsg; - TRACE0("\nDEBUG: jObjectToPrimitiveCKObjectPtrPtr"); + TRACE0("\nDEBUG: jObjectToPrimitiveCKObjectPtr"); if (jObject == NULL) { - *ckpObjectPtr = NULL; *ckpLength = 0; - return; + return NULL; } jLongClass = (*env)->FindClass(env, "java/lang/Long"); - if (jLongClass == NULL) { return; } + if (jLongClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jLongClass)) { - *ckpObjectPtr = jLongObjectToCKULongPtr(env, jObject); + ckpObject = jLongObjectToCKULongPtr(env, jObject); *ckpLength = sizeof(CK_ULONG); - TRACE1("", *((CK_ULONG *) *ckpObjectPtr)); - return; + TRACE1("", *((CK_ULONG *) ckpObject)); + return ckpObject; } jBooleanClass = (*env)->FindClass(env, "java/lang/Boolean"); - if (jBooleanClass == NULL) { return; } + if (jBooleanClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jBooleanClass)) { - *ckpObjectPtr = jBooleanObjectToCKBBoolPtr(env, jObject); + ckpObject = jBooleanObjectToCKBBoolPtr(env, jObject); *ckpLength = sizeof(CK_BBOOL); TRACE0(" " : "FALSE>"); - return; + TRACE0((*((CK_BBOOL *) ckpObjectPtr) == TRUE) ? "TRUE>" : "FALSE>"); + return ckpObject; } jByteArrayClass = (*env)->FindClass(env, "[B"); - if (jByteArrayClass == NULL) { return; } + if (jByteArrayClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jByteArrayClass)) { - jByteArrayToCKByteArray(env, jObject, (CK_BYTE_PTR*)ckpObjectPtr, ckpLength); - return; + jByteArrayToCKByteArray(env, jObject, (CK_BYTE_PTR*) &ckpObject, ckpLength); + return ckpObject; } jCharArrayClass = (*env)->FindClass(env, "[C"); - if (jCharArrayClass == NULL) { return; } + if (jCharArrayClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jCharArrayClass)) { - jCharArrayToCKUTF8CharArray(env, jObject, (CK_UTF8CHAR_PTR*)ckpObjectPtr, ckpLength); - return; + jCharArrayToCKUTF8CharArray(env, jObject, (CK_UTF8CHAR_PTR*) &ckpObject, ckpLength); + return ckpObject; } jByteClass = (*env)->FindClass(env, "java/lang/Byte"); - if (jByteClass == NULL) { return; } + if (jByteClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jByteClass)) { - *ckpObjectPtr = jByteObjectToCKBytePtr(env, jObject); + ckpObject = jByteObjectToCKBytePtr(env, jObject); *ckpLength = sizeof(CK_BYTE); - TRACE1("", *((CK_BYTE *) *ckpObjectPtr)); - return; + TRACE1("", *((CK_BYTE *) ckpObject)); + return ckpObject; } jDateClass = (*env)->FindClass(env, CLASS_DATE); - if (jDateClass == NULL) { return; } + if (jDateClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jDateClass)) { - *ckpObjectPtr = jDateObjectPtrToCKDatePtr(env, jObject); + ckpObject = jDateObjectPtrToCKDatePtr(env, jObject); *ckpLength = sizeof(CK_DATE); - TRACE3("", (*((CK_DATE *) *ckpObjectPtr)).year, (*((CK_DATE *) *ckpObjectPtr)).month, (*((CK_DATE *) *ckpObjectPtr)).day); - return; + TRACE3("", ((CK_DATE *) ckpObject)->year, + ((CK_DATE *) ckpObject)->month, ((CK_DATE *) ckpObject)->day); + return ckpObject; } jCharacterClass = (*env)->FindClass(env, "java/lang/Character"); - if (jCharacterClass == NULL) { return; } + if (jCharacterClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jCharacterClass)) { - *ckpObjectPtr = jCharObjectToCKCharPtr(env, jObject); + ckpObject = jCharObjectToCKCharPtr(env, jObject); *ckpLength = sizeof(CK_UTF8CHAR); - TRACE1("", *((CK_CHAR *) *ckpObjectPtr)); - return; + TRACE1("", *((CK_CHAR *) ckpObject)); + return ckpObject; } jIntegerClass = (*env)->FindClass(env, "java/lang/Integer"); - if (jIntegerClass == NULL) { return; } + if (jIntegerClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jIntegerClass)) { - *ckpObjectPtr = jIntegerObjectToCKULongPtr(env, jObject); + ckpObject = jIntegerObjectToCKULongPtr(env, jObject); *ckpLength = sizeof(CK_ULONG); - TRACE1("", *((CK_ULONG *) *ckpObjectPtr)); - return; + TRACE1("", *((CK_ULONG *) ckpObject)); + return ckpObject; } jBooleanArrayClass = (*env)->FindClass(env, "[Z"); - if (jBooleanArrayClass == NULL) { return; } + if (jBooleanArrayClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jBooleanArrayClass)) { - jBooleanArrayToCKBBoolArray(env, jObject, (CK_BBOOL**)ckpObjectPtr, ckpLength); - return; + jBooleanArrayToCKBBoolArray(env, jObject, (CK_BBOOL**) &ckpObject, ckpLength); + return ckpObject; } jIntArrayClass = (*env)->FindClass(env, "[I"); - if (jIntArrayClass == NULL) { return; } + if (jIntArrayClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jIntArrayClass)) { - jLongArrayToCKULongArray(env, jObject, (CK_ULONG_PTR*)ckpObjectPtr, ckpLength); - return; + jLongArrayToCKULongArray(env, jObject, (CK_ULONG_PTR*) &ckpObject, ckpLength); + return ckpObject; } jLongArrayClass = (*env)->FindClass(env, "[J"); - if (jLongArrayClass == NULL) { return; } + if (jLongArrayClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jLongArrayClass)) { - jLongArrayToCKULongArray(env, jObject, (CK_ULONG_PTR*)ckpObjectPtr, ckpLength); - return; + jLongArrayToCKULongArray(env, jObject, (CK_ULONG_PTR*) &ckpObject, ckpLength); + return ckpObject; } jStringClass = (*env)->FindClass(env, "java/lang/String"); - if (jStringClass == NULL) { return; } + if (jStringClass == NULL) { return NULL; } if ((*env)->IsInstanceOf(env, jObject, jStringClass)) { - jStringToCKUTF8CharArray(env, jObject, (CK_UTF8CHAR_PTR*)ckpObjectPtr, ckpLength); - return; + jStringToCKUTF8CharArray(env, jObject, (CK_UTF8CHAR_PTR*) &ckpObject, ckpLength); + return ckpObject; } /* type of jObject unknown, throw PKCS11RuntimeException */ jObjectClass = (*env)->FindClass(env, "java/lang/Object"); - if (jObjectClass == NULL) { return; } + if (jObjectClass == NULL) { return NULL; } jMethod = (*env)->GetMethodID(env, jObjectClass, "getClass", "()Ljava/lang/Class;"); - if (jMethod == NULL) { return; } + if (jMethod == NULL) { return NULL; } jClassObject = (*env)->CallObjectMethod(env, jObject, jMethod); assert(jClassObject != 0); jClassClass = (*env)->FindClass(env, "java/lang/Class"); - if (jClassClass == NULL) { return; } + if (jClassClass == NULL) { return NULL; } jMethod = (*env)->GetMethodID(env, jClassClass, "getName", "()Ljava/lang/String;"); - if (jMethod == NULL) { return; } + if (jMethod == NULL) { return NULL; } jClassNameString = (jstring) (*env)->CallObjectMethod(env, jClassObject, jMethod); assert(jClassNameString != 0); classNameString = (char*) (*env)->GetStringUTFChars(env, jClassNameString, NULL); - if (classNameString == NULL) { return; } + if (classNameString == NULL) { return NULL; } exceptionMsgPrefix = "Java object of this class cannot be converted to native PKCS#11 type: "; exceptionMsg = (char *) malloc((strlen(exceptionMsgPrefix) + strlen(classNameString) + 1)); if (exceptionMsg == NULL) { (*env)->ReleaseStringUTFChars(env, jClassNameString, classNameString); throwOutOfMemoryError(env, 0); - return; + return NULL; } strcpy(exceptionMsg, exceptionMsgPrefix); strcat(exceptionMsg, classNameString); (*env)->ReleaseStringUTFChars(env, jClassNameString, classNameString); throwPKCS11RuntimeException(env, exceptionMsg); free(exceptionMsg); - *ckpObjectPtr = NULL; *ckpLength = 0; TRACE0("FINISHED\n"); + return NULL; } #ifdef P11_MEMORYDEBUG diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs-11v2-20a3.h b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs-11v2-20a3.h deleted file mode 100644 index 0486fdf6a63..00000000000 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs-11v2-20a3.h +++ /dev/null @@ -1,124 +0,0 @@ -/* pkcs-11v2-20a3.h include file for the PKCS #11 Version 2.20 Amendment 3 - document. */ - -/* $Revision: 1.4 $ */ - -/* License to copy and use this software is granted provided that it is - * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface - * (Cryptoki) Version 2.20 Amendment 3" in all material mentioning or - * referencing this software. - - * RSA Security Inc. makes no representations concerning either the - * merchantability of this software or the suitability of this software for - * any particular purpose. It is provided "as is" without express or implied - * warranty of any kind. - */ - -/* This file is preferably included after inclusion of pkcs11.h */ - -#ifndef _PKCS_11V2_20A3_H_ -#define _PKCS_11V2_20A3_H_ 1 - -/* Are the definitions of this file already included in pkcs11t.h ? */ -#ifndef CKK_CAMELLIA - -#ifdef __cplusplus -extern "C" { -#endif - -/* Key types */ - -/* Camellia is new for PKCS #11 v2.20 amendment 3 */ -#define CKK_CAMELLIA 0x00000025 -/* ARIA is new for PKCS #11 v2.20 amendment 3 */ -#define CKK_ARIA 0x00000026 - - -/* Mask-generating functions */ - -/* SHA-224 is new for PKCS #11 v2.20 amendment 3 */ -#define CKG_MGF1_SHA224 0x00000005 - - -/* Mechanism Identifiers */ - -/* SHA-224 is new for PKCS #11 v2.20 amendment 3 */ -#define CKM_SHA224 0x00000255 -#define CKM_SHA224_HMAC 0x00000256 -#define CKM_SHA224_HMAC_GENERAL 0x00000257 - -/* SHA-224 key derivation is new for PKCS #11 v2.20 amendment 3 */ -#define CKM_SHA224_KEY_DERIVATION 0x00000396 - -/* SHA-224 RSA mechanisms are new for PKCS #11 v2.20 amendment 3 */ -#define CKM_SHA224_RSA_PKCS 0x00000046 -#define CKM_SHA224_RSA_PKCS_PSS 0x00000047 - -/* AES counter mode is new for PKCS #11 v2.20 amendment 3 */ -#define CKM_AES_CTR 0x00001086 - -/* Camellia is new for PKCS #11 v2.20 amendment 3 */ -#define CKM_CAMELLIA_KEY_GEN 0x00000550 -#define CKM_CAMELLIA_ECB 0x00000551 -#define CKM_CAMELLIA_CBC 0x00000552 -#define CKM_CAMELLIA_MAC 0x00000553 -#define CKM_CAMELLIA_MAC_GENERAL 0x00000554 -#define CKM_CAMELLIA_CBC_PAD 0x00000555 -#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556 -#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557 -#define CKM_CAMELLIA_CTR 0x00000558 - -/* ARIA is new for PKCS #11 v2.20 amendment 3 */ -#define CKM_ARIA_KEY_GEN 0x00000560 -#define CKM_ARIA_ECB 0x00000561 -#define CKM_ARIA_CBC 0x00000562 -#define CKM_ARIA_MAC 0x00000563 -#define CKM_ARIA_MAC_GENERAL 0x00000564 -#define CKM_ARIA_CBC_PAD 0x00000565 -#define CKM_ARIA_ECB_ENCRYPT_DATA 0x00000566 -#define CKM_ARIA_CBC_ENCRYPT_DATA 0x00000567 - - -/* Mechanism parameters */ - -/* CK_AES_CTR_PARAMS is new for PKCS #11 v2.20 amendment 3 */ -typedef struct CK_AES_CTR_PARAMS { - CK_ULONG ulCounterBits; - CK_BYTE cb[16]; -} CK_AES_CTR_PARAMS; - -typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR; - -/* CK_CAMELLIA_CTR_PARAMS is new for PKCS #11 v2.20 amendment 3 */ -typedef struct CK_CAMELLIA_CTR_PARAMS { - CK_ULONG ulCounterBits; - CK_BYTE cb[16]; -} CK_CAMELLIA_CTR_PARAMS; - -typedef CK_CAMELLIA_CTR_PARAMS CK_PTR CK_CAMELLIA_CTR_PARAMS_PTR; - -/* CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS is new for PKCS #11 v2.20 amendment 3 */ -typedef struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { - CK_BYTE iv[16]; - CK_BYTE_PTR pData; - CK_ULONG length; -} CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; - -typedef CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR; - -/* CK_ARIA_CBC_ENCRYPT_DATA_PARAMS is new for PKCS #11 v2.20 amendment 3 */ -typedef struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { - CK_BYTE iv[16]; - CK_BYTE_PTR pData; - CK_ULONG length; -} CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; - -typedef CK_ARIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR; - -#ifdef __cplusplus -} -#endif - -#endif - -#endif diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11.h b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11.h index 37b59030508..6c84c8f3e9d 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11.h +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11.h @@ -1,19 +1,12 @@ -/* pkcs11.h include file for PKCS #11. */ -/* $Revision: 1.4 $ */ +/* Copyright (c) OASIS Open 2016. All Rights Reserved./ + * /Distributed under the terms of the OASIS IPR Policy, + * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY + * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. + */ -/* License to copy and use this software is granted provided that it is - * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface - * (Cryptoki)" in all material mentioning or referencing this software. - - * License is also granted to make and use derivative works provided that - * such works are identified as "derived from the RSA Security Inc. PKCS #11 - * Cryptographic Token Interface (Cryptoki)" in all material mentioning or - * referencing the derived work. - - * RSA Security Inc. makes no representations concerning either the - * merchantability of this software or the suitability of this software for - * any particular purpose. It is provided "as is" without express or implied - * warranty of any kind. +/* Latest version of the specification: + * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html */ #ifndef _PKCS11_H_ @@ -24,14 +17,14 @@ extern "C" { #endif /* Before including this file (pkcs11.h) (or pkcs11t.h by - * itself), 6 platform-specific macros must be defined. These + * itself), 5 platform-specific macros must be defined. These * macros are described below, and typical definitions for them * are also given. Be advised that these definitions can depend * on both the platform and the compiler used (and possibly also * on whether a Cryptoki library is linked statically or * dynamically). * - * In addition to defining these 6 macros, the packing convention + * In addition to defining these 5 macros, the packing convention * for Cryptoki structures should be set. The Cryptoki * convention on packing is that structures should be 1-byte * aligned. @@ -81,39 +74,7 @@ extern "C" { * #define CK_PTR * * * - * 2. CK_DEFINE_FUNCTION(returnType, name): A macro which makes - * an exportable Cryptoki library function definition out of a - * return type and a function name. It should be used in the - * following fashion to define the exposed Cryptoki functions in - * a Cryptoki library: - * - * CK_DEFINE_FUNCTION(CK_RV, C_Initialize)( - * CK_VOID_PTR pReserved - * ) - * { - * ... - * } - * - * If you're using Microsoft Developer Studio 5.0 to define a - * function in a Win32 Cryptoki .dll, it might be defined by: - * - * #define CK_DEFINE_FUNCTION(returnType, name) \ - * returnType __declspec(dllexport) name - * - * If you're using an earlier version of Microsoft Developer - * Studio to define a function in a Win16 Cryptoki .dll, it - * might be defined by: - * - * #define CK_DEFINE_FUNCTION(returnType, name) \ - * returnType __export _far _pascal name - * - * In a UNIX environment, it might be defined by: - * - * #define CK_DEFINE_FUNCTION(returnType, name) \ - * returnType name - * - * - * 3. CK_DECLARE_FUNCTION(returnType, name): A macro which makes + * 2. CK_DECLARE_FUNCTION(returnType, name): A macro which makes * an importable Cryptoki library function declaration out of a * return type and a function name. It should be used in the * following fashion: @@ -141,7 +102,7 @@ extern "C" { * returnType name * * - * 4. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro + * 3. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro * which makes a Cryptoki API function pointer declaration or * function pointer type declaration out of a return type and a * function name. It should be used in the following fashion: @@ -178,7 +139,7 @@ extern "C" { * returnType (* name) * * - * 5. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes + * 4. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes * a function pointer type for an application callback out of * a return type for the callback and a name for the callback. * It should be used in the following fashion: @@ -210,7 +171,7 @@ extern "C" { * returnType (* name) * * - * 6. NULL_PTR: This macro is the value of a NULL pointer. + * 5. NULL_PTR: This macro is the value of a NULL pointer. * * In any ANSI/ISO C environment (and in many others as well), * this should best be defined by @@ -222,7 +183,8 @@ extern "C" { /* All the various Cryptoki types and #define'd values are in the - * file pkcs11t.h. */ + * file pkcs11t.h. + */ #include "pkcs11t.h" #define __PASTE(x,y) x##y @@ -238,7 +200,8 @@ extern "C" { extern CK_DECLARE_FUNCTION(CK_RV, name) /* pkcs11f.h has all the information about the Cryptoki - * function prototypes. */ + * function prototypes. + */ #include "pkcs11f.h" #undef CK_NEED_ARG_LIST @@ -257,7 +220,8 @@ extern "C" { typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, __PASTE(CK_,name)) /* pkcs11f.h has all the information about the Cryptoki - * function prototypes. */ + * function prototypes. + */ #include "pkcs11f.h" #undef CK_NEED_ARG_LIST @@ -282,7 +246,8 @@ struct CK_FUNCTION_LIST { /* Pile all the function pointers into the CK_FUNCTION_LIST. */ /* pkcs11f.h has all the information about the Cryptoki - * function prototypes. */ + * function prototypes. + */ #include "pkcs11f.h" }; @@ -296,4 +261,5 @@ struct CK_FUNCTION_LIST { } #endif -#endif +#endif /* _PKCS11_H_ */ + diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11f.h b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11f.h index bbd957bc17c..87afebf2d44 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11f.h +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11f.h @@ -1,26 +1,20 @@ -/* pkcs11f.h include file for PKCS #11. */ -/* $Revision: 1.4 $ */ - -/* License to copy and use this software is granted provided that it is - * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface - * (Cryptoki)" in all material mentioning or referencing this software. - - * License is also granted to make and use derivative works provided that - * such works are identified as "derived from the RSA Security Inc. PKCS #11 - * Cryptographic Token Interface (Cryptoki)" in all material mentioning or - * referencing the derived work. - - * RSA Security Inc. makes no representations concerning either the - * merchantability of this software or the suitability of this software for - * any particular purpose. It is provided "as is" without express or implied - * warranty of any kind. +/* Copyright (c) OASIS Open 2016. All Rights Reserved./ + * /Distributed under the terms of the OASIS IPR Policy, + * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY + * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. */ -/* This header file contains pretty much everything about all the */ -/* Cryptoki function prototypes. Because this information is */ -/* used for more than just declaring function prototypes, the */ -/* order of the functions appearing herein is important, and */ -/* should not be altered. */ +/* Latest version of the specification: + * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html + */ + +/* This header file contains pretty much everything about all the + * Cryptoki function prototypes. Because this information is + * used for more than just declaring function prototypes, the + * order of the functions appearing herein is important, and + * should not be altered. + */ /* General-purpose */ @@ -30,13 +24,15 @@ CK_PKCS11_FUNCTION_INFO(C_Initialize) ( CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets * cast to CK_C_INITIALIZE_ARGS_PTR - * and dereferenced */ + * and dereferenced + */ ); #endif /* C_Finalize indicates that an application is done with the - * Cryptoki library. */ + * Cryptoki library. + */ CK_PKCS11_FUNCTION_INFO(C_Finalize) #ifdef CK_NEED_ARG_LIST ( @@ -59,7 +55,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetFunctionList) #ifdef CK_NEED_ARG_LIST ( CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to - * function list */ + * function list + */ ); #endif @@ -71,7 +68,7 @@ CK_PKCS11_FUNCTION_INFO(C_GetFunctionList) CK_PKCS11_FUNCTION_INFO(C_GetSlotList) #ifdef CK_NEED_ARG_LIST ( - CK_BBOOL tokenPresent, /* only slots with tokens? */ + CK_BBOOL tokenPresent, /* only slots with tokens */ CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */ CK_ULONG_PTR pulCount /* receives number of slots */ ); @@ -79,7 +76,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetSlotList) /* C_GetSlotInfo obtains information about a particular slot in - * the system. */ + * the system. + */ CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo) #ifdef CK_NEED_ARG_LIST ( @@ -90,7 +88,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo) /* C_GetTokenInfo obtains information about a particular token - * in the system. */ + * in the system. + */ CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo) #ifdef CK_NEED_ARG_LIST ( @@ -101,7 +100,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo) /* C_GetMechanismList obtains a list of mechanism types - * supported by a token. */ + * supported by a token. + */ CK_PKCS11_FUNCTION_INFO(C_GetMechanismList) #ifdef CK_NEED_ARG_LIST ( @@ -113,7 +113,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetMechanismList) /* C_GetMechanismInfo obtains information about a particular - * mechanism possibly supported by a token. */ + * mechanism possibly supported by a token. + */ CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo) #ifdef CK_NEED_ARG_LIST ( @@ -127,7 +128,6 @@ CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo) /* C_InitToken initializes a token. */ CK_PKCS11_FUNCTION_INFO(C_InitToken) #ifdef CK_NEED_ARG_LIST -/* pLabel changed from CK_CHAR_PTR to CK_UTF8CHAR_PTR for v2.10 */ ( CK_SLOT_ID slotID, /* ID of the token's slot */ CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */ @@ -165,7 +165,8 @@ CK_PKCS11_FUNCTION_INFO(C_SetPIN) /* Session management */ /* C_OpenSession opens a session between an application and a - * token. */ + * token. + */ CK_PKCS11_FUNCTION_INFO(C_OpenSession) #ifdef CK_NEED_ARG_LIST ( @@ -179,7 +180,8 @@ CK_PKCS11_FUNCTION_INFO(C_OpenSession) /* C_CloseSession closes a session between an application and a - * token. */ + * token. + */ CK_PKCS11_FUNCTION_INFO(C_CloseSession) #ifdef CK_NEED_ARG_LIST ( @@ -208,7 +210,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetSessionInfo) /* C_GetOperationState obtains the state of the cryptographic operation - * in a session. */ + * in a session. + */ CK_PKCS11_FUNCTION_INFO(C_GetOperationState) #ifdef CK_NEED_ARG_LIST ( @@ -220,7 +223,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetOperationState) /* C_SetOperationState restores the state of the cryptographic - * operation in a session. */ + * operation in a session. + */ CK_PKCS11_FUNCTION_INFO(C_SetOperationState) #ifdef CK_NEED_ARG_LIST ( @@ -270,7 +274,8 @@ CK_PKCS11_FUNCTION_INFO(C_CreateObject) /* C_CopyObject copies an object, creating a new object for the - * copy. */ + * copy. + */ CK_PKCS11_FUNCTION_INFO(C_CopyObject) #ifdef CK_NEED_ARG_LIST ( @@ -305,7 +310,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetObjectSize) /* C_GetAttributeValue obtains the value of one or more object - * attributes. */ + * attributes. + */ CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue) #ifdef CK_NEED_ARG_LIST ( @@ -318,7 +324,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue) /* C_SetAttributeValue modifies the value of one or more object - * attributes */ + * attributes. + */ CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue) #ifdef CK_NEED_ARG_LIST ( @@ -331,7 +338,8 @@ CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue) /* C_FindObjectsInit initializes a search for token and session - * objects that match a template. */ + * objects that match a template. + */ CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit) #ifdef CK_NEED_ARG_LIST ( @@ -344,7 +352,8 @@ CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit) /* C_FindObjects continues a search for token and session * objects that match a template, obtaining additional object - * handles. */ + * handles. + */ CK_PKCS11_FUNCTION_INFO(C_FindObjects) #ifdef CK_NEED_ARG_LIST ( @@ -357,7 +366,8 @@ CK_PKCS11_FUNCTION_INFO(C_FindObjects) /* C_FindObjectsFinal finishes a search for token and session - * objects. */ + * objects. + */ CK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal) #ifdef CK_NEED_ARG_LIST ( @@ -394,7 +404,8 @@ CK_PKCS11_FUNCTION_INFO(C_Encrypt) /* C_EncryptUpdate continues a multiple-part encryption - * operation. */ + * operation. + */ CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -408,7 +419,8 @@ CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate) /* C_EncryptFinal finishes a multiple-part encryption - * operation. */ + * operation. + */ CK_PKCS11_FUNCTION_INFO(C_EncryptFinal) #ifdef CK_NEED_ARG_LIST ( @@ -444,7 +456,8 @@ CK_PKCS11_FUNCTION_INFO(C_Decrypt) /* C_DecryptUpdate continues a multiple-part decryption - * operation. */ + * operation. + */ CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -458,7 +471,8 @@ CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate) /* C_DecryptFinal finishes a multiple-part decryption - * operation. */ + * operation. + */ CK_PKCS11_FUNCTION_INFO(C_DecryptFinal) #ifdef CK_NEED_ARG_LIST ( @@ -496,7 +510,8 @@ CK_PKCS11_FUNCTION_INFO(C_Digest) /* C_DigestUpdate continues a multiple-part message-digesting - * operation. */ + * operation. + */ CK_PKCS11_FUNCTION_INFO(C_DigestUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -509,7 +524,8 @@ CK_PKCS11_FUNCTION_INFO(C_DigestUpdate) /* C_DigestKey continues a multi-part message-digesting * operation, by digesting the value of a secret key as part of - * the data already digested. */ + * the data already digested. + */ CK_PKCS11_FUNCTION_INFO(C_DigestKey) #ifdef CK_NEED_ARG_LIST ( @@ -520,7 +536,8 @@ CK_PKCS11_FUNCTION_INFO(C_DigestKey) /* C_DigestFinal finishes a multiple-part message-digesting - * operation. */ + * operation. + */ CK_PKCS11_FUNCTION_INFO(C_DigestFinal) #ifdef CK_NEED_ARG_LIST ( @@ -537,7 +554,8 @@ CK_PKCS11_FUNCTION_INFO(C_DigestFinal) /* C_SignInit initializes a signature (private key encryption) * operation, where the signature is (will be) an appendix to * the data, and plaintext cannot be recovered from the - *signature. */ + * signature. + */ CK_PKCS11_FUNCTION_INFO(C_SignInit) #ifdef CK_NEED_ARG_LIST ( @@ -550,7 +568,8 @@ CK_PKCS11_FUNCTION_INFO(C_SignInit) /* C_Sign signs (encrypts with private key) data in a single * part, where the signature is (will be) an appendix to the - * data, and plaintext cannot be recovered from the signature. */ + * data, and plaintext cannot be recovered from the signature. + */ CK_PKCS11_FUNCTION_INFO(C_Sign) #ifdef CK_NEED_ARG_LIST ( @@ -565,7 +584,8 @@ CK_PKCS11_FUNCTION_INFO(C_Sign) /* C_SignUpdate continues a multiple-part signature operation, * where the signature is (will be) an appendix to the data, - * and plaintext cannot be recovered from the signature. */ + * and plaintext cannot be recovered from the signature. + */ CK_PKCS11_FUNCTION_INFO(C_SignUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -577,7 +597,8 @@ CK_PKCS11_FUNCTION_INFO(C_SignUpdate) /* C_SignFinal finishes a multiple-part signature operation, - * returning the signature. */ + * returning the signature. + */ CK_PKCS11_FUNCTION_INFO(C_SignFinal) #ifdef CK_NEED_ARG_LIST ( @@ -589,7 +610,8 @@ CK_PKCS11_FUNCTION_INFO(C_SignFinal) /* C_SignRecoverInit initializes a signature operation, where - * the data can be recovered from the signature. */ + * the data can be recovered from the signature. + */ CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit) #ifdef CK_NEED_ARG_LIST ( @@ -601,7 +623,8 @@ CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit) /* C_SignRecover signs data in a single operation, where the - * data can be recovered from the signature. */ + * data can be recovered from the signature. + */ CK_PKCS11_FUNCTION_INFO(C_SignRecover) #ifdef CK_NEED_ARG_LIST ( @@ -619,7 +642,8 @@ CK_PKCS11_FUNCTION_INFO(C_SignRecover) /* C_VerifyInit initializes a verification operation, where the * signature is an appendix to the data, and plaintext cannot - * cannot be recovered from the signature (e.g. DSA). */ + * cannot be recovered from the signature (e.g. DSA). + */ CK_PKCS11_FUNCTION_INFO(C_VerifyInit) #ifdef CK_NEED_ARG_LIST ( @@ -632,7 +656,8 @@ CK_PKCS11_FUNCTION_INFO(C_VerifyInit) /* C_Verify verifies a signature in a single-part operation, * where the signature is an appendix to the data, and plaintext - * cannot be recovered from the signature. */ + * cannot be recovered from the signature. + */ CK_PKCS11_FUNCTION_INFO(C_Verify) #ifdef CK_NEED_ARG_LIST ( @@ -647,7 +672,8 @@ CK_PKCS11_FUNCTION_INFO(C_Verify) /* C_VerifyUpdate continues a multiple-part verification * operation, where the signature is an appendix to the data, - * and plaintext cannot be recovered from the signature. */ + * and plaintext cannot be recovered from the signature. + */ CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -659,7 +685,8 @@ CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate) /* C_VerifyFinal finishes a multiple-part verification - * operation, checking the signature. */ + * operation, checking the signature. + */ CK_PKCS11_FUNCTION_INFO(C_VerifyFinal) #ifdef CK_NEED_ARG_LIST ( @@ -671,7 +698,8 @@ CK_PKCS11_FUNCTION_INFO(C_VerifyFinal) /* C_VerifyRecoverInit initializes a signature verification - * operation, where the data is recovered from the signature. */ + * operation, where the data is recovered from the signature. + */ CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit) #ifdef CK_NEED_ARG_LIST ( @@ -683,7 +711,8 @@ CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit) /* C_VerifyRecover verifies a signature in a single-part - * operation, where the data is recovered from the signature. */ + * operation, where the data is recovered from the signature. + */ CK_PKCS11_FUNCTION_INFO(C_VerifyRecover) #ifdef CK_NEED_ARG_LIST ( @@ -700,7 +729,8 @@ CK_PKCS11_FUNCTION_INFO(C_VerifyRecover) /* Dual-function cryptographic operations */ /* C_DigestEncryptUpdate continues a multiple-part digesting - * and encryption operation. */ + * and encryption operation. + */ CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -714,7 +744,8 @@ CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate) /* C_DecryptDigestUpdate continues a multiple-part decryption and - * digesting operation. */ + * digesting operation. + */ CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -728,7 +759,8 @@ CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate) /* C_SignEncryptUpdate continues a multiple-part signing and - * encryption operation. */ + * encryption operation. + */ CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -742,7 +774,8 @@ CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate) /* C_DecryptVerifyUpdate continues a multiple-part decryption and - * verify operation. */ + * verify operation. + */ CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate) #ifdef CK_NEED_ARG_LIST ( @@ -759,7 +792,8 @@ CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate) /* Key management */ /* C_GenerateKey generates a secret key, creating a new key - * object. */ + * object. + */ CK_PKCS11_FUNCTION_INFO(C_GenerateKey) #ifdef CK_NEED_ARG_LIST ( @@ -773,30 +807,19 @@ CK_PKCS11_FUNCTION_INFO(C_GenerateKey) /* C_GenerateKeyPair generates a public-key/private-key pair, - * creating new key objects. */ + * creating new key objects. + */ CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair) #ifdef CK_NEED_ARG_LIST ( - CK_SESSION_HANDLE hSession, /* session - * handle */ - CK_MECHANISM_PTR pMechanism, /* key-gen - * mech. */ - CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template - * for pub. - * key */ - CK_ULONG ulPublicKeyAttributeCount, /* # pub. - * attrs. */ - CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template - * for priv. - * key */ - CK_ULONG ulPrivateKeyAttributeCount, /* # priv. - * attrs. */ - CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub. - * key - * handle */ - CK_OBJECT_HANDLE_PTR phPrivateKey /* gets - * priv. key - * handle */ + CK_SESSION_HANDLE hSession, /* session handle */ + CK_MECHANISM_PTR pMechanism, /* key-gen mech. */ + CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template for pub. key */ + CK_ULONG ulPublicKeyAttributeCount, /* # pub. attrs. */ + CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template for priv. key */ + CK_ULONG ulPrivateKeyAttributeCount, /* # priv. attrs. */ + CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub. key handle */ + CK_OBJECT_HANDLE_PTR phPrivateKey /* gets priv. key handle */ ); #endif @@ -816,7 +839,8 @@ CK_PKCS11_FUNCTION_INFO(C_WrapKey) /* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new - * key object. */ + * key object. + */ CK_PKCS11_FUNCTION_INFO(C_UnwrapKey) #ifdef CK_NEED_ARG_LIST ( @@ -833,7 +857,8 @@ CK_PKCS11_FUNCTION_INFO(C_UnwrapKey) /* C_DeriveKey derives a key from a base key, creating a new key - * object. */ + * object. + */ CK_PKCS11_FUNCTION_INFO(C_DeriveKey) #ifdef CK_NEED_ARG_LIST ( @@ -851,7 +876,8 @@ CK_PKCS11_FUNCTION_INFO(C_DeriveKey) /* Random number generation */ /* C_SeedRandom mixes additional seed material into the token's - * random number generator. */ + * random number generator. + */ CK_PKCS11_FUNCTION_INFO(C_SeedRandom) #ifdef CK_NEED_ARG_LIST ( @@ -878,7 +904,8 @@ CK_PKCS11_FUNCTION_INFO(C_GenerateRandom) /* C_GetFunctionStatus is a legacy function; it obtains an * updated status of a function running in parallel with an - * application. */ + * application. + */ CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus) #ifdef CK_NEED_ARG_LIST ( @@ -888,7 +915,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus) /* C_CancelFunction is a legacy function; it cancels a function - * running in parallel. */ + * running in parallel. + */ CK_PKCS11_FUNCTION_INFO(C_CancelFunction) #ifdef CK_NEED_ARG_LIST ( @@ -897,11 +925,9 @@ CK_PKCS11_FUNCTION_INFO(C_CancelFunction) #endif - -/* Functions added in for Cryptoki Version 2.01 or later */ - /* C_WaitForSlotEvent waits for a slot event (token insertion, - * removal, etc.) to occur. */ + * removal, etc.) to occur. + */ CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent) #ifdef CK_NEED_ARG_LIST ( @@ -910,3 +936,4 @@ CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent) CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */ ); #endif + diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11t.h b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11t.h index 00174e1a97a..c3c6b96f281 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11t.h +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11t.h @@ -1,36 +1,33 @@ -/* pkcs11t.h include file for PKCS #11. */ -/* $Revision: 1.6 $ */ +/* Copyright (c) OASIS Open 2016. All Rights Reserved./ + * /Distributed under the terms of the OASIS IPR Policy, + * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY + * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. + */ -/* License to copy and use this software is granted provided that it is - * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface - * (Cryptoki)" in all material mentioning or referencing this software. - - * License is also granted to make and use derivative works provided that - * such works are identified as "derived from the RSA Security Inc. PKCS #11 - * Cryptographic Token Interface (Cryptoki)" in all material mentioning or - * referencing the derived work. - - * RSA Security Inc. makes no representations concerning either the - * merchantability of this software or the suitability of this software for - * any particular purpose. It is provided "as is" without express or implied - * warranty of any kind. +/* Latest version of the specification: + * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html */ /* See top of pkcs11.h for information about the macros that * must be defined and the structure-packing conventions that - * must be set before including this file. */ + * must be set before including this file. + */ #ifndef _PKCS11T_H_ #define _PKCS11T_H_ 1 -#define CK_TRUE 1 -#define CK_FALSE 0 +#define CRYPTOKI_VERSION_MAJOR 2 +#define CRYPTOKI_VERSION_MINOR 40 +#define CRYPTOKI_VERSION_AMENDMENT 0 + +#define CK_TRUE 1 +#define CK_FALSE 0 #ifndef CK_DISABLE_TRUE_FALSE #ifndef FALSE #define FALSE CK_FALSE #endif - #ifndef TRUE #define TRUE CK_TRUE #endif @@ -52,7 +49,6 @@ typedef CK_BYTE CK_BBOOL; typedef unsigned long int CK_ULONG; /* a signed value, the same size as a CK_ULONG */ -/* CK_LONG is new for v2.0 */ typedef long int CK_LONG; /* at least 32 bits; each bit is a Boolean flag */ @@ -60,8 +56,8 @@ typedef CK_ULONG CK_FLAGS; /* some special values for certain CK_ULONG variables */ -#define CK_UNAVAILABLE_INFORMATION (~0UL) -#define CK_EFFECTIVELY_INFINITE 0 +#define CK_UNAVAILABLE_INFORMATION (~0UL) +#define CK_EFFECTIVELY_INFINITE 0UL typedef CK_BYTE CK_PTR CK_BYTE_PTR; @@ -74,9 +70,10 @@ typedef void CK_PTR CK_VOID_PTR; typedef CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR; -/* The following value is always invalid if used as a session */ -/* handle or object handle */ -#define CK_INVALID_HANDLE 0 +/* The following value is always invalid if used as a session + * handle or object handle + */ +#define CK_INVALID_HANDLE 0UL typedef struct CK_VERSION { @@ -88,13 +85,9 @@ typedef CK_VERSION CK_PTR CK_VERSION_PTR; typedef struct CK_INFO { - /* manufacturerID and libraryDecription have been changed from - * CK_CHAR to CK_UTF8CHAR for v2.10 */ CK_VERSION cryptokiVersion; /* Cryptoki interface ver */ CK_UTF8CHAR manufacturerID[32]; /* blank padded */ CK_FLAGS flags; /* must be zero */ - - /* libraryDescription and libraryVersion are new for v2.0 */ CK_UTF8CHAR libraryDescription[32]; /* blank padded */ CK_VERSION libraryVersion; /* version of library */ } CK_INFO; @@ -103,12 +96,11 @@ typedef CK_INFO CK_PTR CK_INFO_PTR; /* CK_NOTIFICATION enumerates the types of notifications that - * Cryptoki provides to an application */ -/* CK_NOTIFICATION has been changed from an enum to a CK_ULONG - * for v2.0 */ + * Cryptoki provides to an application + */ typedef CK_ULONG CK_NOTIFICATION; -#define CKN_SURRENDER 0 - +#define CKN_SURRENDER 0UL +#define CKN_OTP_CHANGED 1UL typedef CK_ULONG CK_SLOT_ID; @@ -117,13 +109,10 @@ typedef CK_SLOT_ID CK_PTR CK_SLOT_ID_PTR; /* CK_SLOT_INFO provides information about a slot */ typedef struct CK_SLOT_INFO { - /* slotDescription and manufacturerID have been changed from - * CK_CHAR to CK_UTF8CHAR for v2.10 */ CK_UTF8CHAR slotDescription[64]; /* blank padded */ CK_UTF8CHAR manufacturerID[32]; /* blank padded */ CK_FLAGS flags; - /* hardwareVersion and firmwareVersion are new for v2.0 */ CK_VERSION hardwareVersion; /* version of hardware */ CK_VERSION firmwareVersion; /* version of firmware */ } CK_SLOT_INFO; @@ -131,26 +120,21 @@ typedef struct CK_SLOT_INFO { /* flags: bit flags that provide capabilities of the slot * Bit Flag Mask Meaning */ -#define CKF_TOKEN_PRESENT 0x00000001 /* a token is there */ -#define CKF_REMOVABLE_DEVICE 0x00000002 /* removable devices*/ -#define CKF_HW_SLOT 0x00000004 /* hardware slot */ +#define CKF_TOKEN_PRESENT 0x00000001UL /* a token is there */ +#define CKF_REMOVABLE_DEVICE 0x00000002UL /* removable devices*/ +#define CKF_HW_SLOT 0x00000004UL /* hardware slot */ typedef CK_SLOT_INFO CK_PTR CK_SLOT_INFO_PTR; /* CK_TOKEN_INFO provides information about a token */ typedef struct CK_TOKEN_INFO { - /* label, manufacturerID, and model have been changed from - * CK_CHAR to CK_UTF8CHAR for v2.10 */ CK_UTF8CHAR label[32]; /* blank padded */ CK_UTF8CHAR manufacturerID[32]; /* blank padded */ CK_UTF8CHAR model[16]; /* blank padded */ CK_CHAR serialNumber[16]; /* blank padded */ CK_FLAGS flags; /* see below */ - /* ulMaxSessionCount, ulSessionCount, ulMaxRwSessionCount, - * ulRwSessionCount, ulMaxPinLen, and ulMinPinLen have all been - * changed from CK_USHORT to CK_ULONG for v2.0 */ CK_ULONG ulMaxSessionCount; /* max open sessions */ CK_ULONG ulSessionCount; /* sess. now open */ CK_ULONG ulMaxRwSessionCount; /* max R/W sessions */ @@ -161,9 +145,6 @@ typedef struct CK_TOKEN_INFO { CK_ULONG ulFreePublicMemory; /* in bytes */ CK_ULONG ulTotalPrivateMemory; /* in bytes */ CK_ULONG ulFreePrivateMemory; /* in bytes */ - - /* hardwareVersion, firmwareVersion, and time are new for - * v2.0 */ CK_VERSION hardwareVersion; /* version of hardware */ CK_VERSION firmwareVersion; /* version of firmware */ CK_CHAR utcTime[16]; /* time */ @@ -172,146 +153,149 @@ typedef struct CK_TOKEN_INFO { /* The flags parameter is defined as follows: * Bit Flag Mask Meaning */ -#define CKF_RNG 0x00000001 /* has random # - * generator */ -#define CKF_WRITE_PROTECTED 0x00000002 /* token is - * write- - * protected */ -#define CKF_LOGIN_REQUIRED 0x00000004 /* user must - * login */ -#define CKF_USER_PIN_INITIALIZED 0x00000008 /* normal user's - * PIN is set */ +#define CKF_RNG 0x00000001UL /* has random # generator */ +#define CKF_WRITE_PROTECTED 0x00000002UL /* token is write-protected */ +#define CKF_LOGIN_REQUIRED 0x00000004UL /* user must login */ +#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's PIN is set */ -/* CKF_RESTORE_KEY_NOT_NEEDED is new for v2.0. If it is set, +/* CKF_RESTORE_KEY_NOT_NEEDED. If it is set, * that means that *every* time the state of cryptographic * operations of a session is successfully saved, all keys - * needed to continue those operations are stored in the state */ -#define CKF_RESTORE_KEY_NOT_NEEDED 0x00000020 + * needed to continue those operations are stored in the state + */ +#define CKF_RESTORE_KEY_NOT_NEEDED 0x00000020UL -/* CKF_CLOCK_ON_TOKEN is new for v2.0. If it is set, that means +/* CKF_CLOCK_ON_TOKEN. If it is set, that means * that the token has some sort of clock. The time on that - * clock is returned in the token info structure */ -#define CKF_CLOCK_ON_TOKEN 0x00000040 + * clock is returned in the token info structure + */ +#define CKF_CLOCK_ON_TOKEN 0x00000040UL -/* CKF_PROTECTED_AUTHENTICATION_PATH is new for v2.0. If it is +/* CKF_PROTECTED_AUTHENTICATION_PATH. If it is * set, that means that there is some way for the user to login - * without sending a PIN through the Cryptoki library itself */ -#define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100 + * without sending a PIN through the Cryptoki library itself + */ +#define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100UL -/* CKF_DUAL_CRYPTO_OPERATIONS is new for v2.0. If it is true, +/* CKF_DUAL_CRYPTO_OPERATIONS. If it is true, * that means that a single session with the token can perform * dual simultaneous cryptographic operations (digest and * encrypt; decrypt and digest; sign and encrypt; and decrypt - * and sign) */ -#define CKF_DUAL_CRYPTO_OPERATIONS 0x00000200 + * and sign) + */ +#define CKF_DUAL_CRYPTO_OPERATIONS 0x00000200UL -/* CKF_TOKEN_INITIALIZED if new for v2.10. If it is true, the +/* CKF_TOKEN_INITIALIZED. If it is true, the * token has been initialized using C_InitializeToken or an * equivalent mechanism outside the scope of PKCS #11. * Calling C_InitializeToken when this flag is set will cause - * the token to be reinitialized. */ -#define CKF_TOKEN_INITIALIZED 0x00000400 + * the token to be reinitialized. + */ +#define CKF_TOKEN_INITIALIZED 0x00000400UL -/* CKF_SECONDARY_AUTHENTICATION if new for v2.10. If it is +/* CKF_SECONDARY_AUTHENTICATION. If it is * true, the token supports secondary authentication for - * private key objects. This flag is deprecated in v2.11 and - onwards. */ -#define CKF_SECONDARY_AUTHENTICATION 0x00000800 + * private key objects. + */ +#define CKF_SECONDARY_AUTHENTICATION 0x00000800UL -/* CKF_USER_PIN_COUNT_LOW if new for v2.10. If it is true, an +/* CKF_USER_PIN_COUNT_LOW. If it is true, an * incorrect user login PIN has been entered at least once - * since the last successful authentication. */ -#define CKF_USER_PIN_COUNT_LOW 0x00010000 + * since the last successful authentication. + */ +#define CKF_USER_PIN_COUNT_LOW 0x00010000UL -/* CKF_USER_PIN_FINAL_TRY if new for v2.10. If it is true, - * supplying an incorrect user PIN will it to become locked. */ -#define CKF_USER_PIN_FINAL_TRY 0x00020000 +/* CKF_USER_PIN_FINAL_TRY. If it is true, + * supplying an incorrect user PIN will it to become locked. + */ +#define CKF_USER_PIN_FINAL_TRY 0x00020000UL -/* CKF_USER_PIN_LOCKED if new for v2.10. If it is true, the +/* CKF_USER_PIN_LOCKED. If it is true, the * user PIN has been locked. User login to the token is not - * possible. */ -#define CKF_USER_PIN_LOCKED 0x00040000 + * possible. + */ +#define CKF_USER_PIN_LOCKED 0x00040000UL -/* CKF_USER_PIN_TO_BE_CHANGED if new for v2.10. If it is true, +/* CKF_USER_PIN_TO_BE_CHANGED. If it is true, * the user PIN value is the default value set by token * initialization or manufacturing, or the PIN has been - * expired by the card. */ -#define CKF_USER_PIN_TO_BE_CHANGED 0x00080000 + * expired by the card. + */ +#define CKF_USER_PIN_TO_BE_CHANGED 0x00080000UL -/* CKF_SO_PIN_COUNT_LOW if new for v2.10. If it is true, an +/* CKF_SO_PIN_COUNT_LOW. If it is true, an * incorrect SO login PIN has been entered at least once since - * the last successful authentication. */ -#define CKF_SO_PIN_COUNT_LOW 0x00100000 + * the last successful authentication. + */ +#define CKF_SO_PIN_COUNT_LOW 0x00100000UL -/* CKF_SO_PIN_FINAL_TRY if new for v2.10. If it is true, - * supplying an incorrect SO PIN will it to become locked. */ -#define CKF_SO_PIN_FINAL_TRY 0x00200000 +/* CKF_SO_PIN_FINAL_TRY. If it is true, + * supplying an incorrect SO PIN will it to become locked. + */ +#define CKF_SO_PIN_FINAL_TRY 0x00200000UL -/* CKF_SO_PIN_LOCKED if new for v2.10. If it is true, the SO +/* CKF_SO_PIN_LOCKED. If it is true, the SO * PIN has been locked. SO login to the token is not possible. */ -#define CKF_SO_PIN_LOCKED 0x00400000 +#define CKF_SO_PIN_LOCKED 0x00400000UL -/* CKF_SO_PIN_TO_BE_CHANGED if new for v2.10. If it is true, +/* CKF_SO_PIN_TO_BE_CHANGED. If it is true, * the SO PIN value is the default value set by token * initialization or manufacturing, or the PIN has been - * expired by the card. */ -#define CKF_SO_PIN_TO_BE_CHANGED 0x00800000 + * expired by the card. + */ +#define CKF_SO_PIN_TO_BE_CHANGED 0x00800000UL + +#define CKF_ERROR_STATE 0x01000000UL typedef CK_TOKEN_INFO CK_PTR CK_TOKEN_INFO_PTR; /* CK_SESSION_HANDLE is a Cryptoki-assigned value that - * identifies a session */ + * identifies a session + */ typedef CK_ULONG CK_SESSION_HANDLE; typedef CK_SESSION_HANDLE CK_PTR CK_SESSION_HANDLE_PTR; /* CK_USER_TYPE enumerates the types of Cryptoki users */ -/* CK_USER_TYPE has been changed from an enum to a CK_ULONG for - * v2.0 */ typedef CK_ULONG CK_USER_TYPE; /* Security Officer */ -#define CKU_SO 0 +#define CKU_SO 0UL /* Normal user */ -#define CKU_USER 1 -/* Context specific (added in v2.20) */ -#define CKU_CONTEXT_SPECIFIC 2 +#define CKU_USER 1UL +/* Context specific */ +#define CKU_CONTEXT_SPECIFIC 2UL /* CK_STATE enumerates the session states */ -/* CK_STATE has been changed from an enum to a CK_ULONG for - * v2.0 */ typedef CK_ULONG CK_STATE; -#define CKS_RO_PUBLIC_SESSION 0 -#define CKS_RO_USER_FUNCTIONS 1 -#define CKS_RW_PUBLIC_SESSION 2 -#define CKS_RW_USER_FUNCTIONS 3 -#define CKS_RW_SO_FUNCTIONS 4 - +#define CKS_RO_PUBLIC_SESSION 0UL +#define CKS_RO_USER_FUNCTIONS 1UL +#define CKS_RW_PUBLIC_SESSION 2UL +#define CKS_RW_USER_FUNCTIONS 3UL +#define CKS_RW_SO_FUNCTIONS 4UL /* CK_SESSION_INFO provides information about a session */ typedef struct CK_SESSION_INFO { CK_SLOT_ID slotID; CK_STATE state; CK_FLAGS flags; /* see below */ - - /* ulDeviceError was changed from CK_USHORT to CK_ULONG for - * v2.0 */ CK_ULONG ulDeviceError; /* device-dependent error code */ } CK_SESSION_INFO; /* The flags are defined in the following table: * Bit Flag Mask Meaning */ -#define CKF_RW_SESSION 0x00000002 /* session is r/w */ -#define CKF_SERIAL_SESSION 0x00000004 /* no parallel */ +#define CKF_RW_SESSION 0x00000002UL /* session is r/w */ +#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */ typedef CK_SESSION_INFO CK_PTR CK_SESSION_INFO_PTR; /* CK_OBJECT_HANDLE is a token-specific identifier for an - * object */ + * object + */ typedef CK_ULONG CK_OBJECT_HANDLE; typedef CK_OBJECT_HANDLE CK_PTR CK_OBJECT_HANDLE_PTR; @@ -319,251 +303,273 @@ typedef CK_OBJECT_HANDLE CK_PTR CK_OBJECT_HANDLE_PTR; /* CK_OBJECT_CLASS is a value that identifies the classes (or * types) of objects that Cryptoki recognizes. It is defined - * as follows: */ -/* CK_OBJECT_CLASS was changed from CK_USHORT to CK_ULONG for - * v2.0 */ + * as follows: + */ typedef CK_ULONG CK_OBJECT_CLASS; /* The following classes of objects are defined: */ -/* CKO_HW_FEATURE is new for v2.10 */ -/* CKO_DOMAIN_PARAMETERS is new for v2.11 */ -/* CKO_MECHANISM is new for v2.20 */ -#define CKO_DATA 0x00000000 -#define CKO_CERTIFICATE 0x00000001 -#define CKO_PUBLIC_KEY 0x00000002 -#define CKO_PRIVATE_KEY 0x00000003 -#define CKO_SECRET_KEY 0x00000004 -#define CKO_HW_FEATURE 0x00000005 -#define CKO_DOMAIN_PARAMETERS 0x00000006 -#define CKO_MECHANISM 0x00000007 -#define CKO_VENDOR_DEFINED 0x80000000 +#define CKO_DATA 0x00000000UL +#define CKO_CERTIFICATE 0x00000001UL +#define CKO_PUBLIC_KEY 0x00000002UL +#define CKO_PRIVATE_KEY 0x00000003UL +#define CKO_SECRET_KEY 0x00000004UL +#define CKO_HW_FEATURE 0x00000005UL +#define CKO_DOMAIN_PARAMETERS 0x00000006UL +#define CKO_MECHANISM 0x00000007UL +#define CKO_OTP_KEY 0x00000008UL + +#define CKO_VENDOR_DEFINED 0x80000000UL typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR; -/* CK_HW_FEATURE_TYPE is new for v2.10. CK_HW_FEATURE_TYPE is a - * value that identifies the hardware feature type of an object - * with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. */ +/* CK_HW_FEATURE_TYPE is a value that identifies the hardware feature type + * of an object with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. + */ typedef CK_ULONG CK_HW_FEATURE_TYPE; /* The following hardware feature types are defined */ -/* CKH_USER_INTERFACE is new for v2.20 */ -#define CKH_MONOTONIC_COUNTER 0x00000001 -#define CKH_CLOCK 0x00000002 -#define CKH_USER_INTERFACE 0x00000003 -#define CKH_VENDOR_DEFINED 0x80000000 +#define CKH_MONOTONIC_COUNTER 0x00000001UL +#define CKH_CLOCK 0x00000002UL +#define CKH_USER_INTERFACE 0x00000003UL +#define CKH_VENDOR_DEFINED 0x80000000UL /* CK_KEY_TYPE is a value that identifies a key type */ -/* CK_KEY_TYPE was changed from CK_USHORT to CK_ULONG for v2.0 */ typedef CK_ULONG CK_KEY_TYPE; /* the following key types are defined: */ -#define CKK_RSA 0x00000000 -#define CKK_DSA 0x00000001 -#define CKK_DH 0x00000002 +#define CKK_RSA 0x00000000UL +#define CKK_DSA 0x00000001UL +#define CKK_DH 0x00000002UL +#define CKK_ECDSA 0x00000003UL /* Deprecated */ +#define CKK_EC 0x00000003UL +#define CKK_X9_42_DH 0x00000004UL +#define CKK_KEA 0x00000005UL +#define CKK_GENERIC_SECRET 0x00000010UL +#define CKK_RC2 0x00000011UL +#define CKK_RC4 0x00000012UL +#define CKK_DES 0x00000013UL +#define CKK_DES2 0x00000014UL +#define CKK_DES3 0x00000015UL +#define CKK_CAST 0x00000016UL +#define CKK_CAST3 0x00000017UL +#define CKK_CAST5 0x00000018UL /* Deprecated */ +#define CKK_CAST128 0x00000018UL +#define CKK_RC5 0x00000019UL +#define CKK_IDEA 0x0000001AUL +#define CKK_SKIPJACK 0x0000001BUL +#define CKK_BATON 0x0000001CUL +#define CKK_JUNIPER 0x0000001DUL +#define CKK_CDMF 0x0000001EUL +#define CKK_AES 0x0000001FUL +#define CKK_BLOWFISH 0x00000020UL +#define CKK_TWOFISH 0x00000021UL +#define CKK_SECURID 0x00000022UL +#define CKK_HOTP 0x00000023UL +#define CKK_ACTI 0x00000024UL +#define CKK_CAMELLIA 0x00000025UL +#define CKK_ARIA 0x00000026UL -/* CKK_ECDSA and CKK_KEA are new for v2.0 */ -/* CKK_ECDSA is deprecated in v2.11, CKK_EC is preferred. */ -#define CKK_ECDSA 0x00000003 -#define CKK_EC 0x00000003 -#define CKK_X9_42_DH 0x00000004 -#define CKK_KEA 0x00000005 +#define CKK_MD5_HMAC 0x00000027UL +#define CKK_SHA_1_HMAC 0x00000028UL +#define CKK_RIPEMD128_HMAC 0x00000029UL +#define CKK_RIPEMD160_HMAC 0x0000002AUL +#define CKK_SHA256_HMAC 0x0000002BUL +#define CKK_SHA384_HMAC 0x0000002CUL +#define CKK_SHA512_HMAC 0x0000002DUL +#define CKK_SHA224_HMAC 0x0000002EUL -#define CKK_GENERIC_SECRET 0x00000010 -#define CKK_RC2 0x00000011 -#define CKK_RC4 0x00000012 -#define CKK_DES 0x00000013 -#define CKK_DES2 0x00000014 -#define CKK_DES3 0x00000015 +#define CKK_SEED 0x0000002FUL +#define CKK_GOSTR3410 0x00000030UL +#define CKK_GOSTR3411 0x00000031UL +#define CKK_GOST28147 0x00000032UL -/* all these key types are new for v2.0 */ -#define CKK_CAST 0x00000016 -#define CKK_CAST3 0x00000017 -/* CKK_CAST5 is deprecated in v2.11, CKK_CAST128 is preferred. */ -#define CKK_CAST5 0x00000018 -#define CKK_CAST128 0x00000018 -#define CKK_RC5 0x00000019 -#define CKK_IDEA 0x0000001A -#define CKK_SKIPJACK 0x0000001B -#define CKK_BATON 0x0000001C -#define CKK_JUNIPER 0x0000001D -#define CKK_CDMF 0x0000001E -#define CKK_AES 0x0000001F -/* BlowFish and TwoFish are new for v2.20 */ -#define CKK_BLOWFISH 0x00000020 -#define CKK_TWOFISH 0x00000021 -#define CKK_VENDOR_DEFINED 0x80000000 +#define CKK_VENDOR_DEFINED 0x80000000UL /* CK_CERTIFICATE_TYPE is a value that identifies a certificate - * type */ -/* CK_CERTIFICATE_TYPE was changed from CK_USHORT to CK_ULONG - * for v2.0 */ + * type + */ typedef CK_ULONG CK_CERTIFICATE_TYPE; +#define CK_CERTIFICATE_CATEGORY_UNSPECIFIED 0UL +#define CK_CERTIFICATE_CATEGORY_TOKEN_USER 1UL +#define CK_CERTIFICATE_CATEGORY_AUTHORITY 2UL +#define CK_CERTIFICATE_CATEGORY_OTHER_ENTITY 3UL + +#define CK_SECURITY_DOMAIN_UNSPECIFIED 0UL +#define CK_SECURITY_DOMAIN_MANUFACTURER 1UL +#define CK_SECURITY_DOMAIN_OPERATOR 2UL +#define CK_SECURITY_DOMAIN_THIRD_PARTY 3UL + + /* The following certificate types are defined: */ -/* CKC_X_509_ATTR_CERT is new for v2.10 */ -/* CKC_WTLS is new for v2.20 */ -#define CKC_X_509 0x00000000 -#define CKC_X_509_ATTR_CERT 0x00000001 -#define CKC_WTLS 0x00000002 -#define CKC_VENDOR_DEFINED 0x80000000 +#define CKC_X_509 0x00000000UL +#define CKC_X_509_ATTR_CERT 0x00000001UL +#define CKC_WTLS 0x00000002UL +#define CKC_VENDOR_DEFINED 0x80000000UL /* CK_ATTRIBUTE_TYPE is a value that identifies an attribute - * type */ -/* CK_ATTRIBUTE_TYPE was changed from CK_USHORT to CK_ULONG for - * v2.0 */ + * type + */ typedef CK_ULONG CK_ATTRIBUTE_TYPE; /* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which - consists of an array of values. */ -#define CKF_ARRAY_ATTRIBUTE 0x40000000 + * consists of an array of values. + */ +#define CKF_ARRAY_ATTRIBUTE 0x40000000UL + +/* The following OTP-related defines relate to the CKA_OTP_FORMAT attribute */ +#define CK_OTP_FORMAT_DECIMAL 0UL +#define CK_OTP_FORMAT_HEXADECIMAL 1UL +#define CK_OTP_FORMAT_ALPHANUMERIC 2UL +#define CK_OTP_FORMAT_BINARY 3UL + +/* The following OTP-related defines relate to the CKA_OTP_..._REQUIREMENT + * attributes + */ +#define CK_OTP_PARAM_IGNORED 0UL +#define CK_OTP_PARAM_OPTIONAL 1UL +#define CK_OTP_PARAM_MANDATORY 2UL /* The following attribute types are defined: */ -#define CKA_CLASS 0x00000000 -#define CKA_TOKEN 0x00000001 -#define CKA_PRIVATE 0x00000002 -#define CKA_LABEL 0x00000003 -#define CKA_APPLICATION 0x00000010 -#define CKA_VALUE 0x00000011 +#define CKA_CLASS 0x00000000UL +#define CKA_TOKEN 0x00000001UL +#define CKA_PRIVATE 0x00000002UL +#define CKA_LABEL 0x00000003UL +#define CKA_APPLICATION 0x00000010UL +#define CKA_VALUE 0x00000011UL +#define CKA_OBJECT_ID 0x00000012UL +#define CKA_CERTIFICATE_TYPE 0x00000080UL +#define CKA_ISSUER 0x00000081UL +#define CKA_SERIAL_NUMBER 0x00000082UL +#define CKA_AC_ISSUER 0x00000083UL +#define CKA_OWNER 0x00000084UL +#define CKA_ATTR_TYPES 0x00000085UL +#define CKA_TRUSTED 0x00000086UL +#define CKA_CERTIFICATE_CATEGORY 0x00000087UL +#define CKA_JAVA_MIDP_SECURITY_DOMAIN 0x00000088UL +#define CKA_URL 0x00000089UL +#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY 0x0000008AUL +#define CKA_HASH_OF_ISSUER_PUBLIC_KEY 0x0000008BUL +#define CKA_NAME_HASH_ALGORITHM 0x0000008CUL +#define CKA_CHECK_VALUE 0x00000090UL -/* CKA_OBJECT_ID is new for v2.10 */ -#define CKA_OBJECT_ID 0x00000012 +#define CKA_KEY_TYPE 0x00000100UL +#define CKA_SUBJECT 0x00000101UL +#define CKA_ID 0x00000102UL +#define CKA_SENSITIVE 0x00000103UL +#define CKA_ENCRYPT 0x00000104UL +#define CKA_DECRYPT 0x00000105UL +#define CKA_WRAP 0x00000106UL +#define CKA_UNWRAP 0x00000107UL +#define CKA_SIGN 0x00000108UL +#define CKA_SIGN_RECOVER 0x00000109UL +#define CKA_VERIFY 0x0000010AUL +#define CKA_VERIFY_RECOVER 0x0000010BUL +#define CKA_DERIVE 0x0000010CUL +#define CKA_START_DATE 0x00000110UL +#define CKA_END_DATE 0x00000111UL +#define CKA_MODULUS 0x00000120UL +#define CKA_MODULUS_BITS 0x00000121UL +#define CKA_PUBLIC_EXPONENT 0x00000122UL +#define CKA_PRIVATE_EXPONENT 0x00000123UL +#define CKA_PRIME_1 0x00000124UL +#define CKA_PRIME_2 0x00000125UL +#define CKA_EXPONENT_1 0x00000126UL +#define CKA_EXPONENT_2 0x00000127UL +#define CKA_COEFFICIENT 0x00000128UL +#define CKA_PUBLIC_KEY_INFO 0x00000129UL +#define CKA_PRIME 0x00000130UL +#define CKA_SUBPRIME 0x00000131UL +#define CKA_BASE 0x00000132UL -#define CKA_CERTIFICATE_TYPE 0x00000080 -#define CKA_ISSUER 0x00000081 -#define CKA_SERIAL_NUMBER 0x00000082 - -/* CKA_AC_ISSUER, CKA_OWNER, and CKA_ATTR_TYPES are new - * for v2.10 */ -#define CKA_AC_ISSUER 0x00000083 -#define CKA_OWNER 0x00000084 -#define CKA_ATTR_TYPES 0x00000085 - -/* CKA_TRUSTED is new for v2.11 */ -#define CKA_TRUSTED 0x00000086 - -/* CKA_CERTIFICATE_CATEGORY ... - * CKA_CHECK_VALUE are new for v2.20 */ -#define CKA_CERTIFICATE_CATEGORY 0x00000087 -#define CKA_JAVA_MIDP_SECURITY_DOMAIN 0x00000088 -#define CKA_URL 0x00000089 -#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY 0x0000008A -#define CKA_HASH_OF_ISSUER_PUBLIC_KEY 0x0000008B -#define CKA_CHECK_VALUE 0x00000090 - -#define CKA_KEY_TYPE 0x00000100 -#define CKA_SUBJECT 0x00000101 -#define CKA_ID 0x00000102 -#define CKA_SENSITIVE 0x00000103 -#define CKA_ENCRYPT 0x00000104 -#define CKA_DECRYPT 0x00000105 -#define CKA_WRAP 0x00000106 -#define CKA_UNWRAP 0x00000107 -#define CKA_SIGN 0x00000108 -#define CKA_SIGN_RECOVER 0x00000109 -#define CKA_VERIFY 0x0000010A -#define CKA_VERIFY_RECOVER 0x0000010B -#define CKA_DERIVE 0x0000010C -#define CKA_START_DATE 0x00000110 -#define CKA_END_DATE 0x00000111 -#define CKA_MODULUS 0x00000120 -#define CKA_MODULUS_BITS 0x00000121 -#define CKA_PUBLIC_EXPONENT 0x00000122 -#define CKA_PRIVATE_EXPONENT 0x00000123 -#define CKA_PRIME_1 0x00000124 -#define CKA_PRIME_2 0x00000125 -#define CKA_EXPONENT_1 0x00000126 -#define CKA_EXPONENT_2 0x00000127 -#define CKA_COEFFICIENT 0x00000128 -#define CKA_PRIME 0x00000130 -#define CKA_SUBPRIME 0x00000131 -#define CKA_BASE 0x00000132 - -/* CKA_PRIME_BITS and CKA_SUB_PRIME_BITS are new for v2.11 */ -#define CKA_PRIME_BITS 0x00000133 -#define CKA_SUBPRIME_BITS 0x00000134 +#define CKA_PRIME_BITS 0x00000133UL +#define CKA_SUBPRIME_BITS 0x00000134UL #define CKA_SUB_PRIME_BITS CKA_SUBPRIME_BITS -/* (To retain backwards-compatibility) */ -#define CKA_VALUE_BITS 0x00000160 -#define CKA_VALUE_LEN 0x00000161 +#define CKA_VALUE_BITS 0x00000160UL +#define CKA_VALUE_LEN 0x00000161UL +#define CKA_EXTRACTABLE 0x00000162UL +#define CKA_LOCAL 0x00000163UL +#define CKA_NEVER_EXTRACTABLE 0x00000164UL +#define CKA_ALWAYS_SENSITIVE 0x00000165UL +#define CKA_KEY_GEN_MECHANISM 0x00000166UL -/* CKA_EXTRACTABLE, CKA_LOCAL, CKA_NEVER_EXTRACTABLE, - * CKA_ALWAYS_SENSITIVE, CKA_MODIFIABLE, CKA_ECDSA_PARAMS, - * and CKA_EC_POINT are new for v2.0 */ -#define CKA_EXTRACTABLE 0x00000162 -#define CKA_LOCAL 0x00000163 -#define CKA_NEVER_EXTRACTABLE 0x00000164 -#define CKA_ALWAYS_SENSITIVE 0x00000165 +#define CKA_MODIFIABLE 0x00000170UL +#define CKA_COPYABLE 0x00000171UL -/* CKA_KEY_GEN_MECHANISM is new for v2.11 */ -#define CKA_KEY_GEN_MECHANISM 0x00000166 +#define CKA_DESTROYABLE 0x00000172UL -#define CKA_MODIFIABLE 0x00000170 +#define CKA_ECDSA_PARAMS 0x00000180UL /* Deprecated */ +#define CKA_EC_PARAMS 0x00000180UL -/* CKA_ECDSA_PARAMS is deprecated in v2.11, - * CKA_EC_PARAMS is preferred. */ -#define CKA_ECDSA_PARAMS 0x00000180 -#define CKA_EC_PARAMS 0x00000180 +#define CKA_EC_POINT 0x00000181UL -#define CKA_EC_POINT 0x00000181 +#define CKA_SECONDARY_AUTH 0x00000200UL /* Deprecated */ +#define CKA_AUTH_PIN_FLAGS 0x00000201UL /* Deprecated */ -/* CKA_SECONDARY_AUTH, CKA_AUTH_PIN_FLAGS, - * are new for v2.10. Deprecated in v2.11 and onwards. */ -#define CKA_SECONDARY_AUTH 0x00000200 -#define CKA_AUTH_PIN_FLAGS 0x00000201 +#define CKA_ALWAYS_AUTHENTICATE 0x00000202UL -/* CKA_ALWAYS_AUTHENTICATE ... - * CKA_UNWRAP_TEMPLATE are new for v2.20 */ -#define CKA_ALWAYS_AUTHENTICATE 0x00000202 +#define CKA_WRAP_WITH_TRUSTED 0x00000210UL +#define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000211UL) +#define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000212UL) +#define CKA_DERIVE_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000213UL) -#define CKA_WRAP_WITH_TRUSTED 0x00000210 -#define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000211) -#define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000212) +#define CKA_OTP_FORMAT 0x00000220UL +#define CKA_OTP_LENGTH 0x00000221UL +#define CKA_OTP_TIME_INTERVAL 0x00000222UL +#define CKA_OTP_USER_FRIENDLY_MODE 0x00000223UL +#define CKA_OTP_CHALLENGE_REQUIREMENT 0x00000224UL +#define CKA_OTP_TIME_REQUIREMENT 0x00000225UL +#define CKA_OTP_COUNTER_REQUIREMENT 0x00000226UL +#define CKA_OTP_PIN_REQUIREMENT 0x00000227UL +#define CKA_OTP_COUNTER 0x0000022EUL +#define CKA_OTP_TIME 0x0000022FUL +#define CKA_OTP_USER_IDENTIFIER 0x0000022AUL +#define CKA_OTP_SERVICE_IDENTIFIER 0x0000022BUL +#define CKA_OTP_SERVICE_LOGO 0x0000022CUL +#define CKA_OTP_SERVICE_LOGO_TYPE 0x0000022DUL -/* CKA_HW_FEATURE_TYPE, CKA_RESET_ON_INIT, and CKA_HAS_RESET - * are new for v2.10 */ -#define CKA_HW_FEATURE_TYPE 0x00000300 -#define CKA_RESET_ON_INIT 0x00000301 -#define CKA_HAS_RESET 0x00000302 +#define CKA_GOSTR3410_PARAMS 0x00000250UL +#define CKA_GOSTR3411_PARAMS 0x00000251UL +#define CKA_GOST28147_PARAMS 0x00000252UL -/* The following attributes are new for v2.20 */ -#define CKA_PIXEL_X 0x00000400 -#define CKA_PIXEL_Y 0x00000401 -#define CKA_RESOLUTION 0x00000402 -#define CKA_CHAR_ROWS 0x00000403 -#define CKA_CHAR_COLUMNS 0x00000404 -#define CKA_COLOR 0x00000405 -#define CKA_BITS_PER_PIXEL 0x00000406 -#define CKA_CHAR_SETS 0x00000480 -#define CKA_ENCODING_METHODS 0x00000481 -#define CKA_MIME_TYPES 0x00000482 -#define CKA_MECHANISM_TYPE 0x00000500 -#define CKA_REQUIRED_CMS_ATTRIBUTES 0x00000501 -#define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502 -#define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503 -#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE|0x00000600) +#define CKA_HW_FEATURE_TYPE 0x00000300UL +#define CKA_RESET_ON_INIT 0x00000301UL +#define CKA_HAS_RESET 0x00000302UL -#define CKA_VENDOR_DEFINED 0x80000000 -#define CKA_NETSCAPE_DB 0xD5A0DB00 +#define CKA_PIXEL_X 0x00000400UL +#define CKA_PIXEL_Y 0x00000401UL +#define CKA_RESOLUTION 0x00000402UL +#define CKA_CHAR_ROWS 0x00000403UL +#define CKA_CHAR_COLUMNS 0x00000404UL +#define CKA_COLOR 0x00000405UL +#define CKA_BITS_PER_PIXEL 0x00000406UL +#define CKA_CHAR_SETS 0x00000480UL +#define CKA_ENCODING_METHODS 0x00000481UL +#define CKA_MIME_TYPES 0x00000482UL +#define CKA_MECHANISM_TYPE 0x00000500UL +#define CKA_REQUIRED_CMS_ATTRIBUTES 0x00000501UL +#define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502UL +#define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503UL +#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE|0x00000600UL) +#define CKA_VENDOR_DEFINED 0x80000000UL /* CK_ATTRIBUTE is a structure that includes the type, length - * and value of an attribute */ + * and value of an attribute + */ typedef struct CK_ATTRIBUTE { CK_ATTRIBUTE_TYPE type; CK_VOID_PTR pValue; - - /* ulValueLen went from CK_USHORT to CK_ULONG for v2.0 */ CK_ULONG ulValueLen; /* in bytes */ } CK_ATTRIBUTE; typedef CK_ATTRIBUTE CK_PTR CK_ATTRIBUTE_PTR; - /* CK_DATE is a structure that defines a date */ typedef struct CK_DATE{ CK_CHAR year[4]; /* the year ("1900" - "9999") */ @@ -573,341 +579,411 @@ typedef struct CK_DATE{ /* CK_MECHANISM_TYPE is a value that identifies a mechanism - * type */ -/* CK_MECHANISM_TYPE was changed from CK_USHORT to CK_ULONG for - * v2.0 */ + * type + */ typedef CK_ULONG CK_MECHANISM_TYPE; /* the following mechanism types are defined: */ -#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000 -#define CKM_RSA_PKCS 0x00000001 -#define CKM_RSA_9796 0x00000002 -#define CKM_RSA_X_509 0x00000003 +#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL +#define CKM_RSA_PKCS 0x00000001UL +#define CKM_RSA_9796 0x00000002UL +#define CKM_RSA_X_509 0x00000003UL -/* CKM_MD2_RSA_PKCS, CKM_MD5_RSA_PKCS, and CKM_SHA1_RSA_PKCS - * are new for v2.0. They are mechanisms which hash and sign */ -#define CKM_MD2_RSA_PKCS 0x00000004 -#define CKM_MD5_RSA_PKCS 0x00000005 -#define CKM_SHA1_RSA_PKCS 0x00000006 +#define CKM_MD2_RSA_PKCS 0x00000004UL +#define CKM_MD5_RSA_PKCS 0x00000005UL +#define CKM_SHA1_RSA_PKCS 0x00000006UL -/* CKM_RIPEMD128_RSA_PKCS, CKM_RIPEMD160_RSA_PKCS, and - * CKM_RSA_PKCS_OAEP are new for v2.10 */ -#define CKM_RIPEMD128_RSA_PKCS 0x00000007 -#define CKM_RIPEMD160_RSA_PKCS 0x00000008 -#define CKM_RSA_PKCS_OAEP 0x00000009 +#define CKM_RIPEMD128_RSA_PKCS 0x00000007UL +#define CKM_RIPEMD160_RSA_PKCS 0x00000008UL +#define CKM_RSA_PKCS_OAEP 0x00000009UL -/* CKM_RSA_X9_31_KEY_PAIR_GEN, CKM_RSA_X9_31, CKM_SHA1_RSA_X9_31, - * CKM_RSA_PKCS_PSS, and CKM_SHA1_RSA_PKCS_PSS are new for v2.11 */ -#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000A -#define CKM_RSA_X9_31 0x0000000B -#define CKM_SHA1_RSA_X9_31 0x0000000C -#define CKM_RSA_PKCS_PSS 0x0000000D -#define CKM_SHA1_RSA_PKCS_PSS 0x0000000E +#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000AUL +#define CKM_RSA_X9_31 0x0000000BUL +#define CKM_SHA1_RSA_X9_31 0x0000000CUL +#define CKM_RSA_PKCS_PSS 0x0000000DUL +#define CKM_SHA1_RSA_PKCS_PSS 0x0000000EUL -#define CKM_DSA_KEY_PAIR_GEN 0x00000010 -#define CKM_DSA 0x00000011 -#define CKM_DSA_SHA1 0x00000012 -#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020 -#define CKM_DH_PKCS_DERIVE 0x00000021 +#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL +#define CKM_DSA 0x00000011UL +#define CKM_DSA_SHA1 0x00000012UL +#define CKM_DSA_SHA224 0x00000013UL +#define CKM_DSA_SHA256 0x00000014UL +#define CKM_DSA_SHA384 0x00000015UL +#define CKM_DSA_SHA512 0x00000016UL -/* CKM_X9_42_DH_KEY_PAIR_GEN, CKM_X9_42_DH_DERIVE, - * CKM_X9_42_DH_HYBRID_DERIVE, and CKM_X9_42_MQV_DERIVE are new for - * v2.11 */ -#define CKM_X9_42_DH_KEY_PAIR_GEN 0x00000030 -#define CKM_X9_42_DH_DERIVE 0x00000031 -#define CKM_X9_42_DH_HYBRID_DERIVE 0x00000032 -#define CKM_X9_42_MQV_DERIVE 0x00000033 +#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL +#define CKM_DH_PKCS_DERIVE 0x00000021UL -/* CKM_SHA256/384/512 are new for v2.20 */ -#define CKM_SHA256_RSA_PKCS 0x00000040 -#define CKM_SHA384_RSA_PKCS 0x00000041 -#define CKM_SHA512_RSA_PKCS 0x00000042 -#define CKM_SHA256_RSA_PKCS_PSS 0x00000043 -#define CKM_SHA384_RSA_PKCS_PSS 0x00000044 -#define CKM_SHA512_RSA_PKCS_PSS 0x00000045 +#define CKM_X9_42_DH_KEY_PAIR_GEN 0x00000030UL +#define CKM_X9_42_DH_DERIVE 0x00000031UL +#define CKM_X9_42_DH_HYBRID_DERIVE 0x00000032UL +#define CKM_X9_42_MQV_DERIVE 0x00000033UL -#define CKM_RC2_KEY_GEN 0x00000100 -#define CKM_RC2_ECB 0x00000101 -#define CKM_RC2_CBC 0x00000102 -#define CKM_RC2_MAC 0x00000103 +#define CKM_SHA256_RSA_PKCS 0x00000040UL +#define CKM_SHA384_RSA_PKCS 0x00000041UL +#define CKM_SHA512_RSA_PKCS 0x00000042UL +#define CKM_SHA256_RSA_PKCS_PSS 0x00000043UL +#define CKM_SHA384_RSA_PKCS_PSS 0x00000044UL +#define CKM_SHA512_RSA_PKCS_PSS 0x00000045UL -/* CKM_RC2_MAC_GENERAL and CKM_RC2_CBC_PAD are new for v2.0 */ -#define CKM_RC2_MAC_GENERAL 0x00000104 -#define CKM_RC2_CBC_PAD 0x00000105 +#define CKM_SHA224_RSA_PKCS 0x00000046UL +#define CKM_SHA224_RSA_PKCS_PSS 0x00000047UL -#define CKM_RC4_KEY_GEN 0x00000110 -#define CKM_RC4 0x00000111 -#define CKM_DES_KEY_GEN 0x00000120 -#define CKM_DES_ECB 0x00000121 -#define CKM_DES_CBC 0x00000122 -#define CKM_DES_MAC 0x00000123 +#define CKM_SHA512_224 0x00000048UL +#define CKM_SHA512_224_HMAC 0x00000049UL +#define CKM_SHA512_224_HMAC_GENERAL 0x0000004AUL +#define CKM_SHA512_224_KEY_DERIVATION 0x0000004BUL +#define CKM_SHA512_256 0x0000004CUL +#define CKM_SHA512_256_HMAC 0x0000004DUL +#define CKM_SHA512_256_HMAC_GENERAL 0x0000004EUL +#define CKM_SHA512_256_KEY_DERIVATION 0x0000004FUL -/* CKM_DES_MAC_GENERAL and CKM_DES_CBC_PAD are new for v2.0 */ -#define CKM_DES_MAC_GENERAL 0x00000124 -#define CKM_DES_CBC_PAD 0x00000125 +#define CKM_SHA512_T 0x00000050UL +#define CKM_SHA512_T_HMAC 0x00000051UL +#define CKM_SHA512_T_HMAC_GENERAL 0x00000052UL +#define CKM_SHA512_T_KEY_DERIVATION 0x00000053UL -#define CKM_DES2_KEY_GEN 0x00000130 -#define CKM_DES3_KEY_GEN 0x00000131 -#define CKM_DES3_ECB 0x00000132 -#define CKM_DES3_CBC 0x00000133 -#define CKM_DES3_MAC 0x00000134 +#define CKM_RC2_KEY_GEN 0x00000100UL +#define CKM_RC2_ECB 0x00000101UL +#define CKM_RC2_CBC 0x00000102UL +#define CKM_RC2_MAC 0x00000103UL -/* CKM_DES3_MAC_GENERAL, CKM_DES3_CBC_PAD, CKM_CDMF_KEY_GEN, - * CKM_CDMF_ECB, CKM_CDMF_CBC, CKM_CDMF_MAC, - * CKM_CDMF_MAC_GENERAL, and CKM_CDMF_CBC_PAD are new for v2.0 */ -#define CKM_DES3_MAC_GENERAL 0x00000135 -#define CKM_DES3_CBC_PAD 0x00000136 -#define CKM_CDMF_KEY_GEN 0x00000140 -#define CKM_CDMF_ECB 0x00000141 -#define CKM_CDMF_CBC 0x00000142 -#define CKM_CDMF_MAC 0x00000143 -#define CKM_CDMF_MAC_GENERAL 0x00000144 -#define CKM_CDMF_CBC_PAD 0x00000145 +#define CKM_RC2_MAC_GENERAL 0x00000104UL +#define CKM_RC2_CBC_PAD 0x00000105UL -/* the following four DES mechanisms are new for v2.20 */ -#define CKM_DES_OFB64 0x00000150 -#define CKM_DES_OFB8 0x00000151 -#define CKM_DES_CFB64 0x00000152 -#define CKM_DES_CFB8 0x00000153 +#define CKM_RC4_KEY_GEN 0x00000110UL +#define CKM_RC4 0x00000111UL +#define CKM_DES_KEY_GEN 0x00000120UL +#define CKM_DES_ECB 0x00000121UL +#define CKM_DES_CBC 0x00000122UL +#define CKM_DES_MAC 0x00000123UL -#define CKM_MD2 0x00000200 +#define CKM_DES_MAC_GENERAL 0x00000124UL +#define CKM_DES_CBC_PAD 0x00000125UL -/* CKM_MD2_HMAC and CKM_MD2_HMAC_GENERAL are new for v2.0 */ -#define CKM_MD2_HMAC 0x00000201 -#define CKM_MD2_HMAC_GENERAL 0x00000202 +#define CKM_DES2_KEY_GEN 0x00000130UL +#define CKM_DES3_KEY_GEN 0x00000131UL +#define CKM_DES3_ECB 0x00000132UL +#define CKM_DES3_CBC 0x00000133UL +#define CKM_DES3_MAC 0x00000134UL -#define CKM_MD5 0x00000210 +#define CKM_DES3_MAC_GENERAL 0x00000135UL +#define CKM_DES3_CBC_PAD 0x00000136UL +#define CKM_DES3_CMAC_GENERAL 0x00000137UL +#define CKM_DES3_CMAC 0x00000138UL +#define CKM_CDMF_KEY_GEN 0x00000140UL +#define CKM_CDMF_ECB 0x00000141UL +#define CKM_CDMF_CBC 0x00000142UL +#define CKM_CDMF_MAC 0x00000143UL +#define CKM_CDMF_MAC_GENERAL 0x00000144UL +#define CKM_CDMF_CBC_PAD 0x00000145UL -/* CKM_MD5_HMAC and CKM_MD5_HMAC_GENERAL are new for v2.0 */ -#define CKM_MD5_HMAC 0x00000211 -#define CKM_MD5_HMAC_GENERAL 0x00000212 +#define CKM_DES_OFB64 0x00000150UL +#define CKM_DES_OFB8 0x00000151UL +#define CKM_DES_CFB64 0x00000152UL +#define CKM_DES_CFB8 0x00000153UL -#define CKM_SHA_1 0x00000220 +#define CKM_MD2 0x00000200UL -/* CKM_SHA_1_HMAC and CKM_SHA_1_HMAC_GENERAL are new for v2.0 */ -#define CKM_SHA_1_HMAC 0x00000221 -#define CKM_SHA_1_HMAC_GENERAL 0x00000222 +#define CKM_MD2_HMAC 0x00000201UL +#define CKM_MD2_HMAC_GENERAL 0x00000202UL -/* CKM_RIPEMD128, CKM_RIPEMD128_HMAC, - * CKM_RIPEMD128_HMAC_GENERAL, CKM_RIPEMD160, CKM_RIPEMD160_HMAC, - * and CKM_RIPEMD160_HMAC_GENERAL are new for v2.10 */ -#define CKM_RIPEMD128 0x00000230 -#define CKM_RIPEMD128_HMAC 0x00000231 -#define CKM_RIPEMD128_HMAC_GENERAL 0x00000232 -#define CKM_RIPEMD160 0x00000240 -#define CKM_RIPEMD160_HMAC 0x00000241 -#define CKM_RIPEMD160_HMAC_GENERAL 0x00000242 +#define CKM_MD5 0x00000210UL -/* CKM_SHA256/384/512 are new for v2.20 */ -#define CKM_SHA256 0x00000250 -#define CKM_SHA256_HMAC 0x00000251 -#define CKM_SHA256_HMAC_GENERAL 0x00000252 -#define CKM_SHA384 0x00000260 -#define CKM_SHA384_HMAC 0x00000261 -#define CKM_SHA384_HMAC_GENERAL 0x00000262 -#define CKM_SHA512 0x00000270 -#define CKM_SHA512_HMAC 0x00000271 -#define CKM_SHA512_HMAC_GENERAL 0x00000272 +#define CKM_MD5_HMAC 0x00000211UL +#define CKM_MD5_HMAC_GENERAL 0x00000212UL -/* All of the following mechanisms are new for v2.0 */ +#define CKM_SHA_1 0x00000220UL + +#define CKM_SHA_1_HMAC 0x00000221UL +#define CKM_SHA_1_HMAC_GENERAL 0x00000222UL + +#define CKM_RIPEMD128 0x00000230UL +#define CKM_RIPEMD128_HMAC 0x00000231UL +#define CKM_RIPEMD128_HMAC_GENERAL 0x00000232UL +#define CKM_RIPEMD160 0x00000240UL +#define CKM_RIPEMD160_HMAC 0x00000241UL +#define CKM_RIPEMD160_HMAC_GENERAL 0x00000242UL + +#define CKM_SHA256 0x00000250UL +#define CKM_SHA256_HMAC 0x00000251UL +#define CKM_SHA256_HMAC_GENERAL 0x00000252UL +#define CKM_SHA224 0x00000255UL +#define CKM_SHA224_HMAC 0x00000256UL +#define CKM_SHA224_HMAC_GENERAL 0x00000257UL +#define CKM_SHA384 0x00000260UL +#define CKM_SHA384_HMAC 0x00000261UL +#define CKM_SHA384_HMAC_GENERAL 0x00000262UL +#define CKM_SHA512 0x00000270UL +#define CKM_SHA512_HMAC 0x00000271UL +#define CKM_SHA512_HMAC_GENERAL 0x00000272UL +#define CKM_SECURID_KEY_GEN 0x00000280UL +#define CKM_SECURID 0x00000282UL +#define CKM_HOTP_KEY_GEN 0x00000290UL +#define CKM_HOTP 0x00000291UL +#define CKM_ACTI 0x000002A0UL +#define CKM_ACTI_KEY_GEN 0x000002A1UL + +#define CKM_CAST_KEY_GEN 0x00000300UL +#define CKM_CAST_ECB 0x00000301UL +#define CKM_CAST_CBC 0x00000302UL +#define CKM_CAST_MAC 0x00000303UL +#define CKM_CAST_MAC_GENERAL 0x00000304UL +#define CKM_CAST_CBC_PAD 0x00000305UL +#define CKM_CAST3_KEY_GEN 0x00000310UL +#define CKM_CAST3_ECB 0x00000311UL +#define CKM_CAST3_CBC 0x00000312UL +#define CKM_CAST3_MAC 0x00000313UL +#define CKM_CAST3_MAC_GENERAL 0x00000314UL +#define CKM_CAST3_CBC_PAD 0x00000315UL /* Note that CAST128 and CAST5 are the same algorithm */ -#define CKM_CAST_KEY_GEN 0x00000300 -#define CKM_CAST_ECB 0x00000301 -#define CKM_CAST_CBC 0x00000302 -#define CKM_CAST_MAC 0x00000303 -#define CKM_CAST_MAC_GENERAL 0x00000304 -#define CKM_CAST_CBC_PAD 0x00000305 -#define CKM_CAST3_KEY_GEN 0x00000310 -#define CKM_CAST3_ECB 0x00000311 -#define CKM_CAST3_CBC 0x00000312 -#define CKM_CAST3_MAC 0x00000313 -#define CKM_CAST3_MAC_GENERAL 0x00000314 -#define CKM_CAST3_CBC_PAD 0x00000315 -#define CKM_CAST5_KEY_GEN 0x00000320 -#define CKM_CAST128_KEY_GEN 0x00000320 -#define CKM_CAST5_ECB 0x00000321 -#define CKM_CAST128_ECB 0x00000321 -#define CKM_CAST5_CBC 0x00000322 -#define CKM_CAST128_CBC 0x00000322 -#define CKM_CAST5_MAC 0x00000323 -#define CKM_CAST128_MAC 0x00000323 -#define CKM_CAST5_MAC_GENERAL 0x00000324 -#define CKM_CAST128_MAC_GENERAL 0x00000324 -#define CKM_CAST5_CBC_PAD 0x00000325 -#define CKM_CAST128_CBC_PAD 0x00000325 -#define CKM_RC5_KEY_GEN 0x00000330 -#define CKM_RC5_ECB 0x00000331 -#define CKM_RC5_CBC 0x00000332 -#define CKM_RC5_MAC 0x00000333 -#define CKM_RC5_MAC_GENERAL 0x00000334 -#define CKM_RC5_CBC_PAD 0x00000335 -#define CKM_IDEA_KEY_GEN 0x00000340 -#define CKM_IDEA_ECB 0x00000341 -#define CKM_IDEA_CBC 0x00000342 -#define CKM_IDEA_MAC 0x00000343 -#define CKM_IDEA_MAC_GENERAL 0x00000344 -#define CKM_IDEA_CBC_PAD 0x00000345 -#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350 -#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360 -#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362 -#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363 -#define CKM_XOR_BASE_AND_DATA 0x00000364 -#define CKM_EXTRACT_KEY_FROM_KEY 0x00000365 -#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370 -#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371 -#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372 +#define CKM_CAST5_KEY_GEN 0x00000320UL +#define CKM_CAST128_KEY_GEN 0x00000320UL +#define CKM_CAST5_ECB 0x00000321UL +#define CKM_CAST128_ECB 0x00000321UL +#define CKM_CAST5_CBC 0x00000322UL /* Deprecated */ +#define CKM_CAST128_CBC 0x00000322UL +#define CKM_CAST5_MAC 0x00000323UL /* Deprecated */ +#define CKM_CAST128_MAC 0x00000323UL +#define CKM_CAST5_MAC_GENERAL 0x00000324UL /* Deprecated */ +#define CKM_CAST128_MAC_GENERAL 0x00000324UL +#define CKM_CAST5_CBC_PAD 0x00000325UL /* Deprecated */ +#define CKM_CAST128_CBC_PAD 0x00000325UL +#define CKM_RC5_KEY_GEN 0x00000330UL +#define CKM_RC5_ECB 0x00000331UL +#define CKM_RC5_CBC 0x00000332UL +#define CKM_RC5_MAC 0x00000333UL +#define CKM_RC5_MAC_GENERAL 0x00000334UL +#define CKM_RC5_CBC_PAD 0x00000335UL +#define CKM_IDEA_KEY_GEN 0x00000340UL +#define CKM_IDEA_ECB 0x00000341UL +#define CKM_IDEA_CBC 0x00000342UL +#define CKM_IDEA_MAC 0x00000343UL +#define CKM_IDEA_MAC_GENERAL 0x00000344UL +#define CKM_IDEA_CBC_PAD 0x00000345UL +#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL +#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360UL +#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362UL +#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363UL +#define CKM_XOR_BASE_AND_DATA 0x00000364UL +#define CKM_EXTRACT_KEY_FROM_KEY 0x00000365UL +#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL +#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL +#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL -/* CKM_SSL3_MASTER_KEY_DERIVE_DH, CKM_TLS_PRE_MASTER_KEY_GEN, - * CKM_TLS_MASTER_KEY_DERIVE, CKM_TLS_KEY_AND_MAC_DERIVE, and - * CKM_TLS_MASTER_KEY_DERIVE_DH are new for v2.11 */ -#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373 -#define CKM_TLS_PRE_MASTER_KEY_GEN 0x00000374 -#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375 -#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376 -#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377 +#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL +#define CKM_TLS_PRE_MASTER_KEY_GEN 0x00000374UL +#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL +#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL +#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL -/* CKM_TLS_PRF is new for v2.20 */ -#define CKM_TLS_PRF 0x00000378 +#define CKM_TLS_PRF 0x00000378UL -#define CKM_SSL3_MD5_MAC 0x00000380 -#define CKM_SSL3_SHA1_MAC 0x00000381 -#define CKM_MD5_KEY_DERIVATION 0x00000390 -#define CKM_MD2_KEY_DERIVATION 0x00000391 -#define CKM_SHA1_KEY_DERIVATION 0x00000392 +#define CKM_SSL3_MD5_MAC 0x00000380UL +#define CKM_SSL3_SHA1_MAC 0x00000381UL +#define CKM_MD5_KEY_DERIVATION 0x00000390UL +#define CKM_MD2_KEY_DERIVATION 0x00000391UL +#define CKM_SHA1_KEY_DERIVATION 0x00000392UL -/* CKM_SHA256/384/512 are new for v2.20 */ -#define CKM_SHA256_KEY_DERIVATION 0x00000393 -#define CKM_SHA384_KEY_DERIVATION 0x00000394 -#define CKM_SHA512_KEY_DERIVATION 0x00000395 +#define CKM_SHA256_KEY_DERIVATION 0x00000393UL +#define CKM_SHA384_KEY_DERIVATION 0x00000394UL +#define CKM_SHA512_KEY_DERIVATION 0x00000395UL +#define CKM_SHA224_KEY_DERIVATION 0x00000396UL -#define CKM_PBE_MD2_DES_CBC 0x000003A0 -#define CKM_PBE_MD5_DES_CBC 0x000003A1 -#define CKM_PBE_MD5_CAST_CBC 0x000003A2 -#define CKM_PBE_MD5_CAST3_CBC 0x000003A3 -#define CKM_PBE_MD5_CAST5_CBC 0x000003A4 -#define CKM_PBE_MD5_CAST128_CBC 0x000003A4 -#define CKM_PBE_SHA1_CAST5_CBC 0x000003A5 -#define CKM_PBE_SHA1_CAST128_CBC 0x000003A5 -#define CKM_PBE_SHA1_RC4_128 0x000003A6 -#define CKM_PBE_SHA1_RC4_40 0x000003A7 -#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8 -#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9 -#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AA -#define CKM_PBE_SHA1_RC2_40_CBC 0x000003AB +#define CKM_PBE_MD2_DES_CBC 0x000003A0UL +#define CKM_PBE_MD5_DES_CBC 0x000003A1UL +#define CKM_PBE_MD5_CAST_CBC 0x000003A2UL +#define CKM_PBE_MD5_CAST3_CBC 0x000003A3UL +#define CKM_PBE_MD5_CAST5_CBC 0x000003A4UL /* Deprecated */ +#define CKM_PBE_MD5_CAST128_CBC 0x000003A4UL +#define CKM_PBE_SHA1_CAST5_CBC 0x000003A5UL /* Deprecated */ +#define CKM_PBE_SHA1_CAST128_CBC 0x000003A5UL +#define CKM_PBE_SHA1_RC4_128 0x000003A6UL +#define CKM_PBE_SHA1_RC4_40 0x000003A7UL +#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8UL +#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9UL +#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AAUL +#define CKM_PBE_SHA1_RC2_40_CBC 0x000003ABUL -/* CKM_PKCS5_PBKD2 is new for v2.10 */ -#define CKM_PKCS5_PBKD2 0x000003B0 +#define CKM_PKCS5_PBKD2 0x000003B0UL -#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0 +#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0UL -/* WTLS mechanisms are new for v2.20 */ -#define CKM_WTLS_PRE_MASTER_KEY_GEN 0x000003D0 -#define CKM_WTLS_MASTER_KEY_DERIVE 0x000003D1 -#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC 0x000003D2 -#define CKM_WTLS_PRF 0x000003D3 -#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4 -#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5 +#define CKM_WTLS_PRE_MASTER_KEY_GEN 0x000003D0UL +#define CKM_WTLS_MASTER_KEY_DERIVE 0x000003D1UL +#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC 0x000003D2UL +#define CKM_WTLS_PRF 0x000003D3UL +#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4UL +#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5UL -/* new for v2.40 */ -#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0 -#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1 -#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2 -#define CKM_TLS_MAC 0x000003E4 +#define CKM_TLS10_MAC_SERVER 0x000003D6UL +#define CKM_TLS10_MAC_CLIENT 0x000003D7UL +#define CKM_TLS12_MAC 0x000003D8UL +#define CKM_TLS12_KDF 0x000003D9UL +#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL +#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL +#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL +#define CKM_TLS12_KEY_SAFE_DERIVE 0x000003E3UL +#define CKM_TLS_MAC 0x000003E4UL +#define CKM_TLS_KDF 0x000003E5UL -#define CKM_KEY_WRAP_LYNKS 0x00000400 -#define CKM_KEY_WRAP_SET_OAEP 0x00000401 +#define CKM_KEY_WRAP_LYNKS 0x00000400UL +#define CKM_KEY_WRAP_SET_OAEP 0x00000401UL -/* CKM_CMS_SIG is new for v2.20 */ -#define CKM_CMS_SIG 0x00000500 +#define CKM_CMS_SIG 0x00000500UL +#define CKM_KIP_DERIVE 0x00000510UL +#define CKM_KIP_WRAP 0x00000511UL +#define CKM_KIP_MAC 0x00000512UL -/* Fortezza mechanisms */ -#define CKM_SKIPJACK_KEY_GEN 0x00001000 -#define CKM_SKIPJACK_ECB64 0x00001001 -#define CKM_SKIPJACK_CBC64 0x00001002 -#define CKM_SKIPJACK_OFB64 0x00001003 -#define CKM_SKIPJACK_CFB64 0x00001004 -#define CKM_SKIPJACK_CFB32 0x00001005 -#define CKM_SKIPJACK_CFB16 0x00001006 -#define CKM_SKIPJACK_CFB8 0x00001007 -#define CKM_SKIPJACK_WRAP 0x00001008 -#define CKM_SKIPJACK_PRIVATE_WRAP 0x00001009 -#define CKM_SKIPJACK_RELAYX 0x0000100a -#define CKM_KEA_KEY_PAIR_GEN 0x00001010 -#define CKM_KEA_KEY_DERIVE 0x00001011 -#define CKM_FORTEZZA_TIMESTAMP 0x00001020 -#define CKM_BATON_KEY_GEN 0x00001030 -#define CKM_BATON_ECB128 0x00001031 -#define CKM_BATON_ECB96 0x00001032 -#define CKM_BATON_CBC128 0x00001033 -#define CKM_BATON_COUNTER 0x00001034 -#define CKM_BATON_SHUFFLE 0x00001035 -#define CKM_BATON_WRAP 0x00001036 +#define CKM_CAMELLIA_KEY_GEN 0x00000550UL +#define CKM_CAMELLIA_ECB 0x00000551UL +#define CKM_CAMELLIA_CBC 0x00000552UL +#define CKM_CAMELLIA_MAC 0x00000553UL +#define CKM_CAMELLIA_MAC_GENERAL 0x00000554UL +#define CKM_CAMELLIA_CBC_PAD 0x00000555UL +#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556UL +#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557UL +#define CKM_CAMELLIA_CTR 0x00000558UL -/* CKM_ECDSA_KEY_PAIR_GEN is deprecated in v2.11, - * CKM_EC_KEY_PAIR_GEN is preferred */ -#define CKM_ECDSA_KEY_PAIR_GEN 0x00001040 -#define CKM_EC_KEY_PAIR_GEN 0x00001040 +#define CKM_ARIA_KEY_GEN 0x00000560UL +#define CKM_ARIA_ECB 0x00000561UL +#define CKM_ARIA_CBC 0x00000562UL +#define CKM_ARIA_MAC 0x00000563UL +#define CKM_ARIA_MAC_GENERAL 0x00000564UL +#define CKM_ARIA_CBC_PAD 0x00000565UL +#define CKM_ARIA_ECB_ENCRYPT_DATA 0x00000566UL +#define CKM_ARIA_CBC_ENCRYPT_DATA 0x00000567UL -#define CKM_ECDSA 0x00001041 -#define CKM_ECDSA_SHA1 0x00001042 +#define CKM_SEED_KEY_GEN 0x00000650UL +#define CKM_SEED_ECB 0x00000651UL +#define CKM_SEED_CBC 0x00000652UL +#define CKM_SEED_MAC 0x00000653UL +#define CKM_SEED_MAC_GENERAL 0x00000654UL +#define CKM_SEED_CBC_PAD 0x00000655UL +#define CKM_SEED_ECB_ENCRYPT_DATA 0x00000656UL +#define CKM_SEED_CBC_ENCRYPT_DATA 0x00000657UL -/* CKM_ECDH1_DERIVE, CKM_ECDH1_COFACTOR_DERIVE, and CKM_ECMQV_DERIVE - * are new for v2.11 */ -#define CKM_ECDH1_DERIVE 0x00001050 -#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051 -#define CKM_ECMQV_DERIVE 0x00001052 +#define CKM_SKIPJACK_KEY_GEN 0x00001000UL +#define CKM_SKIPJACK_ECB64 0x00001001UL +#define CKM_SKIPJACK_CBC64 0x00001002UL +#define CKM_SKIPJACK_OFB64 0x00001003UL +#define CKM_SKIPJACK_CFB64 0x00001004UL +#define CKM_SKIPJACK_CFB32 0x00001005UL +#define CKM_SKIPJACK_CFB16 0x00001006UL +#define CKM_SKIPJACK_CFB8 0x00001007UL +#define CKM_SKIPJACK_WRAP 0x00001008UL +#define CKM_SKIPJACK_PRIVATE_WRAP 0x00001009UL +#define CKM_SKIPJACK_RELAYX 0x0000100aUL +#define CKM_KEA_KEY_PAIR_GEN 0x00001010UL +#define CKM_KEA_KEY_DERIVE 0x00001011UL +#define CKM_KEA_DERIVE 0x00001012UL +#define CKM_FORTEZZA_TIMESTAMP 0x00001020UL +#define CKM_BATON_KEY_GEN 0x00001030UL +#define CKM_BATON_ECB128 0x00001031UL +#define CKM_BATON_ECB96 0x00001032UL +#define CKM_BATON_CBC128 0x00001033UL +#define CKM_BATON_COUNTER 0x00001034UL +#define CKM_BATON_SHUFFLE 0x00001035UL +#define CKM_BATON_WRAP 0x00001036UL -#define CKM_JUNIPER_KEY_GEN 0x00001060 -#define CKM_JUNIPER_ECB128 0x00001061 -#define CKM_JUNIPER_CBC128 0x00001062 -#define CKM_JUNIPER_COUNTER 0x00001063 -#define CKM_JUNIPER_SHUFFLE 0x00001064 -#define CKM_JUNIPER_WRAP 0x00001065 -#define CKM_FASTHASH 0x00001070 +#define CKM_ECDSA_KEY_PAIR_GEN 0x00001040UL /* Deprecated */ +#define CKM_EC_KEY_PAIR_GEN 0x00001040UL -/* CKM_AES_KEY_GEN, CKM_AES_ECB, CKM_AES_CBC, CKM_AES_MAC, - * CKM_AES_MAC_GENERAL, CKM_AES_CBC_PAD, CKM_DSA_PARAMETER_GEN, - * CKM_DH_PKCS_PARAMETER_GEN, and CKM_X9_42_DH_PARAMETER_GEN are - * new for v2.11 */ -#define CKM_AES_KEY_GEN 0x00001080 -#define CKM_AES_ECB 0x00001081 -#define CKM_AES_CBC 0x00001082 -#define CKM_AES_MAC 0x00001083 -#define CKM_AES_MAC_GENERAL 0x00001084 -#define CKM_AES_CBC_PAD 0x00001085 +#define CKM_ECDSA 0x00001041UL +#define CKM_ECDSA_SHA1 0x00001042UL +#define CKM_ECDSA_SHA224 0x00001043UL +#define CKM_ECDSA_SHA256 0x00001044UL +#define CKM_ECDSA_SHA384 0x00001045UL +#define CKM_ECDSA_SHA512 0x00001046UL -/* BlowFish and TwoFish are new for v2.20 */ -#define CKM_BLOWFISH_KEY_GEN 0x00001090 -#define CKM_BLOWFISH_CBC 0x00001091 -#define CKM_TWOFISH_KEY_GEN 0x00001092 -#define CKM_TWOFISH_CBC 0x00001093 +#define CKM_ECDH1_DERIVE 0x00001050UL +#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL +#define CKM_ECMQV_DERIVE 0x00001052UL +#define CKM_ECDH_AES_KEY_WRAP 0x00001053UL +#define CKM_RSA_AES_KEY_WRAP 0x00001054UL -/* CKM_xxx_ENCRYPT_DATA mechanisms are new for v2.20 */ -#define CKM_DES_ECB_ENCRYPT_DATA 0x00001100 -#define CKM_DES_CBC_ENCRYPT_DATA 0x00001101 -#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102 -#define CKM_DES3_CBC_ENCRYPT_DATA 0x00001103 -#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104 -#define CKM_AES_CBC_ENCRYPT_DATA 0x00001105 +#define CKM_JUNIPER_KEY_GEN 0x00001060UL +#define CKM_JUNIPER_ECB128 0x00001061UL +#define CKM_JUNIPER_CBC128 0x00001062UL +#define CKM_JUNIPER_COUNTER 0x00001063UL +#define CKM_JUNIPER_SHUFFLE 0x00001064UL +#define CKM_JUNIPER_WRAP 0x00001065UL +#define CKM_FASTHASH 0x00001070UL -#define CKM_DSA_PARAMETER_GEN 0x00002000 -#define CKM_DH_PKCS_PARAMETER_GEN 0x00002001 -#define CKM_X9_42_DH_PARAMETER_GEN 0x00002002 +#define CKM_AES_KEY_GEN 0x00001080UL +#define CKM_AES_ECB 0x00001081UL +#define CKM_AES_CBC 0x00001082UL +#define CKM_AES_MAC 0x00001083UL +#define CKM_AES_MAC_GENERAL 0x00001084UL +#define CKM_AES_CBC_PAD 0x00001085UL +#define CKM_AES_CTR 0x00001086UL +#define CKM_AES_GCM 0x00001087UL +#define CKM_AES_CCM 0x00001088UL +#define CKM_AES_CTS 0x00001089UL +#define CKM_AES_CMAC 0x0000108AUL +#define CKM_AES_CMAC_GENERAL 0x0000108BUL -#define CKM_VENDOR_DEFINED 0x80000000 +#define CKM_AES_XCBC_MAC 0x0000108CUL +#define CKM_AES_XCBC_MAC_96 0x0000108DUL +#define CKM_AES_GMAC 0x0000108EUL + +#define CKM_BLOWFISH_KEY_GEN 0x00001090UL +#define CKM_BLOWFISH_CBC 0x00001091UL +#define CKM_TWOFISH_KEY_GEN 0x00001092UL +#define CKM_TWOFISH_CBC 0x00001093UL +#define CKM_BLOWFISH_CBC_PAD 0x00001094UL +#define CKM_TWOFISH_CBC_PAD 0x00001095UL + +#define CKM_DES_ECB_ENCRYPT_DATA 0x00001100UL +#define CKM_DES_CBC_ENCRYPT_DATA 0x00001101UL +#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102UL +#define CKM_DES3_CBC_ENCRYPT_DATA 0x00001103UL +#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104UL +#define CKM_AES_CBC_ENCRYPT_DATA 0x00001105UL + +#define CKM_GOSTR3410_KEY_PAIR_GEN 0x00001200UL +#define CKM_GOSTR3410 0x00001201UL +#define CKM_GOSTR3410_WITH_GOSTR3411 0x00001202UL +#define CKM_GOSTR3410_KEY_WRAP 0x00001203UL +#define CKM_GOSTR3410_DERIVE 0x00001204UL +#define CKM_GOSTR3411 0x00001210UL +#define CKM_GOSTR3411_HMAC 0x00001211UL +#define CKM_GOST28147_KEY_GEN 0x00001220UL +#define CKM_GOST28147_ECB 0x00001221UL +#define CKM_GOST28147 0x00001222UL +#define CKM_GOST28147_MAC 0x00001223UL +#define CKM_GOST28147_KEY_WRAP 0x00001224UL + +#define CKM_DSA_PARAMETER_GEN 0x00002000UL +#define CKM_DH_PKCS_PARAMETER_GEN 0x00002001UL +#define CKM_X9_42_DH_PARAMETER_GEN 0x00002002UL +#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN 0x00002003UL +#define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN 0x00002004UL + +#define CKM_AES_OFB 0x00002104UL +#define CKM_AES_CFB64 0x00002105UL +#define CKM_AES_CFB8 0x00002106UL +#define CKM_AES_CFB128 0x00002107UL + +#define CKM_AES_CFB1 0x00002108UL +#define CKM_AES_KEY_WRAP 0x00002109UL /* WAS: 0x00001090 */ +#define CKM_AES_KEY_WRAP_PAD 0x0000210AUL /* WAS: 0x00001091 */ + +#define CKM_RSA_PKCS_TPM_1_1 0x00004001UL +#define CKM_RSA_PKCS_OAEP_TPM_1_1 0x00004002UL + +#define CKM_VENDOR_DEFINED 0x80000000UL typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR; /* CK_MECHANISM is a structure that specifies a particular - * mechanism */ + * mechanism + */ typedef struct CK_MECHANISM { CK_MECHANISM_TYPE mechanism; CK_VOID_PTR pParameter; - - /* ulParameterLen was changed from CK_USHORT to CK_ULONG for - * v2.0 */ CK_ULONG ulParameterLen; /* in bytes */ } CK_MECHANISM; @@ -915,7 +991,8 @@ typedef CK_MECHANISM CK_PTR CK_MECHANISM_PTR; /* CK_MECHANISM_INFO provides information about a particular - * mechanism */ + * mechanism + */ typedef struct CK_MECHANISM_INFO { CK_ULONG ulMinKeySize; CK_ULONG ulMaxKeySize; @@ -923,179 +1000,163 @@ typedef struct CK_MECHANISM_INFO { } CK_MECHANISM_INFO; /* The flags are defined as follows: - * Bit Flag Mask Meaning */ -#define CKF_HW 0x00000001 /* performed by HW */ + * Bit Flag Mask Meaning */ +#define CKF_HW 0x00000001UL /* performed by HW */ -/* The flags CKF_ENCRYPT, CKF_DECRYPT, CKF_DIGEST, CKF_SIGN, - * CKG_SIGN_RECOVER, CKF_VERIFY, CKF_VERIFY_RECOVER, - * CKF_GENERATE, CKF_GENERATE_KEY_PAIR, CKF_WRAP, CKF_UNWRAP, - * and CKF_DERIVE are new for v2.0. They specify whether or not - * a mechanism can be used for a particular task */ -#define CKF_ENCRYPT 0x00000100 -#define CKF_DECRYPT 0x00000200 -#define CKF_DIGEST 0x00000400 -#define CKF_SIGN 0x00000800 -#define CKF_SIGN_RECOVER 0x00001000 -#define CKF_VERIFY 0x00002000 -#define CKF_VERIFY_RECOVER 0x00004000 -#define CKF_GENERATE 0x00008000 -#define CKF_GENERATE_KEY_PAIR 0x00010000 -#define CKF_WRAP 0x00020000 -#define CKF_UNWRAP 0x00040000 -#define CKF_DERIVE 0x00080000 +/* Specify whether or not a mechanism can be used for a particular task */ +#define CKF_ENCRYPT 0x00000100UL +#define CKF_DECRYPT 0x00000200UL +#define CKF_DIGEST 0x00000400UL +#define CKF_SIGN 0x00000800UL +#define CKF_SIGN_RECOVER 0x00001000UL +#define CKF_VERIFY 0x00002000UL +#define CKF_VERIFY_RECOVER 0x00004000UL +#define CKF_GENERATE 0x00008000UL +#define CKF_GENERATE_KEY_PAIR 0x00010000UL +#define CKF_WRAP 0x00020000UL +#define CKF_UNWRAP 0x00040000UL +#define CKF_DERIVE 0x00080000UL -/* CKF_EC_F_P, CKF_EC_F_2M, CKF_EC_ECPARAMETERS, CKF_EC_NAMEDCURVE, - * CKF_EC_UNCOMPRESS, and CKF_EC_COMPRESS are new for v2.11. They - * describe a token's EC capabilities not available in mechanism - * information. */ -#define CKF_EC_F_P 0x00100000 -#define CKF_EC_F_2M 0x00200000 -#define CKF_EC_ECPARAMETERS 0x00400000 -#define CKF_EC_NAMEDCURVE 0x00800000 -#define CKF_EC_UNCOMPRESS 0x01000000 -#define CKF_EC_COMPRESS 0x02000000 +/* Describe a token's EC capabilities not available in mechanism + * information. + */ +#define CKF_EC_F_P 0x00100000UL +#define CKF_EC_F_2M 0x00200000UL +#define CKF_EC_ECPARAMETERS 0x00400000UL +#define CKF_EC_NAMEDCURVE 0x00800000UL +#define CKF_EC_UNCOMPRESS 0x01000000UL +#define CKF_EC_COMPRESS 0x02000000UL -#define CKF_EXTENSION 0x80000000 /* FALSE for this version */ +#define CKF_EXTENSION 0x80000000UL typedef CK_MECHANISM_INFO CK_PTR CK_MECHANISM_INFO_PTR; - /* CK_RV is a value that identifies the return value of a - * Cryptoki function */ -/* CK_RV was changed from CK_USHORT to CK_ULONG for v2.0 */ + * Cryptoki function + */ typedef CK_ULONG CK_RV; -#define CKR_OK 0x00000000 -#define CKR_CANCEL 0x00000001 -#define CKR_HOST_MEMORY 0x00000002 -#define CKR_SLOT_ID_INVALID 0x00000003 +#define CKR_OK 0x00000000UL +#define CKR_CANCEL 0x00000001UL +#define CKR_HOST_MEMORY 0x00000002UL +#define CKR_SLOT_ID_INVALID 0x00000003UL -/* CKR_FLAGS_INVALID was removed for v2.0 */ +#define CKR_GENERAL_ERROR 0x00000005UL +#define CKR_FUNCTION_FAILED 0x00000006UL -/* CKR_GENERAL_ERROR and CKR_FUNCTION_FAILED are new for v2.0 */ -#define CKR_GENERAL_ERROR 0x00000005 -#define CKR_FUNCTION_FAILED 0x00000006 +#define CKR_ARGUMENTS_BAD 0x00000007UL +#define CKR_NO_EVENT 0x00000008UL +#define CKR_NEED_TO_CREATE_THREADS 0x00000009UL +#define CKR_CANT_LOCK 0x0000000AUL -/* CKR_ARGUMENTS_BAD, CKR_NO_EVENT, CKR_NEED_TO_CREATE_THREADS, - * and CKR_CANT_LOCK are new for v2.01 */ -#define CKR_ARGUMENTS_BAD 0x00000007 -#define CKR_NO_EVENT 0x00000008 -#define CKR_NEED_TO_CREATE_THREADS 0x00000009 -#define CKR_CANT_LOCK 0x0000000A +#define CKR_ATTRIBUTE_READ_ONLY 0x00000010UL +#define CKR_ATTRIBUTE_SENSITIVE 0x00000011UL +#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012UL +#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL -#define CKR_ATTRIBUTE_READ_ONLY 0x00000010 -#define CKR_ATTRIBUTE_SENSITIVE 0x00000011 -#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012 -#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013 -#define CKR_DATA_INVALID 0x00000020 -#define CKR_DATA_LEN_RANGE 0x00000021 -#define CKR_DEVICE_ERROR 0x00000030 -#define CKR_DEVICE_MEMORY 0x00000031 -#define CKR_DEVICE_REMOVED 0x00000032 -#define CKR_ENCRYPTED_DATA_INVALID 0x00000040 -#define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041 -#define CKR_FUNCTION_CANCELED 0x00000050 -#define CKR_FUNCTION_NOT_PARALLEL 0x00000051 +#define CKR_ACTION_PROHIBITED 0x0000001BUL -/* CKR_FUNCTION_NOT_SUPPORTED is new for v2.0 */ -#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054 +#define CKR_DATA_INVALID 0x00000020UL +#define CKR_DATA_LEN_RANGE 0x00000021UL +#define CKR_DEVICE_ERROR 0x00000030UL +#define CKR_DEVICE_MEMORY 0x00000031UL +#define CKR_DEVICE_REMOVED 0x00000032UL +#define CKR_ENCRYPTED_DATA_INVALID 0x00000040UL +#define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041UL +#define CKR_FUNCTION_CANCELED 0x00000050UL +#define CKR_FUNCTION_NOT_PARALLEL 0x00000051UL -#define CKR_KEY_HANDLE_INVALID 0x00000060 +#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL -/* CKR_KEY_SENSITIVE was removed for v2.0 */ +#define CKR_KEY_HANDLE_INVALID 0x00000060UL -#define CKR_KEY_SIZE_RANGE 0x00000062 -#define CKR_KEY_TYPE_INCONSISTENT 0x00000063 +#define CKR_KEY_SIZE_RANGE 0x00000062UL +#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL -/* CKR_KEY_NOT_NEEDED, CKR_KEY_CHANGED, CKR_KEY_NEEDED, - * CKR_KEY_INDIGESTIBLE, CKR_KEY_FUNCTION_NOT_PERMITTED, - * CKR_KEY_NOT_WRAPPABLE, and CKR_KEY_UNEXTRACTABLE are new for - * v2.0 */ -#define CKR_KEY_NOT_NEEDED 0x00000064 -#define CKR_KEY_CHANGED 0x00000065 -#define CKR_KEY_NEEDED 0x00000066 -#define CKR_KEY_INDIGESTIBLE 0x00000067 -#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068 -#define CKR_KEY_NOT_WRAPPABLE 0x00000069 -#define CKR_KEY_UNEXTRACTABLE 0x0000006A +#define CKR_KEY_NOT_NEEDED 0x00000064UL +#define CKR_KEY_CHANGED 0x00000065UL +#define CKR_KEY_NEEDED 0x00000066UL +#define CKR_KEY_INDIGESTIBLE 0x00000067UL +#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL +#define CKR_KEY_NOT_WRAPPABLE 0x00000069UL +#define CKR_KEY_UNEXTRACTABLE 0x0000006AUL -#define CKR_MECHANISM_INVALID 0x00000070 -#define CKR_MECHANISM_PARAM_INVALID 0x00000071 +#define CKR_MECHANISM_INVALID 0x00000070UL +#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL -/* CKR_OBJECT_CLASS_INCONSISTENT and CKR_OBJECT_CLASS_INVALID - * were removed for v2.0 */ -#define CKR_OBJECT_HANDLE_INVALID 0x00000082 -#define CKR_OPERATION_ACTIVE 0x00000090 -#define CKR_OPERATION_NOT_INITIALIZED 0x00000091 -#define CKR_PIN_INCORRECT 0x000000A0 -#define CKR_PIN_INVALID 0x000000A1 -#define CKR_PIN_LEN_RANGE 0x000000A2 +#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL +#define CKR_OPERATION_ACTIVE 0x00000090UL +#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL +#define CKR_PIN_INCORRECT 0x000000A0UL +#define CKR_PIN_INVALID 0x000000A1UL +#define CKR_PIN_LEN_RANGE 0x000000A2UL -/* CKR_PIN_EXPIRED and CKR_PIN_LOCKED are new for v2.0 */ -#define CKR_PIN_EXPIRED 0x000000A3 -#define CKR_PIN_LOCKED 0x000000A4 +#define CKR_PIN_EXPIRED 0x000000A3UL +#define CKR_PIN_LOCKED 0x000000A4UL -#define CKR_SESSION_CLOSED 0x000000B0 -#define CKR_SESSION_COUNT 0x000000B1 -#define CKR_SESSION_HANDLE_INVALID 0x000000B3 -#define CKR_SESSION_PARALLEL_NOT_SUPPORTED 0x000000B4 -#define CKR_SESSION_READ_ONLY 0x000000B5 -#define CKR_SESSION_EXISTS 0x000000B6 +#define CKR_SESSION_CLOSED 0x000000B0UL +#define CKR_SESSION_COUNT 0x000000B1UL +#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL +#define CKR_SESSION_PARALLEL_NOT_SUPPORTED 0x000000B4UL +#define CKR_SESSION_READ_ONLY 0x000000B5UL +#define CKR_SESSION_EXISTS 0x000000B6UL -/* CKR_SESSION_READ_ONLY_EXISTS and - * CKR_SESSION_READ_WRITE_SO_EXISTS are new for v2.0 */ -#define CKR_SESSION_READ_ONLY_EXISTS 0x000000B7 -#define CKR_SESSION_READ_WRITE_SO_EXISTS 0x000000B8 +#define CKR_SESSION_READ_ONLY_EXISTS 0x000000B7UL +#define CKR_SESSION_READ_WRITE_SO_EXISTS 0x000000B8UL -#define CKR_SIGNATURE_INVALID 0x000000C0 -#define CKR_SIGNATURE_LEN_RANGE 0x000000C1 -#define CKR_TEMPLATE_INCOMPLETE 0x000000D0 -#define CKR_TEMPLATE_INCONSISTENT 0x000000D1 -#define CKR_TOKEN_NOT_PRESENT 0x000000E0 -#define CKR_TOKEN_NOT_RECOGNIZED 0x000000E1 -#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2 -#define CKR_UNWRAPPING_KEY_HANDLE_INVALID 0x000000F0 -#define CKR_UNWRAPPING_KEY_SIZE_RANGE 0x000000F1 -#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x000000F2 -#define CKR_USER_ALREADY_LOGGED_IN 0x00000100 -#define CKR_USER_NOT_LOGGED_IN 0x00000101 -#define CKR_USER_PIN_NOT_INITIALIZED 0x00000102 -#define CKR_USER_TYPE_INVALID 0x00000103 +#define CKR_SIGNATURE_INVALID 0x000000C0UL +#define CKR_SIGNATURE_LEN_RANGE 0x000000C1UL +#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL +#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL +#define CKR_TOKEN_NOT_PRESENT 0x000000E0UL +#define CKR_TOKEN_NOT_RECOGNIZED 0x000000E1UL +#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2UL +#define CKR_UNWRAPPING_KEY_HANDLE_INVALID 0x000000F0UL +#define CKR_UNWRAPPING_KEY_SIZE_RANGE 0x000000F1UL +#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x000000F2UL +#define CKR_USER_ALREADY_LOGGED_IN 0x00000100UL +#define CKR_USER_NOT_LOGGED_IN 0x00000101UL +#define CKR_USER_PIN_NOT_INITIALIZED 0x00000102UL +#define CKR_USER_TYPE_INVALID 0x00000103UL -/* CKR_USER_ANOTHER_ALREADY_LOGGED_IN and CKR_USER_TOO_MANY_TYPES - * are new to v2.01 */ -#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000104 -#define CKR_USER_TOO_MANY_TYPES 0x00000105 +#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000104UL +#define CKR_USER_TOO_MANY_TYPES 0x00000105UL -#define CKR_WRAPPED_KEY_INVALID 0x00000110 -#define CKR_WRAPPED_KEY_LEN_RANGE 0x00000112 -#define CKR_WRAPPING_KEY_HANDLE_INVALID 0x00000113 -#define CKR_WRAPPING_KEY_SIZE_RANGE 0x00000114 -#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT 0x00000115 -#define CKR_RANDOM_SEED_NOT_SUPPORTED 0x00000120 +#define CKR_WRAPPED_KEY_INVALID 0x00000110UL +#define CKR_WRAPPED_KEY_LEN_RANGE 0x00000112UL +#define CKR_WRAPPING_KEY_HANDLE_INVALID 0x00000113UL +#define CKR_WRAPPING_KEY_SIZE_RANGE 0x00000114UL +#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT 0x00000115UL +#define CKR_RANDOM_SEED_NOT_SUPPORTED 0x00000120UL -/* These are new to v2.0 */ -#define CKR_RANDOM_NO_RNG 0x00000121 +#define CKR_RANDOM_NO_RNG 0x00000121UL -/* These are new to v2.11 */ -#define CKR_DOMAIN_PARAMS_INVALID 0x00000130 +#define CKR_DOMAIN_PARAMS_INVALID 0x00000130UL -/* These are new to v2.0 */ -#define CKR_BUFFER_TOO_SMALL 0x00000150 -#define CKR_SAVED_STATE_INVALID 0x00000160 -#define CKR_INFORMATION_SENSITIVE 0x00000170 -#define CKR_STATE_UNSAVEABLE 0x00000180 +#define CKR_CURVE_NOT_SUPPORTED 0x00000140UL -/* These are new to v2.01 */ -#define CKR_CRYPTOKI_NOT_INITIALIZED 0x00000190 -#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191 -#define CKR_MUTEX_BAD 0x000001A0 -#define CKR_MUTEX_NOT_LOCKED 0x000001A1 +#define CKR_BUFFER_TOO_SMALL 0x00000150UL +#define CKR_SAVED_STATE_INVALID 0x00000160UL +#define CKR_INFORMATION_SENSITIVE 0x00000170UL +#define CKR_STATE_UNSAVEABLE 0x00000180UL -/* This is new to v2.20 */ -#define CKR_FUNCTION_REJECTED 0x00000200 +#define CKR_CRYPTOKI_NOT_INITIALIZED 0x00000190UL +#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191UL +#define CKR_MUTEX_BAD 0x000001A0UL +#define CKR_MUTEX_NOT_LOCKED 0x000001A1UL -#define CKR_VENDOR_DEFINED 0x80000000 +#define CKR_NEW_PIN_MODE 0x000001B0UL +#define CKR_NEXT_OTP 0x000001B1UL + +#define CKR_EXCEEDED_MAX_ITERATIONS 0x000001B5UL +#define CKR_FIPS_SELF_TEST_FAILED 0x000001B6UL +#define CKR_LIBRARY_LOAD_FAILED 0x000001B7UL +#define CKR_PIN_TOO_WEAK 0x000001B8UL +#define CKR_PUBLIC_KEY_INVALID 0x000001B9UL + +#define CKR_FUNCTION_REJECTED 0x00000200UL + +#define CKR_VENDOR_DEFINED 0x80000000UL /* CK_NOTIFY is an application callback that processes events */ @@ -1108,8 +1169,8 @@ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_NOTIFY)( /* CK_FUNCTION_LIST is a structure holding a Cryptoki spec * version and pointers of appropriate types to all the - * Cryptoki functions */ -/* CK_FUNCTION_LIST is new for v2.0 */ + * Cryptoki functions + */ typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST; typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR; @@ -1118,14 +1179,16 @@ typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR; /* CK_CREATEMUTEX is an application callback for creating a - * mutex object */ + * mutex object + */ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_CREATEMUTEX)( CK_VOID_PTR_PTR ppMutex /* location to receive ptr to mutex */ ); /* CK_DESTROYMUTEX is an application callback for destroying a - * mutex object */ + * mutex object + */ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_DESTROYMUTEX)( CK_VOID_PTR pMutex /* pointer to mutex */ ); @@ -1138,14 +1201,16 @@ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_LOCKMUTEX)( /* CK_UNLOCKMUTEX is an application callback for unlocking a - * mutex */ + * mutex + */ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)( CK_VOID_PTR pMutex /* pointer to mutex */ ); /* CK_C_INITIALIZE_ARGS provides the optional arguments to - * C_Initialize */ + * C_Initialize + */ typedef struct CK_C_INITIALIZE_ARGS { CK_CREATEMUTEX CreateMutex; CK_DESTROYMUTEX DestroyMutex; @@ -1158,8 +1223,8 @@ typedef struct CK_C_INITIALIZE_ARGS { /* flags: bit flags that provide capabilities of the slot * Bit Flag Mask Meaning */ -#define CKF_LIBRARY_CANT_CREATE_OS_THREADS 0x00000001 -#define CKF_OS_LOCKING_OK 0x00000002 +#define CKF_LIBRARY_CANT_CREATE_OS_THREADS 0x00000001UL +#define CKF_OS_LOCKING_OK 0x00000002UL typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR; @@ -1169,37 +1234,36 @@ typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR; /* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ #define CKF_DONT_BLOCK 1 -/* CK_RSA_PKCS_OAEP_MGF_TYPE is new for v2.10. - * CK_RSA_PKCS_OAEP_MGF_TYPE is used to indicate the Message +/* CK_RSA_PKCS_MGF_TYPE is used to indicate the Message * Generation Function (MGF) applied to a message block when * formatting a message block for the PKCS #1 OAEP encryption - * scheme. */ + * scheme. + */ typedef CK_ULONG CK_RSA_PKCS_MGF_TYPE; typedef CK_RSA_PKCS_MGF_TYPE CK_PTR CK_RSA_PKCS_MGF_TYPE_PTR; /* The following MGFs are defined */ -/* CKG_MGF1_SHA256, CKG_MGF1_SHA384, and CKG_MGF1_SHA512 - * are new for v2.20 */ -#define CKG_MGF1_SHA1 0x00000001 -#define CKG_MGF1_SHA256 0x00000002 -#define CKG_MGF1_SHA384 0x00000003 -#define CKG_MGF1_SHA512 0x00000004 +#define CKG_MGF1_SHA1 0x00000001UL +#define CKG_MGF1_SHA256 0x00000002UL +#define CKG_MGF1_SHA384 0x00000003UL +#define CKG_MGF1_SHA512 0x00000004UL +#define CKG_MGF1_SHA224 0x00000005UL -/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is new for v2.10. - * CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source +/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source * of the encoding parameter when formatting a message block - * for the PKCS #1 OAEP encryption scheme. */ + * for the PKCS #1 OAEP encryption scheme. + */ typedef CK_ULONG CK_RSA_PKCS_OAEP_SOURCE_TYPE; typedef CK_RSA_PKCS_OAEP_SOURCE_TYPE CK_PTR CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR; /* The following encoding parameter sources are defined */ -#define CKZ_DATA_SPECIFIED 0x00000001 +#define CKZ_DATA_SPECIFIED 0x00000001UL -/* CK_RSA_PKCS_OAEP_PARAMS is new for v2.10. - * CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the - * CKM_RSA_PKCS_OAEP mechanism. */ +/* CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the + * CKM_RSA_PKCS_OAEP mechanism. + */ typedef struct CK_RSA_PKCS_OAEP_PARAMS { CK_MECHANISM_TYPE hashAlg; CK_RSA_PKCS_MGF_TYPE mgf; @@ -1210,9 +1274,9 @@ typedef struct CK_RSA_PKCS_OAEP_PARAMS { typedef CK_RSA_PKCS_OAEP_PARAMS CK_PTR CK_RSA_PKCS_OAEP_PARAMS_PTR; -/* CK_RSA_PKCS_PSS_PARAMS is new for v2.11. - * CK_RSA_PKCS_PSS_PARAMS provides the parameters to the - * CKM_RSA_PKCS_PSS mechanism(s). */ +/* CK_RSA_PKCS_PSS_PARAMS provides the parameters to the + * CKM_RSA_PKCS_PSS mechanism(s). + */ typedef struct CK_RSA_PKCS_PSS_PARAMS { CK_MECHANISM_TYPE hashAlg; CK_RSA_PKCS_MGF_TYPE mgf; @@ -1221,15 +1285,23 @@ typedef struct CK_RSA_PKCS_PSS_PARAMS { typedef CK_RSA_PKCS_PSS_PARAMS CK_PTR CK_RSA_PKCS_PSS_PARAMS_PTR; -/* CK_EC_KDF_TYPE is new for v2.11. */ typedef CK_ULONG CK_EC_KDF_TYPE; /* The following EC Key Derivation Functions are defined */ -#define CKD_NULL 0x00000001 -#define CKD_SHA1_KDF 0x00000002 +#define CKD_NULL 0x00000001UL +#define CKD_SHA1_KDF 0x00000002UL -/* CK_ECDH1_DERIVE_PARAMS is new for v2.11. - * CK_ECDH1_DERIVE_PARAMS provides the parameters to the +/* The following X9.42 DH key derivation functions are defined */ +#define CKD_SHA1_KDF_ASN1 0x00000003UL +#define CKD_SHA1_KDF_CONCATENATE 0x00000004UL +#define CKD_SHA224_KDF 0x00000005UL +#define CKD_SHA256_KDF 0x00000006UL +#define CKD_SHA384_KDF 0x00000007UL +#define CKD_SHA512_KDF 0x00000008UL +#define CKD_CPDIVERSIFY_KDF 0x00000009UL + + +/* CK_ECDH1_DERIVE_PARAMS provides the parameters to the * CKM_ECDH1_DERIVE and CKM_ECDH1_COFACTOR_DERIVE mechanisms, * where each party contributes one key pair. */ @@ -1243,10 +1315,10 @@ typedef struct CK_ECDH1_DERIVE_PARAMS { typedef CK_ECDH1_DERIVE_PARAMS CK_PTR CK_ECDH1_DERIVE_PARAMS_PTR; - -/* CK_ECDH2_DERIVE_PARAMS is new for v2.11. +/* * CK_ECDH2_DERIVE_PARAMS provides the parameters to the - * CKM_ECMQV_DERIVE mechanism, where each party contributes two key pairs. */ + * CKM_ECMQV_DERIVE mechanism, where each party contributes two key pairs. + */ typedef struct CK_ECDH2_DERIVE_PARAMS { CK_EC_KDF_TYPE kdf; CK_ULONG ulSharedDataLen; @@ -1277,19 +1349,15 @@ typedef struct CK_ECMQV_DERIVE_PARAMS { typedef CK_ECMQV_DERIVE_PARAMS CK_PTR CK_ECMQV_DERIVE_PARAMS_PTR; /* Typedefs and defines for the CKM_X9_42_DH_KEY_PAIR_GEN and the - * CKM_X9_42_DH_PARAMETER_GEN mechanisms (new for PKCS #11 v2.11) */ + * CKM_X9_42_DH_PARAMETER_GEN mechanisms + */ typedef CK_ULONG CK_X9_42_DH_KDF_TYPE; typedef CK_X9_42_DH_KDF_TYPE CK_PTR CK_X9_42_DH_KDF_TYPE_PTR; -/* The following X9.42 DH key derivation functions are defined - (besides CKD_NULL already defined : */ -#define CKD_SHA1_KDF_ASN1 0x00000003 -#define CKD_SHA1_KDF_CONCATENATE 0x00000004 - -/* CK_X9_42_DH1_DERIVE_PARAMS is new for v2.11. - * CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the +/* CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the * CKM_X9_42_DH_DERIVE key derivation mechanism, where each party - * contributes one key pair */ + * contributes one key pair + */ typedef struct CK_X9_42_DH1_DERIVE_PARAMS { CK_X9_42_DH_KDF_TYPE kdf; CK_ULONG ulOtherInfoLen; @@ -1300,10 +1368,10 @@ typedef struct CK_X9_42_DH1_DERIVE_PARAMS { typedef struct CK_X9_42_DH1_DERIVE_PARAMS CK_PTR CK_X9_42_DH1_DERIVE_PARAMS_PTR; -/* CK_X9_42_DH2_DERIVE_PARAMS is new for v2.11. - * CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the +/* CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the * CKM_X9_42_DH_HYBRID_DERIVE and CKM_X9_42_MQV_DERIVE key derivation - * mechanisms, where each party contributes two key pairs */ + * mechanisms, where each party contributes two key pairs + */ typedef struct CK_X9_42_DH2_DERIVE_PARAMS { CK_X9_42_DH_KDF_TYPE kdf; CK_ULONG ulOtherInfoLen; @@ -1334,8 +1402,8 @@ typedef struct CK_X9_42_MQV_DERIVE_PARAMS { typedef CK_X9_42_MQV_DERIVE_PARAMS CK_PTR CK_X9_42_MQV_DERIVE_PARAMS_PTR; /* CK_KEA_DERIVE_PARAMS provides the parameters to the - * CKM_KEA_DERIVE mechanism */ -/* CK_KEA_DERIVE_PARAMS is new for v2.0 */ + * CKM_KEA_DERIVE mechanism + */ typedef struct CK_KEA_DERIVE_PARAMS { CK_BBOOL isSender; CK_ULONG ulRandomLen; @@ -1350,19 +1418,18 @@ typedef CK_KEA_DERIVE_PARAMS CK_PTR CK_KEA_DERIVE_PARAMS_PTR; /* CK_RC2_PARAMS provides the parameters to the CKM_RC2_ECB and * CKM_RC2_MAC mechanisms. An instance of CK_RC2_PARAMS just - * holds the effective keysize */ + * holds the effective keysize + */ typedef CK_ULONG CK_RC2_PARAMS; typedef CK_RC2_PARAMS CK_PTR CK_RC2_PARAMS_PTR; /* CK_RC2_CBC_PARAMS provides the parameters to the CKM_RC2_CBC - * mechanism */ + * mechanism + */ typedef struct CK_RC2_CBC_PARAMS { - /* ulEffectiveBits was changed from CK_USHORT to CK_ULONG for - * v2.0 */ CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ - CK_BYTE iv[8]; /* IV for CBC mode */ } CK_RC2_CBC_PARAMS; @@ -1370,8 +1437,8 @@ typedef CK_RC2_CBC_PARAMS CK_PTR CK_RC2_CBC_PARAMS_PTR; /* CK_RC2_MAC_GENERAL_PARAMS provides the parameters for the - * CKM_RC2_MAC_GENERAL mechanism */ -/* CK_RC2_MAC_GENERAL_PARAMS is new for v2.0 */ + * CKM_RC2_MAC_GENERAL mechanism + */ typedef struct CK_RC2_MAC_GENERAL_PARAMS { CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ CK_ULONG ulMacLength; /* Length of MAC in bytes */ @@ -1382,8 +1449,8 @@ typedef CK_RC2_MAC_GENERAL_PARAMS CK_PTR \ /* CK_RC5_PARAMS provides the parameters to the CKM_RC5_ECB and - * CKM_RC5_MAC mechanisms */ -/* CK_RC5_PARAMS is new for v2.0 */ + * CKM_RC5_MAC mechanisms + */ typedef struct CK_RC5_PARAMS { CK_ULONG ulWordsize; /* wordsize in bits */ CK_ULONG ulRounds; /* number of rounds */ @@ -1393,8 +1460,8 @@ typedef CK_RC5_PARAMS CK_PTR CK_RC5_PARAMS_PTR; /* CK_RC5_CBC_PARAMS provides the parameters to the CKM_RC5_CBC - * mechanism */ -/* CK_RC5_CBC_PARAMS is new for v2.0 */ + * mechanism + */ typedef struct CK_RC5_CBC_PARAMS { CK_ULONG ulWordsize; /* wordsize in bits */ CK_ULONG ulRounds; /* number of rounds */ @@ -1406,8 +1473,8 @@ typedef CK_RC5_CBC_PARAMS CK_PTR CK_RC5_CBC_PARAMS_PTR; /* CK_RC5_MAC_GENERAL_PARAMS provides the parameters for the - * CKM_RC5_MAC_GENERAL mechanism */ -/* CK_RC5_MAC_GENERAL_PARAMS is new for v2.0 */ + * CKM_RC5_MAC_GENERAL mechanism + */ typedef struct CK_RC5_MAC_GENERAL_PARAMS { CK_ULONG ulWordsize; /* wordsize in bits */ CK_ULONG ulRounds; /* number of rounds */ @@ -1417,16 +1484,14 @@ typedef struct CK_RC5_MAC_GENERAL_PARAMS { typedef CK_RC5_MAC_GENERAL_PARAMS CK_PTR \ CK_RC5_MAC_GENERAL_PARAMS_PTR; - /* CK_MAC_GENERAL_PARAMS provides the parameters to most block * ciphers' MAC_GENERAL mechanisms. Its value is the length of - * the MAC */ -/* CK_MAC_GENERAL_PARAMS is new for v2.0 */ + * the MAC + */ typedef CK_ULONG CK_MAC_GENERAL_PARAMS; typedef CK_MAC_GENERAL_PARAMS CK_PTR CK_MAC_GENERAL_PARAMS_PTR; -/* CK_DES/AES_ECB/CBC_ENCRYPT_DATA_PARAMS are new for v2.20 */ typedef struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { CK_BYTE iv[8]; CK_BYTE_PTR pData; @@ -1444,8 +1509,8 @@ typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR; /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the - * CKM_SKIPJACK_PRIVATE_WRAP mechanism */ -/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS is new for v2.0 */ + * CKM_SKIPJACK_PRIVATE_WRAP mechanism + */ typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { CK_ULONG ulPasswordLen; CK_BYTE_PTR pPassword; @@ -1461,12 +1526,12 @@ typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { } CK_SKIPJACK_PRIVATE_WRAP_PARAMS; typedef CK_SKIPJACK_PRIVATE_WRAP_PARAMS CK_PTR \ - CK_SKIPJACK_PRIVATE_WRAP_PTR; + CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR; /* CK_SKIPJACK_RELAYX_PARAMS provides the parameters to the - * CKM_SKIPJACK_RELAYX mechanism */ -/* CK_SKIPJACK_RELAYX_PARAMS is new for v2.0 */ + * CKM_SKIPJACK_RELAYX mechanism + */ typedef struct CK_SKIPJACK_RELAYX_PARAMS { CK_ULONG ulOldWrappedXLen; CK_BYTE_PTR pOldWrappedX; @@ -1501,17 +1566,15 @@ typedef CK_PBE_PARAMS CK_PTR CK_PBE_PARAMS_PTR; /* CK_KEY_WRAP_SET_OAEP_PARAMS provides the parameters to the - * CKM_KEY_WRAP_SET_OAEP mechanism */ -/* CK_KEY_WRAP_SET_OAEP_PARAMS is new for v2.0 */ + * CKM_KEY_WRAP_SET_OAEP mechanism + */ typedef struct CK_KEY_WRAP_SET_OAEP_PARAMS { CK_BYTE bBC; /* block contents byte */ CK_BYTE_PTR pX; /* extra data */ CK_ULONG ulXLen; /* length of extra data in bytes */ } CK_KEY_WRAP_SET_OAEP_PARAMS; -typedef CK_KEY_WRAP_SET_OAEP_PARAMS CK_PTR \ - CK_KEY_WRAP_SET_OAEP_PARAMS_PTR; - +typedef CK_KEY_WRAP_SET_OAEP_PARAMS CK_PTR CK_KEY_WRAP_SET_OAEP_PARAMS_PTR; typedef struct CK_SSL3_RANDOM_DATA { CK_BYTE_PTR pClientRandom; @@ -1529,7 +1592,6 @@ typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS { typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS CK_PTR \ CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR; - typedef struct CK_SSL3_KEY_MAT_OUT { CK_OBJECT_HANDLE hClientMacSecret; CK_OBJECT_HANDLE hServerMacSecret; @@ -1553,7 +1615,6 @@ typedef struct CK_SSL3_KEY_MAT_PARAMS { typedef CK_SSL3_KEY_MAT_PARAMS CK_PTR CK_SSL3_KEY_MAT_PARAMS_PTR; -/* CK_TLS_PRF_PARAMS is new for version 2.20 */ typedef struct CK_TLS_PRF_PARAMS { CK_BYTE_PTR pSeed; CK_ULONG ulSeedLen; @@ -1565,7 +1626,6 @@ typedef struct CK_TLS_PRF_PARAMS { typedef CK_TLS_PRF_PARAMS CK_PTR CK_TLS_PRF_PARAMS_PTR; -/* WTLS is new for version 2.20 */ typedef struct CK_WTLS_RANDOM_DATA { CK_BYTE_PTR pClientRandom; CK_ULONG ulClientRandomLen; @@ -1617,7 +1677,6 @@ typedef struct CK_WTLS_KEY_MAT_PARAMS { typedef CK_WTLS_KEY_MAT_PARAMS CK_PTR CK_WTLS_KEY_MAT_PARAMS_PTR; -/* CMS is new for version 2.20 */ typedef struct CK_CMS_SIG_PARAMS { CK_OBJECT_HANDLE certificateHandle; CK_MECHANISM_PTR pSigningMechanism; @@ -1643,38 +1702,45 @@ typedef CK_KEY_DERIVATION_STRING_DATA CK_PTR \ /* The CK_EXTRACT_PARAMS is used for the * CKM_EXTRACT_KEY_FROM_KEY mechanism. It specifies which bit * of the base key should be used as the first bit of the - * derived key */ -/* CK_EXTRACT_PARAMS is new for v2.0 */ + * derived key + */ typedef CK_ULONG CK_EXTRACT_PARAMS; typedef CK_EXTRACT_PARAMS CK_PTR CK_EXTRACT_PARAMS_PTR; -/* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is new for v2.10. - * CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to +/* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to * indicate the Pseudo-Random Function (PRF) used to generate - * key bits using PKCS #5 PBKDF2. */ + * key bits using PKCS #5 PBKDF2. + */ typedef CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; -typedef CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE CK_PTR CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR; +typedef CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE CK_PTR \ + CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR; -/* The following PRFs are defined in PKCS #5 v2.0. */ -#define CKP_PKCS5_PBKD2_HMAC_SHA1 0x00000001 +#define CKP_PKCS5_PBKD2_HMAC_SHA1 0x00000001UL +#define CKP_PKCS5_PBKD2_HMAC_GOSTR3411 0x00000002UL +#define CKP_PKCS5_PBKD2_HMAC_SHA224 0x00000003UL +#define CKP_PKCS5_PBKD2_HMAC_SHA256 0x00000004UL +#define CKP_PKCS5_PBKD2_HMAC_SHA384 0x00000005UL +#define CKP_PKCS5_PBKD2_HMAC_SHA512 0x00000006UL +#define CKP_PKCS5_PBKD2_HMAC_SHA512_224 0x00000007UL +#define CKP_PKCS5_PBKD2_HMAC_SHA512_256 0x00000008UL - -/* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is new for v2.10. - * CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the +/* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the * source of the salt value when deriving a key using PKCS #5 - * PBKDF2. */ + * PBKDF2. + */ typedef CK_ULONG CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; -typedef CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE CK_PTR CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR; +typedef CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE CK_PTR \ + CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR; /* The following salt value sources are defined in PKCS #5 v2.0. */ -#define CKZ_SALT_SPECIFIED 0x00000001 +#define CKZ_SALT_SPECIFIED 0x00000001UL -/* CK_PKCS5_PBKD2_PARAMS is new for v2.10. - * CK_PKCS5_PBKD2_PARAMS is a structure that provides the - * parameters to the CKM_PKCS5_PBKD2 mechanism. */ +/* CK_PKCS5_PBKD2_PARAMS is a structure that provides the + * parameters to the CKM_PKCS5_PBKD2 mechanism. + */ typedef struct CK_PKCS5_PBKD2_PARAMS { CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; CK_VOID_PTR pSaltSourceData; @@ -1689,34 +1755,248 @@ typedef struct CK_PKCS5_PBKD2_PARAMS { typedef CK_PKCS5_PBKD2_PARAMS CK_PTR CK_PKCS5_PBKD2_PARAMS_PTR; -/* new for v2.40 */ +/* CK_PKCS5_PBKD2_PARAMS2 is a corrected version of the CK_PKCS5_PBKD2_PARAMS + * structure that provides the parameters to the CKM_PKCS5_PBKD2 mechanism + * noting that the ulPasswordLen field is a CK_ULONG and not a CK_ULONG_PTR. + */ +typedef struct CK_PKCS5_PBKD2_PARAMS2 { + CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; + CK_VOID_PTR pSaltSourceData; + CK_ULONG ulSaltSourceDataLen; + CK_ULONG iterations; + CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf; + CK_VOID_PTR pPrfData; + CK_ULONG ulPrfDataLen; + CK_UTF8CHAR_PTR pPassword; + CK_ULONG ulPasswordLen; +} CK_PKCS5_PBKD2_PARAMS2; + +typedef CK_PKCS5_PBKD2_PARAMS2 CK_PTR CK_PKCS5_PBKD2_PARAMS2_PTR; + +typedef CK_ULONG CK_OTP_PARAM_TYPE; +typedef CK_OTP_PARAM_TYPE CK_PARAM_TYPE; /* backward compatibility */ + +typedef struct CK_OTP_PARAM { + CK_OTP_PARAM_TYPE type; + CK_VOID_PTR pValue; + CK_ULONG ulValueLen; +} CK_OTP_PARAM; + +typedef CK_OTP_PARAM CK_PTR CK_OTP_PARAM_PTR; + +typedef struct CK_OTP_PARAMS { + CK_OTP_PARAM_PTR pParams; + CK_ULONG ulCount; +} CK_OTP_PARAMS; + +typedef CK_OTP_PARAMS CK_PTR CK_OTP_PARAMS_PTR; + +typedef struct CK_OTP_SIGNATURE_INFO { + CK_OTP_PARAM_PTR pParams; + CK_ULONG ulCount; +} CK_OTP_SIGNATURE_INFO; + +typedef CK_OTP_SIGNATURE_INFO CK_PTR CK_OTP_SIGNATURE_INFO_PTR; + +#define CK_OTP_VALUE 0UL +#define CK_OTP_PIN 1UL +#define CK_OTP_CHALLENGE 2UL +#define CK_OTP_TIME 3UL +#define CK_OTP_COUNTER 4UL +#define CK_OTP_FLAGS 5UL +#define CK_OTP_OUTPUT_LENGTH 6UL +#define CK_OTP_OUTPUT_FORMAT 7UL + +#define CKF_NEXT_OTP 0x00000001UL +#define CKF_EXCLUDE_TIME 0x00000002UL +#define CKF_EXCLUDE_COUNTER 0x00000004UL +#define CKF_EXCLUDE_CHALLENGE 0x00000008UL +#define CKF_EXCLUDE_PIN 0x00000010UL +#define CKF_USER_FRIENDLY_OTP 0x00000020UL + +typedef struct CK_KIP_PARAMS { + CK_MECHANISM_PTR pMechanism; + CK_OBJECT_HANDLE hKey; + CK_BYTE_PTR pSeed; + CK_ULONG ulSeedLen; +} CK_KIP_PARAMS; + +typedef CK_KIP_PARAMS CK_PTR CK_KIP_PARAMS_PTR; + +typedef struct CK_AES_CTR_PARAMS { + CK_ULONG ulCounterBits; + CK_BYTE cb[16]; +} CK_AES_CTR_PARAMS; + +typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR; + +typedef struct CK_GCM_PARAMS { + CK_BYTE_PTR pIv; + CK_ULONG ulIvLen; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; + CK_ULONG ulTagBits; +} CK_GCM_PARAMS; + +typedef CK_GCM_PARAMS CK_PTR CK_GCM_PARAMS_PTR; + +typedef struct CK_CCM_PARAMS { + CK_ULONG ulDataLen; + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; + CK_ULONG ulMACLen; +} CK_CCM_PARAMS; + +typedef CK_CCM_PARAMS CK_PTR CK_CCM_PARAMS_PTR; + +/* Deprecated. Use CK_GCM_PARAMS */ +typedef struct CK_AES_GCM_PARAMS { + CK_BYTE_PTR pIv; + CK_ULONG ulIvLen; + CK_ULONG ulIvBits; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; + CK_ULONG ulTagBits; +} CK_AES_GCM_PARAMS; + +typedef CK_AES_GCM_PARAMS CK_PTR CK_AES_GCM_PARAMS_PTR; + +/* Deprecated. Use CK_CCM_PARAMS */ +typedef struct CK_AES_CCM_PARAMS { + CK_ULONG ulDataLen; + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; + CK_ULONG ulMACLen; +} CK_AES_CCM_PARAMS; + +typedef CK_AES_CCM_PARAMS CK_PTR CK_AES_CCM_PARAMS_PTR; + +typedef struct CK_CAMELLIA_CTR_PARAMS { + CK_ULONG ulCounterBits; + CK_BYTE cb[16]; +} CK_CAMELLIA_CTR_PARAMS; + +typedef CK_CAMELLIA_CTR_PARAMS CK_PTR CK_CAMELLIA_CTR_PARAMS_PTR; + +typedef struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + CK_BYTE iv[16]; + CK_BYTE_PTR pData; + CK_ULONG length; +} CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; + +typedef CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ + CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR; + +typedef struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + CK_BYTE iv[16]; + CK_BYTE_PTR pData; + CK_ULONG length; +} CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; + +typedef CK_ARIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ + CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR; + +typedef struct CK_DSA_PARAMETER_GEN_PARAM { + CK_MECHANISM_TYPE hash; + CK_BYTE_PTR pSeed; + CK_ULONG ulSeedLen; + CK_ULONG ulIndex; +} CK_DSA_PARAMETER_GEN_PARAM; + +typedef CK_DSA_PARAMETER_GEN_PARAM CK_PTR CK_DSA_PARAMETER_GEN_PARAM_PTR; + +typedef struct CK_ECDH_AES_KEY_WRAP_PARAMS { + CK_ULONG ulAESKeyBits; + CK_EC_KDF_TYPE kdf; + CK_ULONG ulSharedDataLen; + CK_BYTE_PTR pSharedData; +} CK_ECDH_AES_KEY_WRAP_PARAMS; + +typedef CK_ECDH_AES_KEY_WRAP_PARAMS CK_PTR CK_ECDH_AES_KEY_WRAP_PARAMS_PTR; + +typedef CK_ULONG CK_JAVA_MIDP_SECURITY_DOMAIN; + +typedef CK_ULONG CK_CERTIFICATE_CATEGORY; + +typedef struct CK_RSA_AES_KEY_WRAP_PARAMS { + CK_ULONG ulAESKeyBits; + CK_RSA_PKCS_OAEP_PARAMS_PTR pOAEPParams; +} CK_RSA_AES_KEY_WRAP_PARAMS; + +typedef CK_RSA_AES_KEY_WRAP_PARAMS CK_PTR CK_RSA_AES_KEY_WRAP_PARAMS_PTR; typedef struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { - CK_SSL3_RANDOM_DATA RandomInfo; - CK_VERSION_PTR pVersion; - CK_MECHANISM_TYPE prfHashMechanism; + CK_SSL3_RANDOM_DATA RandomInfo; + CK_VERSION_PTR pVersion; + CK_MECHANISM_TYPE prfHashMechanism; } CK_TLS12_MASTER_KEY_DERIVE_PARAMS; -typedef CK_TLS12_MASTER_KEY_DERIVE_PARAMS CK_PTR CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR; +typedef CK_TLS12_MASTER_KEY_DERIVE_PARAMS CK_PTR \ + CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR; typedef struct CK_TLS12_KEY_MAT_PARAMS { - CK_ULONG ulMacSizeInBits; - CK_ULONG ulKeySizeInBits; - CK_ULONG ulIVSizeInBits; - CK_BBOOL bIsExport; - CK_SSL3_RANDOM_DATA RandomInfo; - CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; - CK_MECHANISM_TYPE prfHashMechanism; + CK_ULONG ulMacSizeInBits; + CK_ULONG ulKeySizeInBits; + CK_ULONG ulIVSizeInBits; + CK_BBOOL bIsExport; + CK_SSL3_RANDOM_DATA RandomInfo; + CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; + CK_MECHANISM_TYPE prfHashMechanism; } CK_TLS12_KEY_MAT_PARAMS; typedef CK_TLS12_KEY_MAT_PARAMS CK_PTR CK_TLS12_KEY_MAT_PARAMS_PTR; +typedef struct CK_TLS_KDF_PARAMS { + CK_MECHANISM_TYPE prfMechanism; + CK_BYTE_PTR pLabel; + CK_ULONG ulLabelLength; + CK_SSL3_RANDOM_DATA RandomInfo; + CK_BYTE_PTR pContextData; + CK_ULONG ulContextDataLength; +} CK_TLS_KDF_PARAMS; + +typedef CK_TLS_KDF_PARAMS CK_PTR CK_TLS_KDF_PARAMS_PTR; + typedef struct CK_TLS_MAC_PARAMS { - CK_MECHANISM_TYPE prfMechanism; - CK_ULONG ulMacLength; - CK_ULONG ulServerOrClient; + CK_MECHANISM_TYPE prfMechanism; + CK_ULONG ulMacLength; + CK_ULONG ulServerOrClient; } CK_TLS_MAC_PARAMS; typedef CK_TLS_MAC_PARAMS CK_PTR CK_TLS_MAC_PARAMS_PTR; -#endif +typedef struct CK_GOSTR3410_DERIVE_PARAMS { + CK_EC_KDF_TYPE kdf; + CK_BYTE_PTR pPublicData; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pUKM; + CK_ULONG ulUKMLen; +} CK_GOSTR3410_DERIVE_PARAMS; + +typedef CK_GOSTR3410_DERIVE_PARAMS CK_PTR CK_GOSTR3410_DERIVE_PARAMS_PTR; + +typedef struct CK_GOSTR3410_KEY_WRAP_PARAMS { + CK_BYTE_PTR pWrapOID; + CK_ULONG ulWrapOIDLen; + CK_BYTE_PTR pUKM; + CK_ULONG ulUKMLen; + CK_OBJECT_HANDLE hKey; +} CK_GOSTR3410_KEY_WRAP_PARAMS; + +typedef CK_GOSTR3410_KEY_WRAP_PARAMS CK_PTR CK_GOSTR3410_KEY_WRAP_PARAMS_PTR; + +typedef struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + CK_BYTE iv[16]; + CK_BYTE_PTR pData; + CK_ULONG length; +} CK_SEED_CBC_ENCRYPT_DATA_PARAMS; + +typedef CK_SEED_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ + CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR; + +#endif /* _PKCS11T_H_ */ + diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h index b3e4ebe58a8..17ffef6fb1d 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -69,11 +69,12 @@ #define CKA_NETSCAPE_BASE (0x80000000 + 0x4E534350) #define CKA_NETSCAPE_TRUST_BASE (CKA_NETSCAPE_BASE + 0x2000) - #define CKA_NETSCAPE_TRUST_SERVER_AUTH (CKA_NETSCAPE_TRUST_BASE + 8) #define CKA_NETSCAPE_TRUST_CLIENT_AUTH (CKA_NETSCAPE_TRUST_BASE + 9) #define CKA_NETSCAPE_TRUST_CODE_SIGNING (CKA_NETSCAPE_TRUST_BASE + 10) #define CKA_NETSCAPE_TRUST_EMAIL_PROTECTION (CKA_NETSCAPE_TRUST_BASE + 11) +#define CKA_NETSCAPE_DB 0xD5A0DB00 +#define CKM_NSS_TLS_PRF_GENERAL 0x80000373 /* @@ -154,11 +155,11 @@ #define P11_ENABLE_GETNATIVEKEYINFO #define P11_ENABLE_CREATENATIVEKEY + /* include the platform dependent part of the header */ #include "p11_md.h" #include "pkcs11.h" -#include "pkcs-11v2-20a3.h" #include #include #include @@ -206,8 +207,6 @@ #define ckULongToJSize(x) ((jsize) x) #define unsignedIntToCKULong(x) ((CK_ULONG) x) -//#define P11_DEBUG - #ifdef P11_DEBUG #define TRACE0(s) { printf(s); fflush(stdout); } #define TRACE1(s, p1) { printf(s, p1); fflush(stdout); } @@ -228,6 +227,8 @@ void printDebug(const char *format, ...); #define CK_ASSERT_OK 0L +#define CLASS_P11PSSSIGNATURE "sun/security/pkcs11/P11PSSSignature" + #define CLASS_INFO "sun/security/pkcs11/wrapper/CK_INFO" #define CLASS_VERSION "sun/security/pkcs11/wrapper/CK_VERSION" #define CLASS_SLOT_INFO "sun/security/pkcs11/wrapper/CK_SLOT_INFO" @@ -249,15 +250,18 @@ void printDebug(const char *format, ...); /* mechanism parameter classes */ - +#define CLASS_AES_CTR_PARAMS "sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS" +#define CLASS_GCM_PARAMS "sun/security/pkcs11/wrapper/CK_GCM_PARAMS" +#define CLASS_CCM_PARAMS "sun/security/pkcs11/wrapper/CK_CCM_PARAMS" +#define CLASS_RSA_PKCS_PSS_PARAMS "sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS" #define CLASS_RSA_PKCS_OAEP_PARAMS "sun/security/pkcs11/wrapper/CK_RSA_PKCS_OAEP_PARAMS" + #define CLASS_MAC_GENERAL_PARAMS "sun/security/pkcs11/wrapper/CK_MAC_GENERAL_PARAMS" #define CLASS_PBE_PARAMS "sun/security/pkcs11/wrapper/CK_PBE_PARAMS" #define PBE_INIT_VECTOR_SIZE 8 #define CLASS_PKCS5_PBKD2_PARAMS "sun/security/pkcs11/wrapper/CK_PKCS5_PBKD2_PARAMS" #define CLASS_EXTRACT_PARAMS "sun/security/pkcs11/wrapper/CK_EXTRACT_PARAMS" -#define CLASS_RSA_PKCS_PSS_PARAMS "sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS" #define CLASS_ECDH1_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_ECDH1_DERIVE_PARAMS" #define CLASS_ECDH2_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_ECDH2_DERIVE_PARAMS" #define CLASS_X9_42_DH1_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_X9_42_DH1_DERIVE_PARAMS" @@ -287,7 +291,7 @@ void printDebug(const char *format, ...); #define CLASS_TLS12_KEY_MAT_PARAMS "sun/security/pkcs11/wrapper/CK_TLS12_KEY_MAT_PARAMS" #define CLASS_TLS_PRF_PARAMS "sun/security/pkcs11/wrapper/CK_TLS_PRF_PARAMS" #define CLASS_TLS_MAC_PARAMS "sun/security/pkcs11/wrapper/CK_TLS_MAC_PARAMS" -#define CLASS_AES_CTR_PARAMS "sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS" + /* function to convert a PKCS#11 return value other than CK_OK into a Java Exception * or to throw a PKCS11RuntimeException @@ -300,11 +304,12 @@ void throwIOException(JNIEnv *env, const char *message); void throwPKCS11RuntimeException(JNIEnv *env, const char *message); void throwDisconnectedRuntimeException(JNIEnv *env); -/* function to free CK_ATTRIBUTE array +/* functions to free CK structures and pointers */ void freeCKAttributeArray(CK_ATTRIBUTE_PTR attrPtr, int len); +void freeCKMechanismPtr(CK_MECHANISM_PTR mechPtr); -/* funktions to convert Java arrays to a CK-type array and the array length */ +/* functions to convert Java arrays to a CK-type array and the array length */ void jBooleanArrayToCKBBoolArray(JNIEnv *env, const jbooleanArray jArray, CK_BBOOL **ckpArray, CK_ULONG_PTR ckLength); void jByteArrayToCKByteArray(JNIEnv *env, const jbyteArray jArray, CK_BYTE_PTR *ckpArray, CK_ULONG_PTR ckLength); @@ -316,7 +321,7 @@ void jAttributeArrayToCKAttributeArray(JNIEnv *env, jobjectArray jAArray, CK_ATT /*void jObjectArrayToCKVoidPtrArray(JNIEnv *env, const jobjectArray jArray, CK_VOID_PTR_PTR ckpArray, CK_ULONG_PTR ckpLength); */ -/* funktions to convert a CK-type array and the array length to a Java array */ +/* functions to convert a CK-type array and the array length to a Java array */ jbyteArray ckByteArrayToJByteArray(JNIEnv *env, const CK_BYTE_PTR ckpArray, CK_ULONG ckLength); jlongArray ckULongArrayToJLongArray(JNIEnv *env, const CK_ULONG_PTR ckpArray, CK_ULONG ckLength); @@ -324,7 +329,7 @@ jcharArray ckCharArrayToJCharArray(JNIEnv *env, const CK_CHAR_PTR ckpArray, CK_U jcharArray ckUTF8CharArrayToJCharArray(JNIEnv *env, const CK_UTF8CHAR_PTR ckpArray, CK_ULONG ckLength); -/* funktions to convert a CK-type structure or a pointer to a CK-value to a Java object */ +/* functions to convert a CK-type structure or a pointer to a CK-value to a Java object */ jobject ckBBoolPtrToJBooleanObject(JNIEnv *env, const CK_BBOOL* ckpValue); jobject ckULongPtrToJLongObject(JNIEnv *env, const CK_ULONG_PTR ckpValue); @@ -334,12 +339,12 @@ jobject ckSessionInfoPtrToJSessionInfo(JNIEnv *env, const CK_SESSION_INFO_PTR ck jobject ckAttributePtrToJAttribute(JNIEnv *env, const CK_ATTRIBUTE_PTR ckpAttribute); -/* funktion to convert the CK-value used by the CK_ATTRIBUTE structure to a Java object */ +/* function to convert the CK-value used by the CK_ATTRIBUTE structure to a Java object */ jobject ckAttributeValueToJObject(JNIEnv *env, const CK_ATTRIBUTE_PTR ckpAttribute); -/* funktions to convert a Java object to a CK-type structure or a pointer to a CK-value */ +/* functions to convert a Java object to a CK-type structure or a pointer to a CK-value */ CK_BBOOL* jBooleanObjectToCKBBoolPtr(JNIEnv *env, jobject jObject); CK_BYTE_PTR jByteObjectToCKBytePtr(JNIEnv *env, jobject jObject); @@ -349,44 +354,35 @@ CK_CHAR_PTR jCharObjectToCKCharPtr(JNIEnv *env, jobject jObject); CK_VERSION_PTR jVersionToCKVersionPtr(JNIEnv *env, jobject jVersion); CK_DATE * jDateObjectPtrToCKDatePtr(JNIEnv *env, jobject jDate); CK_ATTRIBUTE jAttributeToCKAttribute(JNIEnv *env, jobject jAttribute); -/*CK_MECHANISM jMechanismToCKMechanism(JNIEnv *env, jobject jMechanism);*/ -void jMechanismToCKMechanism(JNIEnv *env, jobject jMechanism, CK_MECHANISM_PTR ckMechanismPtr); +CK_MECHANISM_PTR jMechanismToCKMechanismPtr(JNIEnv *env, jobject jMechanism); -/* funktions to convert Java objects used by the Mechanism and Attribute class to a CK-type structure */ - -void jObjectToPrimitiveCKObjectPtrPtr(JNIEnv *env, jobject jObject, CK_VOID_PTR *ckpObjectPtr, CK_ULONG *pLength); -void jMechanismParameterToCKMechanismParameter(JNIEnv *env, jobject jParam, CK_VOID_PTR *ckpParamPtr, CK_ULONG *ckpLength); +/* functions to convert Java objects used by the Mechanism and Attribute class to a CK-type structure */ +CK_VOID_PTR jObjectToPrimitiveCKObjectPtr(JNIEnv *env, jobject jObject, CK_ULONG *ckpLength); +CK_VOID_PTR jMechParamToCKMechParamPtr(JNIEnv *env, jobject jParam, CK_MECHANISM_TYPE, CK_ULONG +*ckpLength); /* functions to convert a specific Java mechanism parameter object to a CK-mechanism parameter structure */ -CK_RSA_PKCS_OAEP_PARAMS jRsaPkcsOaepParamToCKRsaPkcsOaepParam(JNIEnv *env, jobject jParam); -CK_KEA_DERIVE_PARAMS jKeaDeriveParamToCKKeaDeriveParam(JNIEnv *env, jobject jParam); -CK_RC2_CBC_PARAMS jRc2CbcParamToCKRc2CbcParam(JNIEnv *env, jobject jParam); -CK_RC2_MAC_GENERAL_PARAMS jRc2MacGeneralParamToCKRc2MacGeneralParam(JNIEnv *env, jobject jParam); -CK_RC5_PARAMS jRc5ParamToCKRc5Param(JNIEnv *env, jobject jParam); -CK_RC5_CBC_PARAMS jRc5CbcParamToCKRc5CbcParam(JNIEnv *env, jobject jParam); -CK_RC5_MAC_GENERAL_PARAMS jRc5MacGeneralParamToCKRc5MacGeneralParam(JNIEnv *env, jobject jParam); -CK_SKIPJACK_PRIVATE_WRAP_PARAMS jSkipjackPrivateWrapParamToCKSkipjackPrivateWrapParam(JNIEnv *env, jobject jParam); -CK_SKIPJACK_RELAYX_PARAMS jSkipjackRelayxParamToCKSkipjackRelayxParam(JNIEnv *env, jobject jParam); -CK_PBE_PARAMS jPbeParamToCKPbeParam(JNIEnv *env, jobject jParam); +void jRsaPkcsOaepParamToCKRsaPkcsOaepParam(JNIEnv *env, jobject jParam, CK_RSA_PKCS_OAEP_PARAMS_PTR ckParamPtr); +void jPbeParamToCKPbeParam(JNIEnv *env, jobject jParam, CK_PBE_PARAMS_PTR ckParamPtr); void copyBackPBEInitializationVector(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism); -CK_PKCS5_PBKD2_PARAMS jPkcs5Pbkd2ParamToCKPkcs5Pbkd2Param(JNIEnv *env, jobject jParam); -CK_KEY_WRAP_SET_OAEP_PARAMS jKeyWrapSetOaepParamToCKKeyWrapSetOaepParam(JNIEnv *env, jobject jParam); +void jPkcs5Pbkd2ParamToCKPkcs5Pbkd2Param(JNIEnv *env, jobject jParam, CK_PKCS5_PBKD2_PARAMS_PTR ckParamPtr); void copyBackSetUnwrappedKey(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism); -CK_SSL3_MASTER_KEY_DERIVE_PARAMS jSsl3MasterKeyDeriveParamToCKSsl3MasterKeyDeriveParam(JNIEnv *env, jobject jParam); +void jSsl3MasterKeyDeriveParamToCKSsl3MasterKeyDeriveParam(JNIEnv *env, jobject jParam, CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR ckParamPtr); void ssl3CopyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism); void tls12CopyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism); -CK_SSL3_KEY_MAT_PARAMS jSsl3KeyMatParamToCKSsl3KeyMatParam(JNIEnv *env, jobject jParam); +void jSsl3KeyMatParamToCKSsl3KeyMatParam(JNIEnv *env, jobject jParam, CK_SSL3_KEY_MAT_PARAMS_PTR ckParamPtr); void ssl3CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism); void tls12CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism); CK_KEY_DERIVATION_STRING_DATA jKeyDerivationStringDataToCKKeyDerivationStringData(JNIEnv *env, jobject jParam); -CK_RSA_PKCS_PSS_PARAMS jRsaPkcsPssParamToCKRsaPkcsPssParam(JNIEnv *env, jobject jParam); -CK_ECDH1_DERIVE_PARAMS jEcdh1DeriveParamToCKEcdh1DeriveParam(JNIEnv *env, jobject jParam); -CK_ECDH2_DERIVE_PARAMS jEcdh2DeriveParamToCKEcdh2DeriveParam(JNIEnv *env, jobject jParam); -CK_X9_42_DH1_DERIVE_PARAMS jX942Dh1DeriveParamToCKX942Dh1DeriveParam(JNIEnv *env, jobject jParam); -CK_X9_42_DH2_DERIVE_PARAMS jX942Dh2DeriveParamToCKX942Dh2DeriveParam(JNIEnv *env, jobject jParam); +void jRsaPkcsPssParamToCKRsaPkcsPssParam(JNIEnv *env, jobject jParam, CK_RSA_PKCS_PSS_PARAMS_PTR ckParamPtr); +void jEcdh1DeriveParamToCKEcdh1DeriveParam(JNIEnv *env, jobject jParam, CK_ECDH1_DERIVE_PARAMS_PTR ckParamPtr); +void jEcdh2DeriveParamToCKEcdh2DeriveParam(JNIEnv *env, jobject jParam, +CK_ECDH2_DERIVE_PARAMS_PTR ckParamPtr); +void jX942Dh1DeriveParamToCKX942Dh1DeriveParam(JNIEnv *env, jobject jParam, CK_X9_42_DH1_DERIVE_PARAMS_PTR ckParamPtr); +void jX942Dh2DeriveParamToCKX942Dh2DeriveParam(JNIEnv *env, jobject jParam, CK_X9_42_DH2_DERIVE_PARAMS_PTR ckParamPtr); /* functions to convert the InitArgs object for calling the right Java mutex functions */ @@ -450,6 +446,7 @@ void destroyLockObject(JNIEnv *env, jobject jLockObject); extern jfieldID pNativeDataID; extern jfieldID mech_mechanismID; extern jfieldID mech_pParameterID; +extern jfieldID mech_pHandleID; extern jclass jByteArrayClass; extern jclass jLongClass; diff --git a/test/jdk/sun/security/pkcs11/Cipher/Test4512704.java b/test/jdk/sun/security/pkcs11/Cipher/Test4512704.java new file mode 100644 index 00000000000..ddca64ecb69 --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Cipher/Test4512704.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @bug 8080462 + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main Test4512704 + * @summary Verify that AES cipher can generate default IV in encrypt mode + */ +import java.io.PrintStream; +import java.security.*; +import java.security.spec.*; +import java.util.Random; + +import javax.crypto.*; +import javax.crypto.spec.*; +import java.security.Provider; + +public class Test4512704 extends PKCS11Test { + + public void test(String mode, Provider p) throws Exception { + Cipher c; + String transformation = "AES/" + mode + "/NoPadding"; + + try { + transformation = "AES/" + mode + "/NoPadding"; + c = Cipher.getInstance(transformation, p); + } catch (GeneralSecurityException e) { + System.out.println("Skip testing " + p.getName() + + ", no support for " + mode); + return; + } + SecretKey key = new SecretKeySpec(new byte[16], "AES"); + + AlgorithmParameterSpec aps = null; + Cipher ci = Cipher.getInstance(transformation, p); + try { + ci.init(Cipher.ENCRYPT_MODE, key, aps); + } catch(InvalidAlgorithmParameterException ex) { + throw new Exception("parameter should be generated when null is specified!"); + } + System.out.println(transformation + ": Passed"); + } + + public static void main (String[] args) throws Exception { + main(new Test4512704(), args); + } + + @Override + public void main(Provider p) throws Exception { + test("GCM", p); + } + +} diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCM.java b/test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCM.java new file mode 100644 index 00000000000..06c1e84392c --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCM.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @bug 8080462 + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main TestCICOWithGCM + * @summary Test CipherInputStream/OutputStream with AES GCM mode. + * @key randomness + */ + +import java.security.*; +import javax.crypto.*; +import javax.crypto.spec.*; +import java.math.*; +import java.io.*; + +import java.util.*; + +public class TestCICOWithGCM extends PKCS11Test { + public static void main(String[] args) throws Exception { + main(new TestCICOWithGCM(), args); + } + + @Override + public void main(Provider p) throws Exception { + test("GCM", p); + } + + public void test(String mode, Provider p) throws Exception { + Cipher c; + try { + String transformation = "AES/" + mode + "/NoPadding"; + c = Cipher.getInstance(transformation, p); + } catch (GeneralSecurityException e) { + System.out.println("Skip testing " + p.getName() + + ", no support for " + mode); + return; + } + + SecretKey key = new SecretKeySpec(new byte[16], "AES"); + + //do initialization of the plainText + byte[] plainText = new byte[800]; + Random rdm = new Random(); + rdm.nextBytes(plainText); + + //init ciphers + Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", p); + encCipher.init(Cipher.ENCRYPT_MODE, key); + Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", p); + decCipher.init(Cipher.DECRYPT_MODE, key, encCipher.getParameters()); + + //init cipher streams + ByteArrayInputStream baInput = new ByteArrayInputStream(plainText); + CipherInputStream ciInput = new CipherInputStream(baInput, encCipher); + ByteArrayOutputStream baOutput = new ByteArrayOutputStream(); + CipherOutputStream ciOutput = new CipherOutputStream(baOutput, decCipher); + + //do test + byte[] buffer = new byte[800]; + int len = ciInput.read(buffer); + System.out.println("read " + len + " bytes from input buffer"); + + while (len != -1) { + ciOutput.write(buffer, 0, len); + System.out.println("wite " + len + " bytes to output buffer"); + len = ciInput.read(buffer); + if (len != -1) { + System.out.println("read " + len + " bytes from input buffer"); + } else { + System.out.println("finished reading"); + } + } + + ciOutput.flush(); + ciInput.close(); + ciOutput.close(); + byte[] recovered = baOutput.toByteArray(); + System.out.println("recovered " + recovered.length + " bytes"); + if (!Arrays.equals(plainText, recovered)) { + throw new RuntimeException("diff check failed!"); + } else { + System.out.println("diff check passed"); + } + } +} diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCMAndAAD.java b/test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCMAndAAD.java new file mode 100644 index 00000000000..be2b1d18c8f --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCMAndAAD.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @bug 8080462 + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main TestCICOWithGCMAndAAD + * @summary Test CipherInputStream/OutputStream with AES GCM mode with AAD. + * @key randomness + */ +import java.io.*; +import java.security.*; +import java.util.*; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class TestCICOWithGCMAndAAD extends PKCS11Test { + public static void main(String[] args) throws Exception { + main(new TestCICOWithGCMAndAAD(), args); + } + + @Override + public void main(Provider p) throws Exception { + test("GCM", p); +// test("CCM", p); + } + + public void test(String mode, Provider p) throws Exception { + Cipher c; + try { + String transformation = "AES/" + mode + "/NoPadding"; + c = Cipher.getInstance(transformation, p); + } catch (GeneralSecurityException e) { + System.out.println("Skip testing " + p.getName() + + ", no support for " + mode); + return; + } + SecretKey key = new SecretKeySpec(new byte[16], "AES"); + + //Do initialization of the plainText + byte[] plainText = new byte[700]; + Random rdm = new Random(); + rdm.nextBytes(plainText); + + byte[] aad = new byte[128]; + rdm.nextBytes(aad); + byte[] aad2 = aad.clone(); + aad2[50]++; + + Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", p); + encCipher.init(Cipher.ENCRYPT_MODE, key); + encCipher.updateAAD(aad); + Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", p); + decCipher.init(Cipher.DECRYPT_MODE, key, encCipher.getParameters()); + decCipher.updateAAD(aad); + + byte[] recovered = test(encCipher, decCipher, plainText); + if (!Arrays.equals(plainText, recovered)) { + throw new Exception("sameAAD: diff check failed!"); + } else System.out.println("sameAAD: passed"); + + encCipher.init(Cipher.ENCRYPT_MODE, key); + encCipher.updateAAD(aad2); + recovered = test(encCipher, decCipher, plainText); + if (recovered != null && recovered.length != 0) { + throw new Exception("diffAAD: no data should be returned!"); + } else System.out.println("diffAAD: passed"); + } + + private static byte[] test(Cipher encCipher, Cipher decCipher, byte[] plainText) + throws Exception { + //init cipher streams + ByteArrayInputStream baInput = new ByteArrayInputStream(plainText); + CipherInputStream ciInput = new CipherInputStream(baInput, encCipher); + ByteArrayOutputStream baOutput = new ByteArrayOutputStream(); + CipherOutputStream ciOutput = new CipherOutputStream(baOutput, decCipher); + + //do test + byte[] buffer = new byte[200]; + int len = ciInput.read(buffer); + System.out.println("read " + len + " bytes from input buffer"); + + while (len != -1) { + ciOutput.write(buffer, 0, len); + System.out.println("wite " + len + " bytes to output buffer"); + len = ciInput.read(buffer); + if (len != -1) { + System.out.println("read " + len + " bytes from input buffer"); + } else { + System.out.println("finished reading"); + } + } + + ciOutput.flush(); + ciInput.close(); + ciOutput.close(); + + return baOutput.toByteArray(); + } +} diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestGCMKeyAndIvCheck.java b/test/jdk/sun/security/pkcs11/Cipher/TestGCMKeyAndIvCheck.java new file mode 100644 index 00000000000..f14e3facc13 --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Cipher/TestGCMKeyAndIvCheck.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @bug 8080462 + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main TestGCMKeyAndIvCheck + * @summary Ensure that same key+iv can't be repeated used for encryption. + */ + + +import java.security.*; +import java.security.spec.AlgorithmParameterSpec; +import javax.crypto.*; +import javax.crypto.spec.*; +import java.math.*; + +import java.util.*; + +public class TestGCMKeyAndIvCheck extends PKCS11Test { + + private static final byte[] AAD = new byte[5]; + private static final byte[] PT = new byte[18]; + + public static void main(String[] args) throws Exception { + main(new TestGCMKeyAndIvCheck(), args); + } + + private static void checkISE(Cipher c) throws Exception { + // Subsequent encryptions should fail + try { + c.updateAAD(AAD); + throw new Exception("Should throw ISE for updateAAD()"); + } catch (IllegalStateException ise) { + // expected + } + + try { + c.update(PT); + throw new Exception("Should throw ISE for update()"); + } catch (IllegalStateException ise) { + // expected + } + try { + c.doFinal(PT); + throw new Exception("Should throw ISE for doFinal()"); + } catch (IllegalStateException ise) { + // expected + } + } + + public void test(String mode, Provider p) throws Exception { + Cipher c; + try { + String transformation = "AES/" + mode + "/NoPadding"; + c = Cipher.getInstance(transformation, p); + } catch (GeneralSecurityException e) { + System.out.println("Skip testing " + p.getName() + + ", no support for " + mode); + return; + } + SecretKey key = new SecretKeySpec(new byte[16], "AES"); + // First try parameter-less init. + c.init(Cipher.ENCRYPT_MODE, key); + c.updateAAD(AAD); + byte[] ctPlusTag = c.doFinal(PT); + + // subsequent encryption should fail unless re-init w/ different key+iv + checkISE(c); + + // Validate the retrieved parameters against the IV and tag length. + AlgorithmParameters params = c.getParameters(); + if (params == null) { + throw new Exception("getParameters() should not return null"); + } + byte[] iv = null; + int tagLength = 0; // in bits + if (mode.equalsIgnoreCase("GCM")) { + GCMParameterSpec spec = params.getParameterSpec(GCMParameterSpec.class); + tagLength = spec.getTLen(); + iv = spec.getIV(); + } else { + throw new RuntimeException("Error: Unsupported mode: " + mode); + } + if (tagLength != (ctPlusTag.length - PT.length)*8) { + throw new Exception("Parameters contains incorrect TLen value"); + } + if (!Arrays.equals(iv, c.getIV())) { + throw new Exception("Parameters contains incorrect IV value"); + } + + // Should be ok to use the same key+iv for decryption + c.init(Cipher.DECRYPT_MODE, key, params); + c.updateAAD(AAD); + byte[] recovered = c.doFinal(ctPlusTag); + if (!Arrays.equals(recovered, PT)) { + throw new Exception("decryption result mismatch"); + } + + // Now try to encrypt again using the same key+iv; should fail also + try { + c.init(Cipher.ENCRYPT_MODE, key, params); + throw new Exception("Should throw exception when same key+iv is used"); + } catch (InvalidAlgorithmParameterException iape) { + // expected + } + + // Now try to encrypt again using parameter-less init; should work + c.init(Cipher.ENCRYPT_MODE, key); + c.doFinal(PT); + + // make sure a different iv is used + byte[] ivNew = c.getIV(); + if (Arrays.equals(iv, ivNew)) { + throw new Exception("IV should be different now"); + } + + // Now try to encrypt again using a different parameter; should work + AlgorithmParameterSpec spec2 = new GCMParameterSpec(128, new byte[30]); + c.init(Cipher.ENCRYPT_MODE, key, spec2); + c.updateAAD(AAD); + c.doFinal(PT); + // subsequent encryption should fail unless re-init w/ different key+iv + checkISE(c); + + // Now try decryption twice in a row; no re-init required and + // same parameters is used. + c.init(Cipher.DECRYPT_MODE, key, params); + c.updateAAD(AAD); + recovered = c.doFinal(ctPlusTag); + + c.updateAAD(AAD); + recovered = c.doFinal(ctPlusTag); + if (!Arrays.equals(recovered, PT)) { + throw new Exception("decryption result mismatch"); + } + + // Now try decryption again and re-init using the same parameters + c.init(Cipher.DECRYPT_MODE, key, params); + c.updateAAD(AAD); + recovered = c.doFinal(ctPlusTag); + + // init to decrypt w/o parameters; should fail with IKE as + // javadoc specified + try { + c.init(Cipher.DECRYPT_MODE, key); + throw new Exception("Should throw IKE for dec w/o params"); + } catch (InvalidKeyException ike) { + // expected + } + + // Lastly, try encryption AND decryption w/ wrong type of parameters, + // e.g. IvParameterSpec + try { + c.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(iv)); + throw new Exception("Should throw IAPE"); + } catch (InvalidAlgorithmParameterException iape) { + // expected + } + try { + c.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv)); + throw new Exception("Should throw IAPE"); + } catch (InvalidAlgorithmParameterException iape) { + // expected + } + + System.out.println("Test Passed!"); + } + + @Override + public void main(Provider p) throws Exception { + test("GCM", p); + } +} + diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java b/test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java new file mode 100644 index 00000000000..b074e102bc0 --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java @@ -0,0 +1,322 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @bug 8080462 + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main TestKATForGCM + * @summary Known Answer Test for AES cipher with GCM mode support in + * PKCS11 provider. + */ +import java.security.*; +import javax.crypto.*; +import javax.crypto.spec.*; +import java.math.*; + +import java.util.*; + +public class TestKATForGCM extends PKCS11Test { + + // Utility methods + private static byte[] HexToBytes(String hexVal) { + if (hexVal == null) return new byte[0]; + byte[] result = new byte[hexVal.length()/2]; + for (int i = 0; i < result.length; i++) { + // 2 characters at a time + String byteVal = hexVal.substring(2*i, 2*i +2); + result[i] = Integer.valueOf(byteVal, 16).byteValue(); + } + return result; + } + + private static class TestVector { + SecretKey key; + byte[] plainText; + byte[] aad; + byte[] cipherText; + byte[] tag; + GCMParameterSpec spec; + String info; + + TestVector(String key, String iv, String pt, String aad, + String ct, String tag) { + this.key = new SecretKeySpec(HexToBytes(key), "AES"); + this.plainText = HexToBytes(pt); + this.aad = HexToBytes(aad); + this.cipherText = HexToBytes(ct); + this.tag = HexToBytes(tag); + this.spec = new GCMParameterSpec(this.tag.length * 8, HexToBytes(iv)); + this.info = "key=" + key + ", iv=" + iv + ", pt=" + pt + + ",aad=" + aad + ", ct=" + ct + ", tag=" + tag; + } + + public String toString() { + return info; + } + } + + // These test vectors are found off NIST's CAVP page + // http://csrc.nist.gov/groups/STM/cavp/index.html + // inside the link named "GCM Test Vectors", i.e. + // http://csrc.nist.gov/groups/STM/cavp/documents/mac/gcmtestvectors.zip + // CAVS 14.0, set of test vectors w/ count = 0, keysize = 128 + private static TestVector[] testValues = { + // 96-bit iv w/ 128/120/112/104/96-bit tags + // no plain text, no aad + new TestVector("11754cd72aec309bf52f7687212e8957", + "3c819d9a9bed087615030b65", + null, null, null, + "250327c674aaf477aef2675748cf6971"), + new TestVector("272f16edb81a7abbea887357a58c1917", + "794ec588176c703d3d2a7a07", + null, null, null, + "b6e6f197168f5049aeda32dafbdaeb"), + new TestVector("81b6844aab6a568c4556a2eb7eae752f", + "ce600f59618315a6829bef4d", + null, null, null, + "89b43e9dbc1b4f597dbbc7655bb5"), + new TestVector("cde2f9a9b1a004165ef9dc981f18651b", + "29512c29566c7322e1e33e8e", + null, null, null, + "2e58ce7dabd107c82759c66a75"), + new TestVector("b01e45cc3088aaba9fa43d81d481823f", + "5a2c4a66468713456a4bd5e1", + null, null, null, + "014280f944f53c681164b2ff"), + // 96-bit iv w/ 128/120/112/104/96-bit tags + // no plain text, 16-byte aad + new TestVector("77be63708971c4e240d1cb79e8d77feb", + "e0e00f19fed7ba0136a797f3", + null, + "7a43ec1d9c0a5a78a0b16533a6213cab", + null, + "209fcc8d3675ed938e9c7166709dd946"), + new TestVector("da0b615656135194ba6d3c851099bc48", + "d39d4b4d3cc927885090e6c3", + null, + "e7e5e6f8dac913036cb2ff29e8625e0e", + null, + "ab967711a5770461724460b07237e2"), + new TestVector("7e0986937a88eef894235aba4a2f43b2", + "92c4a631695907166b422d60", + null, + "85c185f8518f9f2cd597a8f9208fc76b", + null, + "3bb916b728df94fe9d1916736be1"), + new TestVector("c3db570d7f0c21e86b028f11465d1dc9", + "f86970f58ceef89fc7cb679e", + null, + "c095240708c0f57c288d86090ae34ee1", + null, + "e043c52160d652e82c7262fcf4"), + new TestVector("bea48ae4980d27f357611014d4486625", + "32bddb5c3aa998a08556454c", + null, + "8a50b0b8c7654bced884f7f3afda2ead", + null, + "8e0f6d8bf05ffebe6f500eb1"), + // 96-bit iv w/ 128/120/112/104/96-bit tags + // no plain text, 20-byte aad + new TestVector("2fb45e5b8f993a2bfebc4b15b533e0b4", + "5b05755f984d2b90f94b8027", + null, + "e85491b2202caf1d7dce03b97e09331c32473941", + null, + "c75b7832b2a2d9bd827412b6ef5769db"), + new TestVector("9bf406339fcef9675bbcf156aa1a0661", + "8be4a9543d40f542abacac95", + null, + "7167cbf56971793186333a6685bbd58d47d379b3", + null, + "5e7968d7bbd5ba58cfcc750e2ef8f1"), + new TestVector("a2e962fff70fd0f4d63be728b80556fc", + "1fa7103483de43d09bc23db4", + null, + "2a58edf1d53f46e4e7ee5e77ee7aeb60fc360658", + null, + "fa37f2dbbefab1451eae1d0d74ca"), + new TestVector("6bf4fdce82926dcdfc52616ed5f23695", + "cc0f5899a10615567e1193ed", + null, + "3340655592374c1da2f05aac3ee111014986107f", + null, + "8ad3385cce3b5e7c985908192c"), + new TestVector("4df7a13e43c3d7b66b1a72fac5ba398e", + "97179a3a2d417908dcf0fb28", + null, + "cbb7fc0010c255661e23b07dbd804b1e06ae70ac", + null, + "37791edae6c137ea946cfb40"), + // 96-bit iv w/ 128-bit tags, 13/16/32/51-byte plain text, no aad + new TestVector("fe9bb47deb3a61e423c2231841cfd1fb", + "4d328eb776f500a2f7fb47aa", + "f1cc3818e421876bb6b8bbd6c9", + null, + "b88c5c1977b35b517b0aeae967", + "43fd4727fe5cdb4b5b42818dea7ef8c9"), + new TestVector("7fddb57453c241d03efbed3ac44e371c", + "ee283a3fc75575e33efd4887", + "d5de42b461646c255c87bd2962d3b9a2", + null, + "2ccda4a5415cb91e135c2a0f78c9b2fd", + "b36d1df9b9d5e596f83e8b7f52971cb3"), + new TestVector("9971071059abc009e4f2bd69869db338", + "07a9a95ea3821e9c13c63251", + "f54bc3501fed4f6f6dfb5ea80106df0bd836e6826225b75c0222f6e859b35983", + null, + "0556c159f84ef36cb1602b4526b12009c775611bffb64dc0d9ca9297cd2c6a01", + "7870d9117f54811a346970f1de090c41"), + new TestVector("594157ec4693202b030f33798b07176d", + "49b12054082660803a1df3df", + +"3feef98a976a1bd634f364ac428bb59cd51fb159ec1789946918dbd50ea6c9d594a3a31a5269b0da6936c29d063a5fa2cc8a1c", + null, + +"c1b7a46a335f23d65b8db4008a49796906e225474f4fe7d39e55bf2efd97fd82d4167de082ae30fa01e465a601235d8d68bc69", + "ba92d3661ce8b04687e8788d55417dc2"), + // 96-bit iv w/ 128-bit tags, 16-byte plain text, 16/20/48/90-byte aad + new TestVector("c939cc13397c1d37de6ae0e1cb7c423c", + "b3d8cc017cbb89b39e0f67e2", + "c3b3c41f113a31b73d9a5cd432103069", + "24825602bd12a984e0092d3e448eda5f", + "93fe7d9e9bfd10348a5606e5cafa7354", + "0032a1dc85f1c9786925a2e71d8272dd"), + new TestVector("d4a22488f8dd1d5c6c19a7d6ca17964c", + "f3d5837f22ac1a0425e0d1d5", + "7b43016a16896497fb457be6d2a54122", + "f1c5d424b83f96c6ad8cb28ca0d20e475e023b5a", + "c2bd67eef5e95cac27e3b06e3031d0a8", + "f23eacf9d1cdf8737726c58648826e9c"), + new TestVector("89850dd398e1f1e28443a33d40162664", + "e462c58482fe8264aeeb7231", + "2805cdefb3ef6cc35cd1f169f98da81a", + +"d74e99d1bdaa712864eec422ac507bddbe2b0d4633cd3dff29ce5059b49fe868526c59a2a3a604457bc2afea866e7606", + "ba80e244b7fc9025cd031d0f63677e06", + "d84a8c3eac57d1bb0e890a8f461d1065"), + new TestVector("bd7c5c63b7542b56a00ebe71336a1588", + "87721f23ba9c3c8ea5571abc", + "de15ddbb1e202161e8a79af6a55ac6f3", + +"a6ec8075a0d3370eb7598918f3b93e48444751624997b899a87fa6a9939f844e008aa8b70e9f4c3b1a19d3286bf543e7127bfecba1ad17a5ec53fccc26faecacc4c75369498eaa7d706aef634d0009279b11e4ba6c993e5e9ed9", + "41eb28c0fee4d762de972361c863bc80", + "9cb567220d0b252eb97bff46e4b00ff8"), + // 8/1024-bit iv w/ 128-bit tag, no plain text, no aad + new TestVector("1672c3537afa82004c6b8a46f6f0d026", + "05", + null, null, null, + "8e2ad721f9455f74d8b53d3141f27e8e"), + new TestVector("d0f1f4defa1e8c08b4b26d576392027c", + +"42b4f01eb9f5a1ea5b1eb73b0fb0baed54f387ecaa0393c7d7dffc6af50146ecc021abf7eb9038d4303d91f8d741a11743166c0860208bcc02c6258fd9511a2fa626f96d60b72fcff773af4e88e7a923506e4916ecbd814651e9f445adef4ad6a6b6c7290cc13b956130eef5b837c939fcac0cbbcc9656cd75b13823ee5acdac", + null, null, null, + "7ab49b57ddf5f62c427950111c5c4f0d"), + // 8-bit iv w/ 128-bit tag, 13-byte plain text, 90-byte aad + new TestVector("9f79239f0904eace50784b863e723f6b", + "d9", + "bdb0bb10c87965acd34d146171", + +"44db436089327726c5f01139e1f339735c9e85514ccc2f167bad728010fb34a9072a9794c8a5e7361b1d0dbcdc9ac4091e354bb2896561f0486645252e9c78c86beece91bfa4f7cc4a8794ce1f305b1b735efdbf1ed1563c0be0", + "7e5a7c8dadb3f0c7335b4d9d8d", + "6b6ef1f53723a89f3bb7c6d043840717"), + // 1024-bit iv w/ 128-bit tag, 51-byte plain text, 48-byte aad + new TestVector("141f1ce91989b07e7eb6ae1dbd81ea5e", + +"49451da24bd6074509d3cebc2c0394c972e6934b45a1d91f3ce1d3ca69e194aa1958a7c21b6f21d530ce6d2cc5256a3f846b6f9d2f38df0102c4791e57df038f6e69085646007df999751e248e06c47245f4cd3b8004585a7470dee1690e9d2d63169a58d243c0b57b3e5b4a481a3e4e8c60007094ef3adea2e8f05dd3a1396f", + +"d384305af2388699aa302f510913fed0f2cb63ba42efa8c5c9de2922a2ec2fe87719dadf1eb0aef212b51e74c9c5b934104a43", + +"630cf18a91cc5a6481ac9eefd65c24b1a3c93396bd7294d6b8ba323951727666c947a21894a079ef061ee159c05beeb4", + +"f4c34e5fbe74c0297313268296cd561d59ccc95bbfcdfcdc71b0097dbd83240446b28dc088abd42b0fc687f208190ff24c0548", + "dbb93bbb56d0439cd09f620a57687f5d"), + }; + + public boolean execute(TestVector[] testValues, Cipher c) throws Exception { + boolean testFailed = false; + for (int i = 0; i < testValues.length; i++) { + try { + c.init(Cipher.ENCRYPT_MODE, testValues[i].key, testValues[i].spec); + c.updateAAD(testValues[i].aad); + byte[] ctPlusTag = c.doFinal(testValues[i].plainText); + + c.init(Cipher.DECRYPT_MODE, testValues[i].key, testValues[i].spec); + c.updateAAD(testValues[i].aad); + byte[] pt = c.doFinal(ctPlusTag); // should fail if tag mismatched + + // check encryption/decryption results just to be sure + if (!Arrays.equals(testValues[i].plainText, pt)) { + System.out.println("PlainText diff failed for test# " + i); + testFailed = true; + } + int ctLen = testValues[i].cipherText.length; + if (!Arrays.equals(testValues[i].cipherText, + Arrays.copyOf(ctPlusTag, ctLen))) { + System.out.println("CipherText diff failed for test# " + i); + testFailed = true; + } + int tagLen = testValues[i].tag.length; + if (!Arrays.equals + (testValues[i].tag, + Arrays.copyOfRange(ctPlusTag, ctLen, ctLen+tagLen))) { + System.out.println("Tag diff failed for test# " + i); + testFailed = true; + } + } catch (Exception ex) { + // continue testing other test vectors + System.out.println("Failed Test Vector: " + testValues[i]); + ex.printStackTrace(); + testFailed = true; + continue; + } + } + if (testFailed) { + throw new Exception("Test Failed"); + } + // passed all tests...hooray! + return true; + } + + public static void main(String[] args) throws Exception { + main(new TestKATForGCM(), args); + } + + @Override + public void main(Provider p) throws Exception { + Cipher c; + String transformation = "AES/GCM/NoPadding"; + try { + c = Cipher.getInstance(transformation, p); + } catch (GeneralSecurityException e) { + System.out.println("Skip testing " + p.getName() + + ", no support for " + transformation); + return; + } + if (execute(testValues, c)) { + System.out.println("Test Passed!"); + } + } +} + diff --git a/test/jdk/sun/security/pkcs11/MessageDigest/ByteBuffers.java b/test/jdk/sun/security/pkcs11/MessageDigest/ByteBuffers.java index 5aa562b1256..7ced00630cc 100644 --- a/test/jdk/sun/security/pkcs11/MessageDigest/ByteBuffers.java +++ b/test/jdk/sun/security/pkcs11/MessageDigest/ByteBuffers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, 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 @@ -23,60 +23,74 @@ /* * @test - * @bug 4856966 + * @bug 4856966 8080462 * @summary Test the MessageDigest.update(ByteBuffer) method * @author Andreas Sterbenz * @library /test/lib .. * @key randomness * @modules jdk.crypto.cryptoki * @run main/othervm ByteBuffers - * @run main/othervm ByteBuffers sm */ import java.nio.ByteBuffer; -import java.security.MessageDigest; -import java.security.Provider; +import java.security.*; import java.util.Arrays; import java.util.Random; public class ByteBuffers extends PKCS11Test { + static final String[] ALGS = { + "SHA-224", "SHA-256", "SHA-384", "SHA-512", "SHA-512/224", "SHA-512/256" + }; + + private static Random random = new Random(); + public static void main(String[] args) throws Exception { main(new ByteBuffers(), args); } @Override public void main(Provider p) throws Exception { - if (p.getService("MessageDigest", "MD5") == null) { - System.out.println("Provider does not support MD5, skipping"); - return; - } - - Random random = new Random(); int n = 10 * 1024; byte[] t = new byte[n]; random.nextBytes(t); - MessageDigest md = MessageDigest.getInstance("MD5", p); - byte[] d1 = md.digest(t); + for (String alg : ALGS) { + runTest(p, alg, t); + } + } + + private void runTest(Provider p, String alg, byte[] data) throws Exception { + System.out.println("Test against " + p.getName() + " and " + alg); + MessageDigest md; + try { + md = MessageDigest.getInstance(alg, p); + } catch (NoSuchAlgorithmException e) { + System.out.println("Skip " + alg + " due to no support"); + return; + } + + byte[] d1 = md.digest(data); + + int n = data.length; // test 1: ByteBuffer with an accessible backing array ByteBuffer b1 = ByteBuffer.allocate(n + 256); b1.position(random.nextInt(256)); b1.limit(b1.position() + n); ByteBuffer b2 = b1.slice(); - b2.put(t); + b2.put(data); b2.clear(); - byte[] d2 = digest(md, b2, random); + byte[] d2 = digest(md, b2); if (Arrays.equals(d1, d2) == false) { throw new Exception("Test 1 failed"); } // test 2: direct ByteBuffer - ByteBuffer b3 = ByteBuffer.allocateDirect(t.length); - b3.put(t); + ByteBuffer b3 = ByteBuffer.allocateDirect(n); + b3.put(data); b3.clear(); - byte[] d3 = digest(md, b3, random); + byte[] d3 = digest(md, b3); if (Arrays.equals(d1, d2) == false) { throw new Exception("Test 2 failed"); } @@ -84,14 +98,15 @@ public class ByteBuffers extends PKCS11Test { // test 3: ByteBuffer without an accessible backing array b2.clear(); ByteBuffer b4 = b2.asReadOnlyBuffer(); - byte[] d4 = digest(md, b4, random); + byte[] d4 = digest(md, b4); if (Arrays.equals(d1, d2) == false) { throw new Exception("Test 3 failed"); } System.out.println("All tests passed"); } - private static byte[] digest(MessageDigest md, ByteBuffer b, Random random) throws Exception { + private static byte[] digest(MessageDigest md, ByteBuffer b) + throws Exception { int lim = b.limit(); b.limit(random.nextInt(lim)); md.update(b); diff --git a/test/jdk/sun/security/pkcs11/Signature/InitAgainPSS.java b/test/jdk/sun/security/pkcs11/Signature/InitAgainPSS.java new file mode 100644 index 00000000000..ccd66599fb0 --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Signature/InitAgainPSS.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 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 + * 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.security.*; +import java.security.spec.*; + +/** + * @test + * @bug 8080462 + * @summary Make sure old state is cleared when init is called again + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + */ +public class InitAgainPSS extends PKCS11Test { + + public static void main(String[] args) throws Exception { + main(new InitAgainPSS(), args); + } + + @Override + public void main(Provider p) throws Exception { + Signature s1; + try { + s1 = Signature.getInstance("RSASSA-PSS", p); + } catch (NoSuchAlgorithmException e) { + System.out.println("Skip testing RSASSA-PSS" + + " due to no support"); + return; + } + + byte[] msg = "hello".getBytes(); + + Signature s2 = Signature.getInstance("RSASSA-PSS", p); + + PSSParameterSpec params = new PSSParameterSpec("SHA-256", "MGF1", + new MGF1ParameterSpec("SHA-256"), 32, + PSSParameterSpec.TRAILER_FIELD_BC); + s1.setParameter(params); + s2.setParameter(params); + + KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p); + kpg.initialize(2048); + KeyPair kp = kpg.generateKeyPair(); + + s1.initSign(kp.getPrivate()); + + s1.update(msg); + s1.initSign(kp.getPrivate()); + s1.update(msg); + // Data digested in s1: + // Before this fix, msg | msg + // After this fix, msg + + s2.initVerify(kp.getPublic()); + s2.update(msg); + s2.initVerify(kp.getPublic()); + s2.update(msg); + s2.initVerify(kp.getPublic()); + s2.update(msg); + // Data digested in s2: + // Before this fix, msg | msg | msg + // After this fix, msg + + if (!s2.verify(s1.sign())) { + throw new Exception(); + } + } +} diff --git a/test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java b/test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java new file mode 100644 index 00000000000..a401521c8c9 --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 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 + * 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.security.*; +import java.security.interfaces.*; +import java.security.spec.*; + +/** + * @test + * @bug 8080462 + * @summary Ensure that PSS key and params check are implemented properly + * regardless of call sequence + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main KeyAndParamCheckForPSS + */ +public class KeyAndParamCheckForPSS extends PKCS11Test { + + /** + * ALGORITHM name, fixed as RSA for PKCS11 + */ + private static final String KEYALG = "RSA"; + private static final String SIGALG = "RSASSA-PSS"; + + public static void main(String[] args) throws Exception { + main(new KeyAndParamCheckForPSS(), args); + } + + @Override + public void main(Provider p) throws Exception { + Signature sig; + try { + sig = Signature.getInstance(SIGALG, p); + } catch (NoSuchAlgorithmException e) { + System.out.println("Skip testing RSASSA-PSS" + + " due to no support"); + return; + } + // NOTE: key length >= (digest length + 2) in bytes + // otherwise, even salt length = 0 would not work + runTest(p, 1024, "SHA-384"); + runTest(p, 1040, "SHA-512"); + } + + private void runTest(Provider p, int keySize, String hashAlg) + throws Exception { + System.out.println("Testing [" + keySize + " " + hashAlg + "]"); + + // create a key pair with the supplied size + KeyPairGenerator kpg = KeyPairGenerator.getInstance(KEYALG, p); + kpg.initialize(keySize); + KeyPair kp = kpg.generateKeyPair(); + + int bigSaltLen = keySize/8 - 14; + AlgorithmParameterSpec paramsBad = new PSSParameterSpec(hashAlg, + "MGF1", new MGF1ParameterSpec(hashAlg), bigSaltLen, 1); + AlgorithmParameterSpec paramsGood = new PSSParameterSpec(hashAlg, + "MGF1", new MGF1ParameterSpec(hashAlg), 0, 1); + + PrivateKey priv = kp.getPrivate(); + PublicKey pub = kp.getPublic(); + + // test#1 - setParameter then initSign + Signature sig = Signature.getInstance("RSASSA-PSS", p); + sig.setParameter(paramsBad); + try { + sig.initSign(priv); + throw new RuntimeException("Expected IKE not thrown"); + } catch (InvalidKeyException ike) { + System.out.println("test#1: got expected IKE"); + } + sig.setParameter(paramsGood); + sig.initSign(priv); + System.out.println("test#1: pass"); + + // test#2 - setParameter then initVerify + sig = Signature.getInstance("RSASSA-PSS", p); + sig.setParameter(paramsBad); + try { + sig.initVerify(pub); + throw new RuntimeException("Expected IKE not thrown"); + } catch (InvalidKeyException ike) { + System.out.println("test#2: got expected IKE"); + } + sig.setParameter(paramsGood); + sig.initVerify(pub); + System.out.println("test#2: pass"); + + // test#3 - initSign, then setParameter + sig = Signature.getInstance("RSASSA-PSS", p); + sig.initSign(priv); + try { + sig.setParameter(paramsBad); + throw new RuntimeException("Expected IAPE not thrown"); + } catch (InvalidAlgorithmParameterException iape) { + System.out.println("test#3: got expected IAPE"); + } + sig.setParameter(paramsGood); + System.out.println("test#3: pass"); + + // test#4 - initVerify, then setParameter + sig = Signature.getInstance("RSASSA-PSS", p); + sig.initVerify(pub); + try { + sig.setParameter(paramsBad); + throw new RuntimeException("Expected IAPE not thrown"); + } catch (InvalidAlgorithmParameterException iape) { + System.out.println("test#4: got expected IAPE"); + } + sig.setParameter(paramsGood); + System.out.println("test#4: pass"); + } +} diff --git a/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java b/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java new file mode 100644 index 00000000000..0cc1eb55b36 --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 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 + * 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.security.*; +import java.security.spec.*; +import java.security.interfaces.*; + +/* + * @test + * @bug 8080462 + * @summary testing interoperability of PSS signatures of PKCS11 provider + * against SunRsaSign provider + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main/othervm SigInteropPSS + */ +public class SigInteropPSS extends PKCS11Test { + + private static final byte[] MSG = + "Interoperability test between SunRsaSign and SunPKCS11".getBytes(); + + private static final String[] DIGESTS = { + "SHA-224", "SHA-256", "SHA-384", "SHA-512" + }; + + public static void main(String[] args) throws Exception { + main(new SigInteropPSS(), args); + } + + @Override + public void main(Provider p) throws Exception { + Signature sigPkcs11; + try { + sigPkcs11 = Signature.getInstance("RSASSA-PSS", p); + } catch (NoSuchAlgorithmException e) { + System.out.println("Skip testing RSASSA-PSS" + + " due to no support"); + return; + } + + Signature sigSunRsaSign = + Signature.getInstance("RSASSA-PSS", "SunRsaSign"); + + KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p); + kpg.initialize(3072); + KeyPair kp = kpg.generateKeyPair(); + boolean status; + try { + status = runTest(sigSunRsaSign, sigPkcs11, kp); + status &= runTest(sigPkcs11, sigSunRsaSign, kp); + } catch (Exception e) { + System.out.println("Unexpected exception: " + e); + e.printStackTrace(System.out); + status = false; + } + + if (!status) { + throw new RuntimeException("One or more test failed"); + } + System.out.println("Test passed"); + } + + static boolean runTest(Signature signer, Signature verifier, KeyPair kp) throws Exception { + System.out.println("\tSign using " + signer.getProvider().getName()); + System.out.println("\tVerify using " + verifier.getProvider().getName()); + + boolean status; + for (String digestAlg : DIGESTS) { + System.out.println("\tDigest = " + digestAlg); + PSSParameterSpec params = new PSSParameterSpec(digestAlg, "MGF1", + new MGF1ParameterSpec(digestAlg), 0, 1); + try { + signer.setParameter(params); + signer.initSign(kp.getPrivate()); + verifier.setParameter(params); + verifier.initVerify(kp.getPublic()); + } catch (Exception e) { + System.out.println("\tERROR: unexpected ex during init" + e); + status = false; + continue; + } + try { + signer.update(MSG); + byte[] sigBytes = signer.sign(); + verifier.update(MSG); + boolean isValid = verifier.verify(sigBytes); + if (isValid) { + System.out.println("\tPSS Signature verified"); + } else { + System.out.println("\tERROR verifying PSS Signature"); + status = false; + } + } catch (Exception e) { + System.out.println("\tERROR: unexpected ex" + e); + e.printStackTrace(); + status = false; + } + } + return true; + } +} diff --git a/test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java b/test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java new file mode 100644 index 00000000000..1cf142bf19e --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 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 + * 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.security.*; +import java.security.interfaces.*; +import java.security.spec.*; +import java.util.stream.IntStream; + +/** + * @test + * @bug 8080462 + * @summary Generate a RSASSA-PSS signature and verify it using PKCS11 provider + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main SignatureTestPSS + */ +public class SignatureTestPSS extends PKCS11Test { + + // PKCS11 does not support RSASSA-PSS keys yet + private static final String KEYALG = "RSA"; + private static final String SIGALG = "RSASSA-PSS"; + + private static final int[] KEYSIZES = { 2048, 3072 }; + private static final String[] DIGESTS = { "SHA-224", "SHA-256", + "SHA-384" , "SHA-512" }; + private Provider prov; + + /** + * How much times signature updated. + */ + private static final int UPDATE_TIMES_FIFTY = 50; + + /** + * How much times signature initial updated. + */ + private static final int UPDATE_TIMES_HUNDRED = 100; + + public static void main(String[] args) throws Exception { + main(new SignatureTestPSS(), args); + } + + @Override + public void main(Provider p) throws Exception { + Signature sig; + try { + sig = Signature.getInstance(SIGALG, p); + } catch (NoSuchAlgorithmException e) { + System.out.println("Skip testing RSASSA-PSS" + + " due to no support"); + return; + } + this.prov = p; + for (int i : KEYSIZES) { + runTest(i); + } + } + + private void runTest(int keySize) throws Exception { + byte[] data = new byte[100]; + IntStream.range(0, data.length).forEach(j -> { + data[j] = (byte) j; + }); + System.out.println("[KEYSIZE = " + keySize + "]"); + + // create a key pair + KeyPair kpair = generateKeys(KEYALG, keySize); + test(DIGESTS, kpair.getPrivate(), kpair.getPublic(), data); + } + + private void test(String[] testAlgs, PrivateKey privKey, + PublicKey pubKey, byte[] data) throws RuntimeException { + // For signature algorithm, create and verify a signature + for (String testAlg : testAlgs) { + try { + checkSignature(data, pubKey, privKey, testAlg); + } catch (NoSuchAlgorithmException | InvalidKeyException | + SignatureException | NoSuchProviderException ex) { + throw new RuntimeException(ex); + } catch (InvalidAlgorithmParameterException ex2) { + System.out.println("Skip test due to " + ex2); + } + }; + } + + private KeyPair generateKeys(String keyalg, int size) + throws NoSuchAlgorithmException { + KeyPairGenerator kpg = KeyPairGenerator.getInstance(keyalg, prov); + kpg.initialize(size); + return kpg.generateKeyPair(); + } + + private void checkSignature(byte[] data, PublicKey pub, + PrivateKey priv, String mdAlg) throws NoSuchAlgorithmException, + InvalidKeyException, SignatureException, NoSuchProviderException, + InvalidAlgorithmParameterException { + System.out.println("Testing against " + mdAlg); + Signature sig = Signature.getInstance(SIGALG, prov); + AlgorithmParameterSpec params = new PSSParameterSpec( + mdAlg, "MGF1", new MGF1ParameterSpec(mdAlg), 0, 1); + sig.setParameter(params); + sig.initSign(priv); + for (int i = 0; i < UPDATE_TIMES_HUNDRED; i++) { + sig.update(data); + } + byte[] signedData = sig.sign(); + + // Make sure signature verifies with original data + // do we need to call sig.setParameter(params) again? + sig.initVerify(pub); + for (int i = 0; i < UPDATE_TIMES_HUNDRED; i++) { + sig.update(data); + } + if (!sig.verify(signedData)) { + throw new RuntimeException("Failed to verify signature"); + } + + // Make sure signature does NOT verify when the original data + // has changed + sig.initVerify(pub); + for (int i = 0; i < UPDATE_TIMES_FIFTY; i++) { + sig.update(data); + } + + if (sig.verify(signedData)) { + throw new RuntimeException("Failed to detect bad signature"); + } + } +} diff --git a/test/jdk/sun/security/pkcs11/Signature/TestDSA2.java b/test/jdk/sun/security/pkcs11/Signature/TestDSA2.java new file mode 100644 index 00000000000..222f8a2a5ed --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Signature/TestDSA2.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8080462 + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main/othervm/timeout=250 TestDSA2 + * @summary verify that DSA signature works using SHA-2 digests. + * @key randomness + */ + + +import java.security.*; +import java.security.spec.*; +import java.security.interfaces.*; + +public class TestDSA2 extends PKCS11Test { + + private static final String[] SIG_ALGOS = { + "SHA224withDSA", + "SHA256withDSA", + //"SHA384withDSA", + //"SHA512withDSA", + }; + + private static final int KEYSIZE = 2048; + + public static void main(String[] args) throws Exception { + main(new TestDSA2(), args); + } + + @Override + public void main(Provider p) throws Exception { + KeyPair kp; + try { + KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", p); + kpg.initialize(KEYSIZE); + kp = kpg.generateKeyPair(); + } catch (Exception ex) { + System.out.println("Skip due to no 2048-bit DSA support: " + ex); + ex.printStackTrace(); + return; + } + + for (String sigAlg : SIG_ALGOS) { + test(sigAlg, kp, p); + } + } + + private static void test(String sigAlg, KeyPair kp, Provider p) + throws Exception { + Signature sig; + try { + sig = Signature.getInstance(sigAlg, p); + } catch (Exception ex) { + System.out.println("Skip due to no support: " + sigAlg); + ex.printStackTrace(); + return; + } + + byte[] data = "anything will do".getBytes(); + + sig.initSign(kp.getPrivate()); + sig.update(data); + byte[] signature = sig.sign(); + + sig.initVerify(kp.getPublic()); + sig.update(data); + boolean verifies = sig.verify(signature); + System.out.println(sigAlg + ": Passed"); + } +} From 81a6bc8b4bcc658954053db20db29feedb0b2c7a Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Tue, 11 Jun 2019 14:56:48 -0700 Subject: [PATCH 033/109] 8214399: Javap -help should provide information about --multi-release option Reviewed-by: jlahoda --- src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java | 3 ++- .../classes/com/sun/tools/javap/resources/javap.properties | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java index 4987440436f..e674a156019 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java @@ -944,7 +944,8 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { String[] fmOptions = { "--module-path", "--system", "--class-path", "-classpath", "-cp", - "-bootclasspath" + "-bootclasspath", + "--multi-release" }; for (String o: fmOptions) { diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties index 5e0c53d64be..3af66f7c5ea 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties @@ -92,6 +92,9 @@ main.opt.system=\ main.opt.module_path=\ \ --module-path Specify where to find application modules +main.opt.multi_release=\ +\ --multi-release Specify the version to use in multi-release JAR files + main.opt.constants=\ \ -constants Show final constants From 4f171abe26e43e2b4986bc30ad70d3cfa443af96 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Tue, 11 Jun 2019 14:59:46 -0700 Subject: [PATCH 034/109] 8066173: compiler/types/correctness/OffTest.java failed with assert Reviewed-by: kvn --- test/hotspot/jtreg/ProblemList.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 6e7551cf2c9..a082669828f 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -48,8 +48,9 @@ compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all compiler/tiered/LevelTransitionTest.java 8067651 generic-all -compiler/types/correctness/CorrectnessTest.java 8066173 generic-all -compiler/types/correctness/OffTest.java 8066173 generic-all + +compiler/types/correctness/CorrectnessTest.java 8066173 solaris-sparcv9 +compiler/types/correctness/OffTest.java 8066173 solaris-sparcv9 compiler/c2/Test6852078.java 8194310 generic-all compiler/c2/Test8004741.java 8214904 generic-all From 9597144fb2ba8a13313dd5355ed3f44359f7c8a5 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Tue, 11 Jun 2019 19:15:31 -0400 Subject: [PATCH 035/109] 8225572: Shenandoah: Move JNIHandles root out of serial roots Reviewed-by: rkennke --- .../share/gc/shenandoah/shenandoahRootProcessor.cpp | 10 +++++++--- .../share/gc/shenandoah/shenandoahRootProcessor.hpp | 10 +++++++++- .../gc/shenandoah/shenandoahRootProcessor.inline.hpp | 4 ++++ .../share/gc/shenandoah/shenandoahRootVerifier.cpp | 7 +++++-- .../share/gc/shenandoah/shenandoahRootVerifier.hpp | 3 ++- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp index 17f38e58b46..af7ddab3da5 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp @@ -60,8 +60,7 @@ ShenandoahSerialRoots::ShenandoahSerialRoots() : _object_synchronizer_root(&ObjectSynchronizer::oops_do, ShenandoahPhaseTimings::ObjectSynchronizerRoots), _management_root(&Management::oops_do, ShenandoahPhaseTimings::ManagementRoots), _system_dictionary_root(&SystemDictionary::oops_do, ShenandoahPhaseTimings::SystemDictionaryRoots), - _jvmti_root(&JvmtiExport::oops_do, ShenandoahPhaseTimings::JVMTIRoots), - _jni_handle_root(&JNIHandles::oops_do, ShenandoahPhaseTimings::JNIRoots) { + _jvmti_root(&JvmtiExport::oops_do, ShenandoahPhaseTimings::JVMTIRoots) { } void ShenandoahSerialRoots::oops_do(OopClosure* cl, uint worker_id) { @@ -70,7 +69,10 @@ void ShenandoahSerialRoots::oops_do(OopClosure* cl, uint worker_id) { _management_root.oops_do(cl, worker_id); _system_dictionary_root.oops_do(cl, worker_id); _jvmti_root.oops_do(cl, worker_id); - _jni_handle_root.oops_do(cl, worker_id); +} + +ShenandoahJNIHandleRoots::ShenandoahJNIHandleRoots() : + ShenandoahSerialRoot(&JNIHandles::oops_do, ShenandoahPhaseTimings::JNIRoots) { } ShenandoahThreadRoots::ShenandoahThreadRoots(bool is_par) : _is_par(is_par) { @@ -160,6 +162,7 @@ void ShenandoahRootEvacuator::roots_do(uint worker_id, OopClosure* oops) { AlwaysTrueClosure always_true; _serial_roots.oops_do(oops, worker_id); + _jni_roots.oops_do(oops, worker_id); _thread_roots.oops_do(oops, NULL, worker_id); _cld_roots.clds_do(&clds, &clds, worker_id); @@ -189,6 +192,7 @@ void ShenandoahRootAdjuster::roots_do(uint worker_id, OopClosure* oops) { AlwaysTrueClosure always_true; _serial_roots.oops_do(oops, worker_id); + _jni_roots.oops_do(oops, worker_id); _thread_roots.oops_do(oops, NULL, worker_id); _cld_roots.clds_do(&adjust_cld_closure, NULL, worker_id); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp index fa5e09d0acb..02fa1e67c9c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp @@ -56,12 +56,16 @@ private: ShenandoahSerialRoot _management_root; ShenandoahSerialRoot _system_dictionary_root; ShenandoahSerialRoot _jvmti_root; - ShenandoahSerialRoot _jni_handle_root; public: ShenandoahSerialRoots(); void oops_do(OopClosure* cl, uint worker_id); }; +class ShenandoahJNIHandleRoots : public ShenandoahSerialRoot { +public: + ShenandoahJNIHandleRoots(); +}; + class ShenandoahThreadRoots { private: const bool _is_par; @@ -126,6 +130,7 @@ template class ShenandoahRootScanner : public ShenandoahRootProcessor { private: ShenandoahSerialRoots _serial_roots; + ShenandoahJNIHandleRoots _jni_roots; ShenandoahClassLoaderDataRoots _cld_roots; ShenandoahThreadRoots _thread_roots; ShenandoahCodeCacheRoots _code_roots; @@ -152,6 +157,7 @@ typedef ShenandoahRootScanner ShenandoahCSetRoo class ShenandoahRootEvacuator : public ShenandoahRootProcessor { private: ShenandoahSerialRoots _serial_roots; + ShenandoahJNIHandleRoots _jni_roots; ShenandoahClassLoaderDataRoots _cld_roots; ShenandoahThreadRoots _thread_roots; ShenandoahWeakRoots _weak_roots; @@ -168,6 +174,7 @@ public: class ShenandoahRootUpdater : public ShenandoahRootProcessor { private: ShenandoahSerialRoots _serial_roots; + ShenandoahJNIHandleRoots _jni_roots; ShenandoahClassLoaderDataRoots _cld_roots; ShenandoahThreadRoots _thread_roots; ShenandoahWeakRoots _weak_roots; @@ -186,6 +193,7 @@ public: class ShenandoahRootAdjuster : public ShenandoahRootProcessor { private: ShenandoahSerialRoots _serial_roots; + ShenandoahJNIHandleRoots _jni_roots; ShenandoahClassLoaderDataRoots _cld_roots; ShenandoahThreadRoots _thread_roots; ShenandoahWeakRoots _weak_roots; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp index f016a213b81..cb055e47876 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp @@ -99,6 +99,7 @@ void ShenandoahRootScanner::roots_do(uint worker_id, OopClosure* oops, CLDC ResourceMark rm; _serial_roots.oops_do(oops, worker_id); + _jni_roots.oops_do(oops, worker_id); _cld_roots.clds_do(clds, clds, worker_id); _thread_roots.threads_do(&tc_cl, worker_id); @@ -118,6 +119,7 @@ void ShenandoahRootScanner::roots_do_unchecked(OopClosure* oops) { ResourceMark rm; _serial_roots.oops_do(oops, 0); + _jni_roots.oops_do(oops, 0); _cld_roots.clds_do(&clds, &clds, 0); _thread_roots.threads_do(&tc_cl, 0); _code_roots.code_blobs_do(&code, 0); @@ -130,6 +132,7 @@ void ShenandoahRootScanner::strong_roots_do(uint worker_id, OopClosure* oop ResourceMark rm; _serial_roots.oops_do(oops, worker_id); + _jni_roots.oops_do(oops, worker_id); _cld_roots.clds_do(clds, NULL, worker_id); _thread_roots.threads_do(&tc_cl, worker_id); } @@ -141,6 +144,7 @@ void ShenandoahRootUpdater::roots_do(uint worker_id, IsAlive* is_alive, KeepAliv CLDToOopClosure* weak_clds = ShenandoahHeap::heap()->unload_classes() ? NULL : &clds; _serial_roots.oops_do(keep_alive, worker_id); + _jni_roots.oops_do(keep_alive, worker_id); _thread_roots.oops_do(keep_alive, NULL, worker_id); _cld_roots.clds_do(&clds, weak_clds, worker_id); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp index 756be0ec1cf..6bc7d83d6c9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp @@ -69,15 +69,18 @@ void ShenandoahRootVerifier::oops_do(OopClosure* oops) { if (verify(SerialRoots)) { shenandoah_assert_safepoint(); - Universe::oops_do(oops); Management::oops_do(oops); JvmtiExport::oops_do(oops); - JNIHandles::oops_do(oops); ObjectSynchronizer::oops_do(oops); SystemDictionary::oops_do(oops); } + if (verify(JNIHandleRoots)) { + shenandoah_assert_safepoint(); + JNIHandles::oops_do(oops); + } + if (verify(WeakRoots)) { shenandoah_assert_safepoint(); AlwaysTrueClosure always_true; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.hpp index 5224a4f6fb1..66ef7382700 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.hpp @@ -36,7 +36,8 @@ public: CLDGRoots = 1 << 3, WeakRoots = 1 << 4, StringDedupRoots = 1 << 5, - AllRoots = (SerialRoots | ThreadRoots | CodeRoots | CLDGRoots | WeakRoots | StringDedupRoots) + JNIHandleRoots = 1 << 6, + AllRoots = (SerialRoots | ThreadRoots | CodeRoots | CLDGRoots | WeakRoots | StringDedupRoots | JNIHandleRoots) }; private: From f10a0642975b341ee48135cc2197b9cbf9735bad Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 11 Jun 2019 16:23:33 -0700 Subject: [PATCH 036/109] 8221246: NullPointerException within Win32ShellFolder2 Reviewed-by: prr --- .../awt/shell/Win32ShellFolderManager2.java | 103 +++++++++++------- 1 file changed, 66 insertions(+), 37 deletions(-) diff --git a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java index 5e30f36d7df..8dd6cbbb38b 100644 --- a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java +++ b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, 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 @@ -25,23 +25,38 @@ package sun.awt.shell; -import java.awt.*; +import java.awt.Image; +import java.awt.Toolkit; import java.awt.image.BufferedImage; -import java.awt.image.BaseMultiResolutionImage; - import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.concurrent.*; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import static sun.awt.shell.Win32ShellFolder2.*; import sun.awt.OSInfo; import sun.awt.util.ThreadGroupUtils; +import sun.util.logging.PlatformLogger; + +import static sun.awt.shell.Win32ShellFolder2.DESKTOP; +import static sun.awt.shell.Win32ShellFolder2.DRIVES; +import static sun.awt.shell.Win32ShellFolder2.Invoker; +import static sun.awt.shell.Win32ShellFolder2.MultiResolutionIconImage; +import static sun.awt.shell.Win32ShellFolder2.NETWORK; +import static sun.awt.shell.Win32ShellFolder2.PERSONAL; +import static sun.awt.shell.Win32ShellFolder2.RECENT; // NOTE: This class supersedes Win32ShellFolderManager, which was removed // from distribution after version 1.4.2. @@ -54,6 +69,9 @@ import sun.awt.util.ThreadGroupUtils; final class Win32ShellFolderManager2 extends ShellFolderManager { + private static final PlatformLogger + log = PlatformLogger.getLogger("sun.awt.shell.Win32ShellFolderManager2"); + static { // Load library here sun.awt.windows.WToolkit.loadLibraries(); @@ -145,12 +163,13 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { if (desktop == null) { try { desktop = new Win32ShellFolder2(DESKTOP); - } catch (SecurityException e) { - // Ignore error - } catch (IOException e) { - // Ignore error - } catch (InterruptedException e) { - // Ignore error + } catch (final SecurityException ignored) { + // Ignore, the message may have sensitive information, not + // accessible other ways + } catch (IOException | InterruptedException e) { + if (log.isLoggable(PlatformLogger.Level.WARNING)) { + log.warning("Cannot access 'Desktop'", e); + } } } return desktop; @@ -160,12 +179,13 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { if (drives == null) { try { drives = new Win32ShellFolder2(DRIVES); - } catch (SecurityException e) { - // Ignore error - } catch (IOException e) { - // Ignore error - } catch (InterruptedException e) { - // Ignore error + } catch (final SecurityException ignored) { + // Ignore, the message may have sensitive information, not + // accessible other ways + } catch (IOException | InterruptedException e) { + if (log.isLoggable(PlatformLogger.Level.WARNING)) { + log.warning("Cannot access 'Drives'", e); + } } } return drives; @@ -178,12 +198,13 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { if (path != null) { recent = createShellFolder(getDesktop(), new File(path)); } - } catch (SecurityException e) { - // Ignore error - } catch (InterruptedException e) { - // Ignore error - } catch (IOException e) { - // Ignore error + } catch (final SecurityException ignored) { + // Ignore, the message may have sensitive information, not + // accessible other ways + } catch (InterruptedException | IOException e) { + if (log.isLoggable(PlatformLogger.Level.WARNING)) { + log.warning("Cannot access 'Recent'", e); + } } } return recent; @@ -193,12 +214,13 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { if (network == null) { try { network = new Win32ShellFolder2(NETWORK); - } catch (SecurityException e) { - // Ignore error - } catch (IOException e) { - // Ignore error - } catch (InterruptedException e) { - // Ignore error + } catch (final SecurityException ignored) { + // Ignore, the message may have sensitive information, not + // accessible other ways + } catch (IOException | InterruptedException e) { + if (log.isLoggable(PlatformLogger.Level.WARNING)) { + log.warning("Cannot access 'Network'", e); + } } } return network; @@ -218,12 +240,13 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { personal.setIsPersonal(); } } - } catch (SecurityException e) { - // Ignore error - } catch (InterruptedException e) { - // Ignore error - } catch (IOException e) { - // Ignore error + } catch (final SecurityException ignored) { + // Ignore, the message may have sensitive information, not + // accessible other ways + } catch (InterruptedException | IOException e) { + if (log.isLoggable(PlatformLogger.Level.WARNING)) { + log.warning("Cannot access 'Personal'", e); + } } } return personal; @@ -324,8 +347,14 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { folders.add(createShellFolder(new File((String)value))); } } catch (IOException e) { + if (log.isLoggable(PlatformLogger.Level.WARNING)) { + log.warning("Cannot read value = " + value, e); + } // Skip this value } catch (InterruptedException e) { + if (log.isLoggable(PlatformLogger.Level.WARNING)) { + log.warning("Cannot read value = " + value, e); + } // Return empty result return new File[0]; } From 94e1d7530ff03978be305211f6a1e6d14acb6d1c Mon Sep 17 00:00:00 2001 From: Anthony Scarpino Date: Tue, 11 Jun 2019 16:31:37 -0700 Subject: [PATCH 037/109] 8211018: Session Resumption without Server-Side State Reviewed-by: xuelei, jnimeh, jjiang --- .../classes/sun/security/ssl/ClientHello.java | 56 +- .../classes/sun/security/ssl/Finished.java | 27 +- .../sun/security/ssl/HandshakeContext.java | 4 +- .../sun/security/ssl/NewSessionTicket.java | 364 +++++++++--- .../security/ssl/PreSharedKeyExtension.java | 54 +- .../sun/security/ssl/SSLContextImpl.java | 6 +- .../sun/security/ssl/SSLExtension.java | 24 +- .../sun/security/ssl/SSLHandshake.java | 18 +- .../security/ssl/SSLSessionContextImpl.java | 87 ++- .../sun/security/ssl/SSLSessionImpl.java | 382 ++++++++++++- .../classes/sun/security/ssl/ServerHello.java | 46 +- .../classes/sun/security/ssl/SessionId.java | 4 +- .../security/ssl/SessionTicketExtension.java | 539 ++++++++++++++++++ .../sun/security/ssl/TransportContext.java | 13 +- .../ssl/DTLS/PacketLossRetransmission.java | 6 +- .../ssl/SSLSession/SSLCtxAccessToSessCtx.java | 6 +- .../ssl/DHKeyExchange/DHEKeySizing.java | 15 +- .../SSLSessionImpl/ResumeChecksClient.java | 20 +- .../ResumeChecksClientStateless.java | 40 ++ .../SSLSessionImpl/ResumeChecksServer.java | 24 +- .../ResumeChecksServerStateless.java | 35 ++ 21 files changed, 1620 insertions(+), 150 deletions(-) create mode 100644 src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java create mode 100644 test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java create mode 100644 test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java diff --git a/src/java.base/share/classes/sun/security/ssl/ClientHello.java b/src/java.base/share/classes/sun/security/ssl/ClientHello.java index 53b74223bfb..cac23bde65c 100644 --- a/src/java.base/share/classes/sun/security/ssl/ClientHello.java +++ b/src/java.base/share/classes/sun/security/ssl/ClientHello.java @@ -35,7 +35,6 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Locale; -import java.util.Objects; import javax.net.ssl.SSLException; import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLPeerUnverifiedException; @@ -969,11 +968,24 @@ final class ClientHello { } } - // Is it an abbreviated handshake? - if (clientHello.sessionId.length() != 0) { - SSLSessionImpl previous = ((SSLSessionContextImpl)shc.sslContext - .engineGetServerSessionContext()) - .get(clientHello.sessionId.getId()); + // Consume a Session Ticket Extension if it exists + SSLExtension[] ext = new SSLExtension[]{ + SSLExtension.CH_SESSION_TICKET + }; + clientHello.extensions.consumeOnLoad(shc, ext); + + // Does the client want to resume a session? + if (clientHello.sessionId.length() != 0 || shc.statelessResumption) { + SSLSessionContextImpl cache = (SSLSessionContextImpl)shc.sslContext + .engineGetServerSessionContext(); + + SSLSessionImpl previous; + // Use the stateless session ticket if provided + if (shc.statelessResumption) { + previous = shc.resumingSession; + } else { + previous = cache.get(clientHello.sessionId.getId()); + } boolean resumingSession = (previous != null) && previous.isRejoinable(); @@ -1051,14 +1063,20 @@ final class ClientHello { // the resuming options later. shc.isResumption = resumingSession; shc.resumingSession = resumingSession ? previous : null; + + if (!resumingSession && SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Session not resumed."); + } } // cache the client random number for further using shc.clientHelloRandom = clientHello.clientRandom; // Check and launch ClientHello extensions. - SSLExtension[] extTypes = shc.sslConfig.getEnabledExtensions( - SSLHandshake.CLIENT_HELLO); + SSLExtension[] extTypes = shc.sslConfig.getExclusiveExtensions( + SSLHandshake.CLIENT_HELLO, + Arrays.asList(SSLExtension.CH_SESSION_TICKET)); clientHello.extensions.consumeOnLoad(shc, extTypes); // @@ -1276,11 +1294,25 @@ final class ClientHello { } } - // Is it an abbreviated handshake? + + // Does the client want to resume a session? if (clientHello.sessionId.length() != 0) { - SSLSessionImpl previous = ((SSLSessionContextImpl)shc.sslContext - .engineGetServerSessionContext()) - .get(clientHello.sessionId.getId()); + SSLSessionContextImpl cache = (SSLSessionContextImpl)shc.sslContext + .engineGetServerSessionContext(); + + // Consume a Session Ticket Extension if it exists + SSLExtension[] ext = new SSLExtension[]{ + SSLExtension.CH_SESSION_TICKET + }; + clientHello.extensions.consumeOnLoad(shc, ext); + + SSLSessionImpl previous; + // Use stateless session ticket if provided. + if (shc.statelessResumption) { + previous = shc.resumingSession; + } else { + previous = cache.get(clientHello.sessionId.getId()); + } boolean resumingSession = (previous != null) && previous.isRejoinable(); diff --git a/src/java.base/share/classes/sun/security/ssl/Finished.java b/src/java.base/share/classes/sun/security/ssl/Finished.java index e063de34dfa..5cd7fb4b151 100644 --- a/src/java.base/share/classes/sun/security/ssl/Finished.java +++ b/src/java.base/share/classes/sun/security/ssl/Finished.java @@ -410,6 +410,10 @@ final class Finished { chc.conContext.clientVerifyData = fm.verifyData; } + if (chc.statelessResumption) { + chc.handshakeConsumers.put( + SSLHandshake.NEW_SESSION_TICKET.id, SSLHandshake.NEW_SESSION_TICKET); + } // update the consumers and producers if (!chc.isResumption) { chc.conContext.consumers.put(ContentType.CHANGE_CIPHER_SPEC.id, @@ -441,6 +445,10 @@ final class Finished { private byte[] onProduceFinished(ServerHandshakeContext shc, HandshakeMessage message) throws IOException { + if (shc.statelessResumption) { + NewSessionTicket.handshake12Producer.produce(shc, message); + } + // Refresh handshake hash shc.handshakeHash.update(); @@ -473,7 +481,8 @@ final class Finished { SSLHandshake.FINISHED.id, SSLHandshake.FINISHED); shc.conContext.inputRecord.expectingFinishFlight(); } else { - if (shc.handshakeSession.isRejoinable()) { + if (shc.handshakeSession.isRejoinable() && + !shc.statelessResumption) { ((SSLSessionContextImpl)shc.sslContext. engineGetServerSessionContext()).put( shc.handshakeSession); @@ -591,7 +600,8 @@ final class Finished { } if (shc.isResumption) { - if (shc.handshakeSession.isRejoinable()) { + if (shc.handshakeSession.isRejoinable() && + !shc.statelessResumption) { ((SSLSessionContextImpl)shc.sslContext. engineGetServerSessionContext()).put( shc.handshakeSession); @@ -915,9 +925,9 @@ final class Finished { // save the session if (!chc.isResumption && chc.handshakeSession.isRejoinable()) { - SSLSessionContextImpl sessionContext = (SSLSessionContextImpl) - chc.sslContext.engineGetClientSessionContext(); - sessionContext.put(chc.handshakeSession); + ((SSLSessionContextImpl)chc.sslContext. + engineGetClientSessionContext()). + put(chc.handshakeSession); } // derive salt secret @@ -1028,10 +1038,11 @@ final class Finished { shc.negotiatedProtocol); } - // save the session - if (!shc.isResumption && shc.handshakeSession.isRejoinable()) { + // Save the session if possible and not stateless + if (!shc.statelessResumption && !shc.isResumption && + shc.handshakeSession.isRejoinable()) { SSLSessionContextImpl sessionContext = (SSLSessionContextImpl) - shc.sslContext.engineGetServerSessionContext(); + shc.sslContext.engineGetServerSessionContext(); sessionContext.put(shc.handshakeSession); } diff --git a/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java b/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java index 83f4fcee670..49149d11b05 100644 --- a/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java +++ b/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java @@ -102,6 +102,8 @@ abstract class HandshakeContext implements ConnectionContext { // Resumption boolean isResumption; SSLSessionImpl resumingSession; + // Session is using stateless resumption + boolean statelessResumption = false; final Queue> delegatedActions; volatile boolean taskDelegated = false; @@ -551,7 +553,7 @@ abstract class HandshakeContext implements ConnectionContext { List getRequestedServerNames() { if (requestedServerNames == null) { - return Collections.emptyList(); + return Collections.emptyList(); } return requestedServerNames; } diff --git a/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java b/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java index ba25159626f..673a09e86ce 100644 --- a/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java +++ b/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java @@ -28,40 +28,139 @@ import java.io.IOException; import java.math.BigInteger; import java.nio.ByteBuffer; import java.security.GeneralSecurityException; -import java.security.ProviderException; import java.security.SecureRandom; import java.text.MessageFormat; import java.util.Locale; import javax.crypto.SecretKey; import javax.net.ssl.SSLHandshakeException; import sun.security.ssl.PskKeyExchangeModesExtension.PskKeyExchangeModesSpec; - +import sun.security.ssl.SessionTicketExtension.SessionTicketSpec; import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.util.HexDumpEncoder; + +import static sun.security.ssl.SSLHandshake.NEW_SESSION_TICKET; /** * Pack of the NewSessionTicket handshake message. */ final class NewSessionTicket { - private static final int MAX_TICKET_LIFETIME = 604800; // seconds, 7 days + static final int MAX_TICKET_LIFETIME = 604800; // seconds, 7 days static final SSLConsumer handshakeConsumer = - new NewSessionTicketConsumer(); + new T13NewSessionTicketConsumer(); + static final SSLConsumer handshake12Consumer = + new T12NewSessionTicketConsumer(); static final SSLProducer kickstartProducer = new NewSessionTicketKickstartProducer(); - static final HandshakeProducer handshakeProducer = - new NewSessionTicketProducer(); + static final HandshakeProducer handshake12Producer = + new T12NewSessionTicketProducer(); /** - * The NewSessionTicketMessage handshake message. + * The NewSessionTicketMessage handshake messages. */ - static final class NewSessionTicketMessage extends HandshakeMessage { - final int ticketLifetime; - final int ticketAgeAdd; - final byte[] ticketNonce; - final byte[] ticket; - final SSLExtensions extensions; + abstract static class NewSessionTicketMessage extends HandshakeMessage { + int ticketLifetime; + byte[] ticket; - NewSessionTicketMessage(HandshakeContext context, + NewSessionTicketMessage(HandshakeContext context) { + super(context); + } + + @Override + public SSLHandshake handshakeType() { + return NEW_SESSION_TICKET; + } + + // For TLS 1.3 only + int getTicketAgeAdd() throws IOException { + throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "TicketAgeAdd not part of RFC 5077."); + } + + // For TLS 1.3 only + byte[] getTicketNonce() throws IOException { + throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "TicketNonce not part of RFC 5077."); + } + + } + /** + * NewSessionTicket for TLS 1.2 and below (RFC 5077) + */ + static final class T12NewSessionTicketMessage extends NewSessionTicketMessage { + + T12NewSessionTicketMessage(HandshakeContext context, + int ticketLifetime, byte[] ticket) { + super(context); + + this.ticketLifetime = ticketLifetime; + this.ticket = ticket; + } + + T12NewSessionTicketMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + + // RFC5077 struct { + // uint32 ticket_lifetime; + // opaque ticket<1..2^16-1>; + // } NewSessionTicket; + + super(context); + if (m.remaining() < 14) { + throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid NewSessionTicket message: no sufficient data"); + } + + this.ticketLifetime = Record.getInt32(m); + this.ticket = Record.getBytes16(m); + } + + @Override + public SSLHandshake handshakeType() { + return NEW_SESSION_TICKET; + } + + @Override + public int messageLength() { + return 4 + // ticketLifetime + 2 + ticket.length; // len of ticket + ticket + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putInt32(ticketLifetime); + hos.putBytes16(ticket); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"NewSessionTicket\": '{'\n" + + " \"ticket_lifetime\" : \"{0}\",\n" + + " \"ticket\" : '{'\n" + + "{1}\n" + + " '}'" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + ticketLifetime, + Utilities.indent(hexEncoder.encode(ticket), " "), + }; + return messageFormat.format(messageFields); + } + } + + /** + * NewSessionTicket defined by the TLS 1.3 + */ + static final class T13NewSessionTicketMessage extends NewSessionTicketMessage { + int ticketAgeAdd; + byte[] ticketNonce; + SSLExtensions extensions; + + T13NewSessionTicketMessage(HandshakeContext context, int ticketLifetime, SecureRandom generator, byte[] ticketNonce, byte[] ticket) { super(context); @@ -73,7 +172,7 @@ final class NewSessionTicket { this.extensions = new SSLExtensions(this); } - NewSessionTicketMessage(HandshakeContext context, + T13NewSessionTicketMessage(HandshakeContext context, ByteBuffer m) throws IOException { super(context); @@ -84,6 +183,7 @@ final class NewSessionTicket { // opaque ticket<1..2^16-1>; // Extension extensions<0..2^16-2>; // } NewSessionTicket; + if (m.remaining() < 14) { throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER, "Invalid NewSessionTicket message: no sufficient data"); @@ -111,24 +211,36 @@ final class NewSessionTicket { SSLExtension[] supportedExtensions = context.sslConfig.getEnabledExtensions( - SSLHandshake.NEW_SESSION_TICKET); + NEW_SESSION_TICKET); this.extensions = new SSLExtensions(this, m, supportedExtensions); } @Override public SSLHandshake handshakeType() { - return SSLHandshake.NEW_SESSION_TICKET; + return NEW_SESSION_TICKET; + } + + int getTicketAgeAdd() { + return ticketAgeAdd; + } + + byte[] getTicketNonce() { + return ticketNonce; } @Override public int messageLength() { + int extLen = extensions.length(); if (extLen == 0) { extLen = 2; // empty extensions } - return 8 + ticketNonce.length + 1 + - ticket.length + 2 + extLen; + return 4 +// ticketLifetime + 4 + // ticketAgeAdd + 1 + ticketNonce.length + // len of nonce + nonce + 2 + ticket.length + // len of ticket + ticket + extLen; } @Override @@ -153,18 +265,21 @@ final class NewSessionTicket { " \"ticket_lifetime\" : \"{0}\",\n" + " \"ticket_age_add\" : \"{1}\",\n" + " \"ticket_nonce\" : \"{2}\",\n" + - " \"ticket\" : \"{3}\",\n" + + " \"ticket\" : '{'\n" + + "{3}\n" + + " '}'" + " \"extensions\" : [\n" + "{4}\n" + " ]\n" + "'}'", Locale.ENGLISH); + HexDumpEncoder hexEncoder = new HexDumpEncoder(); Object[] messageFields = { ticketLifetime, "", //ticketAgeAdd should not be logged Utilities.toHexString(ticketNonce), - Utilities.toHexString(ticket), + Utilities.indent(hexEncoder.encode(ticket), " "), Utilities.indent(extensions.toString(), " ") }; @@ -248,25 +363,46 @@ final class NewSessionTicket { } return null; } - NewSessionTicketMessage nstm = new NewSessionTicketMessage(shc, - sessionTimeoutSeconds, shc.sslContext.getSecureRandom(), - nonceArr, newId.getId()); - if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { - SSLLogger.fine( - "Produced NewSessionTicket handshake message", nstm); - } - // create and cache the new session - // The new session must be a child of the existing session so - // they will be invalidated together, etc. + NewSessionTicketMessage nstm; + SSLSessionImpl sessionCopy = new SSLSessionImpl(shc.handshakeSession, newId); - shc.handshakeSession.addChild(sessionCopy); sessionCopy.setPreSharedKey(psk); sessionCopy.setPskIdentity(newId.getId()); - sessionCopy.setTicketAgeAdd(nstm.ticketAgeAdd); - sessionCache.put(sessionCopy); + if (shc.statelessResumption) { + try { + nstm = new T13NewSessionTicketMessage(shc, + sessionTimeoutSeconds, shc.sslContext.getSecureRandom(), + nonceArr, new SessionTicketSpec().encrypt(shc, sessionCopy)); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced NewSessionTicket stateless " + + "handshake message", nstm); + } + } catch (Exception e) { + // Error with NST ticket, abort NST + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, e); + return null; + } + } else { + nstm = new T13NewSessionTicketMessage(shc, sessionTimeoutSeconds, + shc.sslContext.getSecureRandom(), nonceArr, + newId.getId()); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced NewSessionTicket handshake message", + nstm); + } + + // create and cache the new session + // The new session must be a child of the existing session so + // they will be invalidated together, etc. + shc.handshakeSession.addChild(sessionCopy); + sessionCopy.setTicketAgeAdd(nstm.getTicketAgeAdd()); + sessionCache.put(sessionCopy); + } // Output the handshake message. nstm.write(shc.handshakeOutput); shc.handshakeOutput.flush(); @@ -277,13 +413,13 @@ final class NewSessionTicket { } /** - * The "NewSessionTicket" handshake message producer. + * The "NewSessionTicket" handshake message producer for RFC 5077 */ - private static final class NewSessionTicketProducer + private static final class T12NewSessionTicketProducer implements HandshakeProducer { // Prevent instantiation of this class. - private NewSessionTicketProducer() { + private T12NewSessionTicketProducer() { // blank } @@ -291,24 +427,65 @@ final class NewSessionTicket { public byte[] produce(ConnectionContext context, HandshakeMessage message) throws IOException { - // NSTM may be sent in response to handshake messages. - // For example: key update + ServerHandshakeContext shc = (ServerHandshakeContext)context; - throw new ProviderException( - "NewSessionTicket handshake producer not implemented"); + // Is this session resumable? + if (!shc.handshakeSession.isRejoinable()) { + return null; + } + + // get a new session ID + SessionId newId = shc.handshakeSession.getSessionId(); + + SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) + shc.sslContext.engineGetServerSessionContext(); + int sessionTimeoutSeconds = sessionCache.getSessionTimeout(); + if (sessionTimeoutSeconds > MAX_TICKET_LIFETIME) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Session timeout is too long. No ticket sent."); + } + return null; + } + + NewSessionTicketMessage nstm; + + SSLSessionImpl sessionCopy = + new SSLSessionImpl(shc.handshakeSession, newId); + sessionCopy.setPskIdentity(newId.getId()); + + try { + nstm = new T12NewSessionTicketMessage(shc, sessionTimeoutSeconds, + new SessionTicketSpec().encrypt(shc, sessionCopy)); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced NewSessionTicket stateless handshake message", nstm); + } + } catch (Exception e) { + // Abort on error with NST ticket + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, e); + return null; + } + + // Output the handshake message. + nstm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The message has been delivered. + return null; } } private static final - class NewSessionTicketConsumer implements SSLConsumer { + class T13NewSessionTicketConsumer implements SSLConsumer { // Prevent instantiation of this class. - private NewSessionTicketConsumer() { + private T13NewSessionTicketConsumer() { // blank } @Override public void consume(ConnectionContext context, - ByteBuffer message) throws IOException { + ByteBuffer message) throws IOException { // Note: Although the resumption master secret depends on the // client's second flight, servers which do not request client @@ -317,13 +494,12 @@ final class NewSessionTicket { // upon sending its Finished rather than waiting for the client // Finished. // - // The consuming happens in client side only. As the server - // may send the NewSessionTicket before handshake complete, the - // context may be a PostHandshakeContext or HandshakeContext - // instance. + // The consuming happens in client side only and is received after + // the server's Finished message with PostHandshakeContext. + HandshakeContext hc = (HandshakeContext)context; NewSessionTicketMessage nstm = - new NewSessionTicketMessage(hc, message); + new T13NewSessionTicketMessage(hc, message); if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { SSLLogger.fine( "Consuming NewSessionTicket message", nstm); @@ -352,37 +528,95 @@ final class NewSessionTicket { } SSLSessionImpl sessionToSave = hc.conContext.conSession; - - SecretKey resumptionMasterSecret = - sessionToSave.getResumptionMasterSecret(); - if (resumptionMasterSecret == null) { - if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { - SSLLogger.fine( - "Session has no resumption master secret. Ignoring ticket."); + SecretKey psk = null; + if (hc.negotiatedProtocol.useTLS13PlusSpec()) { + SecretKey resumptionMasterSecret = + sessionToSave.getResumptionMasterSecret(); + if (resumptionMasterSecret == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Session has no resumption master secret." + + " Ignoring ticket."); + } + return; } - return; - } - // derive the PSK - SecretKey psk = derivePreSharedKey( - sessionToSave.getSuite().hashAlg, resumptionMasterSecret, - nstm.ticketNonce); + // derive the PSK + psk = derivePreSharedKey( + sessionToSave.getSuite().hashAlg, + resumptionMasterSecret, nstm.getTicketNonce()); + } // create and cache the new session // The new session must be a child of the existing session so // they will be invalidated together, etc. SessionId newId = - new SessionId(true, hc.sslContext.getSecureRandom()); + new SessionId(true, hc.sslContext.getSecureRandom()); SSLSessionImpl sessionCopy = new SSLSessionImpl(sessionToSave, newId); sessionToSave.addChild(sessionCopy); sessionCopy.setPreSharedKey(psk); - sessionCopy.setTicketAgeAdd(nstm.ticketAgeAdd); + sessionCopy.setTicketAgeAdd(nstm.getTicketAgeAdd()); sessionCopy.setPskIdentity(nstm.ticket); sessionCache.put(sessionCopy); // clean handshake context - hc.conContext.finishPostHandshake(); + if (hc.negotiatedProtocol.useTLS13PlusSpec()) { + hc.conContext.finishPostHandshake(); + } + } + } + + private static final + class T12NewSessionTicketConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T12NewSessionTicketConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + + HandshakeContext hc = (HandshakeContext)context; + hc.handshakeConsumers.remove(NEW_SESSION_TICKET.id); + + NewSessionTicketMessage nstm = new T12NewSessionTicketMessage(hc, + message); + if (nstm.ticket.length == 0) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("NewSessionTicket ticket was empty"); + } + return; + } + + // discard tickets with timeout 0 + if (nstm.ticketLifetime <= 0 || + nstm.ticketLifetime > MAX_TICKET_LIFETIME) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Discarding NewSessionTicket with lifetime " + + nstm.ticketLifetime, nstm); + } + return; + } + + SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) + hc.sslContext.engineGetClientSessionContext(); + + if (sessionCache.getSessionTimeout() > MAX_TICKET_LIFETIME) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Session cache lifetime is too long. Discarding ticket."); + } + return; + } + + hc.handshakeSession.setPskIdentity(nstm.ticket); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Consuming NewSessionTicket\n" + + nstm.toString()); + } } } } diff --git a/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java b/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java index 335cfc52823..595ed12ead7 100644 --- a/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java @@ -32,7 +32,6 @@ import java.util.List; import java.util.ArrayList; import java.util.Locale; import java.util.Arrays; -import java.util.Objects; import java.util.Collection; import javax.crypto.Mac; import javax.crypto.SecretKey; @@ -42,6 +41,9 @@ import sun.security.ssl.ClientHello.ClientHelloMessage; import sun.security.ssl.SSLExtension.ExtensionConsumer; import sun.security.ssl.SSLExtension.SSLExtensionSpec; import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SessionTicketExtension.SessionTicketSpec; +import sun.security.util.HexDumpEncoder; + import static sun.security.ssl.SSLExtension.*; /** @@ -88,7 +90,7 @@ final class PreSharedKeyExtension { @Override public String toString() { - return "{" + Utilities.toHexString(identity) + "," + + return "{" + Utilities.toHexString(identity) + ", " + obfuscatedAge + "}"; } } @@ -208,8 +210,10 @@ final class PreSharedKeyExtension { public String toString() { MessageFormat messageFormat = new MessageFormat( "\"PreSharedKey\": '{'\n" + - " \"identities\" : \"{0}\",\n" + - " \"binders\" : \"{1}\",\n" + + " \"identities\": '{'\n" + + "{0}\n" + + " '}'" + + " \"binders\": \"{1}\",\n" + "'}'", Locale.ENGLISH); @@ -222,9 +226,13 @@ final class PreSharedKeyExtension { } String identitiesString() { + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + StringBuilder result = new StringBuilder(); for (PskIdentity curId : identities) { - result.append(curId.toString() + "\n"); + result.append(" {\n"+ Utilities.indent( + hexEncoder.encode(curId.identity), " ") + + "\n }\n"); } return result.toString(); @@ -278,7 +286,7 @@ final class PreSharedKeyExtension { this.selectedIdentity = Record.getInt16(m); } - byte[] getEncoded() throws IOException { + byte[] getEncoded() { return new byte[] { (byte)((selectedIdentity >> 8) & 0xFF), (byte)(selectedIdentity & 0xFF) @@ -368,8 +376,36 @@ final class PreSharedKeyExtension { SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) shc.sslContext.engineGetServerSessionContext(); int idIndex = 0; + SSLSessionImpl s = null; + for (PskIdentity requestedId : pskSpec.identities) { - SSLSessionImpl s = sessionCache.get(requestedId.identity); + // If we are keeping state, see if the identity is in the cache + if (requestedId.identity.length == SessionId.MAX_LENGTH) { + s = sessionCache.get(requestedId.identity); + } + // See if the identity is a stateless ticket + if (s == null && + requestedId.identity.length > SessionId.MAX_LENGTH && + sessionCache.statelessEnabled()) { + ByteBuffer b = + new SessionTicketSpec(requestedId.identity). + decrypt(shc); + if (b != null) { + try { + s = new SSLSessionImpl(shc, b); + } catch (IOException | RuntimeException e) { + s = null; + } + } + if (b == null || s == null) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Stateless session ticket invalid"); + } + } + } + if (s != null && canRejoin(clientHello, shc, s)) { if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { SSLLogger.fine("Resuming session: ", s); @@ -391,7 +427,6 @@ final class PreSharedKeyExtension { shc.resumingSession = null; } } - // update the context shc.handshakeExtensions.put( SSLExtension.CH_PRE_SHARED_KEY, pskSpec); @@ -708,7 +743,8 @@ final class PreSharedKeyExtension { int hashLength, List identities) { List binders = new ArrayList<>(); byte[] binderProto = new byte[hashLength]; - for (PskIdentity curId : identities) { + int i = identities.size(); + while (i-- > 0) { binders.add(binderProto); } diff --git a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java index a113b20e099..87997c83e7d 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java @@ -71,11 +71,13 @@ public abstract class SSLContextImpl extends SSLContextSpi { private volatile StatusResponseManager statusResponseManager; private final ReentrantLock contextLock = new ReentrantLock(); + final HashMap keyHashMap = new HashMap<>(); + SSLContextImpl() { ephemeralKeyManager = new EphemeralKeyManager(); - clientCache = new SSLSessionContextImpl(); - serverCache = new SSLSessionContextImpl(); + clientCache = new SSLSessionContextImpl(false); + serverCache = new SSLSessionContextImpl(true); } @Override diff --git a/src/java.base/share/classes/sun/security/ssl/SSLExtension.java b/src/java.base/share/classes/sun/security/ssl/SSLExtension.java index ecbd209aadd..004339d234e 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLExtension.java @@ -309,8 +309,28 @@ enum SSLExtension implements SSLStringizer { // extensions defined in RFC 7924 CACHED_INFO (0x0019, "cached_info"), - // extensions defined in RFC 4507/5077 - SESSION_TICKET (0x0023, "session_ticket"), + // extensions defined in RFC 5077 + CH_SESSION_TICKET (0x0023, "session_ticket", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_10_12, + SessionTicketExtension.chNetworkProducer, + SessionTicketExtension.chOnLoadConsumer, + null, + null, + null, + SessionTicketExtension.steStringizer), + //null), + + SH_SESSION_TICKET (0x0023, "session_ticket", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_10_12, + SessionTicketExtension.shNetworkProducer, + SessionTicketExtension.shOnLoadConsumer, + null, + null, + null, + SessionTicketExtension.steStringizer), + //null), // extensions defined in TLS 1.3 CH_EARLY_DATA (0x002A, "early_data"), diff --git a/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java b/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java index 691f46fc14a..fba43c76f50 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -115,15 +115,19 @@ enum SSLHandshake implements SSLConsumer, HandshakeProducer { NEW_SESSION_TICKET ((byte)0x04, "new_session_ticket", (Map.Entry[])(new Map.Entry[] { new SimpleImmutableEntry( - NewSessionTicket.handshakeConsumer, - ProtocolVersion.PROTOCOLS_OF_13 - ) + NewSessionTicket.handshake12Consumer, + ProtocolVersion.PROTOCOLS_TO_12 + ), + new SimpleImmutableEntry( + NewSessionTicket.handshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_13 + ) }), (Map.Entry[])(new Map.Entry[] { new SimpleImmutableEntry( - NewSessionTicket.handshakeProducer, - ProtocolVersion.PROTOCOLS_OF_13 - ) + NewSessionTicket.handshake12Producer, + ProtocolVersion.PROTOCOLS_TO_12 + ) })), END_OF_EARLY_DATA ((byte)0x05, "end_of_early_data"), diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java index 08966a7160b..a8307d219e1 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -33,11 +33,34 @@ import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSessionContext; import sun.security.action.GetIntegerAction; +import sun.security.action.GetPropertyAction; import sun.security.util.Cache; +/** + * @systemProperty jdk.tls.server.enableSessionTicketExtension} determines if the + * server will provide stateless session tickets, if the client supports it, + * as described in RFC 5077 and RFC 8446. a stateless session ticket + * contains the encrypted server's state which saves server resources. + * + * {@systemProperty jdk.tls.client.enableSessionTicketExtension} determines if the + * client will send an extension in the ClientHello in the pre-TLS 1.3. + * This extension allows the client to accept the server's session state for + * Server Side stateless resumption (RFC 5077). Setting the property to + * "true" turns this on, by default it is false. For TLS 1.3, the system + * property is not needed as this support is part of the spec. + * + * {@systemProperty jdk.tls.server.sessionTicketTimeout} determines how long + * a session in the server cache or the stateless resumption tickets are + * available for use. The value set by the property can be modified by + * {@code SSLSessionContext.setSessionTimeout()} during runtime. + * + */ + final class SSLSessionContextImpl implements SSLSessionContext { private final static int DEFAULT_MAX_CACHE_SIZE = 20480; + // Default lifetime of a session. 24 hours + final static int DEFAULT_SESSION_TIMEOUT = 86400; private final Cache sessionCache; // session cache, session id as key @@ -46,16 +69,24 @@ final class SSLSessionContextImpl implements SSLSessionContext { private int cacheLimit; // the max cache size private int timeout; // timeout in seconds + // Does this context support stateless session (RFC 5077) + private boolean statelessSession = true; + // package private - SSLSessionContextImpl() { - cacheLimit = getDefaultCacheLimit(); // default cache size - timeout = 86400; // default, 24 hours + SSLSessionContextImpl(boolean server) { + timeout = DEFAULT_SESSION_TIMEOUT; + cacheLimit = getDefaults(server); // default cache size // use soft reference sessionCache = Cache.newSoftMemoryCache(cacheLimit, timeout); sessionHostPortCache = Cache.newSoftMemoryCache(cacheLimit, timeout); } + // Stateless sessions when available, but there is a cache + boolean statelessEnabled() { + return statelessSession; + } + /** * Returns the SSLSession bound to the specified session id. */ @@ -163,8 +194,7 @@ final class SSLSessionContextImpl implements SSLSessionContext { } private static String getKey(String hostname, int port) { - return (hostname + ":" + - String.valueOf(port)).toLowerCase(Locale.ENGLISH); + return (hostname + ":" + port).toLowerCase(Locale.ENGLISH); } // cache a SSLSession @@ -197,8 +227,51 @@ final class SSLSessionContextImpl implements SSLSessionContext { } } - private static int getDefaultCacheLimit() { + private int getDefaults(boolean server) { try { + String st; + + // Property for Session Cache state + if (server) { + st = GetPropertyAction.privilegedGetProperty( + "jdk.tls.server.enableSessionTicketExtension", "true"); + } else { + st = GetPropertyAction.privilegedGetProperty( + "jdk.tls.client.enableSessionTicketExtension", "true"); + } + if (st.compareToIgnoreCase("false") == 0) { + statelessSession = false; + } + + // Property for Session Ticket Timeout. The value can be changed + // by SSLSessionContext.setSessionTimeout(int) + String s = GetPropertyAction.privilegedGetProperty( + "jdk.tls.server.sessionTicketTimeout"); + if (s != null) { + try { + int t = Integer.parseInt(s); + if (t < 0 || + t > NewSessionTicket.MAX_TICKET_LIFETIME) { + timeout = DEFAULT_SESSION_TIMEOUT; + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("Invalid timeout given " + + "jdk.tls.server.sessionTicketTimeout: " + t + + ". Set to default value " + timeout); + } + } else { + timeout = t; + } + } catch (NumberFormatException e) { + setSessionTimeout(DEFAULT_SESSION_TIMEOUT); + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("Invalid timeout for " + + "jdk.tls.server.sessionTicketTimeout: " + s + + ". Set to default value " + timeout); + + } + } + } + int defaultCacheLimit = GetIntegerAction.privilegedGetProperty( "javax.net.ssl.sessionCacheSize", DEFAULT_MAX_CACHE_SIZE); diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java index 32ad336db1d..eb63aa135dd 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java @@ -24,8 +24,12 @@ */ package sun.security.ssl; +import sun.security.x509.X509CertImpl; + +import java.io.IOException; import java.math.BigInteger; import java.net.InetAddress; +import java.nio.ByteBuffer; import java.security.Principal; import java.security.PrivateKey; import java.security.cert.CertificateEncodingException; @@ -40,8 +44,11 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.locks.ReentrantLock; import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; import javax.net.ssl.ExtendedSSLSession; +import javax.net.ssl.SNIHostName; import javax.net.ssl.SNIServerName; +import javax.net.ssl.SSLException; import javax.net.ssl.SSLPeerUnverifiedException; import javax.net.ssl.SSLPermission; import javax.net.ssl.SSLSessionBindingEvent; @@ -251,6 +258,371 @@ final class SSLSessionImpl extends ExtendedSSLSession { } } + /** + * < 2 bytes > protocolVersion + * < 2 bytes > cipherSuite + * < 2 bytes > localSupportedSignAlgs entries + * < 2 bytes per entries > localSupportedSignAlgs + * < 2 bytes > preSharedKey length + * < length in bytes > preSharedKey + * < 1 byte > pskIdentity length + * < length in bytes > pskIdentity + * < 1 byte > masterSecret length + * < 1 byte > masterSecret algorithm length + * < length in bytes > masterSecret algorithm + * < 2 bytes > masterSecretKey length + * < length in bytes> masterSecretKey + * < 1 byte > useExtendedMasterSecret + * < 1 byte > identificationProtocol length + * < length in bytes > identificationProtocol + * < 1 byte > serverNameIndication length + * < length in bytes > serverNameIndication + * < 1 byte > Number of requestedServerNames entries + * < 1 byte > ServerName length + * < length in bytes > ServerName + * < 4 bytes > creationTime + * < 1 byte > Length of peer host + * < length in bytes > peer host + * < 2 bytes> peer port + * < 1 byte > Number of peerCerts entries + * < 4 byte > peerCert length + * < length in bytes > peerCert + * < 1 byte > localCerts type (Cert, PSK, Anonymous) + * Certificate + * < 1 byte > Number of Certificate entries + * < 4 byte> Certificate length + * < length in bytes> Certificate + * PSK + * < 1 byte > Number of PSK entries + * < 1 bytes > PSK algorithm length + * < length in bytes > PSK algorithm string + * < 4 bytes > PSK key length + * < length in bytes> PSK key + * < 4 bytes > PSK identity length + * < length in bytes> PSK identity + * Anonymous + * < 1 byte > + */ + + SSLSessionImpl(HandshakeContext hc, ByteBuffer buf) throws IOException { + int i = 0; + byte[] b; + + this.localSupportedSignAlgs = new ArrayList<>(); + + boundValues = null; + + this.protocolVersion = ProtocolVersion.valueOf(Short.toUnsignedInt(buf.getShort())); + + if (protocolVersion.useTLS13PlusSpec()) { + this.sessionId = new SessionId(false, null); + } else { + // The CH session id may reset this if it's provided + this.sessionId = new SessionId(true, + hc.sslContext.getSecureRandom()); + } + + this.cipherSuite = CipherSuite.valueOf(Short.toUnsignedInt(buf.getShort())); + + // Local Supported signature algorithms + i = Short.toUnsignedInt(buf.getShort()); + while (i-- > 0) { + this.localSupportedSignAlgs.add(SignatureScheme.valueOf( + Short.toUnsignedInt(buf.getShort()))); + } + + // PSK + i = Short.toUnsignedInt(buf.getShort()); + if (i > 0) { + b = new byte[i]; + // Get algorithm string + buf.get(b, 0, i); + // Encoded length + i = Short.toUnsignedInt(buf.getShort()); + // Encoded SecretKey + b = new byte[i]; + buf.get(b); + this.preSharedKey = new SecretKeySpec(b, "TlsMasterSecret"); + } else { + this.preSharedKey = null; + } + + // PSK identity + i = buf.get(); + if (i > 0) { + b = new byte[i]; + buf.get(b); + this.pskIdentity = b; + } else { + this.pskIdentity = null; + } + + // Master secret length of secret key algorithm (one byte) + i = buf.get(); + if (i > 0) { + b = new byte[i]; + // Get algorithm string + buf.get(b, 0, i); + // Encoded length + i = Short.toUnsignedInt(buf.getShort()); + // Encoded SecretKey + b = new byte[i]; + buf.get(b); + this.masterSecret = new SecretKeySpec(b, "TlsMasterSecret"); + } else { + this.masterSecret = null; + } + // Use extended master secret + this.useExtendedMasterSecret = (buf.get() != 0); + + // Identification Protocol + i = buf.get(); + if (i == 0) { + identificationProtocol = null; + } else { + b = new byte[i]; + identificationProtocol = + buf.get(b, 0, i).asCharBuffer().toString(); + } + + // SNI + i = buf.get(); // length + if (i == 0) { + serverNameIndication = null; + } else { + b = new byte[i]; + buf.get(b, 0, b.length); + serverNameIndication = new SNIHostName(b); + } + + // List of SNIServerName + int len = Short.toUnsignedInt(buf.getShort()); + if (len == 0) { + this.requestedServerNames = Collections.emptyList(); + } else { + requestedServerNames = new ArrayList<>(); + while (len > 0) { + int l = buf.get(); + b = new byte[l]; + buf.get(b, 0, l); + requestedServerNames.add(new SNIHostName(new String(b))); + len--; + } + } + + // Get creation time + this.creationTime = buf.getLong(); + + // Get Peer host & port + i = Byte.toUnsignedInt(buf.get()); + if (i == 0) { + this.host = new String(); + } else { + b = new byte[i]; + this.host = buf.get(b).toString(); + } + this.port = Short.toUnsignedInt(buf.getShort()); + + // Peer certs + i = buf.get(); + if (i == 0) { + this.peerCerts = null; + } else { + this.peerCerts = new X509Certificate[i]; + int j = 0; + while (i > j) { + b = new byte[buf.getInt()]; + buf.get(b); + try { + this.peerCerts[j] = new X509CertImpl(b); + } catch (Exception e) { + throw new IOException(e); + } + j++; + } + } + + // Get local certs of PSK + switch (buf.get()) { + case 0: + break; + case 1: + // number of certs + len = buf.get(); + this.localCerts = new X509Certificate[len]; + i = 0; + while (len > i) { + b = new byte[buf.getInt()]; + buf.get(b); + try { + this.localCerts[i] = new X509CertImpl(b); + } catch (Exception e) { + throw new IOException(e); + } + i++; + } + break; + case 2: + // pre-shared key + // Length of pre-shared key algorithm (one byte) + i = buf.get(); + b = new byte[i]; + String alg = buf.get(b, 0, i).asCharBuffer().toString(); + // Get length of encoding + i = Short.toUnsignedInt(buf.getShort()); + // Get encoding + b = new byte[i]; + buf.get(b); + this.preSharedKey = new SecretKeySpec(b, alg); + // Get identity len + this.pskIdentity = new byte[buf.get()]; + buf.get(pskIdentity); + break; + default: + throw new SSLException("Failed local certs of session."); + } + + context = (SSLSessionContextImpl) + hc.sslContext.engineGetServerSessionContext(); + } + + /** + * Write out a SSLSessionImpl in a byte array for a stateless session ticket + */ + byte[] write() throws Exception { + byte[] b; + HandshakeOutStream hos = new HandshakeOutStream(null); + + hos.putInt16(protocolVersion.id); + hos.putInt16(cipherSuite.id); + + // Local Supported signature algorithms + int l = localSupportedSignAlgs.size(); + hos.putInt16(l); + SignatureScheme[] sig = new SignatureScheme[l]; + localSupportedSignAlgs.toArray(sig); + for (SignatureScheme s : sig) { + hos.putInt16(s.id); + } + + // PSK + if (preSharedKey == null || + preSharedKey.getAlgorithm() == null) { + hos.putInt16(0); + } else { + hos.putInt16(preSharedKey.getAlgorithm().length()); + if (preSharedKey.getAlgorithm().length() != 0) { + hos.write(preSharedKey.getAlgorithm().getBytes()); + } + b = preSharedKey.getEncoded(); + hos.putInt16(b.length); + hos.write(b, 0, b.length); + } + + // PSK Identity + if (pskIdentity == null) { + hos.putInt8(0); + } else { + hos.putInt8(pskIdentity.length); + hos.write(pskIdentity, 0, pskIdentity.length); + } + + // Master Secret + if (getMasterSecret() == null || + getMasterSecret().getAlgorithm() == null) { + hos.putInt8(0); + } else { + hos.putInt8(getMasterSecret().getAlgorithm().length()); + if (getMasterSecret().getAlgorithm().length() != 0) { + hos.write(getMasterSecret().getAlgorithm().getBytes()); + } + b = getMasterSecret().getEncoded(); + hos.putInt16(b.length); + hos.write(b, 0, b.length); + } + + hos.putInt8(useExtendedMasterSecret ? 1 : 0); + + // Identification Protocol + if (identificationProtocol == null) { + hos.putInt8(0); + } else { + hos.putInt8(identificationProtocol.length()); + hos.write(identificationProtocol.getBytes(), 0, + identificationProtocol.length()); + } + + // SNI + if (serverNameIndication == null) { + hos.putInt8(0); + } else { + b = serverNameIndication.getEncoded(); + hos.putInt8(b.length); + hos.write(b, 0, b.length); + } + + // List of SNIServerName + hos.putInt16(requestedServerNames.size()); + if (requestedServerNames.size() > 0) { + for (SNIServerName host: requestedServerNames) { + b = host.getEncoded(); + hos.putInt8(b.length); + hos.write(b, 0, b.length); + } + } + + ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES); + hos.writeBytes(buffer.putLong(creationTime).array()); + + // peer Host & Port + if (host == null || host.length() == 0) { + hos.putInt8(0); + } else { + hos.putInt8(host.length()); + hos.writeBytes(host.getBytes()); + } + hos.putInt16(port); + + // Peer cert + if (peerCerts == null || peerCerts.length == 0) { + hos.putInt8(0); + } else { + hos.putInt8(peerCerts.length); + for (X509Certificate c : peerCerts) { + b = c.getEncoded(); + hos.putInt32(b.length); + hos.writeBytes(b); + } + } + + // Client identity + if (localCerts != null && localCerts.length > 0) { + // certificate based + hos.putInt8(1); + hos.putInt8(localCerts.length); + for (X509Certificate c : localCerts) { + b = c.getEncoded(); + hos.putInt32(b.length); + hos.writeBytes(b); + } + } else if (preSharedKey != null) { + // pre-shared key + hos.putInt8(2); + hos.putInt8(preSharedKey.getAlgorithm().length()); + hos.write(preSharedKey.getAlgorithm().getBytes()); + b = preSharedKey.getEncoded(); + hos.putInt32(b.length); + hos.writeBytes(b); + hos.putInt32(pskIdentity.length); + hos.writeBytes(pskIdentity); + } else { + // anonymous + hos.putInt8(0); + } + + return hos.toByteArray(); + } + void setMasterSecret(SecretKey secret) { masterSecret = secret; } @@ -333,6 +705,10 @@ final class SSLSessionImpl extends ExtendedSSLSession { } } + byte[] getPskIdentity() { + return pskIdentity; + } + void setPeerCertificates(X509Certificate[] peer) { if (peerCerts == null) { peerCerts = peer; @@ -400,8 +776,12 @@ final class SSLSessionImpl extends ExtendedSSLSession { * maximum lifetime in any case. */ boolean isRejoinable() { + // TLS 1.3 can have no session id + if (protocolVersion.useTLS13PlusSpec()) { + return (!invalidated && isLocalAuthenticationValid()); + } return sessionId != null && sessionId.length() != 0 && - !invalidated && isLocalAuthenticationValid(); + !invalidated && isLocalAuthenticationValid(); } @Override diff --git a/src/java.base/share/classes/sun/security/ssl/ServerHello.java b/src/java.base/share/classes/sun/security/ssl/ServerHello.java index 70bab8ac223..f6c323a995e 100644 --- a/src/java.base/share/classes/sun/security/ssl/ServerHello.java +++ b/src/java.base/share/classes/sun/security/ssl/ServerHello.java @@ -47,6 +47,8 @@ import sun.security.ssl.SSLCipher.SSLWriteCipher; import sun.security.ssl.SSLHandshake.HandshakeMessage; import sun.security.ssl.SupportedVersionsExtension.SHSupportedVersionsSpec; +import static sun.security.ssl.SSLExtension.SH_SESSION_TICKET; + /** * Pack of the ServerHello/HelloRetryRequest handshake message. */ @@ -337,6 +339,15 @@ final class ServerHello { shc.handshakeProducers.put(SSLHandshake.SERVER_HELLO_DONE.id, SSLHandshake.SERVER_HELLO_DONE); } else { + // stateless and use the client session id (RFC 5077 3.4) + if (shc.statelessResumption) { + shc.resumingSession = new SSLSessionImpl(shc.resumingSession, + (clientHello.sessionId.length() == 0) ? + new SessionId(true, + shc.sslContext.getSecureRandom()) : + new SessionId(clientHello.sessionId.getId()) + ); + } shc.handshakeSession = shc.resumingSession; shc.negotiatedProtocol = shc.resumingSession.getProtocolVersion(); @@ -491,6 +502,9 @@ final class ServerHello { ServerHandshakeContext shc = (ServerHandshakeContext)context; ClientHelloMessage clientHello = (ClientHelloMessage)message; + SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) + shc.sslContext.engineGetServerSessionContext(); + // If client hasn't specified a session we can resume, start a // new one and choose its cipher suite and compression options, // unless new session creation is disabled for this connection! @@ -546,8 +560,6 @@ final class ServerHello { shc.resumingSession.consumePreSharedKey()); // The session can't be resumed again---remove it from cache - SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) - shc.sslContext.engineGetServerSessionContext(); sessionCache.remove(shc.resumingSession.getSessionId()); } @@ -679,6 +691,11 @@ final class ServerHello { // Update the context for master key derivation. shc.handshakeKeyDerivation = kd; + // Check if the server supports stateless resumption + if (sessionCache.statelessEnabled()) { + shc.statelessResumption = true; + } + // The handshake message has been delivered. return null; } @@ -1098,9 +1115,23 @@ final class ServerHello { throw chc.conContext.fatal(Alert.PROTOCOL_VERSION, "New session creation is disabled"); } - chc.handshakeSession = new SSLSessionImpl(chc, - chc.negotiatedCipherSuite, - serverHello.sessionId); + + if (serverHello.sessionId.length() == 0 && + chc.statelessResumption) { + SessionId newId = new SessionId(true, + chc.sslContext.getSecureRandom()); + chc.handshakeSession = new SSLSessionImpl(chc, + chc.negotiatedCipherSuite, newId); + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Locally assigned Session Id: " + + newId.toString()); + } + } else { + chc.handshakeSession = new SSLSessionImpl(chc, + chc.negotiatedCipherSuite, + serverHello.sessionId); + } chc.handshakeSession.setMaximumPacketSize( chc.sslConfig.maximumPacketSize); } @@ -1127,6 +1158,11 @@ final class ServerHello { chc.conContext.consumers.putIfAbsent( ContentType.CHANGE_CIPHER_SPEC.id, ChangeCipherSpec.t10Consumer); + if (chc.statelessResumption) { + chc.handshakeConsumers.putIfAbsent( + SSLHandshake.NEW_SESSION_TICKET.id, + SSLHandshake.NEW_SESSION_TICKET); + } chc.handshakeConsumers.put( SSLHandshake.FINISHED.id, SSLHandshake.FINISHED); diff --git a/src/java.base/share/classes/sun/security/ssl/SessionId.java b/src/java.base/share/classes/sun/security/ssl/SessionId.java index 9eb5034adee..f7dedc68fb3 100644 --- a/src/java.base/share/classes/sun/security/ssl/SessionId.java +++ b/src/java.base/share/classes/sun/security/ssl/SessionId.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -36,7 +36,7 @@ import javax.net.ssl.SSLProtocolException; * @author David Brownell */ final class SessionId { - private static final int MAX_LENGTH = 32; + static final int MAX_LENGTH = 32; private final byte[] sessionId; // max 32 bytes // Constructs a new session ID ... perhaps for a rejoinable session diff --git a/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java b/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java new file mode 100644 index 00000000000..2ab2aeec461 --- /dev/null +++ b/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java @@ -0,0 +1,539 @@ +/* + * Copyright (c) 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 + * 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. + */ + +package sun.security.ssl; + +import sun.security.action.GetPropertyAction; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; +import sun.security.util.HexDumpEncoder; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; +import javax.crypto.spec.GCMParameterSpec; +import javax.net.ssl.SSLProtocolException; + +import static sun.security.ssl.SSLExtension.CH_SESSION_TICKET; +import static sun.security.ssl.SSLExtension.SH_SESSION_TICKET; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.text.MessageFormat; +import java.util.Collection; +import java.util.Locale; + +/** + * SessionTicketExtension is an implementation of RFC 5077 with some internals + * that are used for stateless operation in TLS 1.3. + * + * {@systemProperty jdk.tls.server.statelessKeyTimeout} can override the default + * amount of time, in seconds, for how long a randomly-generated key and + * parameters can be used before being regenerated. The key material is used + * to encrypt the stateless session ticket that is sent to the client that will + * be used during resumption. Default is 3600 seconds (1 hour) + * + */ + +final class SessionTicketExtension { + + static final HandshakeProducer chNetworkProducer = + new T12CHSessionTicketProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new T12CHSessionTicketConsumer(); + static final HandshakeProducer shNetworkProducer = + new T12SHSessionTicketProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new T12SHSessionTicketConsumer(); + + static final SSLStringizer steStringizer = new SessionTicketStringizer(); + + // Time in milliseconds until key is changed for encrypting session state + private static final int TIMEOUT_DEFAULT = 3600 * 1000; + private static final int keyTimeout; + private static int currentKeyID = new SecureRandom().nextInt(); + private static final int KEYLEN = 256; + + static { + String s = GetPropertyAction.privilegedGetProperty( + "jdk.tls.server.statelessKeyTimeout"); + if (s != null) { + int kt; + try { + kt = Integer.parseInt(s) * 1000; // change to ms + if (kt < 0 || + kt > NewSessionTicket.MAX_TICKET_LIFETIME) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("Invalid timeout for " + + "jdk.tls.server.statelessKeyTimeout: " + + kt + ". Set to default value " + + TIMEOUT_DEFAULT + "sec"); + } + kt = TIMEOUT_DEFAULT; + } + } catch (NumberFormatException e) { + kt = TIMEOUT_DEFAULT; + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("Invalid timeout for " + + "jdk.tls.server.statelessKeyTimeout: " + s + + ". Set to default value " + TIMEOUT_DEFAULT + + "sec"); + } + } + keyTimeout = kt; + } else { + keyTimeout = TIMEOUT_DEFAULT; + } + } + + // Crypto key context for session state. Used with stateless operation. + final static class StatelessKey { + final long timeout; + final SecretKey key; + final int num; + + StatelessKey(HandshakeContext hc, int newNum) { + SecretKey k = null; + try { + KeyGenerator kg = KeyGenerator.getInstance("AES"); + kg.init(KEYLEN, hc.sslContext.getSecureRandom()); + k = kg.generateKey(); + } catch (NoSuchAlgorithmException e) { + // should not happen; + } + key = k; + timeout = System.currentTimeMillis() + keyTimeout; + num = newNum; + hc.sslContext.keyHashMap.put(Integer.valueOf(num), this); + } + + // Check if key needs to be changed + boolean isExpired() { + return ((System.currentTimeMillis()) > timeout); + } + + // Check if this key is ready for deletion. + boolean isInvalid(long sessionTimeout) { + return ((System.currentTimeMillis()) > (timeout + sessionTimeout)); + } + } + + private static final class KeyState { + + // Get a key with a specific key number + static StatelessKey getKey(HandshakeContext hc, int num) { + StatelessKey ssk = hc.sslContext.keyHashMap.get(num); + + if (ssk == null || ssk.isInvalid(getSessionTimeout(hc))) { + return null; + } + return ssk; + } + + // Get the current valid key, this will generate a new key if needed + static StatelessKey getCurrentKey(HandshakeContext hc) { + StatelessKey ssk = hc.sslContext.keyHashMap.get(currentKeyID); + + if (ssk != null && !ssk.isExpired()) { + return ssk; + } + return nextKey(hc); + } + + // This method locks when the first getCurrentKey() finds it to be too + // old and create a new key to replace the current key. After the new + // key established, the lock can be released so following + // operations will start using the new key. + // The first operation will take a longer code path by generating the + // next key and cleaning up old keys. + private static StatelessKey nextKey(HandshakeContext hc) { + StatelessKey ssk; + + synchronized (hc.sslContext.keyHashMap) { + // If the current key is no longer expired, it was already + // updated by a previous operation and we can return. + ssk = hc.sslContext.keyHashMap.get(currentKeyID); + if (ssk != null && !ssk.isExpired()) { + return ssk; + } + int newNum; + if (currentKeyID == Integer.MAX_VALUE) { + newNum = 0; + } else { + newNum = currentKeyID + 1; + } + // Get new key + ssk = new StatelessKey(hc, newNum); + currentKeyID = newNum; + // Release lock since the new key is ready to be used. + } + + // Clean up any old keys, then return the current key + cleanup(hc); + return ssk; + } + + // Deletes any invalid SessionStateKeys. + static void cleanup(HandshakeContext hc) { + int sessionTimeout = getSessionTimeout(hc); + + StatelessKey ks; + for (Object o : hc.sslContext.keyHashMap.keySet().toArray()) { + Integer i = (Integer)o; + ks = hc.sslContext.keyHashMap.get(i); + if (ks.isInvalid(sessionTimeout)) { + try { + ks.key.destroy(); + } catch (Exception e) { + // Suppress + } + hc.sslContext.keyHashMap.remove(i); + } + } + } + + static int getSessionTimeout(HandshakeContext hc) { + return hc.sslContext.engineGetServerSessionContext(). + getSessionTimeout() * 1000; + } + } + + /** + * This class contains the session state that is in the session ticket. + * Using the key associated with the ticket, the class encrypts and + * decrypts the data, but does not interpret the data. + */ + static final class SessionTicketSpec implements SSLExtensionSpec { + private static final int GCM_TAG_LEN = 128; + ByteBuffer data; + static final ByteBuffer zero = ByteBuffer.wrap(new byte[0]); + + SessionTicketSpec() { + data = zero; + } + + SessionTicketSpec(byte[] b) throws IOException { + this(ByteBuffer.wrap(b)); + } + + SessionTicketSpec(ByteBuffer buf) throws IOException { + if (buf == null) { + throw new SSLProtocolException( + "SessionTicket buffer too small"); + } + if (buf.remaining() > 65536) { + throw new SSLProtocolException( + "SessionTicket buffer too large. " + buf.remaining()); + } + + data = buf; + } + + public byte[] encrypt(HandshakeContext hc, SSLSessionImpl session) + throws IOException { + byte[] encrypted; + StatelessKey key = KeyState.getCurrentKey(hc); + byte[] iv = new byte[16]; + + try { + SecureRandom random = hc.sslContext.getSecureRandom(); + random.nextBytes(iv); + Cipher c = Cipher.getInstance("AES/GCM/NoPadding"); + c.init(Cipher.ENCRYPT_MODE, key.key, + new GCMParameterSpec(GCM_TAG_LEN, iv)); + c.updateAAD(new byte[] { + (byte)(key.num >>> 24), + (byte)(key.num >>> 16), + (byte)(key.num >>> 8), + (byte)(key.num)} + ); + encrypted = c.doFinal(session.write()); + + byte[] result = new byte[encrypted.length + Integer.BYTES + + iv.length]; + result[0] = (byte)(key.num >>> 24); + result[1] = (byte)(key.num >>> 16); + result[2] = (byte)(key.num >>> 8); + result[3] = (byte)(key.num); + System.arraycopy(iv, 0, result, Integer.BYTES, iv.length); + System.arraycopy(encrypted, 0, result, + Integer.BYTES + iv.length, encrypted.length); + return result; + } catch (Exception e) { + throw hc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, e); + } + } + + ByteBuffer decrypt(HandshakeContext hc) { + int keyID; + byte[] iv; + try { + keyID = data.getInt(); + StatelessKey key = KeyState.getKey(hc, keyID); + if (key == null) { + return null; + } + + iv = new byte[16]; + data.get(iv); + Cipher c = Cipher.getInstance("AES/GCM/NoPadding"); + c.init(Cipher.DECRYPT_MODE, key.key, + new GCMParameterSpec(GCM_TAG_LEN, iv)); + c.updateAAD(new byte[] { + (byte)(keyID >>> 24), + (byte)(keyID >>> 16), + (byte)(keyID >>> 8), + (byte)(keyID)} + ); + /* + return ByteBuffer.wrap(c.doFinal(data, + Integer.BYTES + iv.length, + data.length - (Integer.BYTES + iv.length))); + */ + ByteBuffer out; + out = ByteBuffer.allocate(data.remaining() - GCM_TAG_LEN / 8); + c.doFinal(data, out); + out.flip(); + return out; + } catch (Exception e) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Decryption failed." + e.getMessage()); + } + } + return null; + } + + byte[] getEncoded() { + byte[] out = new byte[data.capacity()]; + data.duplicate().get(out); + return out; + } + + @Override + public String toString() { + if (data == null) { + return ""; + } + if (data.capacity() == 0) { + return ""; + } + + MessageFormat messageFormat = new MessageFormat( + " \"ticket\" : '{'\n" + + "{0}\n" + + " '}'", + Locale.ENGLISH); + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + + Object[] messageFields = { + Utilities.indent(hexEncoder.encode(data.duplicate()), + " "), + }; + + return messageFormat.format(messageFields); + } + } + + static final class SessionTicketStringizer implements SSLStringizer { + SessionTicketStringizer() {} + + @Override + public String toString(ByteBuffer buffer) { + try { + return new SessionTicketSpec(buffer).toString(); + } catch (IOException e) { + return e.getMessage(); + } + } + } + + private static final class T12CHSessionTicketProducer + extends SupportedGroups implements HandshakeProducer { + T12CHSessionTicketProducer() { + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // If the context does not allow stateless tickets, exit + if (!((SSLSessionContextImpl)chc.sslContext. + engineGetClientSessionContext()).statelessEnabled()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Stateless resumption not supported"); + } + return null; + } + + chc.statelessResumption = true; + + // If resumption is not in progress, return an empty value + if (!chc.isResumption || chc.resumingSession == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Stateless resumption supported"); + } + return new SessionTicketSpec().getEncoded(); + } + + if (chc.localSupportedSignAlgs == null) { + chc.localSupportedSignAlgs = + SignatureScheme.getSupportedAlgorithms( + chc.algorithmConstraints, chc.activeProtocols); + } + + return chc.resumingSession.getPskIdentity(); + } + + } + + private static final class T12CHSessionTicketConsumer + implements ExtensionConsumer { + T12CHSessionTicketConsumer() { + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) + throws IOException { + ServerHandshakeContext shc = (ServerHandshakeContext) context; + + // Skip if extension is not provided + if (!shc.sslConfig.isAvailable(CH_SESSION_TICKET)) { + return; + } + + // Skip consumption if we are already in stateless resumption + if (shc.statelessResumption) { + return; + } + // If the context does not allow stateless tickets, exit + SSLSessionContextImpl cache = (SSLSessionContextImpl)shc.sslContext + .engineGetServerSessionContext(); + if (!cache.statelessEnabled()) { + return; + } + + if (buffer.remaining() == 0) { + shc.statelessResumption = true; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Client accepts session tickets."); + } + return; + } + + // Parse the extension. + SessionTicketSpec spec; + try { + spec = new SessionTicketSpec(buffer); + } catch (IOException | RuntimeException e) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("SessionTicket data invalid. Doing full " + + "handshake."); + } + return; + } + ByteBuffer b = spec.decrypt(shc); + if (b != null) { + shc.resumingSession = new SSLSessionImpl(shc, b); + shc.isResumption = true; + shc.statelessResumption = true; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Valid stateless session ticket found"); + } + } + } + } + + + private static final class T12SHSessionTicketProducer + extends SupportedGroups implements HandshakeProducer { + T12SHSessionTicketProducer() { + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) { + + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // If boolean is false, the CH did not have this extension + if (!shc.statelessResumption) { + return null; + } + // If the client has sent a SessionTicketExtension and stateless + // is enabled on the server, return an empty message. + // If the context does not allow stateless tickets, exit + SSLSessionContextImpl cache = (SSLSessionContextImpl)shc.sslContext + .engineGetServerSessionContext(); + if (cache.statelessEnabled()) { + return new byte[0]; + } + + shc.statelessResumption = false; + return null; + } + } + + private static final class T12SHSessionTicketConsumer + implements ExtensionConsumer { + T12SHSessionTicketConsumer() { + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) + throws IOException { + ClientHandshakeContext chc = (ClientHandshakeContext) context; + + // Skip if extension is not provided + if (!chc.sslConfig.isAvailable(SH_SESSION_TICKET)) { + chc.statelessResumption = false; + return; + } + + // If the context does not allow stateless tickets, exit + if (!((SSLSessionContextImpl)chc.sslContext. + engineGetClientSessionContext()).statelessEnabled()) { + chc.statelessResumption = false; + return; + } + + try { + if (new SessionTicketSpec(buffer) == null) { + return; + } + chc.statelessResumption = true; + } catch (IOException e) { + throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, e); + } + } + } +} diff --git a/src/java.base/share/classes/sun/security/ssl/TransportContext.java b/src/java.base/share/classes/sun/security/ssl/TransportContext.java index dd8d18a23f9..03656e56446 100644 --- a/src/java.base/share/classes/sun/security/ssl/TransportContext.java +++ b/src/java.base/share/classes/sun/security/ssl/TransportContext.java @@ -159,14 +159,19 @@ class TransportContext implements ConnectionContext { if (handshakeContext == null) { if (type == SSLHandshake.KEY_UPDATE.id || type == SSLHandshake.NEW_SESSION_TICKET.id) { - if (isNegotiated && - protocolVersion.useTLS13PlusSpec()) { - handshakeContext = new PostHandshakeContext(this); - } else { + if (!isNegotiated) { + throw fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected unnegotiated post-handshake" + + " message: " + + SSLHandshake.nameOf(type)); + } + if (type == SSLHandshake.KEY_UPDATE.id && + !protocolVersion.useTLS13PlusSpec()) { throw fatal(Alert.UNEXPECTED_MESSAGE, "Unexpected post-handshake message: " + SSLHandshake.nameOf(type)); } + handshakeContext = new PostHandshakeContext(this); } else { handshakeContext = sslConfig.isClientMode ? new ClientHandshakeContext(sslContext, this) : diff --git a/test/jdk/javax/net/ssl/DTLS/PacketLossRetransmission.java b/test/jdk/javax/net/ssl/DTLS/PacketLossRetransmission.java index 572bf14b27a..54d7f49ae09 100644 --- a/test/jdk/javax/net/ssl/DTLS/PacketLossRetransmission.java +++ b/test/jdk/javax/net/ssl/DTLS/PacketLossRetransmission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -35,7 +35,7 @@ * @run main/othervm PacketLossRetransmission client 1 client_hello * @run main/othervm PacketLossRetransmission client 2 server_hello * @run main/othervm PacketLossRetransmission client 3 hello_verify_request - * @run main/othervm PacketLossRetransmission client 4 new_session_ticket + * @run main/othervm -Djdk.tls.client.enableSessionTicketExtension=false PacketLossRetransmission client 4 new_session_ticket * @run main/othervm PacketLossRetransmission client 11 certificate * @run main/othervm PacketLossRetransmission client 12 server_key_exchange * @run main/othervm PacketLossRetransmission client 13 certificate_request @@ -51,7 +51,7 @@ * @run main/othervm PacketLossRetransmission server 1 client_hello * @run main/othervm PacketLossRetransmission server 2 server_hello * @run main/othervm PacketLossRetransmission server 3 hello_verify_request - * @run main/othervm PacketLossRetransmission server 4 new_session_ticket + * @run main/othervm -Djdk.tls.client.enableSessionTicketExtension=false PacketLossRetransmission server 4 new_session_ticket * @run main/othervm PacketLossRetransmission server 11 certificate * @run main/othervm PacketLossRetransmission server 12 server_key_exchange * @run main/othervm PacketLossRetransmission server 13 certificate_request diff --git a/test/jdk/javax/net/ssl/SSLSession/SSLCtxAccessToSessCtx.java b/test/jdk/javax/net/ssl/SSLSession/SSLCtxAccessToSessCtx.java index 95b9aae3512..4e3b8e0b076 100644 --- a/test/jdk/javax/net/ssl/SSLSession/SSLCtxAccessToSessCtx.java +++ b/test/jdk/javax/net/ssl/SSLSession/SSLCtxAccessToSessCtx.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, 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 @@ -25,7 +25,9 @@ * @test * @bug 4473210 * @summary SSLSessionContext should be accessible from SSLContext - * @run main/othervm SSLCtxAccessToSessCtx + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=false + * SSLCtxAccessToSessCtx + * * * SunJSSE does not support dynamic system properties, no way to re-use * system properties in samevm/agentvm mode. diff --git a/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java b/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java index 26e30608bdf..8aede6a3432 100644 --- a/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java +++ b/test/jdk/sun/security/ssl/DHKeyExchange/DHEKeySizing.java @@ -30,44 +30,57 @@ * @test * @bug 6956398 * @summary make ephemeral DH key match the length of the certificate key - * @run main/othervm + * @run main/othervm -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1643 267 * @run main/othervm -Djsse.enableFFDHE=false + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA true 1259 75 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=matched + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA true 1259 75 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=legacy + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA true 1259 75 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=1024 + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA true 1259 75 * * @run main/othervm -Djsse.enableFFDHE=false + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA true 233 75 * * @run main/othervm -Djsse.enableFFDHE=false + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1387 139 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=legacy + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1323 107 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=matched + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1643 267 * @run main/othervm -Djsse.enableFFDHE=false * -Djdk.tls.ephemeralDHKeySize=1024 + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing TLS_DHE_RSA_WITH_AES_128_CBC_SHA false 1387 139 * * @run main/othervm -Djsse.enableFFDHE=false + * -Djdk.tls.client.enableSessionTicketExtension=false * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 false 361 139 * @run main/othervm -Djsse.enableFFDHE=false + * -Djdk.tls.client.enableSessionTicketExtension=false * -Djdk.tls.ephemeralDHKeySize=legacy * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 false 297 107 * @run main/othervm -Djsse.enableFFDHE=false + * -Djdk.tls.client.enableSessionTicketExtension=false * -Djdk.tls.ephemeralDHKeySize=matched * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 false 361 139 * @run main/othervm -Djsse.enableFFDHE=false + * -Djdk.tls.client.enableSessionTicketExtension=false * -Djdk.tls.ephemeralDHKeySize=1024 * DHEKeySizing SSL_DH_anon_WITH_RC4_128_MD5 false 361 139 */ diff --git a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java index b8c20cc0d95..dc83824ea7e 100644 --- a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java +++ b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -26,13 +26,17 @@ * @bug 8206929 8212885 * @summary ensure that client only resumes a session if certain properties * of the session are compatible with the new connection - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 ResumeChecksClient BASIC - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksClient BASIC - * @run main/othervm ResumeChecksClient BASIC - * @run main/othervm ResumeChecksClient VERSION_2_TO_3 - * @run main/othervm ResumeChecksClient VERSION_3_TO_2 - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksClient CIPHER_SUITE - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksClient SIGNATURE_SCHEME + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient VERSION_2_TO_3 + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient VERSION_3_TO_2 + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient CIPHER_SUITE + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient SIGNATURE_SCHEME * */ diff --git a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java new file mode 100644 index 00000000000..b428a12d478 --- /dev/null +++ b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClientStateless.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 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 + * 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 8211018 + * @summary ensure that client only resumes a session if certain properties + * of the session are compatible with the new connection + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient VERSION_2_TO_3 + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient VERSION_3_TO_2 + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient CIPHER_SUITE + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksClient SIGNATURE_SCHEME + */ diff --git a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java index 14faf95d701..2ee859d2799 100644 --- a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java +++ b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -26,16 +26,18 @@ * @bug 8206929 * @summary ensure that server only resumes a session if certain properties * of the session are compatible with the new connection - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 ResumeChecksServer BASIC - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer BASIC - * @run main/othervm ResumeChecksServer BASIC - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 ResumeChecksServer CLIENT_AUTH - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer CLIENT_AUTH - * @run main/othervm ResumeChecksServer CLIENT_AUTH - * @run main/othervm ResumeChecksServer VERSION_2_TO_3 - * @run main/othervm ResumeChecksServer VERSION_3_TO_2 - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer CIPHER_SUITE - * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer SIGNATURE_SCHEME + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksServer BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer CLIENT_AUTH + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer CLIENT_AUTH + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksServer CLIENT_AUTH + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer VERSION_2_TO_3 + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksServer VERSION_2_TO_3 + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer VERSION_2_TO_3 + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer VERSION_3_TO_2 + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=false -Djdk.tls.client.enableSessionTicketExtension=true ResumeChecksServer VERSION_3_TO_2 + * @run main/othervm -Djdk.tls.server.enableSessionTicketExtension=true -Djdk.tls.client.enableSessionTicketExtension=false ResumeChecksServer VERSION_3_TO_2 * */ diff --git a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java new file mode 100644 index 00000000000..32041114f9c --- /dev/null +++ b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServerStateless.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 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 + * 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 8211018 + * @summary ensure that server only resumes a session if certain properties + * of the session are compatible with the new connection + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer CLIENT_AUTH + * @run main/othervm ResumeChecksServer VERSION_2_TO_3 + * @run main/othervm ResumeChecksServer VERSION_3_TO_2 + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer CIPHER_SUITE + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer SIGNATURE_SCHEME + */ From d3af9ce324b742526e2154081a3b485ea892b87e Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 13 Jun 2019 18:02:18 +0200 Subject: [PATCH 038/109] Added tag jdk-14+0 for changeset 22b3b7983ada --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index bdfaf6ad0f4..06573bb1caa 100644 --- a/.hgtags +++ b/.hgtags @@ -562,3 +562,4 @@ f2f11d7f7f4e7128f8aba6ffa576cfa76fbf7d1a jdk-13+21 181986c5476468bc2dd4532af49599003ee8af37 jdk-13+22 b034d2dee5fc93d42a81b65e58ce3f91e42586ff jdk-13+23 7e2238451585029680f126ccbb46d01f2ff5607f jdk-13+24 +22b3b7983adab54e318f75aeb94471f7a4429c1e jdk-14+0 From 475006482816d2cce3c22f5b44cee280c4b8eb9f Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 11 Jun 2019 16:45:20 -0700 Subject: [PATCH 039/109] 8214546: Start of release updates for JDK 14 8214547: Add SourceVersion.RELEASE_14 8214548: Add source 14 and target 14 to javac 8214549: Bump maximum recognized class file version to 58 for JDK 14 Reviewed-by: jjg, mikael, erikj, jlahoda, dholmes --- make/autoconf/version-numbers | 12 +- make/data/symbols/java.base-D.sym.txt | 638 ++++++++ make/data/symbols/java.compiler-D.sym.txt | 107 ++ make/data/symbols/java.desktop-D.sym.txt | 1402 +++++++++++++++++ make/data/symbols/java.management-D.sym.txt | 102 ++ .../symbols/java.management.rmi-D.sym.txt | 35 + make/data/symbols/java.net.http-D.sym.txt | 89 ++ make/data/symbols/java.xml-D.sym.txt | 47 + make/data/symbols/java.xml.crypto-D.sym.txt | 35 + make/data/symbols/jdk.compiler-D.sym.txt | 35 + make/data/symbols/jdk.httpserver-D.sym.txt | 52 + make/data/symbols/jdk.javadoc-D.sym.txt | 93 ++ make/data/symbols/jdk.jlink-D.sym.txt | 31 + make/data/symbols/jdk.jshell-D.sym.txt | 148 ++ make/data/symbols/symbols | 3 +- .../share/classfile/classFileParser.cpp | 2 + .../com/sun/java/util/jar/pack/Constants.java | 6 +- .../jdk/internal/module/ModuleInfo.java | 4 +- .../org/objectweb/asm/ClassReader.java | 2 +- .../internal/org/objectweb/asm/Opcodes.java | 1 + .../javax/lang/model/SourceVersion.java | 15 +- .../util/AbstractAnnotationValueVisitor9.java | 6 +- .../model/util/AbstractElementVisitor9.java | 6 +- .../lang/model/util/AbstractTypeVisitor9.java | 6 +- .../lang/model/util/ElementKindVisitor9.java | 6 +- .../lang/model/util/ElementScanner9.java | 6 +- .../util/SimpleAnnotationValueVisitor9.java | 6 +- .../model/util/SimpleElementVisitor9.java | 6 +- .../lang/model/util/SimpleTypeVisitor9.java | 6 +- .../lang/model/util/TypeKindVisitor9.java | 6 +- .../com/sun/tools/javac/code/Source.java | 19 +- .../com/sun/tools/javac/jvm/ClassFile.java | 5 +- .../com/sun/tools/javac/jvm/Profile.java | 8 +- .../com/sun/tools/javac/jvm/Target.java | 7 +- .../javac/processing/PrintingProcessor.java | 4 +- .../replacements/classfile/Classfile.java | 4 +- .../sun/tools/java/RuntimeConstants.java | 2 +- .../CommandLine/VMDeprecatedOptions.java | 2 - .../lang/module/ClassFileVersionsTest.java | 9 +- test/langtools/tools/javac/api/T6395981.java | 4 +- .../javac/classfiles/ClassVersionChecker.java | 5 +- .../javac/diags/examples/InvalidYield.java | 2 +- .../diags/examples/InvalidYieldWarning.java | 2 +- .../diags/examples/NoSwitchExpression.java | 2 +- .../examples/NoSwitchExpressionQualify.java | 2 +- .../lib/JavacTestingAbstractProcessor.java | 20 +- .../classReaderTest/Client.nopreview.out | 2 +- .../classReaderTest/Client.preview.out | 2 +- .../javac/profiles/ProfileOptionTest.java | 3 +- .../javac/switchexpr/WarnWrongYieldTest.java | 2 +- .../tools/javac/versions/Versions.java | 14 +- 51 files changed, 2944 insertions(+), 89 deletions(-) create mode 100644 make/data/symbols/java.base-D.sym.txt create mode 100644 make/data/symbols/java.compiler-D.sym.txt create mode 100644 make/data/symbols/java.desktop-D.sym.txt create mode 100644 make/data/symbols/java.management-D.sym.txt create mode 100644 make/data/symbols/java.management.rmi-D.sym.txt create mode 100644 make/data/symbols/java.net.http-D.sym.txt create mode 100644 make/data/symbols/java.xml-D.sym.txt create mode 100644 make/data/symbols/java.xml.crypto-D.sym.txt create mode 100644 make/data/symbols/jdk.compiler-D.sym.txt create mode 100644 make/data/symbols/jdk.httpserver-D.sym.txt create mode 100644 make/data/symbols/jdk.javadoc-D.sym.txt create mode 100644 make/data/symbols/jdk.jlink-D.sym.txt create mode 100644 make/data/symbols/jdk.jshell-D.sym.txt diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers index 2e5270839ad..f2b2ffdd72a 100644 --- a/make/autoconf/version-numbers +++ b/make/autoconf/version-numbers @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 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 @@ -25,18 +25,18 @@ # Default version numbers to use unless overridden by configure -DEFAULT_VERSION_FEATURE=13 +DEFAULT_VERSION_FEATURE=14 DEFAULT_VERSION_INTERIM=0 DEFAULT_VERSION_UPDATE=0 DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_EXTRA1=0 DEFAULT_VERSION_EXTRA2=0 DEFAULT_VERSION_EXTRA3=0 -DEFAULT_VERSION_DATE=2019-09-17 -DEFAULT_VERSION_CLASSFILE_MAJOR=57 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" +DEFAULT_VERSION_DATE=2020-03-17 +DEFAULT_VERSION_CLASSFILE_MAJOR=58 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 -DEFAULT_ACCEPTABLE_BOOT_VERSIONS="12 13" -DEFAULT_JDK_SOURCE_TARGET_VERSION=13 +DEFAULT_ACCEPTABLE_BOOT_VERSIONS="12 13 14" +DEFAULT_JDK_SOURCE_TARGET_VERSION=14 DEFAULT_PROMOTED_VERSION_PRE=ea LAUNCHER_NAME=openjdk diff --git a/make/data/symbols/java.base-D.sym.txt b/make/data/symbols/java.base-D.sym.txt new file mode 100644 index 00000000000..0226f3e2c94 --- /dev/null +++ b/make/data/symbols/java.base-D.sym.txt @@ -0,0 +1,638 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name java/io/ObjectInputStream +header extends java/io/InputStream implements java/io/ObjectInput,java/io/ObjectStreamConstants nestMembers java/io/ObjectInputStream$GetField flags 21 +innerclass innerClass java/io/ObjectInputFilter$Config outerClass java/io/ObjectInputFilter innerClassName Config flags 19 +innerclass innerClass java/io/ObjectInputFilter$FilterInfo outerClass java/io/ObjectInputFilter innerClassName FilterInfo flags 609 +innerclass innerClass java/io/ObjectInputFilter$Status outerClass java/io/ObjectInputFilter innerClassName Status flags 4019 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/CharSequence +header extends java/lang/Object flags 601 +innerclass innerClass java/util/PrimitiveIterator$OfInt outerClass java/util/PrimitiveIterator innerClassName OfInt flags 609 +innerclass innerClass java/util/Spliterator$OfInt outerClass java/util/Spliterator innerClassName OfInt flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/Character +header extends java/lang/Object implements java/io/Serializable,java/lang/Comparable nestMembers java/lang/Character$UnicodeScript,java/lang/Character$UnicodeBlock,java/lang/Character$Subset flags 31 signature Ljava/lang/Object;Ljava/io/Serializable;Ljava/lang/Comparable; +innerclass innerClass java/lang/Character$UnicodeBlock outerClass java/lang/Character innerClassName UnicodeBlock flags 19 +innerclass innerClass java/lang/Character$UnicodeScript outerClass java/lang/Character innerClassName UnicodeScript flags 4019 +innerclass innerClass java/lang/Character$Subset outerClass java/lang/Character innerClassName Subset flags 9 + +class name java/lang/Character$UnicodeBlock +header extends java/lang/Character$Subset nestHost java/lang/Character flags 31 +innerclass innerClass java/lang/Character$Subset outerClass java/lang/Character innerClassName Subset flags 9 +innerclass innerClass java/lang/Character$UnicodeBlock outerClass java/lang/Character innerClassName UnicodeBlock flags 19 +field name ELYMAIC descriptor Ljava/lang/Character$UnicodeBlock; flags 19 +field name NANDINAGARI descriptor Ljava/lang/Character$UnicodeBlock; flags 19 +field name TAMIL_SUPPLEMENT descriptor Ljava/lang/Character$UnicodeBlock; flags 19 +field name EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS descriptor Ljava/lang/Character$UnicodeBlock; flags 19 +field name SMALL_KANA_EXTENSION descriptor Ljava/lang/Character$UnicodeBlock; flags 19 +field name NYIAKENG_PUACHUE_HMONG descriptor Ljava/lang/Character$UnicodeBlock; flags 19 +field name WANCHO descriptor Ljava/lang/Character$UnicodeBlock; flags 19 +field name OTTOMAN_SIYAQ_NUMBERS descriptor Ljava/lang/Character$UnicodeBlock; flags 19 +field name SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A descriptor Ljava/lang/Character$UnicodeBlock; flags 19 + +class name java/lang/Character$UnicodeScript +field name ELYMAIC descriptor Ljava/lang/Character$UnicodeScript; flags 4019 +field name NANDINAGARI descriptor Ljava/lang/Character$UnicodeScript; flags 4019 +field name NYIAKENG_PUACHUE_HMONG descriptor Ljava/lang/Character$UnicodeScript; flags 4019 +field name WANCHO descriptor Ljava/lang/Character$UnicodeScript; flags 4019 + +class name java/lang/Math +-method name abs descriptor (I)I +-method name abs descriptor (J)J +-method name abs descriptor (F)F +-method name max descriptor (FF)F +-method name max descriptor (DD)D +-method name min descriptor (FF)F +-method name min descriptor (DD)D +method name abs descriptor (I)I flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name abs descriptor (J)J flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name abs descriptor (F)F flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name max descriptor (FF)F flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name max descriptor (DD)D flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name min descriptor (FF)F flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name min descriptor (DD)D flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; + +class name java/lang/Process +header extends java/lang/Object flags 421 +innerclass innerClass java/util/concurrent/ForkJoinPool$ManagedBlocker outerClass java/util/concurrent/ForkJoinPool innerClassName ManagedBlocker flags 609 +innerclass innerClass java/lang/ProcessHandle$Info outerClass java/lang/ProcessHandle innerClassName Info flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/StrictMath +-method name max descriptor (FF)F +-method name max descriptor (DD)D +-method name min descriptor (FF)F +-method name min descriptor (DD)D +method name max descriptor (FF)F flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name max descriptor (DD)D flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name min descriptor (FF)F flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; +method name min descriptor (DD)D flags 9 runtimeAnnotations @Ljdk/internal/HotSpotIntrinsicCandidate; + +class name java/lang/String +header extends java/lang/Object implements java/io/Serializable,java/lang/Comparable,java/lang/CharSequence,java/lang/constant/Constable,java/lang/constant/ConstantDesc flags 31 signature Ljava/lang/Object;Ljava/io/Serializable;Ljava/lang/Comparable;Ljava/lang/CharSequence;Ljava/lang/constant/Constable;Ljava/lang/constant/ConstantDesc; +innerclass innerClass java/util/Spliterator$OfInt outerClass java/util/Spliterator innerClassName OfInt flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/System +header extends java/lang/Object nestMembers java/lang/System$LoggerFinder,java/lang/System$Logger,java/lang/System$Logger$Level flags 31 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$LoggerFinder outerClass java/lang/System innerClassName LoggerFinder flags 409 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/constant/DynamicConstantDesc +header extends java/lang/Object implements java/lang/constant/ConstantDesc flags 421 signature Ljava/lang/Object;Ljava/lang/constant/ConstantDesc; +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 +innerclass innerClass java/lang/Enum$EnumDesc outerClass java/lang/Enum innerClassName EnumDesc flags 19 +innerclass innerClass java/lang/invoke/VarHandle$VarHandleDesc outerClass java/lang/invoke/VarHandle innerClassName VarHandleDesc flags 19 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 + +class name java/lang/constant/MethodTypeDesc +header extends java/lang/Object implements java/lang/constant/ConstantDesc,java/lang/invoke/TypeDescriptor$OfMethod flags 601 signature Ljava/lang/Object;Ljava/lang/constant/ConstantDesc;Ljava/lang/invoke/TypeDescriptor$OfMethod; +innerclass innerClass java/lang/invoke/TypeDescriptor$OfMethod outerClass java/lang/invoke/TypeDescriptor innerClassName OfMethod flags 609 +innerclass innerClass java/lang/invoke/TypeDescriptor$OfField outerClass java/lang/invoke/TypeDescriptor innerClassName OfField flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/invoke/MethodType +header extends java/lang/Object implements java/lang/constant/Constable,java/lang/invoke/TypeDescriptor$OfMethod,java/io/Serializable flags 31 signature Ljava/lang/Object;Ljava/lang/constant/Constable;Ljava/lang/invoke/TypeDescriptor$OfMethod;Ljava/lang/invoke/MethodType;>;Ljava/io/Serializable; +innerclass innerClass java/lang/invoke/TypeDescriptor$OfMethod outerClass java/lang/invoke/TypeDescriptor innerClassName OfMethod flags 609 +innerclass innerClass java/lang/invoke/TypeDescriptor$OfField outerClass java/lang/invoke/TypeDescriptor innerClassName OfField flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/invoke/TypeDescriptor$OfMethod +header extends java/lang/Object implements java/lang/invoke/TypeDescriptor nestHost java/lang/invoke/TypeDescriptor flags 601 signature ;M::Ljava/lang/invoke/TypeDescriptor$OfMethod;>Ljava/lang/Object;Ljava/lang/invoke/TypeDescriptor; +innerclass innerClass java/lang/invoke/TypeDescriptor$OfMethod outerClass java/lang/invoke/TypeDescriptor innerClassName OfMethod flags 609 +innerclass innerClass java/lang/invoke/TypeDescriptor$OfField outerClass java/lang/invoke/TypeDescriptor innerClassName OfField flags 609 + +class name java/lang/invoke/VarHandle +header extends java/lang/Object implements java/lang/constant/Constable nestMembers java/lang/invoke/VarHandle$VarHandleDesc,java/lang/invoke/VarHandle$AccessMode flags 421 +innerclass innerClass java/lang/invoke/VarHandle$AccessMode outerClass java/lang/invoke/VarHandle innerClassName AccessMode flags 4019 +innerclass innerClass java/lang/invoke/VarHandle$VarHandleDesc outerClass java/lang/invoke/VarHandle innerClassName VarHandleDesc flags 19 + +class name java/lang/module/ModuleDescriptor +header extends java/lang/Object implements java/lang/Comparable nestMembers java/lang/module/ModuleDescriptor$Builder,java/lang/module/ModuleDescriptor$Version,java/lang/module/ModuleDescriptor$Provides,java/lang/module/ModuleDescriptor$Opens,java/lang/module/ModuleDescriptor$Opens$Modifier,java/lang/module/ModuleDescriptor$Exports,java/lang/module/ModuleDescriptor$Exports$Modifier,java/lang/module/ModuleDescriptor$Requires,java/lang/module/ModuleDescriptor$Requires$Modifier,java/lang/module/ModuleDescriptor$Modifier flags 21 signature Ljava/lang/Object;Ljava/lang/Comparable; +innerclass innerClass java/lang/module/ModuleDescriptor$Version outerClass java/lang/module/ModuleDescriptor innerClassName Version flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Modifier outerClass java/lang/module/ModuleDescriptor innerClassName Modifier flags 4019 +innerclass innerClass java/lang/module/ModuleDescriptor$Builder outerClass java/lang/module/ModuleDescriptor innerClassName Builder flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Provides outerClass java/lang/module/ModuleDescriptor innerClassName Provides flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Opens outerClass java/lang/module/ModuleDescriptor innerClassName Opens flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Exports outerClass java/lang/module/ModuleDescriptor innerClassName Exports flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Requires outerClass java/lang/module/ModuleDescriptor innerClassName Requires flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Opens$Modifier outerClass java/lang/module/ModuleDescriptor$Opens innerClassName Modifier flags 4019 +innerclass innerClass java/lang/module/ModuleDescriptor$Exports$Modifier outerClass java/lang/module/ModuleDescriptor$Exports innerClassName Modifier flags 4019 +innerclass innerClass java/lang/module/ModuleDescriptor$Requires$Modifier outerClass java/lang/module/ModuleDescriptor$Requires innerClassName Modifier flags 4019 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/module/ModuleDescriptor$Builder +header extends java/lang/Object nestHost java/lang/module/ModuleDescriptor flags 31 +innerclass innerClass java/lang/module/ModuleDescriptor$Builder outerClass java/lang/module/ModuleDescriptor innerClassName Builder flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Modifier outerClass java/lang/module/ModuleDescriptor innerClassName Modifier flags 4019 +innerclass innerClass java/lang/module/ModuleDescriptor$Requires outerClass java/lang/module/ModuleDescriptor innerClassName Requires flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Version outerClass java/lang/module/ModuleDescriptor innerClassName Version flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Requires$Modifier outerClass java/lang/module/ModuleDescriptor$Requires innerClassName Modifier flags 4019 +innerclass innerClass java/lang/module/ModuleDescriptor$Exports outerClass java/lang/module/ModuleDescriptor innerClassName Exports flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Opens outerClass java/lang/module/ModuleDescriptor innerClassName Opens flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Provides outerClass java/lang/module/ModuleDescriptor innerClassName Provides flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Exports$Modifier outerClass java/lang/module/ModuleDescriptor$Exports innerClassName Modifier flags 4019 +innerclass innerClass java/lang/module/ModuleDescriptor$Opens$Modifier outerClass java/lang/module/ModuleDescriptor$Opens innerClassName Modifier flags 4019 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/lang/module/ModuleDescriptor$Requires +header extends java/lang/Object implements java/lang/Comparable nestHost java/lang/module/ModuleDescriptor flags 31 signature Ljava/lang/Object;Ljava/lang/Comparable; +innerclass innerClass java/lang/module/ModuleDescriptor$Requires outerClass java/lang/module/ModuleDescriptor innerClassName Requires flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Version outerClass java/lang/module/ModuleDescriptor innerClassName Version flags 19 +innerclass innerClass java/lang/module/ModuleDescriptor$Requires$Modifier outerClass java/lang/module/ModuleDescriptor$Requires innerClassName Modifier flags 4019 + +class name java/net/Socket +header extends java/lang/Object implements java/io/Closeable flags 21 +innerclass innerClass java/net/Proxy$Type outerClass java/net/Proxy innerClassName Type flags 4019 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/net/SocketImpl +header extends java/lang/Object implements java/net/SocketOptions flags 421 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/net/URL +header extends java/lang/Object implements java/io/Serializable flags 31 +innerclass innerClass java/net/Proxy$Type outerClass java/net/Proxy innerClassName Type flags 4019 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 + +class name java/nio/Buffer +method name slice descriptor (II)Ljava/nio/Buffer; flags 401 + +class name java/nio/ByteBuffer +method name slice descriptor (II)Ljava/nio/ByteBuffer; flags 401 +method name get descriptor (I[BII)Ljava/nio/ByteBuffer; flags 1 +method name get descriptor (I[B)Ljava/nio/ByteBuffer; flags 1 +method name put descriptor (I[BII)Ljava/nio/ByteBuffer; flags 1 +method name put descriptor (I[B)Ljava/nio/ByteBuffer; flags 1 +method name slice descriptor (II)Ljava/nio/Buffer; flags 1041 + +class name java/nio/CharBuffer +method name slice descriptor (II)Ljava/nio/CharBuffer; flags 401 +method name get descriptor (I[CII)Ljava/nio/CharBuffer; flags 1 +method name get descriptor (I[C)Ljava/nio/CharBuffer; flags 1 +method name put descriptor (I[CII)Ljava/nio/CharBuffer; flags 1 +method name put descriptor (I[C)Ljava/nio/CharBuffer; flags 1 +method name slice descriptor (II)Ljava/nio/Buffer; flags 1041 + +class name java/nio/DoubleBuffer +method name slice descriptor (II)Ljava/nio/DoubleBuffer; flags 401 +method name get descriptor (I[DII)Ljava/nio/DoubleBuffer; flags 1 +method name get descriptor (I[D)Ljava/nio/DoubleBuffer; flags 1 +method name put descriptor (I[DII)Ljava/nio/DoubleBuffer; flags 1 +method name put descriptor (I[D)Ljava/nio/DoubleBuffer; flags 1 +method name slice descriptor (II)Ljava/nio/Buffer; flags 1041 + +class name java/nio/FloatBuffer +method name slice descriptor (II)Ljava/nio/FloatBuffer; flags 401 +method name get descriptor (I[FII)Ljava/nio/FloatBuffer; flags 1 +method name get descriptor (I[F)Ljava/nio/FloatBuffer; flags 1 +method name put descriptor (I[FII)Ljava/nio/FloatBuffer; flags 1 +method name put descriptor (I[F)Ljava/nio/FloatBuffer; flags 1 +method name slice descriptor (II)Ljava/nio/Buffer; flags 1041 + +class name java/nio/IntBuffer +method name slice descriptor (II)Ljava/nio/IntBuffer; flags 401 +method name get descriptor (I[III)Ljava/nio/IntBuffer; flags 1 +method name get descriptor (I[I)Ljava/nio/IntBuffer; flags 1 +method name put descriptor (I[III)Ljava/nio/IntBuffer; flags 1 +method name put descriptor (I[I)Ljava/nio/IntBuffer; flags 1 +method name slice descriptor (II)Ljava/nio/Buffer; flags 1041 + +class name java/nio/LongBuffer +method name slice descriptor (II)Ljava/nio/LongBuffer; flags 401 +method name get descriptor (I[JII)Ljava/nio/LongBuffer; flags 1 +method name get descriptor (I[J)Ljava/nio/LongBuffer; flags 1 +method name put descriptor (I[JII)Ljava/nio/LongBuffer; flags 1 +method name put descriptor (I[J)Ljava/nio/LongBuffer; flags 1 +method name slice descriptor (II)Ljava/nio/Buffer; flags 1041 + +class name java/nio/MappedByteBuffer +method name force descriptor (II)Ljava/nio/MappedByteBuffer; flags 11 + +class name java/nio/ShortBuffer +method name slice descriptor (II)Ljava/nio/ShortBuffer; flags 401 +method name get descriptor (I[SII)Ljava/nio/ShortBuffer; flags 1 +method name get descriptor (I[S)Ljava/nio/ShortBuffer; flags 1 +method name put descriptor (I[SII)Ljava/nio/ShortBuffer; flags 1 +method name put descriptor (I[S)Ljava/nio/ShortBuffer; flags 1 +method name slice descriptor (II)Ljava/nio/Buffer; flags 1041 + +class name java/nio/file/FileSystems +method name newFileSystem descriptor (Ljava/nio/file/Path;Ljava/util/Map;)Ljava/nio/file/FileSystem; thrownTypes java/io/IOException flags 9 signature (Ljava/nio/file/Path;Ljava/util/Map;)Ljava/nio/file/FileSystem; +method name newFileSystem descriptor (Ljava/nio/file/Path;)Ljava/nio/file/FileSystem; thrownTypes java/io/IOException flags 9 +method name newFileSystem descriptor (Ljava/nio/file/Path;Ljava/util/Map;Ljava/lang/ClassLoader;)Ljava/nio/file/FileSystem; thrownTypes java/io/IOException flags 9 signature (Ljava/nio/file/Path;Ljava/util/Map;Ljava/lang/ClassLoader;)Ljava/nio/file/FileSystem; + +class name java/nio/file/Path +header extends java/lang/Object implements java/lang/Comparable,java/lang/Iterable,java/nio/file/Watchable flags 601 signature Ljava/lang/Object;Ljava/lang/Comparable;Ljava/lang/Iterable;Ljava/nio/file/Watchable; +innerclass innerClass java/nio/file/WatchEvent$Modifier outerClass java/nio/file/WatchEvent innerClassName Modifier flags 609 +innerclass innerClass java/nio/file/WatchEvent$Kind outerClass java/nio/file/WatchEvent innerClassName Kind flags 609 + +class name java/security/DomainLoadStoreParameter +header extends java/lang/Object implements java/security/KeyStore$LoadStoreParameter flags 31 +innerclass innerClass java/security/KeyStore$LoadStoreParameter outerClass java/security/KeyStore innerClassName LoadStoreParameter flags 609 +innerclass innerClass java/security/KeyStore$ProtectionParameter outerClass java/security/KeyStore innerClassName ProtectionParameter flags 609 + +class name java/security/DrbgParameters +header extends java/lang/Object nestMembers java/security/DrbgParameters$Reseed,java/security/DrbgParameters$NextBytes,java/security/DrbgParameters$Instantiation,java/security/DrbgParameters$Capability flags 21 +innerclass innerClass java/security/DrbgParameters$Instantiation outerClass java/security/DrbgParameters innerClassName Instantiation flags 19 +innerclass innerClass java/security/DrbgParameters$Capability outerClass java/security/DrbgParameters innerClassName Capability flags 4019 +innerclass innerClass java/security/DrbgParameters$NextBytes outerClass java/security/DrbgParameters innerClassName NextBytes flags 19 +innerclass innerClass java/security/DrbgParameters$Reseed outerClass java/security/DrbgParameters innerClassName Reseed flags 19 + +class name java/security/DrbgParameters$Instantiation +header extends java/lang/Object implements java/security/SecureRandomParameters nestHost java/security/DrbgParameters flags 31 +innerclass innerClass java/security/DrbgParameters$Instantiation outerClass java/security/DrbgParameters innerClassName Instantiation flags 19 +innerclass innerClass java/security/DrbgParameters$Capability outerClass java/security/DrbgParameters innerClassName Capability flags 4019 + +class name java/security/KeyStore +header extends java/lang/Object nestMembers java/security/KeyStore$Builder,java/security/KeyStore$TrustedCertificateEntry,java/security/KeyStore$SecretKeyEntry,java/security/KeyStore$PrivateKeyEntry,java/security/KeyStore$Entry,java/security/KeyStore$Entry$Attribute,java/security/KeyStore$CallbackHandlerProtection,java/security/KeyStore$PasswordProtection,java/security/KeyStore$ProtectionParameter,java/security/KeyStore$LoadStoreParameter flags 21 +innerclass innerClass java/security/KeyStore$LoadStoreParameter outerClass java/security/KeyStore innerClassName LoadStoreParameter flags 609 +innerclass innerClass java/security/KeyStore$ProtectionParameter outerClass java/security/KeyStore innerClassName ProtectionParameter flags 609 +innerclass innerClass java/security/KeyStore$Entry outerClass java/security/KeyStore innerClassName Entry flags 609 +innerclass innerClass java/security/KeyStore$Builder outerClass java/security/KeyStore innerClassName Builder flags 409 +innerclass innerClass java/security/KeyStore$TrustedCertificateEntry outerClass java/security/KeyStore innerClassName TrustedCertificateEntry flags 19 +innerclass innerClass java/security/KeyStore$SecretKeyEntry outerClass java/security/KeyStore innerClassName SecretKeyEntry flags 19 +innerclass innerClass java/security/KeyStore$PrivateKeyEntry outerClass java/security/KeyStore innerClassName PrivateKeyEntry flags 19 +innerclass innerClass java/security/KeyStore$CallbackHandlerProtection outerClass java/security/KeyStore innerClassName CallbackHandlerProtection flags 9 +innerclass innerClass java/security/KeyStore$PasswordProtection outerClass java/security/KeyStore innerClassName PasswordProtection flags 9 +innerclass innerClass java/security/KeyStore$Entry$Attribute outerClass java/security/KeyStore$Entry innerClassName Attribute flags 609 + +class name java/security/KeyStore$LoadStoreParameter +header extends java/lang/Object nestHost java/security/KeyStore flags 601 +innerclass innerClass java/security/KeyStore$LoadStoreParameter outerClass java/security/KeyStore innerClassName LoadStoreParameter flags 609 +innerclass innerClass java/security/KeyStore$ProtectionParameter outerClass java/security/KeyStore innerClassName ProtectionParameter flags 609 + +class name java/security/KeyStore$PrivateKeyEntry +header extends java/lang/Object implements java/security/KeyStore$Entry nestHost java/security/KeyStore flags 31 +innerclass innerClass java/security/KeyStore$PrivateKeyEntry outerClass java/security/KeyStore innerClassName PrivateKeyEntry flags 19 +innerclass innerClass java/security/KeyStore$Entry outerClass java/security/KeyStore innerClassName Entry flags 609 +innerclass innerClass java/security/KeyStore$Entry$Attribute outerClass java/security/KeyStore$Entry innerClassName Attribute flags 609 + +class name java/security/KeyStore$SecretKeyEntry +header extends java/lang/Object implements java/security/KeyStore$Entry nestHost java/security/KeyStore flags 31 +innerclass innerClass java/security/KeyStore$SecretKeyEntry outerClass java/security/KeyStore innerClassName SecretKeyEntry flags 19 +innerclass innerClass java/security/KeyStore$Entry outerClass java/security/KeyStore innerClassName Entry flags 609 +innerclass innerClass java/security/KeyStore$Entry$Attribute outerClass java/security/KeyStore$Entry innerClassName Attribute flags 609 + +class name java/security/KeyStore$TrustedCertificateEntry +header extends java/lang/Object implements java/security/KeyStore$Entry nestHost java/security/KeyStore flags 31 +innerclass innerClass java/security/KeyStore$TrustedCertificateEntry outerClass java/security/KeyStore innerClassName TrustedCertificateEntry flags 19 +innerclass innerClass java/security/KeyStore$Entry outerClass java/security/KeyStore innerClassName Entry flags 609 +innerclass innerClass java/security/KeyStore$Entry$Attribute outerClass java/security/KeyStore$Entry innerClassName Attribute flags 609 + +class name java/security/KeyStoreSpi +header extends java/lang/Object flags 421 +innerclass innerClass java/security/KeyStore$LoadStoreParameter outerClass java/security/KeyStore innerClassName LoadStoreParameter flags 609 +innerclass innerClass java/security/KeyStore$ProtectionParameter outerClass java/security/KeyStore innerClassName ProtectionParameter flags 609 +innerclass innerClass java/security/KeyStore$PasswordProtection outerClass java/security/KeyStore innerClassName PasswordProtection flags 9 +innerclass innerClass java/security/KeyStore$CallbackHandlerProtection outerClass java/security/KeyStore innerClassName CallbackHandlerProtection flags 9 +innerclass innerClass java/security/KeyStore$TrustedCertificateEntry outerClass java/security/KeyStore innerClassName TrustedCertificateEntry flags 19 +innerclass innerClass java/security/KeyStore$PrivateKeyEntry outerClass java/security/KeyStore innerClassName PrivateKeyEntry flags 19 +innerclass innerClass java/security/KeyStore$SecretKeyEntry outerClass java/security/KeyStore innerClassName SecretKeyEntry flags 19 +innerclass innerClass java/security/KeyStore$Entry outerClass java/security/KeyStore innerClassName Entry flags 609 + +class name java/security/Permissions +header extends java/security/PermissionCollection implements java/io/Serializable flags 31 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 + +class name java/security/PrivilegedAction +header extends java/lang/Object flags 601 signature Ljava/lang/Object; runtimeAnnotations @Ljava/lang/FunctionalInterface; + +class name java/security/PrivilegedExceptionAction +header extends java/lang/Object flags 601 signature Ljava/lang/Object; runtimeAnnotations @Ljava/lang/FunctionalInterface; + +class name java/security/Provider +header extends java/util/Properties nestMembers java/security/Provider$Service flags 421 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/security/Provider$Service outerClass java/security/Provider innerClassName Service flags 9 + +class name java/security/cert/PKIXRevocationChecker +header extends java/security/cert/PKIXCertPathChecker nestMembers java/security/cert/PKIXRevocationChecker$Option flags 421 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/security/cert/PKIXRevocationChecker$Option outerClass java/security/cert/PKIXRevocationChecker innerClassName Option flags 4019 + +class name java/text/AttributedString +header extends java/lang/Object flags 21 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/text/AttributedCharacterIterator$Attribute outerClass java/text/AttributedCharacterIterator innerClassName Attribute flags 9 + +class name java/text/CompactNumberFormat +header extends java/text/NumberFormat flags 31 +innerclass innerClass java/text/NumberFormat$Field outerClass java/text/NumberFormat innerClassName Field flags 9 +innerclass innerClass java/text/Format$Field outerClass java/text/Format innerClassName Field flags 9 + +class name java/text/DateFormat +header extends java/text/Format nestMembers java/text/DateFormat$Field flags 421 +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/text/DateFormat$Field outerClass java/text/DateFormat innerClassName Field flags 9 + +class name java/text/DecimalFormat +header extends java/text/NumberFormat flags 21 +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/text/NumberFormat$Field outerClass java/text/NumberFormat innerClassName Field flags 9 +innerclass innerClass java/text/Format$Field outerClass java/text/Format innerClassName Field flags 9 + +class name java/text/DecimalFormatSymbols +header extends java/lang/Object implements java/lang/Cloneable,java/io/Serializable flags 21 +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/text/Format +header extends java/lang/Object implements java/io/Serializable,java/lang/Cloneable nestMembers java/text/Format$Field flags 421 +innerclass innerClass java/text/AttributedCharacterIterator$Attribute outerClass java/text/AttributedCharacterIterator innerClassName Attribute flags 9 +innerclass innerClass java/text/Format$Field outerClass java/text/Format innerClassName Field flags 9 + +class name java/text/Format$Field +header extends java/text/AttributedCharacterIterator$Attribute nestHost java/text/Format flags 21 +innerclass innerClass java/text/AttributedCharacterIterator$Attribute outerClass java/text/AttributedCharacterIterator innerClassName Attribute flags 9 +innerclass innerClass java/text/Format$Field outerClass java/text/Format innerClassName Field flags 9 + +class name java/text/MessageFormat +header extends java/text/Format nestMembers java/text/MessageFormat$Field flags 21 +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/text/MessageFormat$Field outerClass java/text/MessageFormat innerClassName Field flags 9 +innerclass innerClass java/text/AttributedCharacterIterator$Attribute outerClass java/text/AttributedCharacterIterator innerClassName Attribute flags 9 +innerclass innerClass java/text/Format$Field outerClass java/text/Format innerClassName Field flags 9 + +class name java/text/MessageFormat$Field +header extends java/text/Format$Field nestHost java/text/MessageFormat flags 21 +innerclass innerClass java/text/Format$Field outerClass java/text/Format innerClassName Field flags 9 +innerclass innerClass java/text/MessageFormat$Field outerClass java/text/MessageFormat innerClassName Field flags 9 + +class name java/text/NumberFormat +header extends java/text/Format nestMembers java/text/NumberFormat$Style,java/text/NumberFormat$Field flags 421 +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/text/NumberFormat$Style outerClass java/text/NumberFormat innerClassName Style flags 4019 +innerclass innerClass java/text/NumberFormat$Field outerClass java/text/NumberFormat innerClassName Field flags 9 + +class name java/text/NumberFormat$Field +header extends java/text/Format$Field nestHost java/text/NumberFormat flags 21 +innerclass innerClass java/text/Format$Field outerClass java/text/Format innerClassName Field flags 9 +innerclass innerClass java/text/NumberFormat$Field outerClass java/text/NumberFormat innerClassName Field flags 9 + +class name java/text/SimpleDateFormat +header extends java/text/DateFormat flags 21 +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/text/DateFormat$Field outerClass java/text/DateFormat innerClassName Field flags 9 +innerclass innerClass java/text/Format$Field outerClass java/text/Format innerClassName Field flags 9 + +class name java/time/chrono/JapaneseEra +field name REIWA descriptor Ljava/time/chrono/JapaneseEra; flags 19 + +class name java/util/AbstractMap +header extends java/lang/Object implements java/util/Map nestMembers java/util/AbstractMap$SimpleImmutableEntry,java/util/AbstractMap$SimpleEntry flags 421 signature Ljava/lang/Object;Ljava/util/Map; +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/util/AbstractMap$SimpleImmutableEntry outerClass java/util/AbstractMap innerClassName SimpleImmutableEntry flags 9 +innerclass innerClass java/util/AbstractMap$SimpleEntry outerClass java/util/AbstractMap innerClassName SimpleEntry flags 9 + +class name java/util/Base64 +header extends java/lang/Object nestMembers java/util/Base64$Decoder,java/util/Base64$Encoder flags 21 +innerclass innerClass java/util/Base64$Encoder outerClass java/util/Base64 innerClassName Encoder flags 9 +innerclass innerClass java/util/Base64$Decoder outerClass java/util/Base64 innerClassName Decoder flags 9 + +class name java/util/Calendar +header extends java/lang/Object implements java/io/Serializable,java/lang/Cloneable,java/lang/Comparable nestMembers java/util/Calendar$Builder flags 421 signature Ljava/lang/Object;Ljava/io/Serializable;Ljava/lang/Cloneable;Ljava/lang/Comparable; +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/util/Calendar$Builder outerClass java/util/Calendar innerClassName Builder flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/util/Formatter +header extends java/lang/Object implements java/io/Closeable,java/io/Flushable nestMembers java/util/Formatter$BigDecimalLayoutForm flags 31 +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/util/Formatter$BigDecimalLayoutForm outerClass java/util/Formatter innerClassName BigDecimalLayoutForm flags 4019 + +class name java/util/Locale +header extends java/lang/Object implements java/lang/Cloneable,java/io/Serializable nestMembers java/util/Locale$LanguageRange,java/util/Locale$FilteringMode,java/util/Locale$Builder,java/util/Locale$Category,java/util/Locale$IsoCountryCode flags 31 +innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 +innerclass innerClass java/util/Locale$IsoCountryCode outerClass java/util/Locale innerClassName IsoCountryCode flags 4409 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/util/Locale$FilteringMode outerClass java/util/Locale innerClassName FilteringMode flags 4019 +innerclass innerClass java/util/Locale$LanguageRange outerClass java/util/Locale innerClassName LanguageRange flags 19 +innerclass innerClass java/util/Locale$Builder outerClass java/util/Locale innerClassName Builder flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/util/Random +header extends java/lang/Object implements java/io/Serializable flags 21 +innerclass innerClass java/util/Spliterator$OfInt outerClass java/util/Spliterator innerClassName OfInt flags 609 +innerclass innerClass java/util/Spliterator$OfLong outerClass java/util/Spliterator innerClassName OfLong flags 609 +innerclass innerClass java/util/Spliterator$OfDouble outerClass java/util/Spliterator innerClassName OfDouble flags 609 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 + +class name java/util/Spliterators +header extends java/lang/Object nestMembers java/util/Spliterators$AbstractDoubleSpliterator,java/util/Spliterators$AbstractLongSpliterator,java/util/Spliterators$AbstractIntSpliterator,java/util/Spliterators$AbstractSpliterator flags 31 +innerclass innerClass java/util/Spliterator$OfInt outerClass java/util/Spliterator innerClassName OfInt flags 609 +innerclass innerClass java/util/Spliterator$OfLong outerClass java/util/Spliterator innerClassName OfLong flags 609 +innerclass innerClass java/util/Spliterator$OfDouble outerClass java/util/Spliterator innerClassName OfDouble flags 609 +innerclass innerClass java/util/PrimitiveIterator$OfInt outerClass java/util/PrimitiveIterator innerClassName OfInt flags 609 +innerclass innerClass java/util/PrimitiveIterator$OfLong outerClass java/util/PrimitiveIterator innerClassName OfLong flags 609 +innerclass innerClass java/util/PrimitiveIterator$OfDouble outerClass java/util/PrimitiveIterator innerClassName OfDouble flags 609 +innerclass innerClass java/util/Spliterators$AbstractDoubleSpliterator outerClass java/util/Spliterators innerClassName AbstractDoubleSpliterator flags 409 +innerclass innerClass java/util/Spliterators$AbstractLongSpliterator outerClass java/util/Spliterators innerClassName AbstractLongSpliterator flags 409 +innerclass innerClass java/util/Spliterators$AbstractIntSpliterator outerClass java/util/Spliterators innerClassName AbstractIntSpliterator flags 409 +innerclass innerClass java/util/Spliterators$AbstractSpliterator outerClass java/util/Spliterators innerClassName AbstractSpliterator flags 409 + +class name java/util/Spliterators$AbstractDoubleSpliterator +header extends java/lang/Object implements java/util/Spliterator$OfDouble nestHost java/util/Spliterators flags 421 +innerclass innerClass java/util/Spliterators$AbstractSpliterator outerClass java/util/Spliterators innerClassName AbstractSpliterator flags 409 +innerclass innerClass java/util/Spliterators$AbstractDoubleSpliterator outerClass java/util/Spliterators innerClassName AbstractDoubleSpliterator flags 409 +innerclass innerClass java/util/Spliterator$OfDouble outerClass java/util/Spliterator innerClassName OfDouble flags 609 +innerclass innerClass java/util/Spliterator$OfPrimitive outerClass java/util/Spliterator innerClassName OfPrimitive flags 609 + +class name java/util/Spliterators$AbstractIntSpliterator +header extends java/lang/Object implements java/util/Spliterator$OfInt nestHost java/util/Spliterators flags 421 +innerclass innerClass java/util/Spliterators$AbstractSpliterator outerClass java/util/Spliterators innerClassName AbstractSpliterator flags 409 +innerclass innerClass java/util/Spliterators$AbstractIntSpliterator outerClass java/util/Spliterators innerClassName AbstractIntSpliterator flags 409 +innerclass innerClass java/util/Spliterator$OfInt outerClass java/util/Spliterator innerClassName OfInt flags 609 +innerclass innerClass java/util/Spliterator$OfPrimitive outerClass java/util/Spliterator innerClassName OfPrimitive flags 609 + +class name java/util/Spliterators$AbstractLongSpliterator +header extends java/lang/Object implements java/util/Spliterator$OfLong nestHost java/util/Spliterators flags 421 +innerclass innerClass java/util/Spliterators$AbstractSpliterator outerClass java/util/Spliterators innerClassName AbstractSpliterator flags 409 +innerclass innerClass java/util/Spliterators$AbstractLongSpliterator outerClass java/util/Spliterators innerClassName AbstractLongSpliterator flags 409 +innerclass innerClass java/util/Spliterator$OfLong outerClass java/util/Spliterator innerClassName OfLong flags 609 +innerclass innerClass java/util/Spliterator$OfPrimitive outerClass java/util/Spliterator innerClassName OfPrimitive flags 609 + +class name java/util/concurrent/CompletableFuture +header extends java/lang/Object implements java/util/concurrent/Future,java/util/concurrent/CompletionStage nestMembers java/util/concurrent/CompletableFuture$AsynchronousCompletionTask flags 21 signature Ljava/lang/Object;Ljava/util/concurrent/Future;Ljava/util/concurrent/CompletionStage; +innerclass innerClass java/util/concurrent/ForkJoinPool$ManagedBlocker outerClass java/util/concurrent/ForkJoinPool innerClassName ManagedBlocker flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 +innerclass innerClass java/util/concurrent/CompletableFuture$AsynchronousCompletionTask outerClass java/util/concurrent/CompletableFuture innerClassName AsynchronousCompletionTask flags 609 + +class name java/util/concurrent/ConcurrentHashMap +header extends java/util/AbstractMap implements java/util/concurrent/ConcurrentMap,java/io/Serializable nestMembers java/util/concurrent/ConcurrentHashMap$KeySetView,java/util/concurrent/ConcurrentHashMap$CollectionView flags 21 signature Ljava/util/AbstractMap;Ljava/util/concurrent/ConcurrentMap;Ljava/io/Serializable; +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/util/concurrent/ConcurrentHashMap$KeySetView outerClass java/util/concurrent/ConcurrentHashMap innerClassName KeySetView flags 9 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/util/AbstractMap$SimpleImmutableEntry outerClass java/util/AbstractMap innerClassName SimpleImmutableEntry flags 9 +innerclass innerClass java/util/concurrent/ConcurrentHashMap$CollectionView outerClass java/util/concurrent/ConcurrentHashMap innerClassName CollectionView flags 408 + +class name java/util/concurrent/ConcurrentHashMap$KeySetView +header extends java/util/concurrent/ConcurrentHashMap$CollectionView implements java/util/Set,java/io/Serializable nestHost java/util/concurrent/ConcurrentHashMap flags 21 signature Ljava/util/concurrent/ConcurrentHashMap$CollectionView;Ljava/util/Set;Ljava/io/Serializable; +innerclass innerClass java/util/concurrent/ConcurrentHashMap$CollectionView outerClass java/util/concurrent/ConcurrentHashMap innerClassName CollectionView flags 408 +innerclass innerClass java/util/concurrent/ConcurrentHashMap$KeySetView outerClass java/util/concurrent/ConcurrentHashMap innerClassName KeySetView flags 9 + +class name java/util/concurrent/Flow$Processor +header extends java/lang/Object implements java/util/concurrent/Flow$Subscriber,java/util/concurrent/Flow$Publisher nestHost java/util/concurrent/Flow flags 601 signature Ljava/lang/Object;Ljava/util/concurrent/Flow$Subscriber;Ljava/util/concurrent/Flow$Publisher; +innerclass innerClass java/util/concurrent/Flow$Processor outerClass java/util/concurrent/Flow innerClassName Processor flags 609 +innerclass innerClass java/util/concurrent/Flow$Subscriber outerClass java/util/concurrent/Flow innerClassName Subscriber flags 609 +innerclass innerClass java/util/concurrent/Flow$Publisher outerClass java/util/concurrent/Flow innerClassName Publisher flags 609 + +class name java/util/concurrent/Flow$Publisher +header extends java/lang/Object nestHost java/util/concurrent/Flow flags 601 signature Ljava/lang/Object; runtimeAnnotations @Ljava/lang/FunctionalInterface; +innerclass innerClass java/util/concurrent/Flow$Publisher outerClass java/util/concurrent/Flow innerClassName Publisher flags 609 +innerclass innerClass java/util/concurrent/Flow$Subscriber outerClass java/util/concurrent/Flow innerClassName Subscriber flags 609 + +class name java/util/concurrent/Flow$Subscriber +header extends java/lang/Object nestHost java/util/concurrent/Flow flags 601 signature Ljava/lang/Object; +innerclass innerClass java/util/concurrent/Flow$Subscriber outerClass java/util/concurrent/Flow innerClassName Subscriber flags 609 +innerclass innerClass java/util/concurrent/Flow$Subscription outerClass java/util/concurrent/Flow innerClassName Subscription flags 609 + +class name java/util/concurrent/ForkJoinPool +header extends java/util/concurrent/AbstractExecutorService nestMembers java/util/concurrent/ForkJoinPool$ManagedBlocker,java/util/concurrent/ForkJoinPool$ForkJoinWorkerThreadFactory flags 21 +innerclass innerClass java/util/concurrent/ForkJoinPool$ForkJoinWorkerThreadFactory outerClass java/util/concurrent/ForkJoinPool innerClassName ForkJoinWorkerThreadFactory flags 609 +innerclass innerClass java/lang/Thread$UncaughtExceptionHandler outerClass java/lang/Thread innerClassName UncaughtExceptionHandler flags 609 +innerclass innerClass java/lang/Thread$State outerClass java/lang/Thread innerClassName State flags 4019 +innerclass innerClass java/util/concurrent/ForkJoinPool$ManagedBlocker outerClass java/util/concurrent/ForkJoinPool innerClassName ManagedBlocker flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/util/concurrent/Phaser +header extends java/lang/Object flags 21 +innerclass innerClass java/util/concurrent/ForkJoinPool$ManagedBlocker outerClass java/util/concurrent/ForkJoinPool innerClassName ManagedBlocker flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/util/concurrent/ThreadLocalRandom +header extends java/util/Random flags 21 +innerclass innerClass java/util/Spliterator$OfInt outerClass java/util/Spliterator innerClassName OfInt flags 609 +innerclass innerClass java/util/Spliterator$OfLong outerClass java/util/Spliterator innerClassName OfLong flags 609 +innerclass innerClass java/util/Spliterator$OfDouble outerClass java/util/Spliterator innerClassName OfDouble flags 609 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 + +class name java/util/concurrent/ThreadPoolExecutor +header extends java/util/concurrent/AbstractExecutorService nestMembers java/util/concurrent/ThreadPoolExecutor$DiscardOldestPolicy,java/util/concurrent/ThreadPoolExecutor$DiscardPolicy,java/util/concurrent/ThreadPoolExecutor$AbortPolicy,java/util/concurrent/ThreadPoolExecutor$CallerRunsPolicy flags 21 +innerclass innerClass java/lang/Thread$State outerClass java/lang/Thread innerClassName State flags 4019 +innerclass innerClass java/util/concurrent/ThreadPoolExecutor$AbortPolicy outerClass java/util/concurrent/ThreadPoolExecutor innerClassName AbortPolicy flags 9 +innerclass innerClass java/util/concurrent/ThreadPoolExecutor$DiscardOldestPolicy outerClass java/util/concurrent/ThreadPoolExecutor innerClassName DiscardOldestPolicy flags 9 +innerclass innerClass java/util/concurrent/ThreadPoolExecutor$DiscardPolicy outerClass java/util/concurrent/ThreadPoolExecutor innerClassName DiscardPolicy flags 9 +innerclass innerClass java/util/concurrent/ThreadPoolExecutor$CallerRunsPolicy outerClass java/util/concurrent/ThreadPoolExecutor innerClassName CallerRunsPolicy flags 9 + +class name java/util/concurrent/locks/ReentrantReadWriteLock +header extends java/lang/Object implements java/util/concurrent/locks/ReadWriteLock,java/io/Serializable nestMembers java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock,java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock flags 21 +innerclass innerClass java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock outerClass java/util/concurrent/locks/ReentrantReadWriteLock innerClassName ReadLock flags 9 +innerclass innerClass java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock outerClass java/util/concurrent/locks/ReentrantReadWriteLock innerClassName WriteLock flags 9 +innerclass innerClass java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject outerClass java/util/concurrent/locks/AbstractQueuedSynchronizer innerClassName ConditionObject flags 1 + +class name java/util/jar/Pack200 +header extends java/lang/Object nestMembers java/util/jar/Pack200$Unpacker,java/util/jar/Pack200$Packer flags 421 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="11") +innerclass innerClass java/util/jar/Pack200$Packer outerClass java/util/jar/Pack200 innerClassName Packer flags 609 +innerclass innerClass java/util/jar/Pack200$Unpacker outerClass java/util/jar/Pack200 innerClassName Unpacker flags 609 + +class name java/util/stream/DoubleStream +header extends java/lang/Object implements java/util/stream/BaseStream nestMembers java/util/stream/DoubleStream$Builder flags 601 signature Ljava/lang/Object;Ljava/util/stream/BaseStream; +innerclass innerClass java/util/Spliterator$OfDouble outerClass java/util/Spliterator innerClassName OfDouble flags 609 +innerclass innerClass java/util/PrimitiveIterator$OfDouble outerClass java/util/PrimitiveIterator innerClassName OfDouble flags 609 +innerclass innerClass java/util/stream/DoubleStream$Builder outerClass java/util/stream/DoubleStream innerClassName Builder flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/util/stream/IntStream +header extends java/lang/Object implements java/util/stream/BaseStream nestMembers java/util/stream/IntStream$Builder flags 601 signature Ljava/lang/Object;Ljava/util/stream/BaseStream; +innerclass innerClass java/util/Spliterator$OfInt outerClass java/util/Spliterator innerClassName OfInt flags 609 +innerclass innerClass java/util/PrimitiveIterator$OfInt outerClass java/util/PrimitiveIterator innerClassName OfInt flags 609 +innerclass innerClass java/util/stream/IntStream$Builder outerClass java/util/stream/IntStream innerClassName Builder flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/util/stream/LongStream +header extends java/lang/Object implements java/util/stream/BaseStream nestMembers java/util/stream/LongStream$Builder flags 601 signature Ljava/lang/Object;Ljava/util/stream/BaseStream; +innerclass innerClass java/util/Spliterator$OfLong outerClass java/util/Spliterator innerClassName OfLong flags 609 +innerclass innerClass java/util/PrimitiveIterator$OfLong outerClass java/util/PrimitiveIterator innerClassName OfLong flags 609 +innerclass innerClass java/util/stream/LongStream$Builder outerClass java/util/stream/LongStream innerClassName Builder flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/net/ssl/HandshakeCompletedEvent +-method name getPeerCertificateChain descriptor ()[Ljavax/security/cert/X509Certificate; +method name getPeerCertificateChain descriptor ()[Ljavax/security/cert/X509Certificate; thrownTypes javax/net/ssl/SSLPeerUnverifiedException flags 1 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + +class name javax/net/ssl/SSLContext +header extends java/lang/Object flags 21 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 +-method name getDefault descriptor ()Ljavax/net/ssl/SSLContext; +-method name setDefault descriptor (Ljavax/net/ssl/SSLContext;)V +method name getDefault descriptor ()Ljavax/net/ssl/SSLContext; thrownTypes java/security/NoSuchAlgorithmException flags 9 +method name setDefault descriptor (Ljavax/net/ssl/SSLContext;)V flags 9 + +class name javax/net/ssl/SSLEngineResult +header extends java/lang/Object nestMembers javax/net/ssl/SSLEngineResult$HandshakeStatus,javax/net/ssl/SSLEngineResult$Status flags 21 +innerclass innerClass javax/net/ssl/SSLEngineResult$Status outerClass javax/net/ssl/SSLEngineResult innerClassName Status flags 4019 +innerclass innerClass javax/net/ssl/SSLEngineResult$HandshakeStatus outerClass javax/net/ssl/SSLEngineResult innerClassName HandshakeStatus flags 4019 + +class name javax/net/ssl/SSLServerSocketFactory +-method name getDefault descriptor ()Ljavax/net/ServerSocketFactory; +method name getDefault descriptor ()Ljavax/net/ServerSocketFactory; flags 9 + +class name javax/net/ssl/SSLSession +-method name getPeerCertificateChain descriptor ()[Ljavax/security/cert/X509Certificate; +method name getPeerCertificateChain descriptor ()[Ljavax/security/cert/X509Certificate; thrownTypes javax/net/ssl/SSLPeerUnverifiedException flags 401 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + +class name javax/net/ssl/SSLSocketFactory +-method name getDefault descriptor ()Ljavax/net/SocketFactory; +method name getDefault descriptor ()Ljavax/net/SocketFactory; flags 9 + +class name javax/security/cert/Certificate +header extends java/lang/Object flags 421 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + +class name javax/security/cert/CertificateEncodingException +header extends javax/security/cert/CertificateException flags 21 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + +class name javax/security/cert/CertificateException +header extends java/lang/Exception flags 21 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + +class name javax/security/cert/CertificateExpiredException +header extends javax/security/cert/CertificateException flags 21 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + +class name javax/security/cert/CertificateNotYetValidException +header extends javax/security/cert/CertificateException flags 21 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + +class name javax/security/cert/CertificateParsingException +header extends javax/security/cert/CertificateException flags 21 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + +class name javax/security/cert/X509Certificate +header extends javax/security/cert/Certificate flags 421 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="9") + diff --git a/make/data/symbols/java.compiler-D.sym.txt b/make/data/symbols/java.compiler-D.sym.txt new file mode 100644 index 00000000000..976b18a9a2d --- /dev/null +++ b/make/data/symbols/java.compiler-D.sym.txt @@ -0,0 +1,107 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name javax/annotation/processing/ProcessingEnvironment +method name isPreviewEnabled descriptor ()Z flags 1 + +class name javax/lang/model/SourceVersion +header extends java/lang/Enum flags 4031 signature Ljava/lang/Enum; +innerclass innerClass java/lang/Runtime$Version outerClass java/lang/Runtime innerClassName Version flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 +field name RELEASE_13 descriptor Ljavax/lang/model/SourceVersion; flags 4019 + +class name javax/lang/model/element/ExecutableElement +method name asType descriptor ()Ljavax/lang/model/type/TypeMirror; flags 401 + +class name javax/lang/model/element/ModuleElement +method name asType descriptor ()Ljavax/lang/model/type/TypeMirror; flags 401 + +class name javax/lang/model/element/ModuleElement$Directive +header extends java/lang/Object nestHost javax/lang/model/element/ModuleElement flags 601 +innerclass innerClass javax/lang/model/element/ModuleElement$Directive outerClass javax/lang/model/element/ModuleElement innerClassName Directive flags 609 +innerclass innerClass javax/lang/model/element/ModuleElement$DirectiveKind outerClass javax/lang/model/element/ModuleElement innerClassName DirectiveKind flags 4019 +innerclass innerClass javax/lang/model/element/ModuleElement$DirectiveVisitor outerClass javax/lang/model/element/ModuleElement innerClassName DirectiveVisitor flags 609 + +class name javax/lang/model/element/PackageElement +method name asType descriptor ()Ljavax/lang/model/type/TypeMirror; flags 401 + +class name javax/lang/model/element/TypeElement +method name asType descriptor ()Ljavax/lang/model/type/TypeMirror; flags 401 + +class name javax/lang/model/element/TypeParameterElement +method name asType descriptor ()Ljavax/lang/model/type/TypeMirror; flags 401 + +class name javax/lang/model/element/VariableElement +method name asType descriptor ()Ljavax/lang/model/type/TypeMirror; flags 401 + +class name javax/lang/model/util/AbstractAnnotationValueVisitor9 +header extends javax/lang/model/util/AbstractAnnotationValueVisitor8 flags 421 signature Ljavax/lang/model/util/AbstractAnnotationValueVisitor8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/lang/model/util/AbstractElementVisitor9 +header extends javax/lang/model/util/AbstractElementVisitor8 flags 421 signature Ljavax/lang/model/util/AbstractElementVisitor8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/lang/model/util/AbstractTypeVisitor9 +header extends javax/lang/model/util/AbstractTypeVisitor8 flags 421 signature Ljavax/lang/model/util/AbstractTypeVisitor8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/lang/model/util/ElementFilter +header extends java/lang/Object flags 21 +innerclass innerClass javax/lang/model/element/ModuleElement$DirectiveKind outerClass javax/lang/model/element/ModuleElement innerClassName DirectiveKind flags 4019 +innerclass innerClass javax/lang/model/element/ModuleElement$ExportsDirective outerClass javax/lang/model/element/ModuleElement innerClassName ExportsDirective flags 609 +innerclass innerClass javax/lang/model/element/ModuleElement$OpensDirective outerClass javax/lang/model/element/ModuleElement innerClassName OpensDirective flags 609 +innerclass innerClass javax/lang/model/element/ModuleElement$ProvidesDirective outerClass javax/lang/model/element/ModuleElement innerClassName ProvidesDirective flags 609 +innerclass innerClass javax/lang/model/element/ModuleElement$RequiresDirective outerClass javax/lang/model/element/ModuleElement innerClassName RequiresDirective flags 609 +innerclass innerClass javax/lang/model/element/ModuleElement$UsesDirective outerClass javax/lang/model/element/ModuleElement innerClassName UsesDirective flags 609 +innerclass innerClass javax/lang/model/element/ModuleElement$Directive outerClass javax/lang/model/element/ModuleElement innerClassName Directive flags 609 + +class name javax/lang/model/util/ElementKindVisitor9 +header extends javax/lang/model/util/ElementKindVisitor8 flags 21 signature Ljavax/lang/model/util/ElementKindVisitor8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/lang/model/util/ElementScanner9 +header extends javax/lang/model/util/ElementScanner8 flags 21 signature Ljavax/lang/model/util/ElementScanner8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/lang/model/util/SimpleAnnotationValueVisitor9 +header extends javax/lang/model/util/SimpleAnnotationValueVisitor8 flags 21 signature Ljavax/lang/model/util/SimpleAnnotationValueVisitor8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/lang/model/util/SimpleElementVisitor9 +header extends javax/lang/model/util/SimpleElementVisitor8 flags 21 signature Ljavax/lang/model/util/SimpleElementVisitor8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/lang/model/util/SimpleTypeVisitor9 +header extends javax/lang/model/util/SimpleTypeVisitor8 flags 21 signature Ljavax/lang/model/util/SimpleTypeVisitor8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/lang/model/util/TypeKindVisitor9 +header extends javax/lang/model/util/TypeKindVisitor8 flags 21 signature Ljavax/lang/model/util/TypeKindVisitor8; runtimeAnnotations @Ljavax/annotation/processing/SupportedSourceVersion;(value=eLjavax/lang/model/SourceVersion;RELEASE_13;) + +class name javax/tools/StandardJavaFileManager +header extends java/lang/Object implements javax/tools/JavaFileManager nestMembers javax/tools/StandardJavaFileManager$PathFactory flags 601 +innerclass innerClass javax/tools/JavaFileManager$Location outerClass javax/tools/JavaFileManager innerClassName Location flags 609 +innerclass innerClass javax/tools/StandardJavaFileManager$PathFactory outerClass javax/tools/StandardJavaFileManager innerClassName PathFactory flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 +-method name getJavaFileObjectsFromPaths descriptor (Ljava/lang/Iterable;)Ljava/lang/Iterable; +method name getJavaFileObjectsFromPaths descriptor (Ljava/util/Collection;)Ljava/lang/Iterable; flags 1 signature (Ljava/util/Collection<+Ljava/nio/file/Path;>;)Ljava/lang/Iterable<+Ljavax/tools/JavaFileObject;>; +method name getJavaFileObjectsFromPaths descriptor (Ljava/lang/Iterable;)Ljava/lang/Iterable; flags 1 deprecated true signature (Ljava/lang/Iterable<+Ljava/nio/file/Path;>;)Ljava/lang/Iterable<+Ljavax/tools/JavaFileObject;>; runtimeAnnotations @Ljava/lang/Deprecated;(since="13") + diff --git a/make/data/symbols/java.desktop-D.sym.txt b/make/data/symbols/java.desktop-D.sym.txt new file mode 100644 index 00000000000..ef495667cc0 --- /dev/null +++ b/make/data/symbols/java.desktop-D.sym.txt @@ -0,0 +1,1402 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name java/awt/Component +header extends java/lang/Object implements java/awt/image/ImageObserver,java/awt/MenuContainer,java/io/Serializable nestMembers java/awt/Component$AccessibleAWTComponent,java/awt/Component$AccessibleAWTComponent$AccessibleAWTFocusHandler,java/awt/Component$AccessibleAWTComponent$AccessibleAWTComponentHandler,java/awt/Component$BltBufferStrategy,java/awt/Component$FlipBufferStrategy,java/awt/Component$BaselineResizeBehavior flags 421 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass java/awt/BufferCapabilities$FlipContents outerClass java/awt/BufferCapabilities innerClassName FlipContents flags 19 +innerclass innerClass java/awt/Component$BltBufferStrategy outerClass java/awt/Component innerClassName BltBufferStrategy flags 4 +innerclass innerClass java/awt/Component$FlipBufferStrategy outerClass java/awt/Component innerClassName FlipBufferStrategy flags 4 +innerclass innerClass java/awt/event/FocusEvent$Cause outerClass java/awt/event/FocusEvent innerClassName Cause flags 4019 +innerclass innerClass java/awt/Component$AccessibleAWTComponent outerClass java/awt/Component innerClassName AccessibleAWTComponent flags 404 +innerclass innerClass java/awt/Component$AccessibleAWTComponent$AccessibleAWTFocusHandler outerClass java/awt/Component$AccessibleAWTComponent innerClassName AccessibleAWTFocusHandler flags 4 +innerclass innerClass java/awt/Component$AccessibleAWTComponent$AccessibleAWTComponentHandler outerClass java/awt/Component$AccessibleAWTComponent innerClassName AccessibleAWTComponentHandler flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/Component$AccessibleAWTComponent +header extends javax/accessibility/AccessibleContext implements java/io/Serializable,javax/accessibility/AccessibleComponent nestHost java/awt/Component flags 421 +innerclass innerClass java/awt/Component$AccessibleAWTComponent outerClass java/awt/Component innerClassName AccessibleAWTComponent flags 404 +innerclass innerClass java/awt/Component$AccessibleAWTComponent$AccessibleAWTComponentHandler outerClass java/awt/Component$AccessibleAWTComponent innerClassName AccessibleAWTComponentHandler flags 4 +innerclass innerClass java/awt/Component$AccessibleAWTComponent$AccessibleAWTFocusHandler outerClass java/awt/Component$AccessibleAWTComponent innerClassName AccessibleAWTFocusHandler flags 4 + +class name java/awt/Container +header extends java/awt/Component nestMembers java/awt/Container$AccessibleAWTContainer,java/awt/Container$AccessibleAWTContainer$AccessibleContainerHandler flags 21 +innerclass innerClass java/awt/event/FocusEvent$Cause outerClass java/awt/event/FocusEvent innerClassName Cause flags 4019 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/awt/Container$AccessibleAWTContainer outerClass java/awt/Container innerClassName AccessibleAWTContainer flags 4 +innerclass innerClass java/awt/Container$AccessibleAWTContainer$AccessibleContainerHandler outerClass java/awt/Container$AccessibleAWTContainer innerClassName AccessibleContainerHandler flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/Container$AccessibleAWTContainer +header extends java/awt/Component$AccessibleAWTComponent nestHost java/awt/Container flags 21 +innerclass innerClass java/awt/Container$AccessibleAWTContainer outerClass java/awt/Container innerClassName AccessibleAWTContainer flags 4 +innerclass innerClass java/awt/Component$AccessibleAWTComponent outerClass java/awt/Component innerClassName AccessibleAWTComponent flags 404 +innerclass innerClass java/awt/Container$AccessibleAWTContainer$AccessibleContainerHandler outerClass java/awt/Container$AccessibleAWTContainer innerClassName AccessibleContainerHandler flags 4 + +class name java/awt/Dialog +header extends java/awt/Window nestMembers java/awt/Dialog$AccessibleAWTDialog,java/awt/Dialog$ModalExclusionType,java/awt/Dialog$ModalityType flags 21 +innerclass innerClass java/awt/Dialog$ModalityType outerClass java/awt/Dialog innerClassName ModalityType flags 4019 +innerclass innerClass java/awt/Dialog$ModalExclusionType outerClass java/awt/Dialog innerClassName ModalExclusionType flags 4019 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/awt/Dialog$AccessibleAWTDialog outerClass java/awt/Dialog innerClassName AccessibleAWTDialog flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/JobAttributes +header extends java/lang/Object implements java/lang/Cloneable nestMembers java/awt/JobAttributes$SidesType,java/awt/JobAttributes$MultipleDocumentHandlingType,java/awt/JobAttributes$DialogType,java/awt/JobAttributes$DestinationType,java/awt/JobAttributes$DefaultSelectionType flags 31 +innerclass innerClass java/awt/JobAttributes$DefaultSelectionType outerClass java/awt/JobAttributes innerClassName DefaultSelectionType flags 19 +innerclass innerClass java/awt/JobAttributes$DestinationType outerClass java/awt/JobAttributes innerClassName DestinationType flags 19 +innerclass innerClass java/awt/JobAttributes$DialogType outerClass java/awt/JobAttributes innerClassName DialogType flags 19 +innerclass innerClass java/awt/JobAttributes$MultipleDocumentHandlingType outerClass java/awt/JobAttributes innerClassName MultipleDocumentHandlingType flags 19 +innerclass innerClass java/awt/JobAttributes$SidesType outerClass java/awt/JobAttributes innerClassName SidesType flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/LinearGradientPaint +header extends java/awt/MultipleGradientPaint flags 31 +innerclass innerClass java/awt/geom/Point2D$Float outerClass java/awt/geom/Point2D innerClassName Float flags 9 +innerclass innerClass java/awt/MultipleGradientPaint$CycleMethod outerClass java/awt/MultipleGradientPaint innerClassName CycleMethod flags 4019 +innerclass innerClass java/awt/MultipleGradientPaint$ColorSpaceType outerClass java/awt/MultipleGradientPaint innerClassName ColorSpaceType flags 4019 +innerclass innerClass java/awt/geom/Point2D$Double outerClass java/awt/geom/Point2D innerClassName Double flags 9 + +class name java/awt/List$AccessibleAWTList +header extends java/awt/Component$AccessibleAWTComponent implements javax/accessibility/AccessibleSelection,java/awt/event/ItemListener,java/awt/event/ActionListener nestHost java/awt/List flags 21 +innerclass innerClass java/awt/List$AccessibleAWTList outerClass java/awt/List innerClassName AccessibleAWTList flags 4 +innerclass innerClass java/awt/Component$AccessibleAWTComponent outerClass java/awt/Component innerClassName AccessibleAWTComponent flags 404 +innerclass innerClass java/awt/List$AccessibleAWTList$AccessibleAWTListChild outerClass java/awt/List$AccessibleAWTList innerClassName AccessibleAWTListChild flags 4 + +class name java/awt/PageAttributes +header extends java/lang/Object implements java/lang/Cloneable nestMembers java/awt/PageAttributes$PrintQualityType,java/awt/PageAttributes$OriginType,java/awt/PageAttributes$OrientationRequestedType,java/awt/PageAttributes$MediaType,java/awt/PageAttributes$ColorType flags 31 +innerclass innerClass java/awt/PageAttributes$ColorType outerClass java/awt/PageAttributes innerClassName ColorType flags 19 +innerclass innerClass java/awt/PageAttributes$OriginType outerClass java/awt/PageAttributes innerClassName OriginType flags 19 +innerclass innerClass java/awt/PageAttributes$MediaType outerClass java/awt/PageAttributes innerClassName MediaType flags 19 +innerclass innerClass java/awt/PageAttributes$OrientationRequestedType outerClass java/awt/PageAttributes innerClassName OrientationRequestedType flags 19 +innerclass innerClass java/awt/PageAttributes$PrintQualityType outerClass java/awt/PageAttributes innerClassName PrintQualityType flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/RadialGradientPaint +header extends java/awt/MultipleGradientPaint flags 31 +innerclass innerClass java/awt/MultipleGradientPaint$CycleMethod outerClass java/awt/MultipleGradientPaint innerClassName CycleMethod flags 4019 +innerclass innerClass java/awt/geom/Point2D$Float outerClass java/awt/geom/Point2D innerClassName Float flags 9 +innerclass innerClass java/awt/MultipleGradientPaint$ColorSpaceType outerClass java/awt/MultipleGradientPaint innerClassName ColorSpaceType flags 4019 +innerclass innerClass java/awt/geom/Point2D$Double outerClass java/awt/geom/Point2D innerClassName Double flags 9 + +class name java/awt/ScrollPane +header extends java/awt/Container implements javax/accessibility/Accessible nestMembers java/awt/ScrollPane$AccessibleAWTScrollPane flags 21 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/awt/ScrollPane$AccessibleAWTScrollPane outerClass java/awt/ScrollPane innerClassName AccessibleAWTScrollPane flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/Taskbar +header extends java/lang/Object nestMembers java/awt/Taskbar$State,java/awt/Taskbar$Feature flags 21 +innerclass innerClass java/awt/Taskbar$Feature outerClass java/awt/Taskbar innerClassName Feature flags 4019 +innerclass innerClass java/awt/Taskbar$State outerClass java/awt/Taskbar innerClassName State flags 4019 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/Window +header extends java/awt/Container implements javax/accessibility/Accessible nestMembers java/awt/Window$AccessibleAWTWindow,java/awt/Window$Type flags 21 +innerclass innerClass java/awt/Window$Type outerClass java/awt/Window innerClassName Type flags 4019 +innerclass innerClass java/awt/Dialog$ModalExclusionType outerClass java/awt/Dialog innerClassName ModalExclusionType flags 4019 +innerclass innerClass java/awt/event/FocusEvent$Cause outerClass java/awt/event/FocusEvent innerClassName Cause flags 4019 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/awt/Window$AccessibleAWTWindow outerClass java/awt/Window innerClassName AccessibleAWTWindow flags 4 +innerclass innerClass java/awt/GraphicsDevice$WindowTranslucency outerClass java/awt/GraphicsDevice innerClassName WindowTranslucency flags 4019 +innerclass innerClass java/awt/geom/Path2D$Float outerClass java/awt/geom/Path2D innerClassName Float flags 9 +innerclass innerClass java/awt/geom/Point2D$Double outerClass java/awt/geom/Point2D innerClassName Double flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/dnd/DropTarget +header extends java/lang/Object implements java/awt/dnd/DropTargetListener,java/io/Serializable nestMembers java/awt/dnd/DropTarget$DropTargetAutoScroller flags 21 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/awt/dnd/DropTarget$DropTargetAutoScroller outerClass java/awt/dnd/DropTarget innerClassName DropTargetAutoScroller flags c + +class name java/awt/font/TextLayout +header extends java/lang/Object implements java/lang/Cloneable nestMembers java/awt/font/TextLayout$CaretPolicy flags 31 +innerclass innerClass java/text/AttributedCharacterIterator$Attribute outerClass java/text/AttributedCharacterIterator innerClassName Attribute flags 9 +innerclass innerClass java/awt/geom/Rectangle2D$Float outerClass java/awt/geom/Rectangle2D innerClassName Float flags 9 +innerclass innerClass java/awt/font/TextLayout$CaretPolicy outerClass java/awt/font/TextLayout innerClassName CaretPolicy flags 9 +innerclass innerClass java/awt/geom/Point2D$Float outerClass java/awt/geom/Point2D innerClassName Float flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/geom/Arc2D +header extends java/awt/geom/RectangularShape nestMembers java/awt/geom/Arc2D$Double,java/awt/geom/Arc2D$Float flags 421 +innerclass innerClass java/awt/geom/Point2D$Double outerClass java/awt/geom/Point2D innerClassName Double flags 9 +innerclass innerClass java/awt/geom/Rectangle2D$Double outerClass java/awt/geom/Rectangle2D innerClassName Double flags 9 +innerclass innerClass java/awt/geom/Arc2D$Double outerClass java/awt/geom/Arc2D innerClassName Double flags 9 +innerclass innerClass java/awt/geom/Arc2D$Float outerClass java/awt/geom/Arc2D innerClassName Float flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/awt/geom/Line2D +header extends java/lang/Object implements java/awt/Shape,java/lang/Cloneable nestMembers java/awt/geom/Line2D$Double,java/awt/geom/Line2D$Float flags 421 +innerclass innerClass java/awt/geom/Rectangle2D$Double outerClass java/awt/geom/Rectangle2D innerClassName Double flags 9 +innerclass innerClass java/awt/geom/Line2D$Double outerClass java/awt/geom/Line2D innerClassName Double flags 9 +innerclass innerClass java/awt/geom/Line2D$Float outerClass java/awt/geom/Line2D innerClassName Float flags 9 + +class name java/awt/image/AffineTransformOp +header extends java/lang/Object implements java/awt/image/BufferedImageOp,java/awt/image/RasterOp flags 21 +innerclass innerClass java/awt/RenderingHints$Key outerClass java/awt/RenderingHints innerClassName Key flags 409 +innerclass innerClass java/awt/geom/Rectangle2D$Float outerClass java/awt/geom/Rectangle2D innerClassName Float flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/beans/beancontext/BeanContextServicesSupport +header extends java/beans/beancontext/BeanContextSupport implements java/beans/beancontext/BeanContextServices nestMembers java/beans/beancontext/BeanContextServicesSupport$BCSSProxyServiceProvider,java/beans/beancontext/BeanContextServicesSupport$BCSSServiceProvider,java/beans/beancontext/BeanContextServicesSupport$BCSSChild flags 21 +innerclass innerClass java/beans/beancontext/BeanContextServicesSupport$BCSSChild outerClass java/beans/beancontext/BeanContextServicesSupport innerClassName BCSSChild flags 4 +innerclass innerClass java/beans/beancontext/BeanContextServicesSupport$BCSSServiceProvider outerClass java/beans/beancontext/BeanContextServicesSupport innerClassName BCSSServiceProvider flags c +innerclass innerClass java/beans/beancontext/BeanContextServicesSupport$BCSSProxyServiceProvider outerClass java/beans/beancontext/BeanContextServicesSupport innerClassName BCSSProxyServiceProvider flags 4 +innerclass innerClass java/beans/beancontext/BeanContextSupport$BCSIterator outerClass java/beans/beancontext/BeanContextSupport innerClassName BCSIterator flags 1c +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/beans/beancontext/BeanContextSupport$BCSChild outerClass java/beans/beancontext/BeanContextSupport innerClassName BCSChild flags 4 + +class name java/beans/beancontext/BeanContextServicesSupport$BCSSChild +header extends java/beans/beancontext/BeanContextSupport$BCSChild nestHost java/beans/beancontext/BeanContextServicesSupport flags 21 +innerclass innerClass java/beans/beancontext/BeanContextServicesSupport$BCSSChild outerClass java/beans/beancontext/BeanContextServicesSupport innerClassName BCSSChild flags 4 +innerclass innerClass java/beans/beancontext/BeanContextSupport$BCSChild outerClass java/beans/beancontext/BeanContextSupport innerClassName BCSChild flags 4 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 + +class name java/beans/beancontext/BeanContextServicesSupport$BCSSProxyServiceProvider +header extends java/lang/Object implements java/beans/beancontext/BeanContextServiceProvider,java/beans/beancontext/BeanContextServiceRevokedListener nestHost java/beans/beancontext/BeanContextServicesSupport flags 21 +innerclass innerClass java/beans/beancontext/BeanContextServicesSupport$BCSSProxyServiceProvider outerClass java/beans/beancontext/BeanContextServicesSupport innerClassName BCSSProxyServiceProvider flags 4 +innerclass innerClass java/beans/beancontext/BeanContextServicesSupport$BCSSChild outerClass java/beans/beancontext/BeanContextServicesSupport innerClassName BCSSChild flags 4 +innerclass innerClass java/beans/beancontext/BeanContextSupport$BCSChild outerClass java/beans/beancontext/BeanContextSupport innerClassName BCSChild flags 4 + +class name java/beans/beancontext/BeanContextSupport +header extends java/beans/beancontext/BeanContextChildSupport implements java/beans/beancontext/BeanContext,java/io/Serializable,java/beans/PropertyChangeListener,java/beans/VetoableChangeListener nestMembers java/beans/beancontext/BeanContextSupport$BCSChild,java/beans/beancontext/BeanContextSupport$BCSIterator flags 21 +innerclass innerClass java/beans/beancontext/BeanContextSupport$BCSIterator outerClass java/beans/beancontext/BeanContextSupport innerClassName BCSIterator flags 1c +innerclass innerClass java/beans/beancontext/BeanContextSupport$BCSChild outerClass java/beans/beancontext/BeanContextSupport innerClassName BCSChild flags 4 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 + +class name javax/accessibility/AccessibleBundle +header extends java/lang/Object flags 421 classAnnotations @Ljdk/Profile+Annotation;(value=I4) + +class name javax/print/attribute/standard/MediaSize +header extends javax/print/attribute/Size2DSyntax implements javax/print/attribute/Attribute nestMembers javax/print/attribute/standard/MediaSize$Other,javax/print/attribute/standard/MediaSize$Engineering,javax/print/attribute/standard/MediaSize$NA,javax/print/attribute/standard/MediaSize$JIS,javax/print/attribute/standard/MediaSize$ISO flags 21 +innerclass innerClass javax/print/attribute/standard/MediaSize$ISO outerClass javax/print/attribute/standard/MediaSize innerClassName ISO flags 19 +innerclass innerClass javax/print/attribute/standard/MediaSize$JIS outerClass javax/print/attribute/standard/MediaSize innerClassName JIS flags 19 +innerclass innerClass javax/print/attribute/standard/MediaSize$NA outerClass javax/print/attribute/standard/MediaSize innerClassName NA flags 19 +innerclass innerClass javax/print/attribute/standard/MediaSize$Engineering outerClass javax/print/attribute/standard/MediaSize innerClassName Engineering flags 19 +innerclass innerClass javax/print/attribute/standard/MediaSize$Other outerClass javax/print/attribute/standard/MediaSize innerClassName Other flags 19 + +class name javax/sound/sampled/AudioSystem +header extends java/lang/Object flags 21 +innerclass innerClass javax/sound/sampled/Mixer$Info outerClass javax/sound/sampled/Mixer innerClassName Info flags 9 +innerclass innerClass javax/sound/sampled/Line$Info outerClass javax/sound/sampled/Line innerClassName Info flags 9 +innerclass innerClass javax/sound/sampled/AudioFormat$Encoding outerClass javax/sound/sampled/AudioFormat innerClassName Encoding flags 9 +innerclass innerClass javax/sound/sampled/DataLine$Info outerClass javax/sound/sampled/DataLine innerClassName Info flags 9 +innerclass innerClass javax/sound/sampled/AudioFileFormat$Type outerClass javax/sound/sampled/AudioFileFormat innerClassName Type flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/sound/sampled/BooleanControl +header extends javax/sound/sampled/Control nestMembers javax/sound/sampled/BooleanControl$Type flags 421 +innerclass innerClass javax/sound/sampled/Control$Type outerClass javax/sound/sampled/Control innerClassName Type flags 9 +innerclass innerClass javax/sound/sampled/BooleanControl$Type outerClass javax/sound/sampled/BooleanControl innerClassName Type flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/sound/sampled/BooleanControl$Type +header extends javax/sound/sampled/Control$Type nestHost javax/sound/sampled/BooleanControl flags 21 +innerclass innerClass javax/sound/sampled/Control$Type outerClass javax/sound/sampled/Control innerClassName Type flags 9 +innerclass innerClass javax/sound/sampled/BooleanControl$Type outerClass javax/sound/sampled/BooleanControl innerClassName Type flags 9 + +class name javax/sound/sampled/CompoundControl +header extends javax/sound/sampled/Control nestMembers javax/sound/sampled/CompoundControl$Type flags 421 +innerclass innerClass javax/sound/sampled/Control$Type outerClass javax/sound/sampled/Control innerClassName Type flags 9 +innerclass innerClass javax/sound/sampled/CompoundControl$Type outerClass javax/sound/sampled/CompoundControl innerClassName Type flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/sound/sampled/CompoundControl$Type +header extends javax/sound/sampled/Control$Type nestHost javax/sound/sampled/CompoundControl flags 21 +innerclass innerClass javax/sound/sampled/Control$Type outerClass javax/sound/sampled/Control innerClassName Type flags 9 +innerclass innerClass javax/sound/sampled/CompoundControl$Type outerClass javax/sound/sampled/CompoundControl innerClassName Type flags 9 + +class name javax/sound/sampled/DataLine$Info +header extends javax/sound/sampled/Line$Info nestHost javax/sound/sampled/DataLine flags 21 +innerclass innerClass javax/sound/sampled/Line$Info outerClass javax/sound/sampled/Line innerClassName Info flags 9 +innerclass innerClass javax/sound/sampled/DataLine$Info outerClass javax/sound/sampled/DataLine innerClassName Info flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/sound/sampled/EnumControl +header extends javax/sound/sampled/Control nestMembers javax/sound/sampled/EnumControl$Type flags 421 +innerclass innerClass javax/sound/sampled/Control$Type outerClass javax/sound/sampled/Control innerClassName Type flags 9 +innerclass innerClass javax/sound/sampled/EnumControl$Type outerClass javax/sound/sampled/EnumControl innerClassName Type flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/sound/sampled/EnumControl$Type +header extends javax/sound/sampled/Control$Type nestHost javax/sound/sampled/EnumControl flags 21 +innerclass innerClass javax/sound/sampled/Control$Type outerClass javax/sound/sampled/Control innerClassName Type flags 9 +innerclass innerClass javax/sound/sampled/EnumControl$Type outerClass javax/sound/sampled/EnumControl innerClassName Type flags 9 + +class name javax/sound/sampled/FloatControl +header extends javax/sound/sampled/Control nestMembers javax/sound/sampled/FloatControl$Type flags 421 +innerclass innerClass javax/sound/sampled/Control$Type outerClass javax/sound/sampled/Control innerClassName Type flags 9 +innerclass innerClass javax/sound/sampled/FloatControl$Type outerClass javax/sound/sampled/FloatControl innerClassName Type flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/sound/sampled/FloatControl$Type +header extends javax/sound/sampled/Control$Type nestHost javax/sound/sampled/FloatControl flags 21 +innerclass innerClass javax/sound/sampled/Control$Type outerClass javax/sound/sampled/Control innerClassName Type flags 9 +innerclass innerClass javax/sound/sampled/FloatControl$Type outerClass javax/sound/sampled/FloatControl innerClassName Type flags 9 + +class name javax/sound/sampled/Line$Info +header extends java/lang/Object nestHost javax/sound/sampled/Line flags 21 +innerclass innerClass javax/sound/sampled/Line$Info outerClass javax/sound/sampled/Line innerClassName Info flags 9 + +class name javax/sound/sampled/Port$Info +header extends javax/sound/sampled/Line$Info nestHost javax/sound/sampled/Port flags 21 +innerclass innerClass javax/sound/sampled/Line$Info outerClass javax/sound/sampled/Line innerClassName Info flags 9 +innerclass innerClass javax/sound/sampled/Port$Info outerClass javax/sound/sampled/Port innerClassName Info flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/AbstractButton$AccessibleAbstractButton +header extends javax/swing/JComponent$AccessibleJComponent implements javax/accessibility/AccessibleAction,javax/accessibility/AccessibleValue,javax/accessibility/AccessibleText,javax/accessibility/AccessibleExtendedComponent nestHost javax/swing/AbstractButton flags 421 +innerclass innerClass javax/swing/AbstractButton$AccessibleAbstractButton outerClass javax/swing/AbstractButton innerClassName AccessibleAbstractButton flags 404 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass java/awt/geom/Rectangle2D$Float outerClass java/awt/geom/Rectangle2D innerClassName Float flags 9 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 + +class name javax/swing/Box +header extends javax/swing/JComponent implements javax/accessibility/Accessible nestMembers javax/swing/Box$AccessibleBox,javax/swing/Box$Filler,javax/swing/Box$Filler$AccessibleBoxFiller flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="accessibleContext") +innerclass innerClass javax/swing/Box$Filler outerClass javax/swing/Box innerClassName Filler flags 9 +innerclass innerClass javax/swing/Box$AccessibleBox outerClass javax/swing/Box innerClassName AccessibleBox flags 4 +innerclass innerClass javax/swing/Box$Filler$AccessibleBoxFiller outerClass javax/swing/Box$Filler innerClassName AccessibleBoxFiller flags 4 + +class name javax/swing/DefaultListCellRenderer +header extends javax/swing/JLabel implements javax/swing/ListCellRenderer,java/io/Serializable nestMembers javax/swing/DefaultListCellRenderer$UIResource flags 21 signature Ljavax/swing/JLabel;Ljavax/swing/ListCellRenderer;Ljava/io/Serializable; +innerclass innerClass javax/swing/JList$DropLocation outerClass javax/swing/JList innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/DefaultListCellRenderer$UIResource outerClass javax/swing/DefaultListCellRenderer innerClassName UIResource flags 9 + +class name javax/swing/GroupLayout +header extends java/lang/Object implements java/awt/LayoutManager2 nestMembers javax/swing/GroupLayout$ParallelGroup,javax/swing/GroupLayout$SequentialGroup,javax/swing/GroupLayout$Group,javax/swing/GroupLayout$Spring,javax/swing/GroupLayout$Alignment flags 21 +innerclass innerClass javax/swing/GroupLayout$Alignment outerClass javax/swing/GroupLayout innerClassName Alignment flags 4019 +innerclass innerClass javax/swing/GroupLayout$ParallelGroup outerClass javax/swing/GroupLayout innerClassName ParallelGroup flags 1 +innerclass innerClass javax/swing/GroupLayout$Group outerClass javax/swing/GroupLayout innerClassName Group flags 401 +innerclass innerClass javax/swing/GroupLayout$SequentialGroup outerClass javax/swing/GroupLayout innerClassName SequentialGroup flags 1 +innerclass innerClass javax/swing/GroupLayout$Spring outerClass javax/swing/GroupLayout innerClassName Spring flags 402 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/GroupLayout$Group +header extends javax/swing/GroupLayout$Spring nestHost javax/swing/GroupLayout flags 421 +innerclass innerClass javax/swing/GroupLayout$Group outerClass javax/swing/GroupLayout innerClassName Group flags 401 +innerclass innerClass javax/swing/GroupLayout$Spring outerClass javax/swing/GroupLayout innerClassName Spring flags 402 + +class name javax/swing/GroupLayout$ParallelGroup +header extends javax/swing/GroupLayout$Group nestHost javax/swing/GroupLayout flags 21 +innerclass innerClass javax/swing/GroupLayout$ParallelGroup outerClass javax/swing/GroupLayout innerClassName ParallelGroup flags 1 +innerclass innerClass javax/swing/GroupLayout$Group outerClass javax/swing/GroupLayout innerClassName Group flags 401 +innerclass innerClass javax/swing/GroupLayout$Alignment outerClass javax/swing/GroupLayout innerClassName Alignment flags 4019 +innerclass innerClass javax/swing/GroupLayout$Spring outerClass javax/swing/GroupLayout innerClassName Spring flags 402 + +class name javax/swing/GroupLayout$SequentialGroup +header extends javax/swing/GroupLayout$Group nestHost javax/swing/GroupLayout flags 21 +innerclass innerClass javax/swing/GroupLayout$SequentialGroup outerClass javax/swing/GroupLayout innerClassName SequentialGroup flags 1 +innerclass innerClass javax/swing/GroupLayout$Group outerClass javax/swing/GroupLayout innerClassName Group flags 401 +innerclass innerClass javax/swing/GroupLayout$Spring outerClass javax/swing/GroupLayout innerClassName Spring flags 402 +innerclass innerClass javax/swing/LayoutStyle$ComponentPlacement outerClass javax/swing/LayoutStyle innerClassName ComponentPlacement flags 4019 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 + +class name javax/swing/JCheckBoxMenuItem +header extends javax/swing/JMenuItem implements javax/swing/SwingConstants,javax/accessibility/Accessible nestMembers javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(description="A\u005C;u0020;menu\u005C;u0020;item\u005C;u0020;which\u005C;u0020;can\u005C;u0020;be\u005C;u0020;selected\u005C;u0020;or\u005C;u0020;deselected.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/JToggleButton$ToggleButtonModel outerClass javax/swing/JToggleButton innerClassName ToggleButtonModel flags 9 +innerclass innerClass javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem outerClass javax/swing/JCheckBoxMenuItem innerClassName AccessibleJCheckBoxMenuItem flags 4 + +class name javax/swing/JComboBox +header extends javax/swing/JComponent implements java/awt/ItemSelectable,javax/swing/event/ListDataListener,java/awt/event/ActionListener,javax/accessibility/Accessible nestMembers javax/swing/JComboBox$AccessibleJComboBox,javax/swing/JComboBox$KeySelectionManager flags 21 signature Ljavax/swing/JComponent;Ljava/awt/ItemSelectable;Ljavax/swing/event/ListDataListener;Ljava/awt/event/ActionListener;Ljavax/accessibility/Accessible; runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;combination\u005C;u0020;of\u005C;u0020;a\u005C;u0020;text\u005C;u0020;field\u005C;u0020;and\u005C;u0020;a\u005C;u0020;drop-down\u005C;u0020;list.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/JComboBox$KeySelectionManager outerClass javax/swing/JComboBox innerClassName KeySelectionManager flags 609 +innerclass innerClass javax/swing/JComboBox$AccessibleJComboBox outerClass javax/swing/JComboBox innerClassName AccessibleJComboBox flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JComponent +header extends java/awt/Container implements java/io/Serializable,javax/swing/TransferHandler$HasGetTransferHandler nestMembers javax/swing/JComponent$AccessibleJComponent,javax/swing/JComponent$AccessibleJComponent$AccessibleFocusHandler,javax/swing/JComponent$AccessibleJComponent$AccessibleContainerHandler flags 421 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UIClassID") +innerclass innerClass java/awt/RenderingHints$Key outerClass java/awt/RenderingHints innerClassName Key flags 409 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass javax/swing/TransferHandler$HasGetTransferHandler outerClass javax/swing/TransferHandler innerClassName HasGetTransferHandler flags 608 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent$AccessibleFocusHandler outerClass javax/swing/JComponent$AccessibleJComponent innerClassName AccessibleFocusHandler flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent$AccessibleContainerHandler outerClass javax/swing/JComponent$AccessibleJComponent innerClassName AccessibleContainerHandler flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JComponent$AccessibleJComponent +header extends java/awt/Container$AccessibleAWTContainer implements javax/accessibility/AccessibleExtendedComponent nestHost javax/swing/JComponent flags 421 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass java/awt/Container$AccessibleAWTContainer outerClass java/awt/Container innerClassName AccessibleAWTContainer flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent$AccessibleFocusHandler outerClass javax/swing/JComponent$AccessibleJComponent innerClassName AccessibleFocusHandler flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent$AccessibleContainerHandler outerClass javax/swing/JComponent$AccessibleJComponent innerClassName AccessibleContainerHandler flags 4 + +class name javax/swing/JDesktopPane +header extends javax/swing/JLayeredPane implements javax/accessibility/Accessible nestMembers javax/swing/JDesktopPane$AccessibleJDesktopPane flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI") +innerclass innerClass javax/swing/JInternalFrame$JDesktopIcon outerClass javax/swing/JInternalFrame innerClassName JDesktopIcon flags 9 +innerclass innerClass javax/swing/JDesktopPane$AccessibleJDesktopPane outerClass javax/swing/JDesktopPane innerClassName AccessibleJDesktopPane flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JDialog +header extends java/awt/Dialog implements javax/swing/WindowConstants,javax/accessibility/Accessible,javax/swing/RootPaneContainer,javax/swing/TransferHandler$HasGetTransferHandler nestMembers javax/swing/JDialog$AccessibleJDialog flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="JMenuBar",description="A\u005C;u0020;toplevel\u005C;u0020;window\u005C;u0020;for\u005C;u0020;creating\u005C;u0020;dialog\u005C;u0020;boxes.")@Ljavax/swing/SwingContainer;(delegate="getContentPane") +innerclass innerClass java/awt/Dialog$ModalityType outerClass java/awt/Dialog innerClassName ModalityType flags 4019 +innerclass innerClass javax/swing/JDialog$AccessibleJDialog outerClass javax/swing/JDialog innerClassName AccessibleJDialog flags 4 +innerclass innerClass javax/swing/TransferHandler$HasGetTransferHandler outerClass javax/swing/TransferHandler innerClassName HasGetTransferHandler flags 608 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JEditorPane +header extends javax/swing/text/JTextComponent nestMembers javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport,javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport$HTMLLink,javax/swing/JEditorPane$AccessibleJEditorPaneHTML,javax/swing/JEditorPane$AccessibleJEditorPane flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UIClassID",description="A\u005C;u0020;text\u005C;u0020;component\u005C;u0020;to\u005C;u0020;edit\u005C;u0020;various\u005C;u0020;types\u005C;u0020;of\u005C;u0020;content.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTMLDocument$Iterator outerClass javax/swing/text/html/HTMLDocument innerClassName Iterator flags 409 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/JEditorPane$AccessibleJEditorPaneHTML outerClass javax/swing/JEditorPane innerClassName AccessibleJEditorPaneHTML flags 4 +innerclass innerClass javax/swing/JEditorPane$AccessibleJEditorPane outerClass javax/swing/JEditorPane innerClassName AccessibleJEditorPane flags 4 +innerclass innerClass javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport outerClass javax/swing/JEditorPane innerClassName JEditorPaneAccessibleHypertextSupport flags 4 +innerclass innerClass javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport$HTMLLink outerClass javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport innerClassName HTMLLink flags 1 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JEditorPane$AccessibleJEditorPaneHTML +header extends javax/swing/JEditorPane$AccessibleJEditorPane nestHost javax/swing/JEditorPane flags 21 +innerclass innerClass javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport outerClass javax/swing/JEditorPane innerClassName JEditorPaneAccessibleHypertextSupport flags 4 +innerclass innerClass javax/swing/JEditorPane$AccessibleJEditorPaneHTML outerClass javax/swing/JEditorPane innerClassName AccessibleJEditorPaneHTML flags 4 +innerclass innerClass javax/swing/JEditorPane$AccessibleJEditorPane outerClass javax/swing/JEditorPane innerClassName AccessibleJEditorPane flags 4 + +class name javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport +header extends javax/swing/JEditorPane$AccessibleJEditorPane implements javax/accessibility/AccessibleHypertext nestHost javax/swing/JEditorPane flags 21 +innerclass innerClass javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport outerClass javax/swing/JEditorPane innerClassName JEditorPaneAccessibleHypertextSupport flags 4 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport$HTMLLink outerClass javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport innerClassName HTMLLink flags 1 +innerclass innerClass javax/swing/JEditorPane$AccessibleJEditorPane outerClass javax/swing/JEditorPane innerClassName AccessibleJEditorPane flags 4 + +class name javax/swing/JFileChooser +header extends javax/swing/JComponent implements javax/accessibility/Accessible nestMembers javax/swing/JFileChooser$AccessibleJFileChooser flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;component\u005C;u0020;which\u005C;u0020;allows\u005C;u0020;for\u005C;u0020;the\u005C;u0020;interactive\u005C;u0020;selection\u005C;u0020;of\u005C;u0020;a\u005C;u0020;file.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass javax/swing/JFileChooser$AccessibleJFileChooser outerClass javax/swing/JFileChooser innerClassName AccessibleJFileChooser flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JFormattedTextField +header extends javax/swing/JTextField nestMembers javax/swing/JFormattedTextField$AbstractFormatter,javax/swing/JFormattedTextField$AbstractFormatterFactory flags 21 runtimeAnnotations @Ljava/beans/JavaBean; +innerclass innerClass javax/swing/JFormattedTextField$AbstractFormatterFactory outerClass javax/swing/JFormattedTextField innerClassName AbstractFormatterFactory flags 409 +innerclass innerClass javax/swing/JFormattedTextField$AbstractFormatter outerClass javax/swing/JFormattedTextField innerClassName AbstractFormatter flags 409 + +class name javax/swing/JLabel$AccessibleJLabel +header extends javax/swing/JComponent$AccessibleJComponent implements javax/accessibility/AccessibleText,javax/accessibility/AccessibleExtendedComponent nestHost javax/swing/JLabel flags 21 +innerclass innerClass javax/swing/JLabel$AccessibleJLabel outerClass javax/swing/JLabel innerClassName AccessibleJLabel flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass java/awt/geom/Rectangle2D$Float outerClass java/awt/geom/Rectangle2D innerClassName Float flags 9 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 + +class name javax/swing/JList +header extends javax/swing/JComponent implements javax/swing/Scrollable,javax/accessibility/Accessible nestMembers javax/swing/JList$AccessibleJList,javax/swing/JList$AccessibleJList$AccessibleJListChild,javax/swing/JList$DropLocation flags 21 signature Ljavax/swing/JComponent;Ljavax/swing/Scrollable;Ljavax/accessibility/Accessible; runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;component\u005C;u0020;which\u005C;u0020;allows\u005C;u0020;for\u005C;u0020;the\u005C;u0020;selection\u005C;u0020;of\u005C;u0020;one\u005C;u0020;or\u005C;u0020;more\u005C;u0020;objects\u005C;u0020;from\u005C;u0020;a\u005C;u0020;list.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/JList$DropLocation outerClass javax/swing/JList innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass javax/swing/JList$AccessibleJList outerClass javax/swing/JList innerClassName AccessibleJList flags 4 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass javax/swing/JList$AccessibleJList$AccessibleJListChild outerClass javax/swing/JList$AccessibleJList innerClassName AccessibleJListChild flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JList$AccessibleJList +header extends javax/swing/JComponent$AccessibleJComponent implements javax/accessibility/AccessibleSelection,java/beans/PropertyChangeListener,javax/swing/event/ListSelectionListener,javax/swing/event/ListDataListener nestHost javax/swing/JList flags 21 +innerclass innerClass javax/swing/JList$AccessibleJList outerClass javax/swing/JList innerClassName AccessibleJList flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass javax/swing/JList$AccessibleJList$AccessibleJListChild outerClass javax/swing/JList$AccessibleJList innerClassName AccessibleJListChild flags 4 + +class name javax/swing/JList$DropLocation +header extends javax/swing/TransferHandler$DropLocation nestHost javax/swing/JList flags 31 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass javax/swing/JList$DropLocation outerClass javax/swing/JList innerClassName DropLocation flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JMenu +header extends javax/swing/JMenuItem implements javax/accessibility/Accessible,javax/swing/MenuElement nestMembers javax/swing/JMenu$AccessibleJMenu,javax/swing/JMenu$WinListener flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(description="A\u005C;u0020;popup\u005C;u0020;window\u005C;u0020;containing\u005C;u0020;menu\u005C;u0020;items\u005C;u0020;displayed\u005C;u0020;in\u005C;u0020;a\u005C;u0020;menu\u005C;u0020;bar.")@Ljavax/swing/SwingContainer; +innerclass innerClass javax/swing/JMenu$WinListener outerClass javax/swing/JMenu innerClassName WinListener flags 4 +innerclass innerClass javax/swing/JPopupMenu$Separator outerClass javax/swing/JPopupMenu innerClassName Separator flags 9 +innerclass innerClass javax/swing/JMenu$AccessibleJMenu outerClass javax/swing/JMenu innerClassName AccessibleJMenu flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JOptionPane +header extends javax/swing/JComponent implements javax/accessibility/Accessible nestMembers javax/swing/JOptionPane$AccessibleJOptionPane flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;component\u005C;u0020;which\u005C;u0020;implements\u005C;u0020;standard\u005C;u0020;dialog\u005C;u0020;box\u005C;u0020;controls.")@Ljavax/swing/SwingContainer; +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass javax/swing/JOptionPane$AccessibleJOptionPane outerClass javax/swing/JOptionPane innerClassName AccessibleJOptionPane flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JRadioButtonMenuItem +header extends javax/swing/JMenuItem implements javax/accessibility/Accessible nestMembers javax/swing/JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(description="A\u005C;u0020;component\u005C;u0020;within\u005C;u0020;a\u005C;u0020;group\u005C;u0020;of\u005C;u0020;menu\u005C;u0020;items\u005C;u0020;which\u005C;u0020;can\u005C;u0020;be\u005C;u0020;selected.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/JToggleButton$ToggleButtonModel outerClass javax/swing/JToggleButton innerClassName ToggleButtonModel flags 9 +innerclass innerClass javax/swing/JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem outerClass javax/swing/JRadioButtonMenuItem innerClassName AccessibleJRadioButtonMenuItem flags 4 + +class name javax/swing/JRootPane +header extends javax/swing/JComponent implements javax/accessibility/Accessible nestMembers javax/swing/JRootPane$AccessibleJRootPane,javax/swing/JRootPane$RootLayout flags 21 +innerclass innerClass javax/swing/JRootPane$RootLayout outerClass javax/swing/JRootPane innerClassName RootLayout flags 4 +innerclass innerClass javax/swing/JRootPane$AccessibleJRootPane outerClass javax/swing/JRootPane innerClassName AccessibleJRootPane flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JScrollPane +header extends javax/swing/JComponent implements javax/swing/ScrollPaneConstants,javax/accessibility/Accessible nestMembers javax/swing/JScrollPane$AccessibleJScrollPane,javax/swing/JScrollPane$ScrollBar flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;specialized\u005C;u0020;container\u005C;u0020;that\u005C;u0020;manages\u005C;u0020;a\u005C;u0020;viewport,\u005C;u0020;optional\u005C;u0020;scrollbars\u005C;u0020;and\u005C;u0020;headers")@Ljavax/swing/SwingContainer;(delegate="getViewport") +innerclass innerClass javax/swing/ScrollPaneLayout$UIResource outerClass javax/swing/ScrollPaneLayout innerClassName UIResource flags 9 +innerclass innerClass javax/swing/JScrollPane$ScrollBar outerClass javax/swing/JScrollPane innerClassName ScrollBar flags 4 +innerclass innerClass javax/swing/JScrollPane$AccessibleJScrollPane outerClass javax/swing/JScrollPane innerClassName AccessibleJScrollPane flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JSpinner +header extends javax/swing/JComponent implements javax/accessibility/Accessible nestMembers javax/swing/JSpinner$AccessibleJSpinner,javax/swing/JSpinner$ListEditor,javax/swing/JSpinner$NumberEditor,javax/swing/JSpinner$DateEditor,javax/swing/JSpinner$DefaultEditor flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;single\u005C;u0020;line\u005C;u0020;input\u005C;u0020;field\u005C;u0020;that\u005C;u0020;lets\u005C;u0020;the\u005C;u0020;user\u005C;u0020;select\u005C;u0020;a\u005C;u0020;number\u005C;u0020;or\u005C;u0020;an\u005C;u0020;object\u005C;u0020;value\u005C;u0020;from\u005C;u0020;an\u005C;u0020;ordered\u005C;u0020;set.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/JSpinner$DateEditor outerClass javax/swing/JSpinner innerClassName DateEditor flags 9 +innerclass innerClass javax/swing/JSpinner$ListEditor outerClass javax/swing/JSpinner innerClassName ListEditor flags 9 +innerclass innerClass javax/swing/JSpinner$NumberEditor outerClass javax/swing/JSpinner innerClassName NumberEditor flags 9 +innerclass innerClass javax/swing/JSpinner$DefaultEditor outerClass javax/swing/JSpinner innerClassName DefaultEditor flags 9 +innerclass innerClass javax/swing/JSpinner$AccessibleJSpinner outerClass javax/swing/JSpinner innerClassName AccessibleJSpinner flags 4 + +class name javax/swing/JSpinner$AccessibleJSpinner +header extends javax/swing/JComponent$AccessibleJComponent implements javax/accessibility/AccessibleValue,javax/accessibility/AccessibleAction,javax/accessibility/AccessibleText,javax/accessibility/AccessibleEditableText,javax/swing/event/ChangeListener nestHost javax/swing/JSpinner flags 21 +innerclass innerClass javax/swing/JSpinner$AccessibleJSpinner outerClass javax/swing/JSpinner innerClassName AccessibleJSpinner flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass javax/swing/JSpinner$DefaultEditor outerClass javax/swing/JSpinner innerClassName DefaultEditor flags 9 + +class name javax/swing/JSpinner$ListEditor +header extends javax/swing/JSpinner$DefaultEditor nestHost javax/swing/JSpinner flags 21 +innerclass innerClass javax/swing/JSpinner$DefaultEditor outerClass javax/swing/JSpinner innerClassName DefaultEditor flags 9 +innerclass innerClass javax/swing/JSpinner$ListEditor outerClass javax/swing/JSpinner innerClassName ListEditor flags 9 +innerclass innerClass javax/swing/JFormattedTextField$AbstractFormatter outerClass javax/swing/JFormattedTextField innerClassName AbstractFormatter flags 409 +innerclass innerClass javax/swing/JFormattedTextField$AbstractFormatterFactory outerClass javax/swing/JFormattedTextField innerClassName AbstractFormatterFactory flags 409 + +class name javax/swing/JTabbedPane +header extends javax/swing/JComponent implements java/io/Serializable,javax/accessibility/Accessible,javax/swing/SwingConstants nestMembers javax/swing/JTabbedPane$AccessibleJTabbedPane,javax/swing/JTabbedPane$ModelListener flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;component\u005C;u0020;which\u005C;u0020;provides\u005C;u0020;a\u005C;u0020;tab\u005C;u0020;folder\u005C;u0020;metaphor\u005C;u0020;for\u005C;u0020;displaying\u005C;u0020;one\u005C;u0020;component\u005C;u0020;from\u005C;u0020;a\u005C;u0020;set\u005C;u0020;of\u005C;u0020;components.")@Ljavax/swing/SwingContainer; +innerclass innerClass javax/swing/JTabbedPane$ModelListener outerClass javax/swing/JTabbedPane innerClassName ModelListener flags 4 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass javax/swing/JTabbedPane$AccessibleJTabbedPane outerClass javax/swing/JTabbedPane innerClassName AccessibleJTabbedPane flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JTable +header extends javax/swing/JComponent implements javax/swing/event/TableModelListener,javax/swing/Scrollable,javax/swing/event/TableColumnModelListener,javax/swing/event/ListSelectionListener,javax/swing/event/CellEditorListener,javax/accessibility/Accessible,javax/swing/event/RowSorterListener nestMembers javax/swing/JTable$AccessibleJTable,javax/swing/JTable$AccessibleJTable$AccessibleJTableCell,javax/swing/JTable$AccessibleJTable$AccessibleJTableModelChange,javax/swing/JTable$DropLocation,javax/swing/JTable$PrintMode flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;component\u005C;u0020;which\u005C;u0020;displays\u005C;u0020;data\u005C;u0020;in\u005C;u0020;a\u005C;u0020;two\u005C;u0020;dimensional\u005C;u0020;grid.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/JTable$DropLocation outerClass javax/swing/JTable innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/event/RowSorterEvent$Type outerClass javax/swing/event/RowSorterEvent innerClassName Type flags 4019 +innerclass innerClass javax/swing/UIDefaults$LazyValue outerClass javax/swing/UIDefaults innerClassName LazyValue flags 609 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass javax/swing/JTable$PrintMode outerClass javax/swing/JTable innerClassName PrintMode flags 4019 +innerclass innerClass javax/swing/JTable$AccessibleJTable outerClass javax/swing/JTable innerClassName AccessibleJTable flags 4 +innerclass innerClass javax/swing/table/DefaultTableCellRenderer$UIResource outerClass javax/swing/table/DefaultTableCellRenderer innerClassName UIResource flags 9 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass javax/swing/JTable$AccessibleJTable$AccessibleJTableCell outerClass javax/swing/JTable$AccessibleJTable innerClassName AccessibleJTableCell flags 4 +innerclass innerClass javax/swing/JTable$AccessibleJTable$AccessibleJTableModelChange outerClass javax/swing/JTable$AccessibleJTable innerClassName AccessibleJTableModelChange flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JTable$AccessibleJTable +header extends javax/swing/JComponent$AccessibleJComponent implements javax/accessibility/AccessibleSelection,javax/swing/event/ListSelectionListener,javax/swing/event/TableModelListener,javax/swing/event/TableColumnModelListener,javax/swing/event/CellEditorListener,java/beans/PropertyChangeListener,javax/accessibility/AccessibleExtendedTable nestHost javax/swing/JTable flags 21 +innerclass innerClass javax/swing/JTable$AccessibleJTable outerClass javax/swing/JTable innerClassName AccessibleJTable flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass javax/swing/JTable$AccessibleJTable$AccessibleJTableModelChange outerClass javax/swing/JTable$AccessibleJTable innerClassName AccessibleJTableModelChange flags 4 +innerclass innerClass javax/swing/JTable$AccessibleJTable$AccessibleJTableCell outerClass javax/swing/JTable$AccessibleJTable innerClassName AccessibleJTableCell flags 4 + +class name javax/swing/JTable$DropLocation +header extends javax/swing/TransferHandler$DropLocation nestHost javax/swing/JTable flags 31 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass javax/swing/JTable$DropLocation outerClass javax/swing/JTable innerClassName DropLocation flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JToggleButton +header extends javax/swing/AbstractButton implements javax/accessibility/Accessible nestMembers javax/swing/JToggleButton$AccessibleJToggleButton,javax/swing/JToggleButton$ToggleButtonModel flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UIClassID",description="An\u005C;u0020;implementation\u005C;u0020;of\u005C;u0020;a\u005C;u0020;two-state\u005C;u0020;button.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/JToggleButton$ToggleButtonModel outerClass javax/swing/JToggleButton innerClassName ToggleButtonModel flags 9 +innerclass innerClass java/awt/event/FocusEvent$Cause outerClass java/awt/event/FocusEvent innerClassName Cause flags 4019 +innerclass innerClass javax/swing/JToggleButton$AccessibleJToggleButton outerClass javax/swing/JToggleButton innerClassName AccessibleJToggleButton flags 4 + +class name javax/swing/JToolBar +header extends javax/swing/JComponent implements javax/swing/SwingConstants,javax/accessibility/Accessible nestMembers javax/swing/JToolBar$AccessibleJToolBar,javax/swing/JToolBar$Separator flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;component\u005C;u0020;which\u005C;u0020;displays\u005C;u0020;commonly\u005C;u0020;used\u005C;u0020;controls\u005C;u0020;or\u005C;u0020;Actions.")@Ljavax/swing/SwingContainer; +innerclass innerClass javax/swing/JToolBar$Separator outerClass javax/swing/JToolBar innerClassName Separator flags 9 +innerclass innerClass javax/swing/JToolBar$AccessibleJToolBar outerClass javax/swing/JToolBar innerClassName AccessibleJToolBar flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JTree +header extends javax/swing/JComponent implements javax/swing/Scrollable,javax/accessibility/Accessible nestMembers javax/swing/JTree$AccessibleJTree,javax/swing/JTree$AccessibleJTree$AccessibleJTreeNode,javax/swing/JTree$DynamicUtilTreeNode,javax/swing/JTree$TreeModelHandler,javax/swing/JTree$TreeSelectionRedirector,javax/swing/JTree$EmptySelectionModel,javax/swing/JTree$DropLocation flags 21 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI",description="A\u005C;u0020;component\u005C;u0020;that\u005C;u0020;displays\u005C;u0020;a\u005C;u0020;set\u005C;u0020;of\u005C;u0020;hierarchical\u005C;u0020;data\u005C;u0020;as\u005C;u0020;an\u005C;u0020;outline.")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/JTree$DynamicUtilTreeNode outerClass javax/swing/JTree innerClassName DynamicUtilTreeNode flags 9 +innerclass innerClass javax/swing/JTree$AccessibleJTree outerClass javax/swing/JTree innerClassName AccessibleJTree flags 4 +innerclass innerClass javax/swing/JTree$DropLocation outerClass javax/swing/JTree innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/JTree$EmptySelectionModel outerClass javax/swing/JTree innerClassName EmptySelectionModel flags c +innerclass innerClass javax/swing/JTree$TreeSelectionRedirector outerClass javax/swing/JTree innerClassName TreeSelectionRedirector flags 4 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass javax/swing/JTree$TreeModelHandler outerClass javax/swing/JTree innerClassName TreeModelHandler flags 4 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass javax/swing/JTree$AccessibleJTree$AccessibleJTreeNode outerClass javax/swing/JTree$AccessibleJTree innerClassName AccessibleJTreeNode flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JTree$AccessibleJTree +header extends javax/swing/JComponent$AccessibleJComponent implements javax/accessibility/AccessibleSelection,javax/swing/event/TreeSelectionListener,javax/swing/event/TreeModelListener,javax/swing/event/TreeExpansionListener nestHost javax/swing/JTree flags 21 +innerclass innerClass javax/swing/JTree$AccessibleJTree outerClass javax/swing/JTree innerClassName AccessibleJTree flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass javax/swing/JTree$AccessibleJTree$AccessibleJTreeNode outerClass javax/swing/JTree$AccessibleJTree innerClassName AccessibleJTreeNode flags 4 + +class name javax/swing/JTree$DropLocation +header extends javax/swing/TransferHandler$DropLocation nestHost javax/swing/JTree flags 31 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass javax/swing/JTree$DropLocation outerClass javax/swing/JTree innerClassName DropLocation flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/JViewport +header extends javax/swing/JComponent implements javax/accessibility/Accessible nestMembers javax/swing/JViewport$AccessibleJViewport,javax/swing/JViewport$ViewListener flags 21 +innerclass innerClass javax/swing/JViewport$ViewListener outerClass javax/swing/JViewport innerClassName ViewListener flags 4 +innerclass innerClass javax/swing/JViewport$AccessibleJViewport outerClass javax/swing/JViewport innerClassName AccessibleJViewport flags 4 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/RowFilter +header extends java/lang/Object nestMembers javax/swing/RowFilter$Entry,javax/swing/RowFilter$ComparisonType flags 421 signature Ljava/lang/Object; +innerclass innerClass javax/swing/RowFilter$ComparisonType outerClass javax/swing/RowFilter innerClassName ComparisonType flags 4019 +innerclass innerClass javax/swing/RowFilter$Entry outerClass javax/swing/RowFilter innerClassName Entry flags 409 + +class name javax/swing/RowSorter +header extends java/lang/Object nestMembers javax/swing/RowSorter$SortKey flags 421 signature Ljava/lang/Object; +innerclass innerClass javax/swing/event/RowSorterEvent$Type outerClass javax/swing/event/RowSorterEvent innerClassName Type flags 4019 +innerclass innerClass javax/swing/RowSorter$SortKey outerClass javax/swing/RowSorter innerClassName SortKey flags 9 + +class name javax/swing/ToolTipManager +header extends java/awt/event/MouseAdapter implements java/awt/event/MouseMotionListener nestMembers javax/swing/ToolTipManager$stillInsideTimerAction,javax/swing/ToolTipManager$outsideTimerAction,javax/swing/ToolTipManager$insideTimerAction flags 21 +innerclass innerClass javax/swing/ToolTipManager$insideTimerAction outerClass javax/swing/ToolTipManager innerClassName insideTimerAction flags 4 +innerclass innerClass javax/swing/ToolTipManager$outsideTimerAction outerClass javax/swing/ToolTipManager innerClassName outsideTimerAction flags 4 +innerclass innerClass javax/swing/ToolTipManager$stillInsideTimerAction outerClass javax/swing/ToolTipManager innerClassName stillInsideTimerAction flags 4 + +class name javax/swing/TransferHandler$TransferSupport +header extends java/lang/Object nestHost javax/swing/TransferHandler flags 31 +innerclass innerClass javax/swing/TransferHandler$TransferSupport outerClass javax/swing/TransferHandler innerClassName TransferSupport flags 19 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/UIDefaults +header extends java/util/Hashtable nestMembers javax/swing/UIDefaults$LazyInputMap,javax/swing/UIDefaults$ProxyLazyValue,javax/swing/UIDefaults$ActiveValue,javax/swing/UIDefaults$LazyValue flags 21 signature Ljava/util/Hashtable; +innerclass innerClass javax/swing/UIDefaults$ActiveValue outerClass javax/swing/UIDefaults innerClassName ActiveValue flags 609 +innerclass innerClass javax/swing/UIDefaults$LazyValue outerClass javax/swing/UIDefaults innerClassName LazyValue flags 609 +innerclass innerClass javax/swing/UIDefaults$LazyInputMap outerClass javax/swing/UIDefaults innerClassName LazyInputMap flags 9 +innerclass innerClass javax/swing/UIDefaults$ProxyLazyValue outerClass javax/swing/UIDefaults innerClassName ProxyLazyValue flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/border/StrokeBorder +header extends javax/swing/border/AbstractBorder flags 21 +innerclass innerClass java/awt/RenderingHints$Key outerClass java/awt/RenderingHints innerClassName Key flags 409 +innerclass innerClass java/awt/geom/Rectangle2D$Float outerClass java/awt/geom/Rectangle2D innerClassName Float flags 9 + +class name javax/swing/border/TitledBorder +header extends javax/swing/border/AbstractBorder flags 21 +innerclass innerClass java/awt/geom/Path2D$Float outerClass java/awt/geom/Path2D innerClassName Float flags 9 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass java/lang/ref/Cleaner$Cleanable outerClass java/lang/ref/Cleaner innerClassName Cleanable flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/plaf/BorderUIResource +header extends java/lang/Object implements javax/swing/border/Border,javax/swing/plaf/UIResource,java/io/Serializable nestMembers javax/swing/plaf/BorderUIResource$TitledBorderUIResource,javax/swing/plaf/BorderUIResource$MatteBorderUIResource,javax/swing/plaf/BorderUIResource$EtchedBorderUIResource,javax/swing/plaf/BorderUIResource$BevelBorderUIResource,javax/swing/plaf/BorderUIResource$LineBorderUIResource,javax/swing/plaf/BorderUIResource$EmptyBorderUIResource,javax/swing/plaf/BorderUIResource$CompoundBorderUIResource flags 21 +innerclass innerClass javax/swing/plaf/BorderUIResource$EtchedBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName EtchedBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/BorderUIResource$BevelBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName BevelBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/BorderUIResource$LineBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName LineBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/BorderUIResource$TitledBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName TitledBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/BorderUIResource$MatteBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName MatteBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/BorderUIResource$EmptyBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName EmptyBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/BorderUIResource$CompoundBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName CompoundBorderUIResource flags 9 + +class name javax/swing/plaf/basic/BasicBorders +header extends java/lang/Object nestMembers javax/swing/plaf/basic/BasicBorders$SplitPaneBorder,javax/swing/plaf/basic/BasicBorders$FieldBorder,javax/swing/plaf/basic/BasicBorders$MarginBorder,javax/swing/plaf/basic/BasicBorders$MenuBarBorder,javax/swing/plaf/basic/BasicBorders$RadioButtonBorder,javax/swing/plaf/basic/BasicBorders$ToggleButtonBorder,javax/swing/plaf/basic/BasicBorders$ButtonBorder,javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder flags 21 +innerclass innerClass javax/swing/plaf/BorderUIResource$CompoundBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName CompoundBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$ButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName ButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$MarginBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName MarginBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$RadioButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName RadioButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$ToggleButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName ToggleButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$MenuBarBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName MenuBarBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$SplitPaneBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName SplitPaneBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$FieldBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName FieldBorder flags 9 +innerclass innerClass javax/swing/plaf/BorderUIResource$LineBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName LineBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName RolloverButtonBorder flags 9 + +class name javax/swing/plaf/basic/BasicBorders$RadioButtonBorder +header extends javax/swing/plaf/basic/BasicBorders$ButtonBorder nestHost javax/swing/plaf/basic/BasicBorders flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$ButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName ButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$RadioButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName RadioButtonBorder flags 9 + +class name javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder +header extends javax/swing/plaf/basic/BasicBorders$ButtonBorder nestHost javax/swing/plaf/basic/BasicBorders flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$ButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName ButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName RolloverButtonBorder flags 9 + +class name javax/swing/plaf/basic/BasicBorders$ToggleButtonBorder +header extends javax/swing/plaf/basic/BasicBorders$ButtonBorder nestHost javax/swing/plaf/basic/BasicBorders flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$ButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName ButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$ToggleButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName ToggleButtonBorder flags 9 + +class name javax/swing/plaf/basic/BasicComboBoxUI +header extends javax/swing/plaf/ComboBoxUI nestMembers javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager,javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler,javax/swing/plaf/basic/BasicComboBoxUI$ItemHandler,javax/swing/plaf/basic/BasicComboBoxUI$ListDataHandler,javax/swing/plaf/basic/BasicComboBoxUI$FocusHandler,javax/swing/plaf/basic/BasicComboBoxUI$KeyHandler flags 21 +innerclass innerClass javax/swing/JComboBox$KeySelectionManager outerClass javax/swing/JComboBox innerClassName KeySelectionManager flags 609 +innerclass innerClass javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource outerClass javax/swing/plaf/basic/BasicComboBoxRenderer innerClassName UIResource flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicComboBoxEditor$UIResource outerClass javax/swing/plaf/basic/BasicComboBoxEditor innerClassName UIResource flags 9 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager outerClass javax/swing/plaf/basic/BasicComboBoxUI innerClassName ComboBoxLayoutManager flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicComboBoxUI innerClassName PropertyChangeHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicComboBoxUI$ItemHandler outerClass javax/swing/plaf/basic/BasicComboBoxUI innerClassName ItemHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicComboBoxUI$ListDataHandler outerClass javax/swing/plaf/basic/BasicComboBoxUI innerClassName ListDataHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicComboBoxUI$FocusHandler outerClass javax/swing/plaf/basic/BasicComboBoxUI innerClassName FocusHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicComboBoxUI$KeyHandler outerClass javax/swing/plaf/basic/BasicComboBoxUI innerClassName KeyHandler flags 1 + +class name javax/swing/plaf/basic/BasicDesktopIconUI +header extends javax/swing/plaf/DesktopIconUI nestMembers javax/swing/plaf/basic/BasicDesktopIconUI$MouseInputHandler flags 21 +innerclass innerClass javax/swing/JInternalFrame$JDesktopIcon outerClass javax/swing/JInternalFrame innerClassName JDesktopIcon flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicDesktopIconUI$MouseInputHandler outerClass javax/swing/plaf/basic/BasicDesktopIconUI innerClassName MouseInputHandler flags 1 + +class name javax/swing/plaf/basic/BasicFileChooserUI +header extends javax/swing/plaf/FileChooserUI nestMembers javax/swing/plaf/basic/BasicFileChooserUI$BasicFileView,javax/swing/plaf/basic/BasicFileChooserUI$AcceptAllFileFilter,javax/swing/plaf/basic/BasicFileChooserUI$UpdateAction,javax/swing/plaf/basic/BasicFileChooserUI$CancelSelectionAction,javax/swing/plaf/basic/BasicFileChooserUI$ApproveSelectionAction,javax/swing/plaf/basic/BasicFileChooserUI$ChangeToParentDirectoryAction,javax/swing/plaf/basic/BasicFileChooserUI$GoHomeAction,javax/swing/plaf/basic/BasicFileChooserUI$NewFolderAction,javax/swing/plaf/basic/BasicFileChooserUI$SelectionListener,javax/swing/plaf/basic/BasicFileChooserUI$DoubleClickListener flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$ApproveSelectionAction outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName ApproveSelectionAction flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$CancelSelectionAction outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName CancelSelectionAction flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$UpdateAction outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName UpdateAction flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$GoHomeAction outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName GoHomeAction flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$ChangeToParentDirectoryAction outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName ChangeToParentDirectoryAction flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$AcceptAllFileFilter outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName AcceptAllFileFilter flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$BasicFileView outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName BasicFileView flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$NewFolderAction outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName NewFolderAction flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$SelectionListener outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName SelectionListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicFileChooserUI$DoubleClickListener outerClass javax/swing/plaf/basic/BasicFileChooserUI innerClassName DoubleClickListener flags 4 + +class name javax/swing/plaf/basic/BasicInternalFrameTitlePane +header extends javax/swing/JComponent nestMembers javax/swing/plaf/basic/BasicInternalFrameTitlePane$SystemMenuBar,javax/swing/plaf/basic/BasicInternalFrameTitlePane$SizeAction,javax/swing/plaf/basic/BasicInternalFrameTitlePane$MoveAction,javax/swing/plaf/basic/BasicInternalFrameTitlePane$RestoreAction,javax/swing/plaf/basic/BasicInternalFrameTitlePane$IconifyAction,javax/swing/plaf/basic/BasicInternalFrameTitlePane$MaximizeAction,javax/swing/plaf/basic/BasicInternalFrameTitlePane$CloseAction,javax/swing/plaf/basic/BasicInternalFrameTitlePane$TitlePaneLayout,javax/swing/plaf/basic/BasicInternalFrameTitlePane$PropertyChangeHandler flags 21 +innerclass innerClass java/awt/RenderingHints$Key outerClass java/awt/RenderingHints innerClassName Key flags 409 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$MaximizeAction outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName MaximizeAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$IconifyAction outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName IconifyAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$CloseAction outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName CloseAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$RestoreAction outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName RestoreAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$MoveAction outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName MoveAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$SizeAction outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName SizeAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$SystemMenuBar outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName SystemMenuBar flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$TitlePaneLayout outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName TitlePaneLayout flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicInternalFrameTitlePane innerClassName PropertyChangeHandler flags 1 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/plaf/basic/BasicInternalFrameUI +header extends javax/swing/plaf/InternalFrameUI nestMembers javax/swing/plaf/basic/BasicInternalFrameUI$BasicInternalFrameListener,javax/swing/plaf/basic/BasicInternalFrameUI$GlassPaneDispatcher,javax/swing/plaf/basic/BasicInternalFrameUI$ComponentHandler,javax/swing/plaf/basic/BasicInternalFrameUI$BorderListener,javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameLayout,javax/swing/plaf/basic/BasicInternalFrameUI$InternalFramePropertyChangeListener flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameUI$BorderListener outerClass javax/swing/plaf/basic/BasicInternalFrameUI innerClassName BorderListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameUI$BasicInternalFrameListener outerClass javax/swing/plaf/basic/BasicInternalFrameUI innerClassName BasicInternalFrameListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameUI$GlassPaneDispatcher outerClass javax/swing/plaf/basic/BasicInternalFrameUI innerClassName GlassPaneDispatcher flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameUI$ComponentHandler outerClass javax/swing/plaf/basic/BasicInternalFrameUI innerClassName ComponentHandler flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameLayout outerClass javax/swing/plaf/basic/BasicInternalFrameUI innerClassName InternalFrameLayout flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicInternalFrameUI$InternalFramePropertyChangeListener outerClass javax/swing/plaf/basic/BasicInternalFrameUI innerClassName InternalFramePropertyChangeListener flags 1 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/plaf/basic/BasicListUI +header extends javax/swing/plaf/ListUI nestMembers javax/swing/plaf/basic/BasicListUI$PropertyChangeHandler,javax/swing/plaf/basic/BasicListUI$ListDataHandler,javax/swing/plaf/basic/BasicListUI$ListSelectionHandler,javax/swing/plaf/basic/BasicListUI$FocusHandler,javax/swing/plaf/basic/BasicListUI$MouseInputHandler flags 21 +innerclass innerClass javax/swing/JList$DropLocation outerClass javax/swing/JList innerClassName DropLocation flags 19 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass javax/swing/plaf/basic/BasicListUI$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicListUI innerClassName PropertyChangeHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicListUI$ListDataHandler outerClass javax/swing/plaf/basic/BasicListUI innerClassName ListDataHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicListUI$ListSelectionHandler outerClass javax/swing/plaf/basic/BasicListUI innerClassName ListSelectionHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicListUI$FocusHandler outerClass javax/swing/plaf/basic/BasicListUI innerClassName FocusHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicListUI$MouseInputHandler outerClass javax/swing/plaf/basic/BasicListUI innerClassName MouseInputHandler flags 1 + +class name javax/swing/plaf/basic/BasicOptionPaneUI +header extends javax/swing/plaf/OptionPaneUI nestMembers javax/swing/plaf/basic/BasicOptionPaneUI$ButtonActionListener,javax/swing/plaf/basic/BasicOptionPaneUI$PropertyChangeHandler,javax/swing/plaf/basic/BasicOptionPaneUI$ButtonAreaLayout flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicOptionPaneUI$ButtonAreaLayout outerClass javax/swing/plaf/basic/BasicOptionPaneUI innerClassName ButtonAreaLayout flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicOptionPaneUI$ButtonActionListener outerClass javax/swing/plaf/basic/BasicOptionPaneUI innerClassName ButtonActionListener flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicOptionPaneUI$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicOptionPaneUI innerClassName PropertyChangeHandler flags 1 + +class name javax/swing/plaf/basic/BasicProgressBarUI +header extends javax/swing/plaf/ProgressBarUI nestMembers javax/swing/plaf/basic/BasicProgressBarUI$ChangeHandler flags 21 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass javax/swing/plaf/basic/BasicProgressBarUI$ChangeHandler outerClass javax/swing/plaf/basic/BasicProgressBarUI innerClassName ChangeHandler flags 1 + +class name javax/swing/plaf/basic/BasicScrollBarUI +header extends javax/swing/plaf/ScrollBarUI implements java/awt/LayoutManager,javax/swing/SwingConstants nestMembers javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler,javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener,javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener,javax/swing/plaf/basic/BasicScrollBarUI$TrackListener,javax/swing/plaf/basic/BasicScrollBarUI$ModelListener flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicScrollBarUI$TrackListener outerClass javax/swing/plaf/basic/BasicScrollBarUI innerClassName TrackListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener outerClass javax/swing/plaf/basic/BasicScrollBarUI innerClassName ArrowButtonListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicScrollBarUI$ModelListener outerClass javax/swing/plaf/basic/BasicScrollBarUI innerClassName ModelListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener outerClass javax/swing/plaf/basic/BasicScrollBarUI innerClassName ScrollListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicScrollBarUI innerClassName PropertyChangeHandler flags 1 + +class name javax/swing/plaf/basic/BasicScrollPaneUI +header extends javax/swing/plaf/ScrollPaneUI implements javax/swing/ScrollPaneConstants nestMembers javax/swing/plaf/basic/BasicScrollPaneUI$PropertyChangeHandler,javax/swing/plaf/basic/BasicScrollPaneUI$MouseWheelHandler,javax/swing/plaf/basic/BasicScrollPaneUI$VSBChangeListener,javax/swing/plaf/basic/BasicScrollPaneUI$HSBChangeListener,javax/swing/plaf/basic/BasicScrollPaneUI$ViewportChangeHandler flags 21 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass javax/swing/plaf/basic/BasicScrollPaneUI$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicScrollPaneUI innerClassName PropertyChangeHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicScrollPaneUI$MouseWheelHandler outerClass javax/swing/plaf/basic/BasicScrollPaneUI innerClassName MouseWheelHandler flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicScrollPaneUI$VSBChangeListener outerClass javax/swing/plaf/basic/BasicScrollPaneUI innerClassName VSBChangeListener flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicScrollPaneUI$HSBChangeListener outerClass javax/swing/plaf/basic/BasicScrollPaneUI innerClassName HSBChangeListener flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicScrollPaneUI$ViewportChangeHandler outerClass javax/swing/plaf/basic/BasicScrollPaneUI innerClassName ViewportChangeHandler flags 1 + +class name javax/swing/plaf/basic/BasicSliderUI +header extends javax/swing/plaf/SliderUI nestMembers javax/swing/plaf/basic/BasicSliderUI$ActionScroller,javax/swing/plaf/basic/BasicSliderUI$FocusHandler,javax/swing/plaf/basic/BasicSliderUI$ComponentHandler,javax/swing/plaf/basic/BasicSliderUI$ScrollListener,javax/swing/plaf/basic/BasicSliderUI$TrackListener,javax/swing/plaf/basic/BasicSliderUI$ChangeHandler,javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicSliderUI$TrackListener outerClass javax/swing/plaf/basic/BasicSliderUI innerClassName TrackListener flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSliderUI$ScrollListener outerClass javax/swing/plaf/basic/BasicSliderUI innerClassName ScrollListener flags 1 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass javax/swing/plaf/basic/BasicSliderUI$ActionScroller outerClass javax/swing/plaf/basic/BasicSliderUI innerClassName ActionScroller flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSliderUI$FocusHandler outerClass javax/swing/plaf/basic/BasicSliderUI innerClassName FocusHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSliderUI$ComponentHandler outerClass javax/swing/plaf/basic/BasicSliderUI innerClassName ComponentHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSliderUI$ChangeHandler outerClass javax/swing/plaf/basic/BasicSliderUI innerClassName ChangeHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicSliderUI innerClassName PropertyChangeHandler flags 1 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/plaf/basic/BasicSpinnerUI +header extends javax/swing/plaf/SpinnerUI flags 21 +innerclass innerClass javax/swing/JSpinner$DefaultEditor outerClass javax/swing/JSpinner innerClassName DefaultEditor flags 9 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 + +class name javax/swing/plaf/basic/BasicSplitPaneDivider +header extends java/awt/Container implements java/beans/PropertyChangeListener nestMembers javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout,javax/swing/plaf/basic/BasicSplitPaneDivider$VerticalDragController,javax/swing/plaf/basic/BasicSplitPaneDivider$DragController,javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout outerClass javax/swing/plaf/basic/BasicSplitPaneDivider innerClassName DividerLayout flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler outerClass javax/swing/plaf/basic/BasicSplitPaneDivider innerClassName MouseHandler flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneDivider$VerticalDragController outerClass javax/swing/plaf/basic/BasicSplitPaneDivider innerClassName VerticalDragController flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneDivider$DragController outerClass javax/swing/plaf/basic/BasicSplitPaneDivider innerClassName DragController flags 4 + +class name javax/swing/plaf/basic/BasicSplitPaneUI +header extends javax/swing/plaf/SplitPaneUI nestMembers javax/swing/plaf/basic/BasicSplitPaneUI$BasicVerticalLayoutManager,javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager,javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardResizeToggleHandler,javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardEndHandler,javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardHomeHandler,javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardDownRightHandler,javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardUpLeftHandler,javax/swing/plaf/basic/BasicSplitPaneUI$FocusHandler,javax/swing/plaf/basic/BasicSplitPaneUI$PropertyHandler flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName BasicHorizontalLayoutManager flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardUpLeftHandler outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName KeyboardUpLeftHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardDownRightHandler outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName KeyboardDownRightHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardHomeHandler outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName KeyboardHomeHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardEndHandler outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName KeyboardEndHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardResizeToggleHandler outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName KeyboardResizeToggleHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$BasicVerticalLayoutManager outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName BasicVerticalLayoutManager flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$FocusHandler outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName FocusHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicSplitPaneUI$PropertyHandler outerClass javax/swing/plaf/basic/BasicSplitPaneUI innerClassName PropertyHandler flags 1 + +class name javax/swing/plaf/basic/BasicTabbedPaneUI +header extends javax/swing/plaf/TabbedPaneUI implements javax/swing/SwingConstants nestMembers javax/swing/plaf/basic/BasicTabbedPaneUI$FocusHandler,javax/swing/plaf/basic/BasicTabbedPaneUI$MouseHandler,javax/swing/plaf/basic/BasicTabbedPaneUI$TabSelectionHandler,javax/swing/plaf/basic/BasicTabbedPaneUI$PropertyChangeHandler,javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout outerClass javax/swing/plaf/basic/BasicTabbedPaneUI innerClassName TabbedPaneLayout flags 1 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass javax/swing/plaf/basic/BasicTabbedPaneUI$FocusHandler outerClass javax/swing/plaf/basic/BasicTabbedPaneUI innerClassName FocusHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTabbedPaneUI$MouseHandler outerClass javax/swing/plaf/basic/BasicTabbedPaneUI innerClassName MouseHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTabbedPaneUI$TabSelectionHandler outerClass javax/swing/plaf/basic/BasicTabbedPaneUI innerClassName TabSelectionHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTabbedPaneUI$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicTabbedPaneUI innerClassName PropertyChangeHandler flags 1 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/plaf/basic/BasicTableUI +header extends javax/swing/plaf/TableUI nestMembers javax/swing/plaf/basic/BasicTableUI$MouseInputHandler,javax/swing/plaf/basic/BasicTableUI$FocusHandler,javax/swing/plaf/basic/BasicTableUI$KeyHandler flags 21 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass javax/swing/JTable$PrintMode outerClass javax/swing/JTable innerClassName PrintMode flags 4019 +innerclass innerClass javax/swing/JTable$DropLocation outerClass javax/swing/JTable innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/plaf/basic/BasicTableUI$MouseInputHandler outerClass javax/swing/plaf/basic/BasicTableUI innerClassName MouseInputHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTableUI$FocusHandler outerClass javax/swing/plaf/basic/BasicTableUI innerClassName FocusHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTableUI$KeyHandler outerClass javax/swing/plaf/basic/BasicTableUI innerClassName KeyHandler flags 1 + +class name javax/swing/plaf/basic/BasicTextUI +header extends javax/swing/plaf/TextUI implements javax/swing/text/ViewFactory nestMembers javax/swing/plaf/basic/BasicTextUI$BasicHighlighter,javax/swing/plaf/basic/BasicTextUI$BasicCaret flags 421 +innerclass innerClass javax/swing/plaf/basic/BasicTextUI$BasicCaret outerClass javax/swing/plaf/basic/BasicTextUI innerClassName BasicCaret flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicTextUI$BasicHighlighter outerClass javax/swing/plaf/basic/BasicTextUI innerClassName BasicHighlighter flags 9 +innerclass innerClass javax/swing/text/JTextComponent$KeyBinding outerClass javax/swing/text/JTextComponent innerClassName KeyBinding flags 9 +innerclass innerClass javax/swing/text/DefaultEditorKit$InsertBreakAction outerClass javax/swing/text/DefaultEditorKit innerClassName InsertBreakAction flags 9 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/plaf/basic/BasicToolBarUI +header extends javax/swing/plaf/ToolBarUI implements javax/swing/SwingConstants nestMembers javax/swing/plaf/basic/BasicToolBarUI$DragWindow,javax/swing/plaf/basic/BasicToolBarUI$DockingListener,javax/swing/plaf/basic/BasicToolBarUI$PropertyListener,javax/swing/plaf/basic/BasicToolBarUI$ToolBarFocusListener,javax/swing/plaf/basic/BasicToolBarUI$ToolBarContListener,javax/swing/plaf/basic/BasicToolBarUI$FrameListener flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicToolBarUI$DragWindow outerClass javax/swing/plaf/basic/BasicToolBarUI innerClassName DragWindow flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName RolloverButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$ButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName ButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$RadioButtonBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName RadioButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicToolBarUI$FrameListener outerClass javax/swing/plaf/basic/BasicToolBarUI innerClassName FrameListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicToolBarUI$DockingListener outerClass javax/swing/plaf/basic/BasicToolBarUI innerClassName DockingListener flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicToolBarUI$PropertyListener outerClass javax/swing/plaf/basic/BasicToolBarUI innerClassName PropertyListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicToolBarUI$ToolBarFocusListener outerClass javax/swing/plaf/basic/BasicToolBarUI innerClassName ToolBarFocusListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicToolBarUI$ToolBarContListener outerClass javax/swing/plaf/basic/BasicToolBarUI innerClassName ToolBarContListener flags 4 + +class name javax/swing/plaf/basic/BasicTreeUI +header extends javax/swing/plaf/TreeUI nestMembers javax/swing/plaf/basic/BasicTreeUI$MouseInputHandler,javax/swing/plaf/basic/BasicTreeUI$TreeCancelEditingAction,javax/swing/plaf/basic/BasicTreeUI$TreeToggleAction,javax/swing/plaf/basic/BasicTreeUI$TreeHomeAction,javax/swing/plaf/basic/BasicTreeUI$TreeIncrementAction,javax/swing/plaf/basic/BasicTreeUI$TreePageAction,javax/swing/plaf/basic/BasicTreeUI$TreeTraverseAction,javax/swing/plaf/basic/BasicTreeUI$SelectionModelPropertyChangeHandler,javax/swing/plaf/basic/BasicTreeUI$PropertyChangeHandler,javax/swing/plaf/basic/BasicTreeUI$MouseHandler,javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler,javax/swing/plaf/basic/BasicTreeUI$FocusHandler,javax/swing/plaf/basic/BasicTreeUI$KeyHandler,javax/swing/plaf/basic/BasicTreeUI$CellEditorHandler,javax/swing/plaf/basic/BasicTreeUI$TreeSelectionHandler,javax/swing/plaf/basic/BasicTreeUI$TreeModelHandler,javax/swing/plaf/basic/BasicTreeUI$ComponentHandler,javax/swing/plaf/basic/BasicTreeUI$TreeExpansionHandler flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName NodeDimensionsHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$ComponentHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName ComponentHandler flags 1 +innerclass innerClass java/awt/Component$BaselineResizeBehavior outerClass java/awt/Component innerClassName BaselineResizeBehavior flags 4019 +innerclass innerClass javax/swing/JTree$DropLocation outerClass javax/swing/JTree innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/tree/AbstractLayoutCache$NodeDimensions outerClass javax/swing/tree/AbstractLayoutCache innerClassName NodeDimensions flags 409 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$MouseInputHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName MouseInputHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreeCancelEditingAction outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreeCancelEditingAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreeToggleAction outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreeToggleAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreeHomeAction outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreeHomeAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreeIncrementAction outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreeIncrementAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreePageAction outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreePageAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreeTraverseAction outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreeTraverseAction flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$SelectionModelPropertyChangeHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName SelectionModelPropertyChangeHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$PropertyChangeHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName PropertyChangeHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$MouseHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName MouseHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$FocusHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName FocusHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$KeyHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName KeyHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$CellEditorHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName CellEditorHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreeSelectionHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreeSelectionHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreeModelHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreeModelHandler flags 1 +innerclass innerClass javax/swing/plaf/basic/BasicTreeUI$TreeExpansionHandler outerClass javax/swing/plaf/basic/BasicTreeUI innerClassName TreeExpansionHandler flags 1 + +class name javax/swing/plaf/metal/MetalBorders +header extends java/lang/Object nestMembers javax/swing/plaf/metal/MetalBorders$TableHeaderBorder,javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder,javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder,javax/swing/plaf/metal/MetalBorders$TextFieldBorder,javax/swing/plaf/metal/MetalBorders$ToolBarBorder,javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder,javax/swing/plaf/metal/MetalBorders$PopupMenuBorder,javax/swing/plaf/metal/MetalBorders$MenuItemBorder,javax/swing/plaf/metal/MetalBorders$MenuBarBorder,javax/swing/plaf/metal/MetalBorders$OptionDialogBorder,javax/swing/plaf/metal/MetalBorders$PaletteBorder,javax/swing/plaf/metal/MetalBorders$InternalFrameBorder,javax/swing/plaf/metal/MetalBorders$ButtonBorder,javax/swing/plaf/metal/MetalBorders$Flush3DBorder flags 21 +innerclass innerClass javax/swing/plaf/BorderUIResource$CompoundBorderUIResource outerClass javax/swing/plaf/BorderUIResource innerClassName CompoundBorderUIResource flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$ButtonBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName ButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/basic/BasicBorders$MarginBorder outerClass javax/swing/plaf/basic/BasicBorders innerClassName MarginBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$Flush3DBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName Flush3DBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$TextFieldBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName TextFieldBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName ToggleButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName RolloverButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$TableHeaderBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName TableHeaderBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName ScrollPaneBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$ToolBarBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName ToolBarBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$PopupMenuBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName PopupMenuBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$MenuItemBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName MenuItemBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$MenuBarBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName MenuBarBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$OptionDialogBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName OptionDialogBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$PaletteBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName PaletteBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$InternalFrameBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName InternalFrameBorder flags 9 + +class name javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder +header extends javax/swing/plaf/metal/MetalBorders$ButtonBorder nestHost javax/swing/plaf/metal/MetalBorders flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$ButtonBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName ButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName RolloverButtonBorder flags 9 + +class name javax/swing/plaf/metal/MetalBorders$TextFieldBorder +header extends javax/swing/plaf/metal/MetalBorders$Flush3DBorder nestHost javax/swing/plaf/metal/MetalBorders flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$Flush3DBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName Flush3DBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$TextFieldBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName TextFieldBorder flags 9 + +class name javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder +header extends javax/swing/plaf/metal/MetalBorders$ButtonBorder nestHost javax/swing/plaf/metal/MetalBorders flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$ButtonBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName ButtonBorder flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder outerClass javax/swing/plaf/metal/MetalBorders innerClassName ToggleButtonBorder flags 9 + +class name javax/swing/plaf/metal/MetalComboBoxUI +header extends javax/swing/plaf/basic/BasicComboBoxUI nestMembers javax/swing/plaf/metal/MetalComboBoxUI$MetalComboPopup,javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager,javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalComboBoxEditor$UIResource outerClass javax/swing/plaf/metal/MetalComboBoxEditor innerClassName UIResource flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener outerClass javax/swing/plaf/metal/MetalComboBoxUI innerClassName MetalPropertyChangeListener flags 1 +innerclass innerClass javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager outerClass javax/swing/plaf/metal/MetalComboBoxUI innerClassName MetalComboBoxLayoutManager flags 1 +innerclass innerClass javax/swing/plaf/metal/MetalComboBoxUI$MetalComboPopup outerClass javax/swing/plaf/metal/MetalComboBoxUI innerClassName MetalComboPopup flags 1 + +class name javax/swing/plaf/metal/MetalFileChooserUI +header extends javax/swing/plaf/basic/BasicFileChooserUI nestMembers javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxAction,javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxModel,javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxRenderer,javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxModel,javax/swing/plaf/metal/MetalFileChooserUI$FileRenderer,javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxAction outerClass javax/swing/plaf/metal/MetalFileChooserUI innerClassName DirectoryComboBoxAction flags 4 +innerclass innerClass javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxModel outerClass javax/swing/plaf/metal/MetalFileChooserUI innerClassName DirectoryComboBoxModel flags 4 +innerclass innerClass javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxModel outerClass javax/swing/plaf/metal/MetalFileChooserUI innerClassName FilterComboBoxModel flags 4 +innerclass innerClass javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxRenderer outerClass javax/swing/plaf/metal/MetalFileChooserUI innerClassName FilterComboBoxRenderer flags 1 +innerclass innerClass javax/swing/plaf/metal/MetalFileChooserUI$FileRenderer outerClass javax/swing/plaf/metal/MetalFileChooserUI innerClassName FileRenderer flags 4 +innerclass innerClass javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener outerClass javax/swing/plaf/metal/MetalFileChooserUI innerClassName SingleClickListener flags 4 + +class name javax/swing/plaf/metal/MetalIconFactory +header extends java/lang/Object implements java/io/Serializable nestMembers javax/swing/plaf/metal/MetalIconFactory$TreeControlIcon,javax/swing/plaf/metal/MetalIconFactory$TreeLeafIcon,javax/swing/plaf/metal/MetalIconFactory$FileIcon16,javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon,javax/swing/plaf/metal/MetalIconFactory$FolderIcon16,javax/swing/plaf/metal/MetalIconFactory$PaletteCloseIcon flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName TreeFolderIcon flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$TreeLeafIcon outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName TreeLeafIcon flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$TreeControlIcon outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName TreeControlIcon flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$FileIcon16 outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName FileIcon16 flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName FolderIcon16 flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$PaletteCloseIcon outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName PaletteCloseIcon flags 9 + +class name javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon +header extends javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 nestHost javax/swing/plaf/metal/MetalIconFactory flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName FolderIcon16 flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName TreeFolderIcon flags 9 + +class name javax/swing/plaf/metal/MetalIconFactory$TreeLeafIcon +header extends javax/swing/plaf/metal/MetalIconFactory$FileIcon16 nestHost javax/swing/plaf/metal/MetalIconFactory flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$FileIcon16 outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName FileIcon16 flags 9 +innerclass innerClass javax/swing/plaf/metal/MetalIconFactory$TreeLeafIcon outerClass javax/swing/plaf/metal/MetalIconFactory innerClassName TreeLeafIcon flags 9 + +class name javax/swing/plaf/metal/MetalSliderUI +header extends javax/swing/plaf/basic/BasicSliderUI nestMembers javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener flags 21 +innerclass innerClass javax/swing/plaf/basic/BasicSliderUI$ScrollListener outerClass javax/swing/plaf/basic/BasicSliderUI innerClassName ScrollListener flags 1 +innerclass innerClass javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener outerClass javax/swing/plaf/metal/MetalSliderUI innerClassName MetalPropertyListener flags 4 + +class name javax/swing/plaf/metal/MetalToolBarUI +header extends javax/swing/plaf/basic/BasicToolBarUI nestMembers javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener,javax/swing/plaf/metal/MetalToolBarUI$MetalRolloverListener,javax/swing/plaf/metal/MetalToolBarUI$MetalContainerListener flags 21 +innerclass innerClass javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener outerClass javax/swing/plaf/metal/MetalToolBarUI innerClassName MetalDockingListener flags 4 +innerclass innerClass javax/swing/plaf/basic/BasicToolBarUI$DragWindow outerClass javax/swing/plaf/basic/BasicToolBarUI innerClassName DragWindow flags 4 +innerclass innerClass javax/swing/plaf/metal/MetalToolBarUI$MetalRolloverListener outerClass javax/swing/plaf/metal/MetalToolBarUI innerClassName MetalRolloverListener flags 4 +innerclass innerClass javax/swing/plaf/metal/MetalToolBarUI$MetalContainerListener outerClass javax/swing/plaf/metal/MetalToolBarUI innerClassName MetalContainerListener flags 4 + +class name javax/swing/table/DefaultTableCellRenderer +header extends javax/swing/JLabel implements javax/swing/table/TableCellRenderer,java/io/Serializable nestMembers javax/swing/table/DefaultTableCellRenderer$UIResource flags 21 +innerclass innerClass javax/swing/JTable$DropLocation outerClass javax/swing/JTable innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/table/DefaultTableCellRenderer$UIResource outerClass javax/swing/table/DefaultTableCellRenderer innerClassName UIResource flags 9 + +class name javax/swing/table/JTableHeader$AccessibleJTableHeader +header extends javax/swing/JComponent$AccessibleJComponent nestHost javax/swing/table/JTableHeader flags 21 +innerclass innerClass javax/swing/table/JTableHeader$AccessibleJTableHeader outerClass javax/swing/table/JTableHeader innerClassName AccessibleJTableHeader flags 4 +innerclass innerClass javax/swing/JComponent$AccessibleJComponent outerClass javax/swing/JComponent innerClassName AccessibleJComponent flags 401 +innerclass innerClass javax/swing/table/JTableHeader$AccessibleJTableHeader$AccessibleJTableHeaderEntry outerClass javax/swing/table/JTableHeader$AccessibleJTableHeader innerClassName AccessibleJTableHeaderEntry flags 4 + +class name javax/swing/text/AbstractDocument +header extends java/lang/Object implements javax/swing/text/Document,java/io/Serializable nestMembers javax/swing/text/AbstractDocument$ElementEdit,javax/swing/text/AbstractDocument$DefaultDocumentEvent,javax/swing/text/AbstractDocument$LeafElement,javax/swing/text/AbstractDocument$BranchElement,javax/swing/text/AbstractDocument$AbstractElement,javax/swing/text/AbstractDocument$AttributeContext,javax/swing/text/AbstractDocument$Content flags 421 +innerclass innerClass javax/swing/text/AbstractDocument$Content outerClass javax/swing/text/AbstractDocument innerClassName Content flags 609 +innerclass innerClass javax/swing/text/AbstractDocument$AttributeContext outerClass javax/swing/text/AbstractDocument innerClassName AttributeContext flags 609 +innerclass innerClass javax/swing/text/AbstractDocument$BranchElement outerClass javax/swing/text/AbstractDocument innerClassName BranchElement flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$DefaultDocumentEvent outerClass javax/swing/text/AbstractDocument innerClassName DefaultDocumentEvent flags 1 +innerclass innerClass javax/swing/event/DocumentEvent$EventType outerClass javax/swing/event/DocumentEvent innerClassName EventType flags 19 +innerclass innerClass javax/swing/text/DocumentFilter$FilterBypass outerClass javax/swing/text/DocumentFilter innerClassName FilterBypass flags 409 +innerclass innerClass javax/swing/text/AbstractDocument$ElementEdit outerClass javax/swing/text/AbstractDocument innerClassName ElementEdit flags 9 +innerclass innerClass javax/swing/text/AbstractDocument$AbstractElement outerClass javax/swing/text/AbstractDocument innerClassName AbstractElement flags 401 +innerclass innerClass javax/swing/text/AbstractDocument$LeafElement outerClass javax/swing/text/AbstractDocument innerClassName LeafElement flags 1 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/AbstractDocument$AbstractElement +header extends java/lang/Object implements javax/swing/text/Element,javax/swing/text/MutableAttributeSet,java/io/Serializable,javax/swing/tree/TreeNode nestHost javax/swing/text/AbstractDocument flags 421 +innerclass innerClass javax/swing/text/AbstractDocument$AbstractElement outerClass javax/swing/text/AbstractDocument innerClassName AbstractElement flags 401 +innerclass innerClass javax/swing/text/AbstractDocument$AttributeContext outerClass javax/swing/text/AbstractDocument innerClassName AttributeContext flags 609 +innerclass innerClass javax/swing/text/AbstractDocument$Content outerClass javax/swing/text/AbstractDocument innerClassName Content flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/AbstractDocument$BranchElement +header extends javax/swing/text/AbstractDocument$AbstractElement nestHost javax/swing/text/AbstractDocument flags 21 +innerclass innerClass javax/swing/text/AbstractDocument$BranchElement outerClass javax/swing/text/AbstractDocument innerClassName BranchElement flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$AbstractElement outerClass javax/swing/text/AbstractDocument innerClassName AbstractElement flags 401 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/AbstractDocument$DefaultDocumentEvent +header extends javax/swing/undo/CompoundEdit implements javax/swing/event/DocumentEvent nestHost javax/swing/text/AbstractDocument flags 21 +innerclass innerClass javax/swing/text/AbstractDocument$DefaultDocumentEvent outerClass javax/swing/text/AbstractDocument innerClassName DefaultDocumentEvent flags 1 +innerclass innerClass javax/swing/event/DocumentEvent$EventType outerClass javax/swing/event/DocumentEvent innerClassName EventType flags 19 +innerclass innerClass javax/swing/event/DocumentEvent$ElementChange outerClass javax/swing/event/DocumentEvent innerClassName ElementChange flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/AsyncBoxView +header extends javax/swing/text/View nestMembers javax/swing/text/AsyncBoxView$ChildState,javax/swing/text/AsyncBoxView$ChildLocator flags 21 +innerclass innerClass javax/swing/text/AsyncBoxView$ChildLocator outerClass javax/swing/text/AsyncBoxView innerClassName ChildLocator flags 1 +innerclass innerClass javax/swing/text/AsyncBoxView$ChildState outerClass javax/swing/text/AsyncBoxView innerClassName ChildState flags 1 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass javax/swing/event/DocumentEvent$ElementChange outerClass javax/swing/event/DocumentEvent innerClassName ElementChange flags 609 + +class name javax/swing/text/AsyncBoxView$ChildLocator +header extends java/lang/Object nestHost javax/swing/text/AsyncBoxView flags 21 +innerclass innerClass javax/swing/text/AsyncBoxView$ChildLocator outerClass javax/swing/text/AsyncBoxView innerClassName ChildLocator flags 1 +innerclass innerClass javax/swing/text/AsyncBoxView$ChildState outerClass javax/swing/text/AsyncBoxView innerClassName ChildState flags 1 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 + +class name javax/swing/text/DefaultCaret +header extends java/awt/Rectangle implements javax/swing/text/Caret,java/awt/event/FocusListener,java/awt/event/MouseListener,java/awt/event/MouseMotionListener flags 21 +innerclass innerClass javax/swing/text/LayeredHighlighter$LayerPainter outerClass javax/swing/text/LayeredHighlighter innerClassName LayerPainter flags 409 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass java/awt/event/FocusEvent$Cause outerClass java/awt/event/FocusEvent innerClassName Cause flags 4019 +innerclass innerClass javax/swing/text/Highlighter$HighlightPainter outerClass javax/swing/text/Highlighter innerClassName HighlightPainter flags 609 +innerclass innerClass javax/swing/text/NavigationFilter$FilterBypass outerClass javax/swing/text/NavigationFilter innerClassName FilterBypass flags 409 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/DefaultEditorKit +header extends javax/swing/text/EditorKit nestMembers javax/swing/text/DefaultEditorKit$BeepAction,javax/swing/text/DefaultEditorKit$PasteAction,javax/swing/text/DefaultEditorKit$CopyAction,javax/swing/text/DefaultEditorKit$CutAction,javax/swing/text/DefaultEditorKit$InsertTabAction,javax/swing/text/DefaultEditorKit$InsertBreakAction,javax/swing/text/DefaultEditorKit$InsertContentAction,javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction flags 21 +innerclass innerClass javax/swing/text/DefaultEditorKit$InsertContentAction outerClass javax/swing/text/DefaultEditorKit innerClassName InsertContentAction flags 9 +innerclass innerClass javax/swing/text/DefaultEditorKit$CutAction outerClass javax/swing/text/DefaultEditorKit innerClassName CutAction flags 9 +innerclass innerClass javax/swing/text/DefaultEditorKit$CopyAction outerClass javax/swing/text/DefaultEditorKit innerClassName CopyAction flags 9 +innerclass innerClass javax/swing/text/DefaultEditorKit$PasteAction outerClass javax/swing/text/DefaultEditorKit innerClassName PasteAction flags 9 +innerclass innerClass javax/swing/text/DefaultEditorKit$InsertBreakAction outerClass javax/swing/text/DefaultEditorKit innerClassName InsertBreakAction flags 9 +innerclass innerClass javax/swing/text/DefaultEditorKit$BeepAction outerClass javax/swing/text/DefaultEditorKit innerClassName BeepAction flags 9 +innerclass innerClass javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction outerClass javax/swing/text/DefaultEditorKit innerClassName DefaultKeyTypedAction flags 9 +innerclass innerClass javax/swing/text/DefaultEditorKit$InsertTabAction outerClass javax/swing/text/DefaultEditorKit innerClassName InsertTabAction flags 9 + +class name javax/swing/text/DefaultFormatter +header extends javax/swing/JFormattedTextField$AbstractFormatter implements java/lang/Cloneable,java/io/Serializable flags 21 +innerclass innerClass javax/swing/JFormattedTextField$AbstractFormatter outerClass javax/swing/JFormattedTextField innerClassName AbstractFormatter flags 409 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass javax/swing/text/DocumentFilter$FilterBypass outerClass javax/swing/text/DocumentFilter innerClassName FilterBypass flags 409 +innerclass innerClass javax/swing/text/NavigationFilter$FilterBypass outerClass javax/swing/text/NavigationFilter innerClassName FilterBypass flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/DefaultFormatterFactory +header extends javax/swing/JFormattedTextField$AbstractFormatterFactory implements java/io/Serializable flags 21 +innerclass innerClass javax/swing/JFormattedTextField$AbstractFormatterFactory outerClass javax/swing/JFormattedTextField innerClassName AbstractFormatterFactory flags 409 +innerclass innerClass javax/swing/JFormattedTextField$AbstractFormatter outerClass javax/swing/JFormattedTextField innerClassName AbstractFormatter flags 409 + +class name javax/swing/text/DefaultHighlighter +header extends javax/swing/text/LayeredHighlighter nestMembers javax/swing/text/DefaultHighlighter$DefaultHighlightPainter flags 21 +innerclass innerClass javax/swing/text/Highlighter$HighlightPainter outerClass javax/swing/text/Highlighter innerClassName HighlightPainter flags 609 +innerclass innerClass javax/swing/text/LayeredHighlighter$LayerPainter outerClass javax/swing/text/LayeredHighlighter innerClassName LayerPainter flags 409 +innerclass innerClass javax/swing/text/Highlighter$Highlight outerClass javax/swing/text/Highlighter innerClassName Highlight flags 609 +innerclass innerClass javax/swing/text/DefaultHighlighter$DefaultHighlightPainter outerClass javax/swing/text/DefaultHighlighter innerClassName DefaultHighlightPainter flags 9 + +class name javax/swing/text/DefaultHighlighter$DefaultHighlightPainter +header extends javax/swing/text/LayeredHighlighter$LayerPainter nestHost javax/swing/text/DefaultHighlighter flags 21 +innerclass innerClass javax/swing/text/LayeredHighlighter$LayerPainter outerClass javax/swing/text/LayeredHighlighter innerClassName LayerPainter flags 409 +innerclass innerClass javax/swing/text/DefaultHighlighter$DefaultHighlightPainter outerClass javax/swing/text/DefaultHighlighter innerClassName DefaultHighlightPainter flags 9 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 + +class name javax/swing/text/DefaultStyledDocument +header extends javax/swing/text/AbstractDocument implements javax/swing/text/StyledDocument nestMembers javax/swing/text/DefaultStyledDocument$AttributeUndoableEdit,javax/swing/text/DefaultStyledDocument$ElementBuffer,javax/swing/text/DefaultStyledDocument$ElementSpec,javax/swing/text/DefaultStyledDocument$SectionElement flags 21 +innerclass innerClass javax/swing/text/AbstractDocument$Content outerClass javax/swing/text/AbstractDocument innerClassName Content flags 609 +innerclass innerClass javax/swing/text/AbstractDocument$AttributeContext outerClass javax/swing/text/AbstractDocument innerClassName AttributeContext flags 609 +innerclass innerClass javax/swing/text/DefaultStyledDocument$ElementBuffer outerClass javax/swing/text/DefaultStyledDocument innerClassName ElementBuffer flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$AbstractElement outerClass javax/swing/text/AbstractDocument innerClassName AbstractElement flags 401 +innerclass innerClass javax/swing/text/DefaultStyledDocument$ElementSpec outerClass javax/swing/text/DefaultStyledDocument innerClassName ElementSpec flags 9 +innerclass innerClass javax/swing/text/AbstractDocument$DefaultDocumentEvent outerClass javax/swing/text/AbstractDocument innerClassName DefaultDocumentEvent flags 1 +innerclass innerClass javax/swing/event/DocumentEvent$EventType outerClass javax/swing/event/DocumentEvent innerClassName EventType flags 19 +innerclass innerClass javax/swing/text/AbstractDocument$BranchElement outerClass javax/swing/text/AbstractDocument innerClassName BranchElement flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$ElementEdit outerClass javax/swing/text/AbstractDocument innerClassName ElementEdit flags 9 +innerclass innerClass javax/swing/text/DefaultStyledDocument$AttributeUndoableEdit outerClass javax/swing/text/DefaultStyledDocument innerClassName AttributeUndoableEdit flags 9 +innerclass innerClass javax/swing/text/DefaultStyledDocument$SectionElement outerClass javax/swing/text/DefaultStyledDocument innerClassName SectionElement flags 4 +innerclass innerClass javax/swing/text/AbstractDocument$LeafElement outerClass javax/swing/text/AbstractDocument innerClassName LeafElement flags 1 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 + +class name javax/swing/text/DefaultStyledDocument$ElementBuffer +header extends java/lang/Object implements java/io/Serializable nestHost javax/swing/text/DefaultStyledDocument flags 21 +innerclass innerClass javax/swing/text/DefaultStyledDocument$ElementBuffer outerClass javax/swing/text/DefaultStyledDocument innerClassName ElementBuffer flags 1 +innerclass innerClass javax/swing/text/DefaultStyledDocument$ElementSpec outerClass javax/swing/text/DefaultStyledDocument innerClassName ElementSpec flags 9 +innerclass innerClass javax/swing/text/AbstractDocument$DefaultDocumentEvent outerClass javax/swing/text/AbstractDocument innerClassName DefaultDocumentEvent flags 1 +innerclass innerClass javax/swing/text/DefaultStyledDocument$AttributeUndoableEdit outerClass javax/swing/text/DefaultStyledDocument innerClassName AttributeUndoableEdit flags 9 +innerclass innerClass javax/swing/text/AbstractDocument$BranchElement outerClass javax/swing/text/AbstractDocument innerClassName BranchElement flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$ElementEdit outerClass javax/swing/text/AbstractDocument innerClassName ElementEdit flags 9 + +class name javax/swing/text/GlyphView$GlyphPainter +header extends java/lang/Object nestHost javax/swing/text/GlyphView flags 421 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass javax/swing/text/GlyphView$GlyphPainter outerClass javax/swing/text/GlyphView innerClassName GlyphPainter flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/Highlighter$Highlight +header extends java/lang/Object nestHost javax/swing/text/Highlighter flags 601 +innerclass innerClass javax/swing/text/Highlighter$Highlight outerClass javax/swing/text/Highlighter innerClassName Highlight flags 609 +innerclass innerClass javax/swing/text/Highlighter$HighlightPainter outerClass javax/swing/text/Highlighter innerClassName HighlightPainter flags 609 + +class name javax/swing/text/JTextComponent +header extends javax/swing/JComponent implements javax/swing/Scrollable,javax/accessibility/Accessible nestMembers javax/swing/text/JTextComponent$DropLocation,javax/swing/text/JTextComponent$AccessibleJTextComponent,javax/swing/text/JTextComponent$KeyBinding flags 421 runtimeAnnotations @Ljava/beans/JavaBean;(defaultProperty="UI")@Ljavax/swing/SwingContainer;(value=Zfalse) +innerclass innerClass javax/swing/text/JTextComponent$AccessibleJTextComponent outerClass javax/swing/text/JTextComponent innerClassName AccessibleJTextComponent flags 1 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass javax/swing/text/JTextComponent$DropLocation outerClass javax/swing/text/JTextComponent innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction outerClass javax/swing/text/DefaultEditorKit innerClassName DefaultKeyTypedAction flags 9 +innerclass innerClass javax/swing/text/JTextComponent$KeyBinding outerClass javax/swing/text/JTextComponent innerClassName KeyBinding flags 9 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/JTextComponent$DropLocation +header extends javax/swing/TransferHandler$DropLocation nestHost javax/swing/text/JTextComponent flags 31 +innerclass innerClass javax/swing/TransferHandler$DropLocation outerClass javax/swing/TransferHandler innerClassName DropLocation flags 9 +innerclass innerClass javax/swing/text/JTextComponent$DropLocation outerClass javax/swing/text/JTextComponent innerClassName DropLocation flags 19 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/ParagraphView +header extends javax/swing/text/FlowView implements javax/swing/text/TabExpander flags 21 +innerclass innerClass javax/swing/text/FlowView$FlowStrategy outerClass javax/swing/text/FlowView innerClassName FlowStrategy flags 9 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/PlainDocument +header extends javax/swing/text/AbstractDocument flags 21 +innerclass innerClass javax/swing/text/AbstractDocument$Content outerClass javax/swing/text/AbstractDocument innerClassName Content flags 609 +innerclass innerClass javax/swing/text/AbstractDocument$AbstractElement outerClass javax/swing/text/AbstractDocument innerClassName AbstractElement flags 401 +innerclass innerClass javax/swing/text/AbstractDocument$BranchElement outerClass javax/swing/text/AbstractDocument innerClassName BranchElement flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$DefaultDocumentEvent outerClass javax/swing/text/AbstractDocument innerClassName DefaultDocumentEvent flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$ElementEdit outerClass javax/swing/text/AbstractDocument innerClassName ElementEdit flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/PlainView +header extends javax/swing/text/View implements javax/swing/text/TabExpander flags 21 +innerclass innerClass java/awt/geom/Rectangle2D$Float outerClass java/awt/geom/Rectangle2D innerClassName Float flags 9 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass javax/swing/event/DocumentEvent$ElementChange outerClass javax/swing/event/DocumentEvent innerClassName ElementChange flags 609 +innerclass innerClass javax/swing/event/DocumentEvent$EventType outerClass javax/swing/event/DocumentEvent innerClassName EventType flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/StyleConstants +header extends java/lang/Object nestMembers javax/swing/text/StyleConstants$FontConstants,javax/swing/text/StyleConstants$ColorConstants,javax/swing/text/StyleConstants$CharacterConstants,javax/swing/text/StyleConstants$ParagraphConstants flags 21 +innerclass innerClass javax/swing/text/StyleConstants$CharacterConstants outerClass javax/swing/text/StyleConstants innerClassName CharacterConstants flags 9 +innerclass innerClass javax/swing/text/StyleConstants$FontConstants outerClass javax/swing/text/StyleConstants innerClassName FontConstants flags 9 +innerclass innerClass javax/swing/text/StyleConstants$ColorConstants outerClass javax/swing/text/StyleConstants innerClassName ColorConstants flags 9 +innerclass innerClass javax/swing/text/StyleConstants$ParagraphConstants outerClass javax/swing/text/StyleConstants innerClassName ParagraphConstants flags 9 + +class name javax/swing/text/StyledEditorKit +header extends javax/swing/text/DefaultEditorKit nestMembers javax/swing/text/StyledEditorKit$UnderlineAction,javax/swing/text/StyledEditorKit$ItalicAction,javax/swing/text/StyledEditorKit$BoldAction,javax/swing/text/StyledEditorKit$AlignmentAction,javax/swing/text/StyledEditorKit$ForegroundAction,javax/swing/text/StyledEditorKit$FontSizeAction,javax/swing/text/StyledEditorKit$FontFamilyAction,javax/swing/text/StyledEditorKit$StyledTextAction flags 21 +innerclass innerClass javax/swing/text/StyledEditorKit$FontFamilyAction outerClass javax/swing/text/StyledEditorKit innerClassName FontFamilyAction flags 9 +innerclass innerClass javax/swing/text/StyledEditorKit$FontSizeAction outerClass javax/swing/text/StyledEditorKit innerClassName FontSizeAction flags 9 +innerclass innerClass javax/swing/text/StyledEditorKit$AlignmentAction outerClass javax/swing/text/StyledEditorKit innerClassName AlignmentAction flags 9 +innerclass innerClass javax/swing/text/StyledEditorKit$BoldAction outerClass javax/swing/text/StyledEditorKit innerClassName BoldAction flags 9 +innerclass innerClass javax/swing/text/StyledEditorKit$ItalicAction outerClass javax/swing/text/StyledEditorKit innerClassName ItalicAction flags 9 +innerclass innerClass javax/swing/text/StyledEditorKit$UnderlineAction outerClass javax/swing/text/StyledEditorKit innerClassName UnderlineAction flags 9 +innerclass innerClass javax/swing/text/StyledEditorKit$ForegroundAction outerClass javax/swing/text/StyledEditorKit innerClassName ForegroundAction flags 9 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 + +class name javax/swing/text/StyledEditorKit$AlignmentAction +header extends javax/swing/text/StyledEditorKit$StyledTextAction nestHost javax/swing/text/StyledEditorKit flags 21 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 +innerclass innerClass javax/swing/text/StyledEditorKit$AlignmentAction outerClass javax/swing/text/StyledEditorKit innerClassName AlignmentAction flags 9 + +class name javax/swing/text/StyledEditorKit$BoldAction +header extends javax/swing/text/StyledEditorKit$StyledTextAction nestHost javax/swing/text/StyledEditorKit flags 21 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 +innerclass innerClass javax/swing/text/StyledEditorKit$BoldAction outerClass javax/swing/text/StyledEditorKit innerClassName BoldAction flags 9 + +class name javax/swing/text/StyledEditorKit$FontFamilyAction +header extends javax/swing/text/StyledEditorKit$StyledTextAction nestHost javax/swing/text/StyledEditorKit flags 21 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 +innerclass innerClass javax/swing/text/StyledEditorKit$FontFamilyAction outerClass javax/swing/text/StyledEditorKit innerClassName FontFamilyAction flags 9 + +class name javax/swing/text/StyledEditorKit$FontSizeAction +header extends javax/swing/text/StyledEditorKit$StyledTextAction nestHost javax/swing/text/StyledEditorKit flags 21 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 +innerclass innerClass javax/swing/text/StyledEditorKit$FontSizeAction outerClass javax/swing/text/StyledEditorKit innerClassName FontSizeAction flags 9 + +class name javax/swing/text/StyledEditorKit$ForegroundAction +header extends javax/swing/text/StyledEditorKit$StyledTextAction nestHost javax/swing/text/StyledEditorKit flags 21 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 +innerclass innerClass javax/swing/text/StyledEditorKit$ForegroundAction outerClass javax/swing/text/StyledEditorKit innerClassName ForegroundAction flags 9 + +class name javax/swing/text/StyledEditorKit$ItalicAction +header extends javax/swing/text/StyledEditorKit$StyledTextAction nestHost javax/swing/text/StyledEditorKit flags 21 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 +innerclass innerClass javax/swing/text/StyledEditorKit$ItalicAction outerClass javax/swing/text/StyledEditorKit innerClassName ItalicAction flags 9 + +class name javax/swing/text/StyledEditorKit$UnderlineAction +header extends javax/swing/text/StyledEditorKit$StyledTextAction nestHost javax/swing/text/StyledEditorKit flags 21 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 +innerclass innerClass javax/swing/text/StyledEditorKit$UnderlineAction outerClass javax/swing/text/StyledEditorKit innerClassName UnderlineAction flags 9 + +class name javax/swing/text/TableView +header extends javax/swing/text/BoxView nestMembers javax/swing/text/TableView$GridCell,javax/swing/text/TableView$TableCell,javax/swing/text/TableView$TableRow flags 421 +innerclass innerClass javax/swing/text/TableView$TableRow outerClass javax/swing/text/TableView innerClassName TableRow flags 1 +innerclass innerClass javax/swing/text/TableView$TableCell outerClass javax/swing/text/TableView innerClassName TableCell flags 1 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/event/DocumentEvent$ElementChange outerClass javax/swing/event/DocumentEvent innerClassName ElementChange flags 609 +innerclass innerClass javax/swing/text/TableView$GridCell outerClass javax/swing/text/TableView innerClassName GridCell flags 608 + +class name javax/swing/text/Utilities +header extends java/lang/Object flags 21 +innerclass innerClass java/text/AttributedCharacterIterator$Attribute outerClass java/text/AttributedCharacterIterator innerClassName Attribute flags 9 +innerclass innerClass javax/swing/text/GlyphView$GlyphPainter outerClass javax/swing/text/GlyphView innerClassName GlyphPainter flags 409 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/ZoneView +header extends javax/swing/text/BoxView flags 21 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass javax/swing/event/DocumentEvent$ElementChange outerClass javax/swing/event/DocumentEvent innerClassName ElementChange flags 609 + +class name javax/swing/text/html/BlockView +header extends javax/swing/text/BoxView flags 21 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/StyleSheet$BoxPainter outerClass javax/swing/text/html/StyleSheet innerClassName BoxPainter flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/CSS +header extends java/lang/Object implements java/io/Serializable nestMembers javax/swing/text/html/CSS$Attribute flags 21 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/FormSubmitEvent +header extends javax/swing/text/html/HTMLFrameHyperlinkEvent nestMembers javax/swing/text/html/FormSubmitEvent$MethodType flags 21 +innerclass innerClass javax/swing/event/HyperlinkEvent$EventType outerClass javax/swing/event/HyperlinkEvent innerClassName EventType flags 19 +innerclass innerClass javax/swing/text/html/FormSubmitEvent$MethodType outerClass javax/swing/text/html/FormSubmitEvent innerClassName MethodType flags 4019 + +class name javax/swing/text/html/FormView +header extends javax/swing/text/ComponentView implements java/awt/event/ActionListener nestMembers javax/swing/text/html/FormView$MouseEventListener flags 21 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/FormView$MouseEventListener outerClass javax/swing/text/html/FormView innerClassName MouseEventListener flags 4 +innerclass innerClass javax/swing/JToggleButton$ToggleButtonModel outerClass javax/swing/JToggleButton innerClassName ToggleButtonModel flags 9 +innerclass innerClass javax/swing/text/html/FormSubmitEvent$MethodType outerClass javax/swing/text/html/FormSubmitEvent innerClassName MethodType flags 4019 +innerclass innerClass javax/swing/event/HyperlinkEvent$EventType outerClass javax/swing/event/HyperlinkEvent innerClassName EventType flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/HTML +header extends java/lang/Object nestMembers javax/swing/text/html/HTML$Attribute,javax/swing/text/html/HTML$UnknownTag,javax/swing/text/html/HTML$Tag flags 21 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$UnknownTag outerClass javax/swing/text/html/HTML innerClassName UnknownTag flags 9 + +class name javax/swing/text/html/HTML$UnknownTag +header extends javax/swing/text/html/HTML$Tag implements java/io/Serializable nestHost javax/swing/text/html/HTML flags 21 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$UnknownTag outerClass javax/swing/text/html/HTML innerClassName UnknownTag flags 9 + +class name javax/swing/text/html/HTMLDocument +header extends javax/swing/text/DefaultStyledDocument nestMembers javax/swing/text/html/HTMLDocument$BlockElement,javax/swing/text/html/HTMLDocument$RunElement,javax/swing/text/html/HTMLDocument$HTMLReader,javax/swing/text/html/HTMLDocument$HTMLReader$FormAction,javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction,javax/swing/text/html/HTMLDocument$HTMLReader$PreAction,javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction,javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction,javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction,javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction,javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction,javax/swing/text/html/HTMLDocument$HTMLReader$TagAction,javax/swing/text/html/HTMLDocument$Iterator flags 21 +innerclass innerClass javax/swing/text/AbstractDocument$DefaultDocumentEvent outerClass javax/swing/text/AbstractDocument innerClassName DefaultDocumentEvent flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$Content outerClass javax/swing/text/AbstractDocument innerClassName Content flags 609 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$ParserCallback outerClass javax/swing/text/html/HTMLEditorKit innerClassName ParserCallback flags 9 +innerclass innerClass javax/swing/text/DefaultStyledDocument$ElementSpec outerClass javax/swing/text/DefaultStyledDocument innerClassName ElementSpec flags 9 +innerclass innerClass javax/swing/event/DocumentEvent$EventType outerClass javax/swing/event/DocumentEvent innerClassName EventType flags 19 +innerclass innerClass javax/swing/text/DefaultStyledDocument$AttributeUndoableEdit outerClass javax/swing/text/DefaultStyledDocument innerClassName AttributeUndoableEdit flags 9 +innerclass innerClass javax/swing/text/AbstractDocument$AttributeContext outerClass javax/swing/text/AbstractDocument innerClassName AttributeContext flags 609 +innerclass innerClass javax/swing/text/html/HTMLDocument$RunElement outerClass javax/swing/text/html/HTMLDocument innerClassName RunElement flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$BlockElement outerClass javax/swing/text/html/HTMLDocument innerClassName BlockElement flags 1 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$Parser outerClass javax/swing/text/html/HTMLEditorKit innerClassName Parser flags 409 +innerclass innerClass javax/swing/text/AbstractDocument$ElementEdit outerClass javax/swing/text/AbstractDocument innerClassName ElementEdit flags 9 +innerclass innerClass javax/swing/text/AbstractDocument$BranchElement outerClass javax/swing/text/AbstractDocument innerClassName BranchElement flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$Iterator outerClass javax/swing/text/html/HTMLDocument innerClassName Iterator flags 409 +innerclass innerClass javax/swing/text/AbstractDocument$AbstractElement outerClass javax/swing/text/AbstractDocument innerClassName AbstractElement flags 401 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$FormAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName FormAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName CharacterAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$PreAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName PreAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName HiddenAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName IsindexAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName SpecialAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName ParagraphAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName BlockAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$TagAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName TagAction flags 1 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/HTMLDocument$HTMLReader +header extends javax/swing/text/html/HTMLEditorKit$ParserCallback nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$ParserCallback outerClass javax/swing/text/html/HTMLEditorKit innerClassName ParserCallback flags 9 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$TagAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName TagAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName BlockAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName ParagraphAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName CharacterAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName SpecialAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$FormAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName FormAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName HiddenAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName IsindexAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$PreAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName PreAction flags 1 +innerclass innerClass javax/swing/text/DefaultStyledDocument$ElementSpec outerClass javax/swing/text/DefaultStyledDocument innerClassName ElementSpec flags 9 +innerclass innerClass javax/swing/text/AbstractDocument$BranchElement outerClass javax/swing/text/AbstractDocument innerClassName BranchElement flags 1 +innerclass innerClass javax/swing/text/AbstractDocument$ElementEdit outerClass javax/swing/text/AbstractDocument innerClassName ElementEdit flags 9 +innerclass innerClass javax/swing/text/AbstractDocument$DefaultDocumentEvent outerClass javax/swing/text/AbstractDocument innerClassName DefaultDocumentEvent flags 1 +innerclass innerClass javax/swing/event/DocumentEvent$EventType outerClass javax/swing/event/DocumentEvent innerClassName EventType flags 19 +innerclass innerClass javax/swing/text/AbstractDocument$Content outerClass javax/swing/text/AbstractDocument innerClassName Content flags 609 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$UnknownTag outerClass javax/swing/text/html/HTML innerClassName UnknownTag flags 9 + +class name javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction +header extends javax/swing/text/html/HTMLDocument$HTMLReader$TagAction nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName BlockAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$TagAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName TagAction flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 + +class name javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction +header extends javax/swing/text/html/HTMLDocument$HTMLReader$TagAction nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName CharacterAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$TagAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName TagAction flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$ParserCallback outerClass javax/swing/text/html/HTMLEditorKit innerClassName ParserCallback flags 9 + +class name javax/swing/text/html/HTMLDocument$HTMLReader$FormAction +header extends javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$FormAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName FormAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName SpecialAction flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/JToggleButton$ToggleButtonModel outerClass javax/swing/JToggleButton innerClassName ToggleButtonModel flags 9 + +class name javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction +header extends javax/swing/text/html/HTMLDocument$HTMLReader$TagAction nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName HiddenAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$TagAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName TagAction flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 + +class name javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction +header extends javax/swing/text/html/HTMLDocument$HTMLReader$TagAction nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName IsindexAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$TagAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName TagAction flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 + +class name javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction +header extends javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName ParagraphAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName BlockAction flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 + +class name javax/swing/text/html/HTMLDocument$HTMLReader$PreAction +header extends javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$PreAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName PreAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName BlockAction flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 + +class name javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction +header extends javax/swing/text/html/HTMLDocument$HTMLReader$TagAction nestHost javax/swing/text/html/HTMLDocument flags 21 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader outerClass javax/swing/text/html/HTMLDocument innerClassName HTMLReader flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName SpecialAction flags 1 +innerclass innerClass javax/swing/text/html/HTMLDocument$HTMLReader$TagAction outerClass javax/swing/text/html/HTMLDocument$HTMLReader innerClassName TagAction flags 1 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 + +class name javax/swing/text/html/HTMLEditorKit +header extends javax/swing/text/StyledEditorKit implements javax/accessibility/Accessible nestMembers javax/swing/text/html/HTMLEditorKit$InsertHTMLTextAction,javax/swing/text/html/HTMLEditorKit$HTMLTextAction,javax/swing/text/html/HTMLEditorKit$HTMLFactory,javax/swing/text/html/HTMLEditorKit$ParserCallback,javax/swing/text/html/HTMLEditorKit$Parser,javax/swing/text/html/HTMLEditorKit$LinkController flags 21 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$LinkController outerClass javax/swing/text/html/HTMLEditorKit innerClassName LinkController flags 9 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$Parser outerClass javax/swing/text/html/HTMLEditorKit innerClassName Parser flags 409 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$ParserCallback outerClass javax/swing/text/html/HTMLEditorKit innerClassName ParserCallback flags 9 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$UnknownTag outerClass javax/swing/text/html/HTML innerClassName UnknownTag flags 9 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$HTMLFactory outerClass javax/swing/text/html/HTMLEditorKit innerClassName HTMLFactory flags 9 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$InsertHTMLTextAction outerClass javax/swing/text/html/HTMLEditorKit innerClassName InsertHTMLTextAction flags 9 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$HTMLTextAction outerClass javax/swing/text/html/HTMLEditorKit innerClassName HTMLTextAction flags 409 + +class name javax/swing/text/html/HTMLEditorKit$HTMLFactory +header extends java/lang/Object implements javax/swing/text/ViewFactory nestHost javax/swing/text/html/HTMLEditorKit flags 21 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$HTMLFactory outerClass javax/swing/text/html/HTMLEditorKit innerClassName HTMLFactory flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$UnknownTag outerClass javax/swing/text/html/HTML innerClassName UnknownTag flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/HTMLEditorKit$HTMLTextAction +header extends javax/swing/text/StyledEditorKit$StyledTextAction nestHost javax/swing/text/html/HTMLEditorKit flags 421 +innerclass innerClass javax/swing/text/StyledEditorKit$StyledTextAction outerClass javax/swing/text/StyledEditorKit innerClassName StyledTextAction flags 409 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$HTMLTextAction outerClass javax/swing/text/html/HTMLEditorKit innerClassName HTMLTextAction flags 409 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 + +class name javax/swing/text/html/HTMLEditorKit$InsertHTMLTextAction +header extends javax/swing/text/html/HTMLEditorKit$HTMLTextAction nestHost javax/swing/text/html/HTMLEditorKit flags 21 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$InsertHTMLTextAction outerClass javax/swing/text/html/HTMLEditorKit innerClassName InsertHTMLTextAction flags 9 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$HTMLTextAction outerClass javax/swing/text/html/HTMLEditorKit innerClassName HTMLTextAction flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/HTMLEditorKit$LinkController +header extends java/awt/event/MouseAdapter implements java/awt/event/MouseMotionListener,java/io/Serializable nestHost javax/swing/text/html/HTMLEditorKit flags 21 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$LinkController outerClass javax/swing/text/html/HTMLEditorKit innerClassName LinkController flags 9 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/event/HyperlinkEvent$EventType outerClass javax/swing/event/HyperlinkEvent innerClassName EventType flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/HTMLWriter +header extends javax/swing/text/AbstractWriter flags 21 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/ImageView +header extends javax/swing/text/View flags 21 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/Position$Bias outerClass javax/swing/text/Position innerClassName Bias flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/StyleSheet +header extends javax/swing/text/StyleContext nestMembers javax/swing/text/html/StyleSheet$ListPainter,javax/swing/text/html/StyleSheet$BoxPainter flags 21 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/StyleSheet$BoxPainter outerClass javax/swing/text/html/StyleSheet innerClassName BoxPainter flags 9 +innerclass innerClass javax/swing/text/html/StyleSheet$ListPainter outerClass javax/swing/text/html/StyleSheet innerClassName ListPainter flags 9 +innerclass innerClass javax/swing/text/StyleContext$SmallAttributeSet outerClass javax/swing/text/StyleContext innerClassName SmallAttributeSet flags 1 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/StyleSheet$ListPainter +header extends java/lang/Object implements java/io/Serializable nestHost javax/swing/text/html/StyleSheet flags 21 +innerclass innerClass javax/swing/text/html/StyleSheet$ListPainter outerClass javax/swing/text/html/StyleSheet innerClassName ListPainter flags 9 +innerclass innerClass javax/swing/text/html/CSS$Attribute outerClass javax/swing/text/html/CSS innerClassName Attribute flags 19 +innerclass innerClass javax/swing/text/html/HTML$Tag outerClass javax/swing/text/html/HTML innerClassName Tag flags 9 +innerclass innerClass javax/swing/text/html/HTML$Attribute outerClass javax/swing/text/html/HTML innerClassName Attribute flags 19 +innerclass innerClass java/awt/RenderingHints$Key outerClass java/awt/RenderingHints innerClassName Key flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/swing/text/html/parser/ParserDelegator +header extends javax/swing/text/html/HTMLEditorKit$Parser implements java/io/Serializable flags 21 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$Parser outerClass javax/swing/text/html/HTMLEditorKit innerClassName Parser flags 409 +innerclass innerClass javax/swing/text/html/HTMLEditorKit$ParserCallback outerClass javax/swing/text/html/HTMLEditorKit innerClassName ParserCallback flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + diff --git a/make/data/symbols/java.management-D.sym.txt b/make/data/symbols/java.management-D.sym.txt new file mode 100644 index 00000000000..656a365bf86 --- /dev/null +++ b/make/data/symbols/java.management-D.sym.txt @@ -0,0 +1,102 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name javax/management/modelmbean/DescriptorSupport +header extends java/lang/Object implements javax/management/Descriptor flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/management/modelmbean/ModelMBeanAttributeInfo +header extends javax/management/MBeanAttributeInfo implements javax/management/DescriptorAccess flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/management/modelmbean/ModelMBeanConstructorInfo +header extends javax/management/MBeanConstructorInfo implements javax/management/DescriptorAccess flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/management/modelmbean/ModelMBeanInfoSupport +header extends javax/management/MBeanInfo implements javax/management/modelmbean/ModelMBeanInfo flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/management/modelmbean/ModelMBeanNotificationInfo +header extends javax/management/MBeanNotificationInfo implements javax/management/DescriptorAccess flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/management/modelmbean/ModelMBeanOperationInfo +header extends javax/management/MBeanOperationInfo implements javax/management/DescriptorAccess flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/management/relation/MBeanServerNotificationFilter +header extends javax/management/NotificationFilterSupport flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/management/relation/RelationService +header extends javax/management/NotificationBroadcasterSupport implements javax/management/relation/RelationServiceMBean,javax/management/MBeanRegistration,javax/management/NotificationListener flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name javax/management/relation/RelationTypeSupport +header extends java/lang/Object implements javax/management/relation/RelationType flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/io/ObjectInputStream$GetField outerClass java/io/ObjectInputStream innerClassName GetField flags 409 +innerclass innerClass java/io/ObjectOutputStream$PutField outerClass java/io/ObjectOutputStream innerClassName PutField flags 409 + +class name javax/management/timer/Timer +header extends javax/management/NotificationBroadcasterSupport implements javax/management/timer/TimerMBean,javax/management/MBeanRegistration flags 21 +innerclass innerClass java/lang/System$Logger outerClass java/lang/System innerClassName Logger flags 609 +innerclass innerClass java/lang/System$Logger$Level outerClass java/lang/System$Logger innerClassName Level flags 4019 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + diff --git a/make/data/symbols/java.management.rmi-D.sym.txt b/make/data/symbols/java.management.rmi-D.sym.txt new file mode 100644 index 00000000000..c002289908c --- /dev/null +++ b/make/data/symbols/java.management.rmi-D.sym.txt @@ -0,0 +1,35 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name javax/management/remote/rmi/RMIJRMPServerImpl +header extends javax/management/remote/rmi/RMIServerImpl flags 21 +innerclass innerClass java/io/ObjectInputFilter$Config outerClass java/io/ObjectInputFilter innerClassName Config flags 19 +innerclass innerClass java/io/ObjectInputFilter$Status outerClass java/io/ObjectInputFilter innerClassName Status flags 4019 +innerclass innerClass java/io/ObjectInputFilter$FilterInfo outerClass java/io/ObjectInputFilter innerClassName FilterInfo flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + diff --git a/make/data/symbols/java.net.http-D.sym.txt b/make/data/symbols/java.net.http-D.sym.txt new file mode 100644 index 00000000000..16816de4686 --- /dev/null +++ b/make/data/symbols/java.net.http-D.sym.txt @@ -0,0 +1,89 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name java/net/http/HttpClient +header extends java/lang/Object nestMembers java/net/http/HttpClient$Redirect,java/net/http/HttpClient$Version,java/net/http/HttpClient$Builder flags 421 +innerclass innerClass java/net/http/HttpClient$Builder outerClass java/net/http/HttpClient innerClassName Builder flags 609 +innerclass innerClass java/net/http/HttpClient$Redirect outerClass java/net/http/HttpClient innerClassName Redirect flags 4019 +innerclass innerClass java/net/http/HttpClient$Version outerClass java/net/http/HttpClient innerClassName Version flags 4019 +innerclass innerClass java/net/http/HttpResponse$BodyHandler outerClass java/net/http/HttpResponse innerClassName BodyHandler flags 609 +innerclass innerClass java/net/http/HttpResponse$PushPromiseHandler outerClass java/net/http/HttpResponse innerClassName PushPromiseHandler flags 609 +innerclass innerClass java/net/http/WebSocket$Builder outerClass java/net/http/WebSocket innerClassName Builder flags 609 + +class name java/net/http/HttpRequest$BodyPublisher +header extends java/lang/Object implements java/util/concurrent/Flow$Publisher nestHost java/net/http/HttpRequest flags 601 signature Ljava/lang/Object;Ljava/util/concurrent/Flow$Publisher; +innerclass innerClass java/net/http/HttpRequest$BodyPublisher outerClass java/net/http/HttpRequest innerClassName BodyPublisher flags 609 +innerclass innerClass java/util/concurrent/Flow$Publisher outerClass java/util/concurrent/Flow innerClassName Publisher flags 609 + +class name java/net/http/HttpRequest$BodyPublishers +header extends java/lang/Object nestHost java/net/http/HttpRequest flags 21 +innerclass innerClass java/util/concurrent/Flow$Publisher outerClass java/util/concurrent/Flow innerClassName Publisher flags 609 +innerclass innerClass java/net/http/HttpRequest$BodyPublishers outerClass java/net/http/HttpRequest innerClassName BodyPublishers flags 9 +innerclass innerClass java/net/http/HttpRequest$BodyPublisher outerClass java/net/http/HttpRequest innerClassName BodyPublisher flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/net/http/HttpResponse$BodyHandler +header extends java/lang/Object nestHost java/net/http/HttpResponse flags 601 signature Ljava/lang/Object; runtimeAnnotations @Ljava/lang/FunctionalInterface; +innerclass innerClass java/net/http/HttpResponse$BodyHandler outerClass java/net/http/HttpResponse innerClassName BodyHandler flags 609 +innerclass innerClass java/net/http/HttpResponse$ResponseInfo outerClass java/net/http/HttpResponse innerClassName ResponseInfo flags 609 +innerclass innerClass java/net/http/HttpResponse$BodySubscriber outerClass java/net/http/HttpResponse innerClassName BodySubscriber flags 609 + +class name java/net/http/HttpResponse$BodyHandlers +header extends java/lang/Object nestHost java/net/http/HttpResponse flags 21 +innerclass innerClass java/util/concurrent/Flow$Subscriber outerClass java/util/concurrent/Flow innerClassName Subscriber flags 609 +innerclass innerClass java/net/http/HttpResponse$BodyHandler outerClass java/net/http/HttpResponse innerClassName BodyHandler flags 609 +innerclass innerClass java/net/http/HttpResponse$BodyHandlers outerClass java/net/http/HttpResponse innerClassName BodyHandlers flags 9 +innerclass innerClass java/net/http/HttpResponse$ResponseInfo outerClass java/net/http/HttpResponse innerClassName ResponseInfo flags 609 +innerclass innerClass java/net/http/HttpResponse$BodySubscriber outerClass java/net/http/HttpResponse innerClassName BodySubscriber flags 609 +innerclass innerClass java/net/http/HttpResponse$BodySubscribers outerClass java/net/http/HttpResponse innerClassName BodySubscribers flags 9 +innerclass innerClass java/util/concurrent/Flow$Publisher outerClass java/util/concurrent/Flow innerClassName Publisher flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/net/http/HttpResponse$BodySubscriber +header extends java/lang/Object implements java/util/concurrent/Flow$Subscriber nestHost java/net/http/HttpResponse flags 601 signature Ljava/lang/Object;Ljava/util/concurrent/Flow$Subscriber;>; +innerclass innerClass java/net/http/HttpResponse$BodySubscriber outerClass java/net/http/HttpResponse innerClassName BodySubscriber flags 609 +innerclass innerClass java/util/concurrent/Flow$Subscriber outerClass java/util/concurrent/Flow innerClassName Subscriber flags 609 + +class name java/net/http/HttpResponse$BodySubscribers +header extends java/lang/Object nestHost java/net/http/HttpResponse flags 21 +innerclass innerClass java/util/concurrent/Flow$Subscriber outerClass java/util/concurrent/Flow innerClassName Subscriber flags 609 +innerclass innerClass java/net/http/HttpResponse$BodySubscribers outerClass java/net/http/HttpResponse innerClassName BodySubscribers flags 9 +innerclass innerClass java/net/http/HttpResponse$BodySubscriber outerClass java/net/http/HttpResponse innerClassName BodySubscriber flags 609 +innerclass innerClass java/util/concurrent/Flow$Publisher outerClass java/util/concurrent/Flow innerClassName Publisher flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name java/net/http/HttpResponse$PushPromiseHandler +header extends java/lang/Object nestHost java/net/http/HttpResponse flags 601 signature Ljava/lang/Object; +innerclass innerClass java/net/http/HttpResponse$PushPromiseHandler outerClass java/net/http/HttpResponse innerClassName PushPromiseHandler flags 609 +innerclass innerClass java/net/http/HttpResponse$BodyHandler outerClass java/net/http/HttpResponse innerClassName BodyHandler flags 609 + +class name java/net/http/HttpResponse$ResponseInfo +header extends java/lang/Object nestHost java/net/http/HttpResponse flags 601 +innerclass innerClass java/net/http/HttpResponse$ResponseInfo outerClass java/net/http/HttpResponse innerClassName ResponseInfo flags 609 +innerclass innerClass java/net/http/HttpClient$Version outerClass java/net/http/HttpClient innerClassName Version flags 4019 + diff --git a/make/data/symbols/java.xml-D.sym.txt b/make/data/symbols/java.xml-D.sym.txt new file mode 100644 index 00000000000..29a4adb0d58 --- /dev/null +++ b/make/data/symbols/java.xml-D.sym.txt @@ -0,0 +1,47 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name javax/xml/catalog/CatalogFeatures$Builder +header extends java/lang/Object nestHost javax/xml/catalog/CatalogFeatures flags 21 +innerclass innerClass javax/xml/catalog/CatalogFeatures$Builder outerClass javax/xml/catalog/CatalogFeatures innerClassName Builder flags 9 +innerclass innerClass javax/xml/catalog/CatalogFeatures$Feature outerClass javax/xml/catalog/CatalogFeatures innerClassName Feature flags 4019 + +class name javax/xml/parsers/DocumentBuilderFactory +method name newDefaultNSInstance descriptor ()Ljavax/xml/parsers/DocumentBuilderFactory; flags 9 +method name newNSInstance descriptor ()Ljavax/xml/parsers/DocumentBuilderFactory; flags 9 +method name newNSInstance descriptor (Ljava/lang/String;Ljava/lang/ClassLoader;)Ljavax/xml/parsers/DocumentBuilderFactory; flags 9 + +class name javax/xml/parsers/SAXParserFactory +method name newDefaultNSInstance descriptor ()Ljavax/xml/parsers/SAXParserFactory; flags 9 +method name newNSInstance descriptor ()Ljavax/xml/parsers/SAXParserFactory; flags 9 +method name newNSInstance descriptor (Ljava/lang/String;Ljava/lang/ClassLoader;)Ljavax/xml/parsers/SAXParserFactory; flags 9 + +class name javax/xml/stream/XMLInputFactory +method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 +-method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; + diff --git a/make/data/symbols/java.xml.crypto-D.sym.txt b/make/data/symbols/java.xml.crypto-D.sym.txt new file mode 100644 index 00000000000..4d3d0ebc594 --- /dev/null +++ b/make/data/symbols/java.xml.crypto-D.sym.txt @@ -0,0 +1,35 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name javax/xml/crypto/dsig/CanonicalizationMethod +field name INCLUSIVE_11 descriptor Ljava/lang/String; constantValue http://www.w3.org/2006/12/xml-c14n11 flags 19 +field name INCLUSIVE_11_WITH_COMMENTS descriptor Ljava/lang/String; constantValue http://www.w3.org/2006/12/xml-c14n11#WithComments flags 19 + +class name javax/xml/crypto/dsig/keyinfo/KeyValue +field name EC_TYPE descriptor Ljava/lang/String; constantValue http://www.w3.org/2009/xmldsig11#ECKeyValue flags 19 + diff --git a/make/data/symbols/jdk.compiler-D.sym.txt b/make/data/symbols/jdk.compiler-D.sym.txt new file mode 100644 index 00000000000..fe5b3364ee1 --- /dev/null +++ b/make/data/symbols/jdk.compiler-D.sym.txt @@ -0,0 +1,35 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name com/sun/source/util/JavacTask +method name setParameterNameProvider descriptor (Lcom/sun/source/util/ParameterNameProvider;)V flags 1 + +class name com/sun/source/util/ParameterNameProvider +header extends java/lang/Object flags 601 +method name getParameterName descriptor (Ljavax/lang/model/element/VariableElement;)Ljava/lang/CharSequence; flags 401 + diff --git a/make/data/symbols/jdk.httpserver-D.sym.txt b/make/data/symbols/jdk.httpserver-D.sym.txt new file mode 100644 index 00000000000..add3d2b538d --- /dev/null +++ b/make/data/symbols/jdk.httpserver-D.sym.txt @@ -0,0 +1,52 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name com/sun/net/httpserver/Authenticator$Failure +header extends com/sun/net/httpserver/Authenticator$Result nestHost com/sun/net/httpserver/Authenticator flags 21 +innerclass innerClass com/sun/net/httpserver/Authenticator$Result outerClass com/sun/net/httpserver/Authenticator innerClassName Result flags 409 +innerclass innerClass com/sun/net/httpserver/Authenticator$Failure outerClass com/sun/net/httpserver/Authenticator innerClassName Failure flags 9 + +class name com/sun/net/httpserver/Authenticator$Retry +header extends com/sun/net/httpserver/Authenticator$Result nestHost com/sun/net/httpserver/Authenticator flags 21 +innerclass innerClass com/sun/net/httpserver/Authenticator$Result outerClass com/sun/net/httpserver/Authenticator innerClassName Result flags 409 +innerclass innerClass com/sun/net/httpserver/Authenticator$Retry outerClass com/sun/net/httpserver/Authenticator innerClassName Retry flags 9 + +class name com/sun/net/httpserver/Authenticator$Success +header extends com/sun/net/httpserver/Authenticator$Result nestHost com/sun/net/httpserver/Authenticator flags 21 +innerclass innerClass com/sun/net/httpserver/Authenticator$Result outerClass com/sun/net/httpserver/Authenticator innerClassName Result flags 409 +innerclass innerClass com/sun/net/httpserver/Authenticator$Success outerClass com/sun/net/httpserver/Authenticator innerClassName Success flags 9 + +class name com/sun/net/httpserver/BasicAuthenticator +header extends com/sun/net/httpserver/Authenticator flags 421 +innerclass innerClass com/sun/net/httpserver/Authenticator$Retry outerClass com/sun/net/httpserver/Authenticator innerClassName Retry flags 9 +innerclass innerClass com/sun/net/httpserver/Authenticator$Failure outerClass com/sun/net/httpserver/Authenticator innerClassName Failure flags 9 +innerclass innerClass java/util/Base64$Decoder outerClass java/util/Base64 innerClassName Decoder flags 9 +innerclass innerClass com/sun/net/httpserver/Authenticator$Success outerClass com/sun/net/httpserver/Authenticator innerClassName Success flags 9 +innerclass innerClass com/sun/net/httpserver/Authenticator$Result outerClass com/sun/net/httpserver/Authenticator innerClassName Result flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + diff --git a/make/data/symbols/jdk.javadoc-D.sym.txt b/make/data/symbols/jdk.javadoc-D.sym.txt new file mode 100644 index 00000000000..ab659b6c5e8 --- /dev/null +++ b/make/data/symbols/jdk.javadoc-D.sym.txt @@ -0,0 +1,93 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +module name jdk.javadoc +header exports jdk/javadoc/doclet requires name\u0020;java.base\u0020;flags\u0020;8000,name\u0020;java.xml\u0020;flags\u0020;0,name\u0020;java.compiler\u0020;flags\u0020;20,name\u0020;jdk.compiler\u0020;flags\u0020;20 provides interface\u0020;java/util/spi/ToolProvider\u0020;impls\u0020;jdk/javadoc/internal/tool/JavadocToolProvider,interface\u0020;javax/tools/DocumentationTool\u0020;impls\u0020;jdk/javadoc/internal/api/JavadocTool,interface\u0020;javax/tools/Tool\u0020;impls\u0020;jdk/javadoc/internal/api/JavadocTool target linux-amd64 flags 8000 + +-class name com/sun/javadoc/AnnotatedType + +-class name com/sun/javadoc/AnnotationDesc + +-class name com/sun/javadoc/AnnotationDesc$ElementValuePair + +-class name com/sun/javadoc/AnnotationTypeDoc + +-class name com/sun/javadoc/AnnotationTypeElementDoc + +-class name com/sun/javadoc/AnnotationValue + +-class name com/sun/javadoc/ClassDoc + +-class name com/sun/javadoc/ConstructorDoc + +-class name com/sun/javadoc/Doc + +-class name com/sun/javadoc/DocErrorReporter + +-class name com/sun/javadoc/Doclet + +-class name com/sun/javadoc/ExecutableMemberDoc + +-class name com/sun/javadoc/FieldDoc + +-class name com/sun/javadoc/LanguageVersion + +-class name com/sun/javadoc/MemberDoc + +-class name com/sun/javadoc/MethodDoc + +-class name com/sun/javadoc/PackageDoc + +-class name com/sun/javadoc/ParamTag + +-class name com/sun/javadoc/Parameter + +-class name com/sun/javadoc/ParameterizedType + +-class name com/sun/javadoc/ProgramElementDoc + +-class name com/sun/javadoc/RootDoc + +-class name com/sun/javadoc/SeeTag + +-class name com/sun/javadoc/SerialFieldTag + +-class name com/sun/javadoc/SourcePosition + +-class name com/sun/javadoc/Tag + +-class name com/sun/javadoc/ThrowsTag + +-class name com/sun/javadoc/Type + +-class name com/sun/javadoc/TypeVariable + +-class name com/sun/javadoc/WildcardType + +-class name com/sun/tools/javadoc/Main + diff --git a/make/data/symbols/jdk.jlink-D.sym.txt b/make/data/symbols/jdk.jlink-D.sym.txt new file mode 100644 index 00000000000..8bc4daacde8 --- /dev/null +++ b/make/data/symbols/jdk.jlink-D.sym.txt @@ -0,0 +1,31 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +module name jdk.jlink +header requires name\u0020;java.base\u0020;flags\u0020;8000,name\u0020;jdk.internal.opt\u0020;flags\u0020;0,name\u0020;jdk.jdeps\u0020;flags\u0020;0 uses jdk/tools/jlink/plugin/Plugin provides interface\u0020;java/util/spi/ToolProvider\u0020;impls\u0020;jdk/tools/jmod/Main$JmodToolProvider\u005C;u002C;jdk/tools/jlink/internal/Main$JlinkToolProvider,interface\u0020;jdk/tools/jlink/plugin/Plugin\u0020;impls\u0020;jdk/tools/jlink/internal/plugins/DefaultStripDebugPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/ExcludePlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/ExcludeFilesPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/ExcludeJmodSectionPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/LegalNoticeFilePlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/SystemModulesPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/StripNativeCommandsPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/OrderResourcesPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/DefaultCompressPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/ExcludeVMPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin\u005C;u002C;jdk/tools/jlink/internal/plugins/StripNativeDebugSymbolsPlugin target linux-amd64 flags 8000 + diff --git a/make/data/symbols/jdk.jshell-D.sym.txt b/make/data/symbols/jdk.jshell-D.sym.txt new file mode 100644 index 00000000000..e0f122b9303 --- /dev/null +++ b/make/data/symbols/jdk.jshell-D.sym.txt @@ -0,0 +1,148 @@ +# +# Copyright (c) 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 +# 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. +# +# ########################################################## +# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### +# ########################################################## +# +class name jdk/jshell/ErroneousSnippet +header extends jdk/jshell/Snippet flags 21 +innerclass innerClass jdk/jshell/Snippet$SubKind outerClass jdk/jshell/Snippet innerClassName SubKind flags 4019 +innerclass innerClass jdk/jshell/Snippet$Kind outerClass jdk/jshell/Snippet innerClassName Kind flags 4019 + +class name jdk/jshell/JShell +header extends java/lang/Object implements java/lang/AutoCloseable nestMembers jdk/jshell/JShell$Subscription,jdk/jshell/JShell$Builder flags 21 +innerclass innerClass jdk/jshell/JShell$Builder outerClass jdk/jshell/JShell innerClassName Builder flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ExecutionControlException outerClass jdk/jshell/spi/ExecutionControl innerClassName ExecutionControlException flags 409 +innerclass innerClass jdk/jshell/Snippet$Status outerClass jdk/jshell/Snippet innerClassName Status flags 4019 +innerclass innerClass jdk/jshell/spi/ExecutionControl$EngineTerminationException outerClass jdk/jshell/spi/ExecutionControl innerClassName EngineTerminationException flags 9 +innerclass innerClass jdk/jshell/JShell$Subscription outerClass jdk/jshell/JShell innerClassName Subscription flags 1 +innerclass innerClass jdk/jshell/Snippet$Kind outerClass jdk/jshell/Snippet innerClassName Kind flags 4019 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/jshell/Snippet +header extends java/lang/Object nestMembers jdk/jshell/Snippet$Status,jdk/jshell/Snippet$SubKind,jdk/jshell/Snippet$Kind flags 421 +innerclass innerClass jdk/jshell/Snippet$SubKind outerClass jdk/jshell/Snippet innerClassName SubKind flags 4019 +innerclass innerClass jdk/jshell/Snippet$Status outerClass jdk/jshell/Snippet innerClassName Status flags 4019 +innerclass innerClass jdk/jshell/Snippet$Kind outerClass jdk/jshell/Snippet innerClassName Kind flags 4019 + +class name jdk/jshell/SourceCodeAnalysis$CompletionInfo +header extends java/lang/Object nestHost jdk/jshell/SourceCodeAnalysis flags 601 +innerclass innerClass jdk/jshell/SourceCodeAnalysis$CompletionInfo outerClass jdk/jshell/SourceCodeAnalysis innerClassName CompletionInfo flags 609 +innerclass innerClass jdk/jshell/SourceCodeAnalysis$Completeness outerClass jdk/jshell/SourceCodeAnalysis innerClassName Completeness flags 4019 + +class name jdk/jshell/SourceCodeAnalysis$SnippetWrapper +header extends java/lang/Object nestHost jdk/jshell/SourceCodeAnalysis flags 601 +innerclass innerClass jdk/jshell/SourceCodeAnalysis$SnippetWrapper outerClass jdk/jshell/SourceCodeAnalysis innerClassName SnippetWrapper flags 609 +innerclass innerClass jdk/jshell/Snippet$Kind outerClass jdk/jshell/Snippet innerClassName Kind flags 4019 + +class name jdk/jshell/execution/DirectExecutionControl +header extends java/lang/Object implements jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ClassBytecodes outerClass jdk/jshell/spi/ExecutionControl innerClassName ClassBytecodes flags 19 +innerclass innerClass jdk/jshell/spi/ExecutionControl$NotImplementedException outerClass jdk/jshell/spi/ExecutionControl innerClassName NotImplementedException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$InternalException outerClass jdk/jshell/spi/ExecutionControl innerClassName InternalException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$RunException outerClass jdk/jshell/spi/ExecutionControl innerClassName RunException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$EngineTerminationException outerClass jdk/jshell/spi/ExecutionControl innerClassName EngineTerminationException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ResolutionException outerClass jdk/jshell/spi/ExecutionControl innerClassName ResolutionException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$UserException outerClass jdk/jshell/spi/ExecutionControl innerClassName UserException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ClassInstallException outerClass jdk/jshell/spi/ExecutionControl innerClassName ClassInstallException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ExecutionControlException outerClass jdk/jshell/spi/ExecutionControl innerClassName ExecutionControlException flags 409 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/jshell/execution/JdiExecutionControl +header extends jdk/jshell/execution/StreamingExecutionControl implements jdk/jshell/spi/ExecutionControl flags 421 +innerclass innerClass jdk/jshell/spi/ExecutionControl$EngineTerminationException outerClass jdk/jshell/spi/ExecutionControl innerClassName EngineTerminationException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ClassInstallException outerClass jdk/jshell/spi/ExecutionControl innerClassName ClassInstallException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ClassBytecodes outerClass jdk/jshell/spi/ExecutionControl innerClassName ClassBytecodes flags 19 +innerclass innerClass jdk/jshell/spi/ExecutionControl$NotImplementedException outerClass jdk/jshell/spi/ExecutionControl innerClassName NotImplementedException flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/jshell/execution/JdiInitiator +header extends java/lang/Object flags 21 +innerclass innerClass java/util/Map$Entry outerClass java/util/Map innerClassName Entry flags 609 +innerclass innerClass com/sun/jdi/connect/Connector$Argument outerClass com/sun/jdi/connect/Connector innerClassName Argument flags 609 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/jshell/execution/LocalExecutionControl +header extends jdk/jshell/execution/DirectExecutionControl flags 21 +innerclass innerClass java/lang/Thread$UncaughtExceptionHandler outerClass java/lang/Thread innerClassName UncaughtExceptionHandler flags 609 +innerclass innerClass jdk/jshell/spi/ExecutionControl$StoppedException outerClass jdk/jshell/spi/ExecutionControl innerClassName StoppedException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$InternalException outerClass jdk/jshell/spi/ExecutionControl innerClassName InternalException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$EngineTerminationException outerClass jdk/jshell/spi/ExecutionControl innerClassName EngineTerminationException flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/jshell/execution/StreamingExecutionControl +header extends java/lang/Object implements jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$EngineTerminationException outerClass jdk/jshell/spi/ExecutionControl innerClassName EngineTerminationException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$NotImplementedException outerClass jdk/jshell/spi/ExecutionControl innerClassName NotImplementedException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$InternalException outerClass jdk/jshell/spi/ExecutionControl innerClassName InternalException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ClassInstallException outerClass jdk/jshell/spi/ExecutionControl innerClassName ClassInstallException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$UserException outerClass jdk/jshell/spi/ExecutionControl innerClassName UserException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ResolutionException outerClass jdk/jshell/spi/ExecutionControl innerClassName ResolutionException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$RunException outerClass jdk/jshell/spi/ExecutionControl innerClassName RunException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$StoppedException outerClass jdk/jshell/spi/ExecutionControl innerClassName StoppedException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ClassBytecodes outerClass jdk/jshell/spi/ExecutionControl innerClassName ClassBytecodes flags 19 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/jshell/spi/ExecutionControl$ClassInstallException +header extends jdk/jshell/spi/ExecutionControl$ExecutionControlException nestHost jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ExecutionControlException outerClass jdk/jshell/spi/ExecutionControl innerClassName ExecutionControlException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ClassInstallException outerClass jdk/jshell/spi/ExecutionControl innerClassName ClassInstallException flags 9 + +class name jdk/jshell/spi/ExecutionControl$EngineTerminationException +header extends jdk/jshell/spi/ExecutionControl$ExecutionControlException nestHost jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ExecutionControlException outerClass jdk/jshell/spi/ExecutionControl innerClassName ExecutionControlException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$EngineTerminationException outerClass jdk/jshell/spi/ExecutionControl innerClassName EngineTerminationException flags 9 + +class name jdk/jshell/spi/ExecutionControl$InternalException +header extends jdk/jshell/spi/ExecutionControl$ExecutionControlException nestHost jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ExecutionControlException outerClass jdk/jshell/spi/ExecutionControl innerClassName ExecutionControlException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$InternalException outerClass jdk/jshell/spi/ExecutionControl innerClassName InternalException flags 9 + +class name jdk/jshell/spi/ExecutionControl$NotImplementedException +header extends jdk/jshell/spi/ExecutionControl$InternalException nestHost jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$InternalException outerClass jdk/jshell/spi/ExecutionControl innerClassName InternalException flags 9 +innerclass innerClass jdk/jshell/spi/ExecutionControl$NotImplementedException outerClass jdk/jshell/spi/ExecutionControl innerClassName NotImplementedException flags 9 + +class name jdk/jshell/spi/ExecutionControl$ResolutionException +header extends jdk/jshell/spi/ExecutionControl$RunException nestHost jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$RunException outerClass jdk/jshell/spi/ExecutionControl innerClassName RunException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ResolutionException outerClass jdk/jshell/spi/ExecutionControl innerClassName ResolutionException flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/jshell/spi/ExecutionControl$RunException +header extends jdk/jshell/spi/ExecutionControl$ExecutionControlException nestHost jdk/jshell/spi/ExecutionControl flags 421 +innerclass innerClass jdk/jshell/spi/ExecutionControl$ExecutionControlException outerClass jdk/jshell/spi/ExecutionControl innerClassName ExecutionControlException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$RunException outerClass jdk/jshell/spi/ExecutionControl innerClassName RunException flags 409 + +class name jdk/jshell/spi/ExecutionControl$StoppedException +header extends jdk/jshell/spi/ExecutionControl$RunException nestHost jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$RunException outerClass jdk/jshell/spi/ExecutionControl innerClassName RunException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$StoppedException outerClass jdk/jshell/spi/ExecutionControl innerClassName StoppedException flags 9 + +class name jdk/jshell/spi/ExecutionControl$UserException +header extends jdk/jshell/spi/ExecutionControl$RunException nestHost jdk/jshell/spi/ExecutionControl flags 21 +innerclass innerClass jdk/jshell/spi/ExecutionControl$RunException outerClass jdk/jshell/spi/ExecutionControl innerClassName RunException flags 409 +innerclass innerClass jdk/jshell/spi/ExecutionControl$UserException outerClass jdk/jshell/spi/ExecutionControl innerClassName UserException flags 9 + diff --git a/make/data/symbols/symbols b/make/data/symbols/symbols index 9681a368cd7..e4897ab3739 100644 --- a/make/data/symbols/symbols +++ b/make/data/symbols/symbols @@ -29,10 +29,11 @@ #command used to generate this file: #build.tools.symbolgenerator.CreateSymbols build-description-incremental symbols include.list # -generate platforms 7:8:9:A:B:C +generate platforms 7:8:9:A:B:C:D platform version 8 files java.activation-8.sym.txt:java.base-8.sym.txt:java.compiler-8.sym.txt:java.corba-8.sym.txt:java.datatransfer-8.sym.txt:java.desktop-8.sym.txt:java.instrument-8.sym.txt:java.logging-8.sym.txt:java.management-8.sym.txt:java.management.rmi-8.sym.txt:java.naming-8.sym.txt:java.prefs-8.sym.txt:java.rmi-8.sym.txt:java.scripting-8.sym.txt:java.security.jgss-8.sym.txt:java.security.sasl-8.sym.txt:java.sql-8.sym.txt:java.sql.rowset-8.sym.txt:java.transaction-8.sym.txt:java.xml-8.sym.txt:java.xml.bind-8.sym.txt:java.xml.crypto-8.sym.txt:java.xml.ws-8.sym.txt:java.xml.ws.annotation-8.sym.txt:jdk.httpserver-8.sym.txt:jdk.management-8.sym.txt:jdk.scripting.nashorn-8.sym.txt:jdk.sctp-8.sym.txt:jdk.security.auth-8.sym.txt:jdk.security.jgss-8.sym.txt platform version 7 base 8 files java.base-7.sym.txt:java.compiler-7.sym.txt:java.datatransfer-7.sym.txt:java.desktop-7.sym.txt:java.logging-7.sym.txt:java.management-7.sym.txt:java.naming-7.sym.txt:java.prefs-7.sym.txt:java.rmi-7.sym.txt:java.scripting-7.sym.txt:java.security.jgss-7.sym.txt:java.security.sasl-7.sym.txt:java.sql-7.sym.txt:java.sql.rowset-7.sym.txt:java.xml-7.sym.txt:java.xml.bind-7.sym.txt:java.xml.ws.annotation-7.sym.txt:jdk.httpserver-7.sym.txt:jdk.management-7.sym.txt:jdk.scripting.nashorn-7.sym.txt:jdk.sctp-7.sym.txt:jdk.security.auth-7.sym.txt:jdk.security.jgss-7.sym.txt platform version 9 base 8 files java.activation-9.sym.txt:java.base-9.sym.txt:java.compiler-9.sym.txt:java.corba-9.sym.txt:java.datatransfer-9.sym.txt:java.desktop-9.sym.txt:java.instrument-9.sym.txt:java.logging-9.sym.txt:java.management-9.sym.txt:java.management.rmi-9.sym.txt:java.naming-9.sym.txt:java.prefs-9.sym.txt:java.rmi-9.sym.txt:java.scripting-9.sym.txt:java.se-9.sym.txt:java.se.ee-9.sym.txt:java.security.jgss-9.sym.txt:java.security.sasl-9.sym.txt:java.smartcardio-9.sym.txt:java.sql-9.sym.txt:java.sql.rowset-9.sym.txt:java.transaction-9.sym.txt:java.xml-9.sym.txt:java.xml.bind-9.sym.txt:java.xml.crypto-9.sym.txt:java.xml.ws-9.sym.txt:java.xml.ws.annotation-9.sym.txt:jdk.accessibility-9.sym.txt:jdk.attach-9.sym.txt:jdk.charsets-9.sym.txt:jdk.compiler-9.sym.txt:jdk.crypto.cryptoki-9.sym.txt:jdk.crypto.ec-9.sym.txt:jdk.dynalink-9.sym.txt:jdk.editpad-9.sym.txt:jdk.hotspot.agent-9.sym.txt:jdk.httpserver-9.sym.txt:jdk.incubator.httpclient-9.sym.txt:jdk.jartool-9.sym.txt:jdk.javadoc-9.sym.txt:jdk.jcmd-9.sym.txt:jdk.jconsole-9.sym.txt:jdk.jdeps-9.sym.txt:jdk.jdi-9.sym.txt:jdk.jdwp.agent-9.sym.txt:jdk.jlink-9.sym.txt:jdk.jshell-9.sym.txt:jdk.jsobject-9.sym.txt:jdk.jstatd-9.sym.txt:jdk.localedata-9.sym.txt:jdk.management-9.sym.txt:jdk.management.agent-9.sym.txt:jdk.naming.dns-9.sym.txt:jdk.naming.rmi-9.sym.txt:jdk.net-9.sym.txt:jdk.pack-9.sym.txt:jdk.policytool-9.sym.txt:jdk.rmic-9.sym.txt:jdk.scripting.nashorn-9.sym.txt:jdk.sctp-9.sym.txt:jdk.security.auth-9.sym.txt:jdk.security.jgss-9.sym.txt:jdk.unsupported-9.sym.txt:jdk.xml.dom-9.sym.txt:jdk.zipfs-9.sym.txt platform version A base 9 files java.activation-A.sym.txt:java.base-A.sym.txt:java.compiler-A.sym.txt:java.corba-A.sym.txt:java.datatransfer-A.sym.txt:java.desktop-A.sym.txt:java.instrument-A.sym.txt:java.logging-A.sym.txt:java.management-A.sym.txt:java.management.rmi-A.sym.txt:java.naming-A.sym.txt:java.prefs-A.sym.txt:java.rmi-A.sym.txt:java.scripting-A.sym.txt:java.se-A.sym.txt:java.se.ee-A.sym.txt:java.security.jgss-A.sym.txt:java.security.sasl-A.sym.txt:java.smartcardio-A.sym.txt:java.sql-A.sym.txt:java.sql.rowset-A.sym.txt:java.transaction-A.sym.txt:java.xml-A.sym.txt:java.xml.bind-A.sym.txt:java.xml.crypto-A.sym.txt:java.xml.ws-A.sym.txt:java.xml.ws.annotation-A.sym.txt:jdk.accessibility-A.sym.txt:jdk.attach-A.sym.txt:jdk.charsets-A.sym.txt:jdk.compiler-A.sym.txt:jdk.crypto.cryptoki-A.sym.txt:jdk.crypto.ec-A.sym.txt:jdk.dynalink-A.sym.txt:jdk.editpad-A.sym.txt:jdk.hotspot.agent-A.sym.txt:jdk.httpserver-A.sym.txt:jdk.incubator.httpclient-A.sym.txt:jdk.jartool-A.sym.txt:jdk.javadoc-A.sym.txt:jdk.jcmd-A.sym.txt:jdk.jconsole-A.sym.txt:jdk.jdeps-A.sym.txt:jdk.jdi-A.sym.txt:jdk.jdwp.agent-A.sym.txt:jdk.jlink-A.sym.txt:jdk.jshell-A.sym.txt:jdk.jsobject-A.sym.txt:jdk.jstatd-A.sym.txt:jdk.localedata-A.sym.txt:jdk.management-A.sym.txt:jdk.management.agent-A.sym.txt:jdk.naming.dns-A.sym.txt:jdk.naming.rmi-A.sym.txt:jdk.net-A.sym.txt:jdk.pack-A.sym.txt:jdk.policytool-A.sym.txt:jdk.rmic-A.sym.txt:jdk.scripting.nashorn-A.sym.txt:jdk.sctp-A.sym.txt:jdk.security.auth-A.sym.txt:jdk.security.jgss-A.sym.txt:jdk.unsupported-A.sym.txt:jdk.xml.dom-A.sym.txt:jdk.zipfs-A.sym.txt platform version B base A files java.activation-B.sym.txt:java.base-B.sym.txt:java.compiler-B.sym.txt:java.corba-B.sym.txt:java.datatransfer-B.sym.txt:java.desktop-B.sym.txt:java.instrument-B.sym.txt:java.logging-B.sym.txt:java.management-B.sym.txt:java.management.rmi-B.sym.txt:java.naming-B.sym.txt:java.net.http-B.sym.txt:java.prefs-B.sym.txt:java.rmi-B.sym.txt:java.scripting-B.sym.txt:java.se-B.sym.txt:java.se.ee-B.sym.txt:java.security.jgss-B.sym.txt:java.security.sasl-B.sym.txt:java.smartcardio-B.sym.txt:java.sql-B.sym.txt:java.sql.rowset-B.sym.txt:java.transaction-B.sym.txt:java.transaction.xa-B.sym.txt:java.xml-B.sym.txt:java.xml.bind-B.sym.txt:java.xml.crypto-B.sym.txt:java.xml.ws-B.sym.txt:java.xml.ws.annotation-B.sym.txt:jdk.accessibility-B.sym.txt:jdk.attach-B.sym.txt:jdk.charsets-B.sym.txt:jdk.compiler-B.sym.txt:jdk.crypto.cryptoki-B.sym.txt:jdk.crypto.ec-B.sym.txt:jdk.dynalink-B.sym.txt:jdk.editpad-B.sym.txt:jdk.hotspot.agent-B.sym.txt:jdk.httpserver-B.sym.txt:jdk.incubator.httpclient-B.sym.txt:jdk.jartool-B.sym.txt:jdk.javadoc-B.sym.txt:jdk.jcmd-B.sym.txt:jdk.jconsole-B.sym.txt:jdk.jdeps-B.sym.txt:jdk.jdi-B.sym.txt:jdk.jdwp.agent-B.sym.txt:jdk.jfr-B.sym.txt:jdk.jlink-B.sym.txt:jdk.jshell-B.sym.txt:jdk.jsobject-B.sym.txt:jdk.jstatd-B.sym.txt:jdk.localedata-B.sym.txt:jdk.management-B.sym.txt:jdk.management.agent-B.sym.txt:jdk.management.jfr-B.sym.txt:jdk.naming.dns-B.sym.txt:jdk.naming.rmi-B.sym.txt:jdk.net-B.sym.txt:jdk.pack-B.sym.txt:jdk.rmic-B.sym.txt:jdk.scripting.nashorn-B.sym.txt:jdk.sctp-B.sym.txt:jdk.security.auth-B.sym.txt:jdk.security.jgss-B.sym.txt:jdk.unsupported-B.sym.txt:jdk.xml.dom-B.sym.txt:jdk.zipfs-B.sym.txt platform version C base B files java.base-C.sym.txt:java.compiler-C.sym.txt:java.desktop-C.sym.txt:java.naming-C.sym.txt:java.rmi-C.sym.txt:java.xml-C.sym.txt:jdk.compiler-C.sym.txt:jdk.jfr-C.sym.txt:jdk.jsobject-C.sym.txt:jdk.unsupported-C.sym.txt +platform version D base C files java.base-D.sym.txt:java.compiler-D.sym.txt:java.desktop-D.sym.txt:java.management-D.sym.txt:java.management.rmi-D.sym.txt:java.net.http-D.sym.txt:java.xml-D.sym.txt:java.xml.crypto-D.sym.txt:jdk.compiler-D.sym.txt:jdk.httpserver-D.sym.txt:jdk.javadoc-D.sym.txt:jdk.jlink-D.sym.txt:jdk.jshell-D.sym.txt diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 1583441e7e1..07da65dcc6e 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -125,6 +125,8 @@ #define JAVA_13_VERSION 57 +#define JAVA_14_VERSION 58 + void ClassFileParser::set_class_bad_constant_seen(short bad_constant) { assert((bad_constant == JVM_CONSTANT_Module || bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION, diff --git a/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java b/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java index d178f02d80b..3cef47ae5d6 100644 --- a/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java +++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, 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 @@ -51,6 +51,7 @@ class Constants { 1.11 to 1.11.X 55,0 1.12 to 1.12.X 56,0 1.13 to 1.13.X 57,0 + 1.14 to 1.14.X 58,0 */ public static final Package.Version JAVA_MIN_CLASS_VERSION = @@ -83,6 +84,9 @@ class Constants { public static final Package.Version JAVA13_MAX_CLASS_VERSION = Package.Version.of(57, 00); + public static final Package.Version JAVA14_MAX_CLASS_VERSION = + Package.Version.of(58, 00); + public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D; public static final Package.Version JAVA5_PACKAGE_VERSION = diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java b/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java index 2a10a8952f8..65cc14549e5 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -63,7 +63,7 @@ import static jdk.internal.module.ClassFileConstants.*; public final class ModuleInfo { private final int JAVA_MIN_SUPPORTED_VERSION = 53; - private final int JAVA_MAX_SUPPORTED_VERSION = 57; + private final int JAVA_MAX_SUPPORTED_VERSION = 58; private static final JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess(); diff --git a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java index 5d2833e012b..23be25752ef 100644 --- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java +++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java @@ -210,7 +210,7 @@ public class ClassReader { b = classFileBuffer; // Check the class' major_version. This field is after the magic and minor_version fields, which // use 4 and 2 bytes respectively. - if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V13) { + if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V14) { throw new IllegalArgumentException( "Unsupported class file major version " + readShort(classFileOffset + 6)); } diff --git a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java index 0fb28cacd11..65fb9443525 100644 --- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java +++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java @@ -96,6 +96,7 @@ public interface Opcodes { int V11 = 0 << 16 | 55; int V12 = 0 << 16 | 56; int V13 = 0 << 16 | 57; + int V14 = 0 << 16 | 58; /** * Version flag indicating that the class is using 'preview' features. diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java index fd967a0b73e..bd405213ad5 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -60,6 +60,7 @@ public enum SourceVersion { * 11: local-variable syntax for lambda parameters * 12: no changes (switch expressions were in preview) * 13: no changes (switch expressions and text blocks in preview) + * 14: TBD */ /** @@ -192,7 +193,15 @@ public enum SourceVersion { * * @since 13 */ - RELEASE_13; + RELEASE_13, + + /** + * The version recognized by the Java Platform, Standard Edition + * 14. + * + * @since 14 + */ + RELEASE_14; // Note that when adding constants for newer releases, the // behavior of latest() and latestSupported() must be updated too. @@ -203,7 +212,7 @@ public enum SourceVersion { * @return the latest source version that can be modeled */ public static SourceVersion latest() { - return RELEASE_13; + return RELEASE_14; } private static final SourceVersion latestSupported = getLatestSupported(); @@ -218,7 +227,7 @@ public enum SourceVersion { private static SourceVersion getLatestSupported() { int intVersion = Runtime.version().feature(); return (intVersion >= 11) ? - valueOf("RELEASE_" + Math.min(13, intVersion)): + valueOf("RELEASE_" + Math.min(14, intVersion)): RELEASE_10; } diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java index da18c3fc82e..6ed1445e5e2 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -32,7 +32,7 @@ import javax.annotation.processing.SupportedSourceVersion; /** * A skeletal visitor for annotation values with default behavior * appropriate for source versions {@link SourceVersion#RELEASE_9 - * RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}. + * RELEASE_9} through {@link SourceVersion#RELEASE_14 RELEASE_14}. * *

    WARNING: The {@code AnnotationValueVisitor} interface * implemented by this class may have methods added to it in the @@ -59,7 +59,7 @@ import javax.annotation.processing.SupportedSourceVersion; * @see AbstractAnnotationValueVisitor8 * @since 9 */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public abstract class AbstractAnnotationValueVisitor9 extends AbstractAnnotationValueVisitor8 { /** diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java index d8d5df0b605..da778e2d2ed 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -34,7 +34,7 @@ import static javax.lang.model.SourceVersion.*; /** * A skeletal visitor of program elements with default behavior * appropriate for source versions {@link SourceVersion#RELEASE_9 - * RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}. + * RELEASE_9} through {@link SourceVersion#RELEASE_14 RELEASE_14}. * *

    WARNING: The {@code ElementVisitor} interface * implemented by this class may have methods added to it in the @@ -65,7 +65,7 @@ import static javax.lang.model.SourceVersion.*; * @since 9 * @spec JPMS */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public abstract class AbstractElementVisitor9 extends AbstractElementVisitor8 { /** * Constructor for concrete subclasses to call. diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java index a85ec879bd8..caafc7f6125 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -33,7 +33,7 @@ import static javax.lang.model.SourceVersion.*; /** * A skeletal visitor of types with default behavior appropriate for * source versions {@link SourceVersion#RELEASE_9 RELEASE_9} through - * {@link SourceVersion#RELEASE_13 RELEASE_13}. + * {@link SourceVersion#RELEASE_14 RELEASE_14}. * *

    WARNING: The {@code TypeVisitor} interface implemented * by this class may have methods added to it in the future to @@ -63,7 +63,7 @@ import static javax.lang.model.SourceVersion.*; * @see AbstractTypeVisitor8 * @since 9 */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public abstract class AbstractTypeVisitor9 extends AbstractTypeVisitor8 { /** * Constructor for concrete subclasses to call. diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java index 02a74d9e4e2..791ef9cfd61 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -34,7 +34,7 @@ import javax.lang.model.SourceVersion; * A visitor of program elements based on their {@linkplain * ElementKind kind} with default behavior appropriate for source * versions {@link SourceVersion#RELEASE_9 RELEASE_9} through {@link - * SourceVersion#RELEASE_13 RELEASE_13}. + * SourceVersion#RELEASE_14 RELEASE_14}. * * For {@linkplain * Element elements} Xyz that may have more than one @@ -80,7 +80,7 @@ import javax.lang.model.SourceVersion; * @since 9 * @spec JPMS */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public class ElementKindVisitor9 extends ElementKindVisitor8 { /** * Constructor for concrete subclasses; uses {@code null} for the diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java index a399e3a2702..07e2a204682 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -34,7 +34,7 @@ import static javax.lang.model.SourceVersion.*; /** * A scanning visitor of program elements with default behavior * appropriate for source versions {@link SourceVersion#RELEASE_9 - * RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}. + * RELEASE_9} through {@link SourceVersion#RELEASE_14 RELEASE_14}. * * The visitXyz methods in this * class scan their component elements by calling {@code scan} on @@ -92,7 +92,7 @@ import static javax.lang.model.SourceVersion.*; * @since 9 * @spec JPMS */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public class ElementScanner9 extends ElementScanner8 { /** * Constructor for concrete subclasses; uses {@code null} for the diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java index ca1fabea66f..a884c629e47 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -32,7 +32,7 @@ import static javax.lang.model.SourceVersion.*; /** * A simple visitor for annotation values with default behavior * appropriate for source versions {@link SourceVersion#RELEASE_9 - * RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}. + * RELEASE_9} through {@link SourceVersion#RELEASE_14 RELEASE_14}. * * Visit methods call {@link #defaultAction * defaultAction} passing their arguments to {@code defaultAction}'s @@ -68,7 +68,7 @@ import static javax.lang.model.SourceVersion.*; * @see SimpleAnnotationValueVisitor8 * @since 9 */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public class SimpleAnnotationValueVisitor9 extends SimpleAnnotationValueVisitor8 { /** * Constructor for concrete subclasses; uses {@code null} for the diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java index 2d9218603fa..60463f65b1b 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -33,7 +33,7 @@ import static javax.lang.model.SourceVersion.*; /** * A simple visitor of program elements with default behavior * appropriate for source versions {@link SourceVersion#RELEASE_9 - * RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}. + * RELEASE_9} through {@link SourceVersion#RELEASE_14 RELEASE_14}. * * Visit methods corresponding to {@code RELEASE_9} and earlier * language constructs call {@link #defaultAction defaultAction}, @@ -73,7 +73,7 @@ import static javax.lang.model.SourceVersion.*; * @since 9 * @spec JPMS */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public class SimpleElementVisitor9 extends SimpleElementVisitor8 { /** * Constructor for concrete subclasses; uses {@code null} for the diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java index b1e719747b3..d2040e8d68c 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -33,7 +33,7 @@ import static javax.lang.model.SourceVersion.*; /** * A simple visitor of types with default behavior appropriate for * source versions {@link SourceVersion#RELEASE_9 RELEASE_9} through - * {@link SourceVersion#RELEASE_13 RELEASE_13}. + * {@link SourceVersion#RELEASE_14 RELEASE_14}. * * Visit methods corresponding to {@code RELEASE_9} and earlier * language constructs call {@link #defaultAction defaultAction}, @@ -73,7 +73,7 @@ import static javax.lang.model.SourceVersion.*; * @see SimpleTypeVisitor8 * @since 9 */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public class SimpleTypeVisitor9 extends SimpleTypeVisitor8 { /** * Constructor for concrete subclasses; uses {@code null} for the diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java index 83f91cb32da..3bd087e2e8b 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -34,7 +34,7 @@ import static javax.lang.model.SourceVersion.*; * A visitor of types based on their {@linkplain TypeKind kind} with * default behavior appropriate for source versions {@link * SourceVersion#RELEASE_9 RELEASE_9} through {@link - * SourceVersion#RELEASE_13 RELEASE_13}. + * SourceVersion#RELEASE_14 RELEASE_14}. * * For {@linkplain * TypeMirror types} Xyz that may have more than one @@ -77,7 +77,7 @@ import static javax.lang.model.SourceVersion.*; * @see TypeKindVisitor8 * @since 9 */ -@SupportedSourceVersion(RELEASE_13) +@SupportedSourceVersion(RELEASE_14) public class TypeKindVisitor9 extends TypeKindVisitor8 { /** * Constructor for concrete subclasses to call; uses {@code null} diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java index e8c0eb32d76..20d0d7780b2 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java @@ -91,7 +91,13 @@ public enum Source { * 13, no language features; text blocks and revised switch * expressions in preview */ - JDK13("13"); + JDK13("13"), + + /** + * 14 covers the to be determined language features that will be + * added in JDK 14. + */ + JDK14("14"); private static final Context.Key sourceKey = new Context.Key<>(); @@ -142,6 +148,7 @@ public enum Source { } public Target requiredTarget() { + if (this.compareTo(JDK14) >= 0) return Target.JDK1_14; if (this.compareTo(JDK13) >= 0) return Target.JDK1_13; if (this.compareTo(JDK12) >= 0) return Target.JDK1_12; if (this.compareTo(JDK11) >= 0) return Target.JDK1_11; @@ -189,10 +196,10 @@ public enum Source { LOCAL_VARIABLE_TYPE_INFERENCE(JDK10), VAR_SYNTAX_IMPLICIT_LAMBDAS(JDK11, Fragments.FeatureVarSyntaxInImplicitLambda, DiagKind.PLURAL), IMPORT_ON_DEMAND_OBSERVABLE_PACKAGES(JDK1_2, JDK8), - SWITCH_MULTIPLE_CASE_LABELS(JDK13, Fragments.FeatureMultipleCaseLabels, DiagKind.PLURAL), - SWITCH_RULE(JDK13, Fragments.FeatureSwitchRules, DiagKind.PLURAL), - SWITCH_EXPRESSION(JDK13, Fragments.FeatureSwitchExpressions, DiagKind.PLURAL), - TEXT_BLOCKS(JDK13, Fragments.FeatureTextBlocks, DiagKind.PLURAL); + SWITCH_MULTIPLE_CASE_LABELS(JDK14, Fragments.FeatureMultipleCaseLabels, DiagKind.PLURAL), + SWITCH_RULE(JDK14, Fragments.FeatureSwitchRules, DiagKind.PLURAL), + SWITCH_EXPRESSION(JDK14, Fragments.FeatureSwitchExpressions, DiagKind.PLURAL), + TEXT_BLOCKS(JDK14, Fragments.FeatureTextBlocks, DiagKind.PLURAL); enum DiagKind { NORMAL, @@ -279,6 +286,8 @@ public enum Source { return RELEASE_12; case JDK13: return RELEASE_13; + case JDK14: + return RELEASE_14; default: return null; } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java index 3dac06c5948..c9302f41c4a 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -114,7 +114,8 @@ public class ClassFile { V54(54, 0), // JDK 10 V55(55, 0), // JDK 11: constant dynamic, nest mates V56(56, 0), // JDK 12 - V57(57, 0); // JDK 13 + V57(57, 0), // JDK 13 + V58(58, 0); // JDK 14 Version(int major, int minor) { this.major = major; this.minor = minor; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Profile.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Profile.java index f0c41348705..a81f0262787 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Profile.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Profile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -40,9 +40,9 @@ import static com.sun.tools.javac.main.Option.PROFILE; * deletion without notice. */ public enum Profile { - COMPACT1("compact1", 1, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13), - COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13), - COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13), + COMPACT1("compact1", 1, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13, Target.JDK1_14), + COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13, Target.JDK1_14), + COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13, Target.JDK1_14), DEFAULT { @Override diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java index c5bd79811c4..1edaee79853 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -73,7 +73,10 @@ public enum Target { JDK1_12("12", 56, 0), /** JDK 13. */ - JDK1_13("13", 57, 0); + JDK1_13("13", 57, 0), + + /** JDK 14. */ + JDK1_14("14", 58, 0); private static final Context.Key targetKey = new Context.Key<>(); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java index efe38dcc1f7..3225b46bbc9 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -55,7 +55,7 @@ import com.sun.tools.javac.util.StringUtils; * deletion without notice. */ @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_13) +@SupportedSourceVersion(SourceVersion.RELEASE_14) public class PrintingProcessor extends AbstractProcessor { PrintWriter writer; diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java index a671c6ef9e6..931a1031433 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -49,7 +49,7 @@ public class Classfile { private final List codeAttributes; private static final int MAJOR_VERSION_JAVA_MIN = 51; // JDK7 - private static final int MAJOR_VERSION_JAVA_MAX = 57; // JDK13 + private static final int MAJOR_VERSION_JAVA_MAX = 58; // JDK14 private static final int MAGIC = 0xCAFEBABE; /** diff --git a/src/jdk.rmic/share/classes/sun/tools/java/RuntimeConstants.java b/src/jdk.rmic/share/classes/sun/tools/java/RuntimeConstants.java index 1161ef967dd..8da5acc533a 100644 --- a/src/jdk.rmic/share/classes/sun/tools/java/RuntimeConstants.java +++ b/src/jdk.rmic/share/classes/sun/tools/java/RuntimeConstants.java @@ -67,7 +67,7 @@ public interface RuntimeConstants { /* Class File Constants */ int JAVA_MAGIC = 0xcafebabe; int JAVA_MIN_SUPPORTED_VERSION = 45; - int JAVA_MAX_SUPPORTED_VERSION = 57; + int JAVA_MAX_SUPPORTED_VERSION = 58; int JAVA_MAX_SUPPORTED_MINOR_VERSION = 0; int JAVA_MIN_PREVIEW_MAJOR_VERSION = 55; // preview intro'd in JDK 11 int JAVA_PREVIEW_MINOR_VERSION = 0xffff; diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index e0be1f8c372..b055a859f68 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -45,8 +45,6 @@ public class VMDeprecatedOptions { {"MinRAMFraction", "2"}, {"InitialRAMFraction", "64"}, {"TLABStats", "false"}, - {"ThreadLocalHandshakes", "true"}, - {"AllowJNIEnvProxy", "true"}, {"AllowRedefinitionToAddDeleteMethods", "true"}, // deprecated alias flags (see also aliased_jvm_flags): diff --git a/test/jdk/java/lang/module/ClassFileVersionsTest.java b/test/jdk/java/lang/module/ClassFileVersionsTest.java index 7b6e606eaab..795c18741bb 100644 --- a/test/jdk/java/lang/module/ClassFileVersionsTest.java +++ b/test/jdk/java/lang/module/ClassFileVersionsTest.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 @@ -57,6 +57,7 @@ public class ClassFileVersionsTest { { 55, 0, Set.of() }, // JDK 11 { 56, 0, Set.of() }, // JDK 12 { 57, 0, Set.of() }, // JDK 13 + { 58, 0, Set.of() }, // JDK 14 }; } @@ -84,7 +85,11 @@ public class ClassFileVersionsTest { { 57, 0, Set.of(TRANSITIVE) }, { 57, 0, Set.of(STATIC, TRANSITIVE) }, - { 58, 0, Set.of()}, // JDK 14 + { 58, 0, Set.of(STATIC) }, // JDK 14 + { 58, 0, Set.of(TRANSITIVE) }, + { 58, 0, Set.of(STATIC, TRANSITIVE) }, + + { 59, 0, Set.of()}, // JDK 15 }; } diff --git a/test/langtools/tools/javac/api/T6395981.java b/test/langtools/tools/javac/api/T6395981.java index 60c4526dcd9..3aefdf2825e 100644 --- a/test/langtools/tools/javac/api/T6395981.java +++ b/test/langtools/tools/javac/api/T6395981.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -31,7 +31,7 @@ * @run main/fail T6395981 * @run main/fail T6395981 RELEASE_3 RELEASE_5 RELEASE_6 * @run main/fail T6395981 RELEASE_0 RELEASE_1 RELEASE_2 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 - * @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8 RELEASE_9 RELEASE_10 RELEASE_11 RELEASE_12 RELEASE_13 + * @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8 RELEASE_9 RELEASE_10 RELEASE_11 RELEASE_12 RELEASE_13 RELEASE_14 */ import java.util.EnumSet; diff --git a/test/langtools/tools/javac/classfiles/ClassVersionChecker.java b/test/langtools/tools/javac/classfiles/ClassVersionChecker.java index 346441c9e6f..3a81bb2db1f 100644 --- a/test/langtools/tools/javac/classfiles/ClassVersionChecker.java +++ b/test/langtools/tools/javac/classfiles/ClassVersionChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -48,7 +48,8 @@ public class ClassVersionChecker { TEN("10", 54), ELEVEN("11", 55), TWELVE("12", 56), - THIRTEEN("13", 57); + THIRTEEN("13", 57), + FOURTEEN("14", 58); private Version(String release, int classFileVer) { this.release = release; diff --git a/test/langtools/tools/javac/diags/examples/InvalidYield.java b/test/langtools/tools/javac/diags/examples/InvalidYield.java index eebbd591de3..365ecfb92a9 100644 --- a/test/langtools/tools/javac/diags/examples/InvalidYield.java +++ b/test/langtools/tools/javac/diags/examples/InvalidYield.java @@ -22,7 +22,7 @@ */ // key: compiler.err.invalid.yield -// options: --enable-preview --source 13 +// options: --enable-preview --source ${jdk.version} class BreakComplexValueNoSwitchExpressions { void t() { diff --git a/test/langtools/tools/javac/diags/examples/InvalidYieldWarning.java b/test/langtools/tools/javac/diags/examples/InvalidYieldWarning.java index 8b4fead9638..b67c18c84e3 100644 --- a/test/langtools/tools/javac/diags/examples/InvalidYieldWarning.java +++ b/test/langtools/tools/javac/diags/examples/InvalidYieldWarning.java @@ -22,7 +22,7 @@ */ // key: compiler.warn.invalid.yield -// options: --source 13 +// options: --source ${jdk.version} class BreakComplexValueNoSwitchExpressions { void t() { diff --git a/test/langtools/tools/javac/diags/examples/NoSwitchExpression.java b/test/langtools/tools/javac/diags/examples/NoSwitchExpression.java index e2a38ce5873..57105102bdc 100644 --- a/test/langtools/tools/javac/diags/examples/NoSwitchExpression.java +++ b/test/langtools/tools/javac/diags/examples/NoSwitchExpression.java @@ -22,7 +22,7 @@ */ // key: compiler.err.no.switch.expression -// options: --enable-preview --source 13 +// options: --enable-preview --source ${jdk.version} class BreakComplexValueNoSwitchExpressions { void t() { diff --git a/test/langtools/tools/javac/diags/examples/NoSwitchExpressionQualify.java b/test/langtools/tools/javac/diags/examples/NoSwitchExpressionQualify.java index d9b549242a5..75e520f19b7 100644 --- a/test/langtools/tools/javac/diags/examples/NoSwitchExpressionQualify.java +++ b/test/langtools/tools/javac/diags/examples/NoSwitchExpressionQualify.java @@ -22,7 +22,7 @@ */ // key: compiler.err.no.switch.expression.qualify -// options: --enable-preview --source 13 +// options: --enable-preview --source ${jdk.version} class BreakComplexValueNoSwitchExpressions { void t() { diff --git a/test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java b/test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java index 9e28eca5695..f7805c3464b 100644 --- a/test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java +++ b/test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -110,7 +110,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { * corresponding platform visitor type. */ - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static abstract class AbstractAnnotationValueVisitor extends AbstractAnnotationValueVisitor9 { /** @@ -121,7 +121,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { } } - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static abstract class AbstractElementVisitor extends AbstractElementVisitor9 { /** * Constructor for concrete subclasses to call. @@ -131,7 +131,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { } } - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static abstract class AbstractTypeVisitor extends AbstractTypeVisitor9 { /** * Constructor for concrete subclasses to call. @@ -141,7 +141,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { } } - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static class ElementKindVisitor extends ElementKindVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -162,7 +162,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { } } - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static class ElementScanner extends ElementScanner9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -181,7 +181,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { } } - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static class SimpleAnnotationValueVisitor extends SimpleAnnotationValueVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -202,7 +202,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { } } - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static class SimpleElementVisitor extends SimpleElementVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -223,7 +223,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { } } - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static class SimpleTypeVisitor extends SimpleTypeVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -244,7 +244,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { } } - @SupportedSourceVersion(RELEASE_13) + @SupportedSourceVersion(RELEASE_14) public static class TypeKindVisitor extends TypeKindVisitor9 { /** * Constructor for concrete subclasses to call; uses {@code null} diff --git a/test/langtools/tools/javac/preview/classReaderTest/Client.nopreview.out b/test/langtools/tools/javac/preview/classReaderTest/Client.nopreview.out index 05f9b25b304..1807ca32858 100644 --- a/test/langtools/tools/javac/preview/classReaderTest/Client.nopreview.out +++ b/test/langtools/tools/javac/preview/classReaderTest/Client.nopreview.out @@ -1,2 +1,2 @@ -- compiler.err.preview.feature.disabled.classfile: Bar.class, 13 +- compiler.err.preview.feature.disabled.classfile: Bar.class, 14 1 error diff --git a/test/langtools/tools/javac/preview/classReaderTest/Client.preview.out b/test/langtools/tools/javac/preview/classReaderTest/Client.preview.out index d4c86919361..a66c818b6de 100644 --- a/test/langtools/tools/javac/preview/classReaderTest/Client.preview.out +++ b/test/langtools/tools/javac/preview/classReaderTest/Client.preview.out @@ -1,4 +1,4 @@ -- compiler.warn.preview.feature.use.classfile: Bar.class, 13 +- compiler.warn.preview.feature.use.classfile: Bar.class, 14 - compiler.err.warnings.and.werror 1 error 1 warning diff --git a/test/langtools/tools/javac/profiles/ProfileOptionTest.java b/test/langtools/tools/javac/profiles/ProfileOptionTest.java index 67cb0487ce7..79e5e47e30f 100644 --- a/test/langtools/tools/javac/profiles/ProfileOptionTest.java +++ b/test/langtools/tools/javac/profiles/ProfileOptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -152,6 +152,7 @@ public class ProfileOptionTest { case JDK1_11: case JDK1_12: case JDK1_13: + case JDK1_14: if (p == Profile.DEFAULT) break; if (ise == null) diff --git a/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java b/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java index 5aa73a77da8..f716e082b6d 100644 --- a/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java +++ b/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java @@ -25,7 +25,7 @@ * @test * @bug 8223305 * @summary Verify correct warnings w.r.t. yield - * @compile/ref=WarnWrongYieldTest.out -source 13 -XDrawDiagnostics -XDshould-stop.at=ATTR WarnWrongYieldTest.java + * @compile/ref=WarnWrongYieldTest.out -source ${jdk.version} -XDrawDiagnostics -XDshould-stop.at=ATTR WarnWrongYieldTest.java */ package t; diff --git a/test/langtools/tools/javac/versions/Versions.java b/test/langtools/tools/javac/versions/Versions.java index c95e5c6d256..e8b7d0c1b9e 100644 --- a/test/langtools/tools/javac/versions/Versions.java +++ b/test/langtools/tools/javac/versions/Versions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -69,9 +69,9 @@ public class Versions { Set.of("1.2", "1.3", "1.4", "1.5", "1.6"); public static final Set VALID_SOURCES = - Set.of("1.7", "1.8", "1.9", "1.10", "11", "12", "13"); + Set.of("1.7", "1.8", "1.9", "1.10", "11", "12", "13", "14"); - public static final String LATEST_MAJOR_VERSION = "57.0"; + public static final String LATEST_MAJOR_VERSION = "58.0"; static enum SourceTarget { SEVEN(true, "51.0", "7", Versions::checksrc17), @@ -80,7 +80,8 @@ public class Versions { TEN(true, "54.0", "10", Versions::checksrc110), ELEVEN(false, "55.0", "11", Versions::checksrc111), TWELVE(false, "56.0", "12", Versions::checksrc112), - THIRTEEN(false, "57.0", "13", Versions::checksrc113); + THIRTEEN(false, "57.0", "13", Versions::checksrc113), + FOURTEEN(false, "58.0", "14", Versions::checksrc114); private final boolean dotOne; private final String classFileVer; @@ -299,6 +300,11 @@ public class Versions { checksrc111(args); } + protected void checksrc114(String... args) { + printargs("checksrc114", args); + checksrc111(args); + } + protected void pass(String... args) { printargs("pass", args); From 65a2f12843c55512a623c3eb81da3aabed181302 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Tue, 11 Jun 2019 17:15:25 -0700 Subject: [PATCH 040/109] 8225487: giflib legal file is missing attribution for openbsd-reallocarray.c Reviewed-by: serb, kcr --- src/java.desktop/share/legal/giflib.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/java.desktop/share/legal/giflib.md b/src/java.desktop/share/legal/giflib.md index 0e97b6cee2d..e5ba9dbe7fc 100644 --- a/src/java.desktop/share/legal/giflib.md +++ b/src/java.desktop/share/legal/giflib.md @@ -1,7 +1,7 @@ ## GIFLIB v5.1.8 ### GIFLIB License -

    +```
     
     The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
     
    @@ -17,10 +17,27 @@ all copies or substantial portions of the Software.
     
     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     THE SOFTWARE.
     
    -
    + +https://sourceforge.net/p/giflib/code/ci/master/tree/openbsd-reallocarray.c + +Copyright (c) 2008 Otto Moerbeek + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +``` From d3dd56d3b2b1f4b824c3ed65f14f8f3e607c311a Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 11 Jun 2019 17:20:51 -0700 Subject: [PATCH 041/109] 7086604: (reflect) Clarifications to javadoc for getGeneric*Type methods in j.l.r Reviewed-by: lancea, abuckley --- src/java.base/share/classes/java/lang/Class.java | 4 ++-- .../share/classes/java/lang/reflect/Executable.java | 2 +- src/java.base/share/classes/java/lang/reflect/Field.java | 8 ++++---- src/java.base/share/classes/java/lang/reflect/Method.java | 2 +- .../share/classes/java/lang/reflect/TypeVariable.java | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Class.java b/src/java.base/share/classes/java/lang/Class.java index 351df755b73..df38e6ee29f 100644 --- a/src/java.base/share/classes/java/lang/Class.java +++ b/src/java.base/share/classes/java/lang/Class.java @@ -917,7 +917,7 @@ public final class Class implements java.io.Serializable, * *

    If the superclass is a parameterized type, the {@code Type} * object returned must accurately reflect the actual type - * parameters used in the source code. The parameterized type + * arguments used in the source code. The parameterized type * representing the superclass is created if it had not been * created before. See the declaration of {@link * java.lang.reflect.ParameterizedType ParameterizedType} for the @@ -1097,7 +1097,7 @@ public final class Class implements java.io.Serializable, * *

    If a superinterface is a parameterized type, the * {@code Type} object returned for it must accurately reflect - * the actual type parameters used in the source code. The + * the actual type arguments used in the source code. The * parameterized type representing each superinterface is created * if it had not been created before. See the declaration of * {@link java.lang.reflect.ParameterizedType ParameterizedType} diff --git a/src/java.base/share/classes/java/lang/reflect/Executable.java b/src/java.base/share/classes/java/lang/reflect/Executable.java index 99b0aa04260..95b50e94bc4 100644 --- a/src/java.base/share/classes/java/lang/reflect/Executable.java +++ b/src/java.base/share/classes/java/lang/reflect/Executable.java @@ -266,7 +266,7 @@ public abstract class Executable extends AccessibleObject * *

    If a formal parameter type is a parameterized type, * the {@code Type} object returned for it must accurately reflect - * the actual type parameters used in the source code. + * the actual type arguments used in the source code. * *

    If a formal parameter type is a type variable or a parameterized * type, it is created. Otherwise, it is resolved. diff --git a/src/java.base/share/classes/java/lang/reflect/Field.java b/src/java.base/share/classes/java/lang/reflect/Field.java index a4bed37832a..3223e5c6cb9 100644 --- a/src/java.base/share/classes/java/lang/reflect/Field.java +++ b/src/java.base/share/classes/java/lang/reflect/Field.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -243,9 +243,9 @@ class Field extends AccessibleObject implements Member { * Returns a {@code Type} object that represents the declared type for * the field represented by this {@code Field} object. * - *

    If the {@code Type} is a parameterized type, the - * {@code Type} object returned must accurately reflect the - * actual type parameters used in the source code. + *

    If the declared type of the field is a parameterized type, + * the {@code Type} object returned must accurately reflect the + * actual type arguments used in the source code. * *

    If the type of the underlying field is a type variable or a * parameterized type, it is created. Otherwise, it is resolved. diff --git a/src/java.base/share/classes/java/lang/reflect/Method.java b/src/java.base/share/classes/java/lang/reflect/Method.java index 201a1ae3bc0..7f08142b4aa 100644 --- a/src/java.base/share/classes/java/lang/reflect/Method.java +++ b/src/java.base/share/classes/java/lang/reflect/Method.java @@ -269,7 +269,7 @@ public final class Method extends Executable { * *

    If the return type is a parameterized type, * the {@code Type} object returned must accurately reflect - * the actual type parameters used in the source code. + * the actual type arguments used in the source code. * *

    If the return type is a type variable or a parameterized type, it * is created. Otherwise, it is resolved. diff --git a/src/java.base/share/classes/java/lang/reflect/TypeVariable.java b/src/java.base/share/classes/java/lang/reflect/TypeVariable.java index e2e98ee02a2..6e4b105c3ba 100644 --- a/src/java.base/share/classes/java/lang/reflect/TypeVariable.java +++ b/src/java.base/share/classes/java/lang/reflect/TypeVariable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, 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 @@ -72,7 +72,7 @@ public interface TypeVariable extends Type, Annota /** * Returns the {@code GenericDeclaration} object representing the - * generic declaration declared this type variable. + * generic declaration declared for this type variable. * * @return the generic declaration declared for this type variable. * From 62d7317f860477916a95537f8d82843981e9053b Mon Sep 17 00:00:00 2001 From: Sangheon Kim Date: Wed, 12 Jun 2019 10:34:29 +0200 Subject: [PATCH 042/109] 8225478: Make G1CMRootRegions independent of HeapRegions Remove dependency of HeapRegion from G1CMRootRegions class Reviewed-by: tschatzl, kbarrett --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 2 +- src/hotspot/share/gc/g1/g1ConcurrentMark.cpp | 79 ++++++++++++-------- src/hotspot/share/gc/g1/g1ConcurrentMark.hpp | 34 +++++---- src/hotspot/share/memory/memRegion.hpp | 8 +- 4 files changed, 70 insertions(+), 53 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index e9c480ac8b3..800861f5f41 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -4640,7 +4640,7 @@ void G1CollectedHeap::retire_gc_alloc_region(HeapRegion* alloc_region, bool const during_im = collector_state()->in_initial_mark_gc(); if (during_im && allocated_bytes > 0) { - _cm->root_regions()->add(alloc_region); + _cm->root_regions()->add(alloc_region->next_top_at_mark_start(), alloc_region->top()); } _hr_printer.retire(alloc_region); } diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index eb0824bb633..e7044a826eb 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -257,30 +257,38 @@ void G1CMMarkStack::set_empty() { _free_list = NULL; } -G1CMRootRegions::G1CMRootRegions(uint const max_regions) : - _root_regions(NEW_C_HEAP_ARRAY(HeapRegion*, max_regions, mtGC)), - _max_regions(max_regions), - _num_root_regions(0), - _claimed_root_regions(0), - _scan_in_progress(false), - _should_abort(false) { } - -G1CMRootRegions::~G1CMRootRegions() { - FREE_C_HEAP_ARRAY(HeapRegion*, _max_regions); +G1CMRootMemRegions::G1CMRootMemRegions(uint const max_regions) : + _root_regions(NULL), + _max_regions(max_regions), + _num_root_regions(0), + _claimed_root_regions(0), + _scan_in_progress(false), + _should_abort(false) { + _root_regions = new MemRegion[_max_regions]; + if (_root_regions == NULL) { + vm_exit_during_initialization("Could not allocate root MemRegion set."); + } } -void G1CMRootRegions::reset() { +G1CMRootMemRegions::~G1CMRootMemRegions() { + delete[] _root_regions; +} + +void G1CMRootMemRegions::reset() { _num_root_regions = 0; } -void G1CMRootRegions::add(HeapRegion* hr) { +void G1CMRootMemRegions::add(HeapWord* start, HeapWord* end) { assert_at_safepoint(); size_t idx = Atomic::add((size_t)1, &_num_root_regions) - 1; - assert(idx < _max_regions, "Trying to add more root regions than there is space " SIZE_FORMAT, _max_regions); - _root_regions[idx] = hr; + assert(idx < _max_regions, "Trying to add more root MemRegions than there is space " SIZE_FORMAT, _max_regions); + assert(start != NULL && end != NULL && start <= end, "Start (" PTR_FORMAT ") should be less or equal to " + "end (" PTR_FORMAT ")", p2i(start), p2i(end)); + _root_regions[idx].set_start(start); + _root_regions[idx].set_end(end); } -void G1CMRootRegions::prepare_for_scan() { +void G1CMRootMemRegions::prepare_for_scan() { assert(!scan_in_progress(), "pre-condition"); _scan_in_progress = _num_root_regions > 0; @@ -289,7 +297,7 @@ void G1CMRootRegions::prepare_for_scan() { _should_abort = false; } -HeapRegion* G1CMRootRegions::claim_next() { +const MemRegion* G1CMRootMemRegions::claim_next() { if (_should_abort) { // If someone has set the should_abort flag, we return NULL to // force the caller to bail out of their loop. @@ -302,26 +310,26 @@ HeapRegion* G1CMRootRegions::claim_next() { size_t claimed_index = Atomic::add((size_t)1, &_claimed_root_regions) - 1; if (claimed_index < _num_root_regions) { - return _root_regions[claimed_index]; + return &_root_regions[claimed_index]; } return NULL; } -uint G1CMRootRegions::num_root_regions() const { +uint G1CMRootMemRegions::num_root_regions() const { return (uint)_num_root_regions; } -void G1CMRootRegions::notify_scan_done() { +void G1CMRootMemRegions::notify_scan_done() { MutexLocker x(RootRegionScan_lock, Mutex::_no_safepoint_check_flag); _scan_in_progress = false; RootRegionScan_lock->notify_all(); } -void G1CMRootRegions::cancel_scan() { +void G1CMRootMemRegions::cancel_scan() { notify_scan_done(); } -void G1CMRootRegions::scan_finished() { +void G1CMRootMemRegions::scan_finished() { assert(scan_in_progress(), "pre-condition"); if (!_should_abort) { @@ -333,7 +341,7 @@ void G1CMRootRegions::scan_finished() { notify_scan_done(); } -bool G1CMRootRegions::wait_until_scan_finished() { +bool G1CMRootMemRegions::wait_until_scan_finished() { if (!scan_in_progress()) { return false; } @@ -875,14 +883,21 @@ uint G1ConcurrentMark::calc_active_marking_workers() { return result; } -void G1ConcurrentMark::scan_root_region(HeapRegion* hr, uint worker_id) { - assert(hr->is_old() || (hr->is_survivor() && hr->next_top_at_mark_start() == hr->bottom()), - "Root regions must be old or survivor but region %u is %s", hr->hrm_index(), hr->get_type_str()); +void G1ConcurrentMark::scan_root_region(const MemRegion* region, uint worker_id) { +#ifdef ASSERT + HeapWord* last = region->last(); + HeapRegion* hr = _g1h->heap_region_containing(last); + assert(hr->is_old() || hr->next_top_at_mark_start() == hr->bottom(), + "Root regions must be old or survivor/eden but region %u is %s", hr->hrm_index(), hr->get_type_str()); + assert(hr->next_top_at_mark_start() == region->start(), + "MemRegion start should be equal to nTAMS"); +#endif + G1RootRegionScanClosure cl(_g1h, this, worker_id); const uintx interval = PrefetchScanIntervalInBytes; - HeapWord* curr = hr->next_top_at_mark_start(); - const HeapWord* end = hr->top(); + HeapWord* curr = region->start(); + const HeapWord* end = region->end(); while (curr < end) { Prefetch::read(curr, interval); oop obj = oop(curr); @@ -902,11 +917,11 @@ public: assert(Thread::current()->is_ConcurrentGC_thread(), "this should only be done by a conc GC thread"); - G1CMRootRegions* root_regions = _cm->root_regions(); - HeapRegion* hr = root_regions->claim_next(); - while (hr != NULL) { - _cm->scan_root_region(hr, worker_id); - hr = root_regions->claim_next(); + G1CMRootMemRegions* root_regions = _cm->root_regions(); + const MemRegion* region = root_regions->claim_next(); + while (region != NULL) { + _cm->scan_root_region(region, worker_id); + region = root_regions->claim_next(); } } }; diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp index 62079af67df..8454622ae24 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp @@ -222,18 +222,20 @@ private: template void iterate(Fn fn) const PRODUCT_RETURN; }; -// Root Regions are regions that contain objects from nTAMS to top. These are roots -// for marking, i.e. their referenced objects must be kept alive to maintain the +// Root MemRegions are memory areas that contain objects which references are +// roots wrt to the marking. They must be scanned before marking to maintain the // SATB invariant. -// We could scan and mark them through during the initial-mark pause, but for +// Typically they contain the areas from nTAMS to top of the regions. +// We could scan and mark through these objects during the initial-mark pause, but for // pause time reasons we move this work to the concurrent phase. // We need to complete this procedure before the next GC because it might determine // that some of these "root objects" are dead, potentially dropping some required // references. -// Root regions comprise of the complete contents of survivor regions, and any -// objects copied into old gen during GC. -class G1CMRootRegions { - HeapRegion** _root_regions; +// Root MemRegions comprise of the contents of survivor regions at the end +// of the GC, and any objects copied into the old gen during GC. +class G1CMRootMemRegions { + // The set of root MemRegions. + MemRegion* _root_regions; size_t const _max_regions; volatile size_t _num_root_regions; // Actual number of root regions. @@ -246,13 +248,13 @@ class G1CMRootRegions { void notify_scan_done(); public: - G1CMRootRegions(uint const max_regions); - ~G1CMRootRegions(); + G1CMRootMemRegions(uint const max_regions); + ~G1CMRootMemRegions(); // Reset the data structure to allow addition of new root regions. void reset(); - void add(HeapRegion* hr); + void add(HeapWord* start, HeapWord* end); // Reset the claiming / scanning of the root regions. void prepare_for_scan(); @@ -264,9 +266,9 @@ public: // false otherwise. bool scan_in_progress() { return _scan_in_progress; } - // Claim the next root region to scan atomically, or return NULL if + // Claim the next root MemRegion to scan atomically, or return NULL if // all have been claimed. - HeapRegion* claim_next(); + const MemRegion* claim_next(); // The number of root regions to scan. uint num_root_regions() const; @@ -310,7 +312,7 @@ class G1ConcurrentMark : public CHeapObj { MemRegion const _heap; // Root region tracking and claiming - G1CMRootRegions _root_regions; + G1CMRootMemRegions _root_regions; // For grey objects G1CMMarkStack _global_mark_stack; // Grey objects behind global finger @@ -501,7 +503,7 @@ public: size_t partial_mark_stack_size_target() const { return _global_mark_stack.capacity() / 3; } bool mark_stack_empty() const { return _global_mark_stack.is_empty(); } - G1CMRootRegions* root_regions() { return &_root_regions; } + G1CMRootMemRegions* root_regions() { return &_root_regions; } void concurrent_cycle_start(); // Abandon current marking iteration due to a Full GC. @@ -554,8 +556,8 @@ public: // them. void scan_root_regions(); - // Scan a single root region from nTAMS to top and mark everything reachable from it. - void scan_root_region(HeapRegion* hr, uint worker_id); + // Scan a single root MemRegion to mark everything reachable from it. + void scan_root_region(const MemRegion* region, uint worker_id); // Do concurrent phase of marking, to a tentative transitive closure. void mark_from_roots(); diff --git a/src/hotspot/share/memory/memRegion.hpp b/src/hotspot/share/memory/memRegion.hpp index 1e79a545e4f..d1268caea0a 100644 --- a/src/hotspot/share/memory/memRegion.hpp +++ b/src/hotspot/share/memory/memRegion.hpp @@ -32,13 +32,13 @@ // A very simple data structure representing a contigous region // region of address space. -// Note that MemRegions are passed by value, not by reference. +// Note that MemRegions are typically passed by value, not by reference. // The intent is that they remain very small and contain no // objects. The copy constructor and destructor must be trivial, // to support optimization for pass-by-value. -// These should never be allocated in heap but we do -// create MemRegions (in CardTableBarrierSet) in heap so operator -// new and operator new [] added for this special case. +// These should almost never be allocated in heap but we do +// create MemRegions (in CardTable and G1CMRootMemRegions) on the heap so operator +// new and operator new [] were added for these special cases. class MemRegion { friend class VMStructs; From 0d8209a2b74dcc2ebbbf43ff0b85273f2aecedee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 12 Jun 2019 13:21:25 +0200 Subject: [PATCH 043/109] 8223364: Bad placement of anchor relative to header Reviewed-by: jjg --- .../html/AnnotationTypeFieldWriterImpl.java | 6 +- ...nnotationTypeRequiredMemberWriterImpl.java | 8 +-- .../formats/html/ConstructorWriterImpl.java | 10 ++-- .../formats/html/EnumConstantWriterImpl.java | 6 +- .../doclets/formats/html/FieldWriterImpl.java | 5 +- .../formats/html/MethodWriterImpl.java | 9 ++- .../formats/html/PropertyWriterImpl.java | 6 +- .../doclets/formats/html/markup/Links.java | 2 +- .../doclets/toolkit/resources/stylesheet.css | 3 +- .../TestAnnotationTypes.java | 12 +--- .../jdk/javadoc/doclet/testHref/TestHref.java | 8 +-- .../testHtmlVersion/TestHtmlVersion.java | 54 +++++++++--------- .../doclet/testInterface/TestInterface.java | 10 +--- .../javadoc/doclet/testJavaFX/TestJavaFX.java | 54 ++++-------------- .../testMemberSummary/TestMemberSummary.java | 4 +- .../doclet/testOptions/TestOptions.java | 10 +--- .../doclet/testOrdering/TestOrdering.java | 56 +++++++++---------- .../TestBadOverride.java | 5 +- .../doclet/testSummaryTag/TestSummaryTag.java | 5 +- .../testTypeParams/TestTypeParameters.java | 4 +- 20 files changed, 106 insertions(+), 171 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java index f05d4ba5e6b..b61e11a2d3c 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java @@ -33,6 +33,7 @@ import javax.lang.model.type.TypeMirror; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; +import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.formats.html.markup.Table; import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeFieldWriter; @@ -104,9 +105,9 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter if (!writer.printedAnnotationFieldHeading) { Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, contents.fieldDetailsLabel); - memberDetailsTree.add(heading); memberDetailsTree.add(links.createAnchor( SectionName.ANNOTATION_TYPE_FIELD_DETAIL)); + memberDetailsTree.add(heading); writer.printedAnnotationFieldHeading = true; } return memberDetailsTree; @@ -119,9 +120,8 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter Content annotationDetailsTree) { Content annotationDocTree = new ContentBuilder(); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); - heading.add(name(member)); + heading.add(links.createAnchor(name(member), new StringContent(name(member)))); annotationDocTree.add(heading); - annotationDocTree.add(links.createAnchor(name(member))); return HtmlTree.SECTION(HtmlStyle.detail, annotationDocTree); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java index 52067767b09..50d3f7f40ae 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java @@ -33,6 +33,7 @@ import javax.lang.model.type.TypeMirror; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; +import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.formats.html.markup.Table; import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter; @@ -106,9 +107,9 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter if (!writer.printedAnnotationHeading) { Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, contents.annotationTypeDetailsLabel); - memberDetailsTree.add(heading); memberDetailsTree.add(links.createAnchor( SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL)); + memberDetailsTree.add(heading); writer.printedAnnotationHeading = true; } return memberDetailsTree; @@ -122,10 +123,9 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter String simpleName = name(member); Content annotationDocTree = new ContentBuilder(); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); - heading.add(simpleName); + heading.add(links.createAnchor( + simpleName + utils.signature((ExecutableElement) member), new StringContent(simpleName))); annotationDocTree.add(heading); - annotationDocTree.add(links.createAnchor( - simpleName + utils.signature((ExecutableElement) member))); return HtmlTree.SECTION(HtmlStyle.detail, annotationDocTree); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java index f88962e924a..1e9a262f69a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java @@ -37,6 +37,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.Entity; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; +import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.formats.html.markup.Table; import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; import jdk.javadoc.internal.doclets.toolkit.ConstructorWriter; @@ -122,9 +123,9 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter Content constructorDetailsTree = new ContentBuilder(); Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, contents.constructorDetailsLabel); - constructorDetailsTree.add(heading); constructorDetailsTree.add(links.createAnchor( SectionName.CONSTRUCTOR_DETAIL)); + constructorDetailsTree.add(heading); return constructorDetailsTree; } @@ -137,12 +138,11 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter String erasureAnchor; Content constructorDocTree = new ContentBuilder(); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); - heading.add(name(constructor)); - constructorDocTree.add(heading); if ((erasureAnchor = getErasureAnchor(constructor)) != null) { - constructorDocTree.add(links.createAnchor((erasureAnchor))); + heading.add(links.createAnchor((erasureAnchor))); } - constructorDocTree.add(links.createAnchor(writer.getAnchor(constructor))); + heading.add(links.createAnchor(writer.getAnchor(constructor), new StringContent(name(constructor)))); + constructorDocTree.add(heading); return HtmlTree.SECTION(HtmlStyle.detail, constructorDocTree); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java index b9af9c62644..ce222bb9aa9 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java @@ -33,6 +33,7 @@ import javax.lang.model.element.VariableElement; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; +import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.formats.html.markup.Table; import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; import jdk.javadoc.internal.doclets.toolkit.Content; @@ -91,9 +92,9 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter Content enumConstantsDetailsTree = new ContentBuilder(); Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, contents.enumConstantDetailLabel); - enumConstantsDetailsTree.add(heading); enumConstantsDetailsTree.add(links.createAnchor( SectionName.ENUM_CONSTANT_DETAIL)); + enumConstantsDetailsTree.add(heading); return enumConstantsDetailsTree; } @@ -105,9 +106,8 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter Content enumConstantsDetailsTree) { Content enumConstantsTree = new ContentBuilder(); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); - heading.add(name(enumConstant)); + heading.add(links.createAnchor(name(enumConstant), new StringContent(name(enumConstant)))); enumConstantsTree.add(heading); - enumConstantsTree.add(links.createAnchor(name(enumConstant))); return HtmlTree.SECTION(HtmlStyle.detail, enumConstantsTree); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java index 0e1db2fb686..ad78c02a4d0 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java @@ -96,9 +96,9 @@ public class FieldWriterImpl extends AbstractMemberWriter Content fieldDetailsTree = new ContentBuilder(); Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, contents.fieldDetailsLabel); - fieldDetailsTree.add(heading); fieldDetailsTree.add(links.createAnchor( SectionName.FIELD_DETAIL)); + fieldDetailsTree.add(heading); return fieldDetailsTree; } @@ -109,9 +109,8 @@ public class FieldWriterImpl extends AbstractMemberWriter public Content getFieldDocTreeHeader(VariableElement field, Content fieldDetailsTree) { Content fieldTree = new ContentBuilder(); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); - heading.add(name(field)); + heading.add(links.createAnchor(name(field), new StringContent(name(field)))); fieldTree.add(heading); - fieldTree.add(links.createAnchor(name(field))); return HtmlTree.SECTION(HtmlStyle.detail, fieldTree); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java index 6cbf6a37a3f..fe2b0f02439 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java @@ -109,8 +109,8 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter Content methodDetailsTree = new ContentBuilder(); Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, contents.methodDetailLabel); - methodDetailsTree.add(heading); methodDetailsTree.add(links.createAnchor(SectionName.METHOD_DETAIL)); + methodDetailsTree.add(heading); return methodDetailsTree; } @@ -122,12 +122,11 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter String erasureAnchor; Content methodDocTree = new ContentBuilder(); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); - heading.add(name(method)); - methodDocTree.add(heading); if ((erasureAnchor = getErasureAnchor(method)) != null) { - methodDocTree.add(links.createAnchor((erasureAnchor))); + heading.add(links.createAnchor((erasureAnchor))); } - methodDocTree.add(links.createAnchor(writer.getAnchor(method))); + heading.add(links.createAnchor(writer.getAnchor(method), new StringContent(name(method)))); + methodDocTree.add(heading); return HtmlTree.SECTION(HtmlStyle.detail, methodDocTree); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java index 2b66346f9a4..43547bfc00e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java @@ -89,8 +89,8 @@ public class PropertyWriterImpl extends AbstractMemberWriter Content propertyDetailsTree = new ContentBuilder(); Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, contents.propertyDetailsLabel); - propertyDetailsTree.add(heading); propertyDetailsTree.add(links.createAnchor(SectionName.PROPERTY_DETAIL)); + propertyDetailsTree.add(heading); return propertyDetailsTree; } @@ -102,9 +102,9 @@ public class PropertyWriterImpl extends AbstractMemberWriter Content propertyDetailsTree) { Content propertyDocTree = new ContentBuilder(); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); - heading.add(utils.getPropertyLabel(name(property))); + heading.add(links.createAnchor(name(property), + new StringContent(utils.getPropertyLabel(name(property))))); propertyDocTree.add(heading); - propertyDocTree.add(links.createAnchor(name(property))); return HtmlTree.SECTION(HtmlStyle.detail, propertyDocTree); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java index cf2876e95c1..f9eb9ee749f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java @@ -100,7 +100,7 @@ public class Links { * @return a content tree for the marker anchor */ public Content createAnchor(String name, Content content) { - return HtmlTree.A_ID(name, (content == null ? EMPTY_COMMENT : content)); + return HtmlTree.A_ID(getName(name), (content == null ? EMPTY_COMMENT : content)); } private static final Content EMPTY_COMMENT = new Comment(" "); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index 19d8acc3de4..9681235b9e5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -574,8 +574,7 @@ td.colLast a { div.memberSignature { font-family:'DejaVu Sans Mono', monospace; font-size:14px; - margin-top:6px; - margin-bottom:14px; + margin:14px 0; white-space: pre-wrap; } div.memberSignature span.annotations { diff --git a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java index 5c5ea97a115..15ea74d4aa2 100644 --- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java +++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4973609 8015249 8025633 8026567 6469561 8071982 8162363 8182765 + * @bug 4973609 8015249 8025633 8026567 6469561 8071982 8162363 8182765 8223364 * @summary Make sure that annotation types with 0 members does not have * extra HR tags. * @author jamieh @@ -61,10 +61,7 @@ public class TestAnnotationTypes extends JavadocTester { "DEFAULT_NAME" + "", "", - "

    DEFAULT_NAME

    \n" - + "\n" - + "\n" - + "\n" + "

    DEFAULT_NAME

    \n" + "
    static final " + "java.lang.String " + "DEFAULT_NAME
    \n"); @@ -87,10 +84,7 @@ public class TestAnnotationTypes extends JavadocTester { "