Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion make/test/BuildTestLib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ $(eval $(call SetupJavaCompilation, BUILD_WB_JAR, \

TARGETS += $(BUILD_WB_JAR)

ifeq ($(call isTargetOs, linux), false)
BUILD_TEST_LIB_JAR_EXCLUDES := jdk/test/lib/containers
endif

$(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
SRC := $(TEST_LIB_SOURCE_DIR), \
EXCLUDES := jdk/test/lib/containers jdk/test/lib/security, \
EXCLUDES := $(BUILD_TEST_LIB_JAR_EXCLUDES), \
BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \
HEADERS := $(TEST_LIB_SUPPORT)/test-lib_headers, \
JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \
Expand All @@ -69,6 +73,10 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
--add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED \
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
--add-exports java.base/jdk.internal.platform=ALL-UNNAMED \
--add-exports java.base/sun.security.pkcs=ALL-UNNAMED \
--add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED \
--add-exports java.base/sun.security.x509=ALL-UNNAMED \
--enable-preview, \
))

Expand Down
6 changes: 4 additions & 2 deletions test/lib/jdk/test/lib/security/CertUtils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -21,7 +21,7 @@
* questions.
*/

/**
/*
*
* @author Sean Mullan
* @author Steve Hanna
Expand Down Expand Up @@ -645,7 +645,9 @@ private static String readFile(String relativeFilePath,
* This class is useful for overriding one or more methods of an
* X509Certificate for testing purposes.
*/
@SuppressWarnings("deprecation")
public static class ForwardingX509Certificate extends X509Certificate {
private static final long serialVersionUID = -8453912214640985478L;
private final X509Certificate cert;
public ForwardingX509Certificate(X509Certificate cert) {
this.cert = cert;
Expand Down
4 changes: 3 additions & 1 deletion test/lib/jdk/test/lib/security/FixedSecureRandom.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -37,6 +37,8 @@
/// bytes are exhausted.
public class FixedSecureRandom extends SecureRandom {

private static final long serialVersionUID = -8753752741562231543L;

private byte[] buffer;
private int offset;

Expand Down
4 changes: 3 additions & 1 deletion test/lib/jdk/test/lib/security/SeededSecureRandom.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -35,6 +35,8 @@
*/
public class SeededSecureRandom extends SecureRandom {

private static final long serialVersionUID = 4657031557630518194L;

private final Random rnd;

public static long seed() {
Expand Down
3 changes: 2 additions & 1 deletion test/lib/jdk/test/lib/security/XMLUtils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -559,6 +559,7 @@ public KeySelectorResult select(KeyInfo keyInfo,
/**
* Adds a new rule to "jdk.xml.dsig.secureValidationPolicy"
*/
@SuppressWarnings("dangling-doc-comments")
public static void addPolicy(String rule) {
String value = Security.getProperty("jdk.xml.dsig.secureValidationPolicy");
value = rule + "," + value;
Expand Down