Skip to content

Commit c6710c1

Browse files
committed
GR-69858: Architectural, functional spec, and test cleanup
1 parent 29685d8 commit c6710c1

8 files changed

Lines changed: 26 additions & 24 deletions

File tree

substratevm/docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ Consulting the CI configurations in ci/ci.jsonnet may help understand how `mx ga
4747
## Security Providers
4848

4949
- [JCA Security Provider Inclusion](functional-spec/security-providers.md): required provider inclusion and run-time behavior.
50-
- [§AR-002-security-providers](../src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java):
50+
- [§AR-001-security-providers](../src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java):
5151
provider inclusion, verification, and metadata tracing.

substratevm/docs/architecture/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
This directory contains developer-facing architecture records for Native Image.
44

5-
- [§AR-002-security-providers](../../src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java):
5+
- [§AR-001-security-providers](../../src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java):
66
provider inclusion, verification, and metadata tracing.

substratevm/docs/functional-spec/security-providers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ initialization, and an application can instead install an existing instance with
5959
[§7](#7-transition-to-the-future-defaults) defines the future-default options that select this
6060
behavior during the transition from service-driven provider inclusion and build-time provider-list
6161
initialization.
62-
The implementation is described by [§AR-002-security-providers](../../src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java).
62+
The implementation is described by [§AR-001-security-providers](../../src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java).
6363

6464
## 1. Notation
6565

@@ -334,7 +334,7 @@ Instantiation reachability records successful verification for an application-su
334334
provider class independently of any configured-list instance of the same class. In particular, a
335335
verification failure for an omitted configured instance does not prevent provider-object use of an
336336
application-created instance.
337-
The implementation-specific recognition rule is §AR-002-security-providers.3.
337+
The implementation-specific recognition rule is §AR-001-security-providers.3.
338338

339339
## 6. Tracing Metadata
340340

@@ -564,7 +564,7 @@ condition.
564564
### 8.9 Architecture Obligations
565565

566566
The following requirements apply universally to the implementation.
567-
[§AR-002-security-providers](../../src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java) names the structures that enforce
567+
[§AR-001-security-providers](../../src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java) names the structures that enforce
568568
them.
569569

570570
#### 8.9.1 Closure of Registration Signals

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecurityProviderRuntimeAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public final class SecurityProviderRuntimeAccess {
4343
private SecurityProviderRuntimeAccess() {
4444
}
4545

46-
// §AR-002-security-providers.2
46+
// §AR-001-security-providers.2
4747
/** Apply the single JDK-acquisition filter to hosted or run-time eligibility state. */
4848
public static boolean passesJdkAcquisitionFilter(boolean eligible) {
4949
return eligible;

substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompilationFeature.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,9 @@ public void duringSetup(DuringSetupAccess c) {
418418
if (SubstrateOptions.useLLVMBackend()) {
419419
throw UserError.abort("Runtime compilation is currently unimplemented on the LLVM backend (GR-43073).");
420420
}
421-
/*
422-
* Runtime randomness seeds constant blinding and code-offset randomization. Register it
423-
* only with its runtime-compilation consumer so ordinary executables do not retain JCA
424-
* security providers. §FS-002-security-providers.2.4
425-
*/
421+
/* Runtime randomness seeds constant blinding and code-offset randomization. Register it
422+
* only with runtime compilation so ordinary executables do not retain JCA providers.
423+
* §FS-002-security-providers.2.4 */
426424
if (ImageLayerBuildingSupport.firstImageBuild() && !ImageSingletons.contains(RuntimeRandomness.class)) {
427425
ImageSingletons.add(RuntimeRandomness.class, new RuntimeRandomnessSupport());
428426
}

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jca/SecurityServicesFeature.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
import sun.security.provider.NativePRNG;
139139
import sun.security.x509.OIDMap;
140140

141-
/// AR-002-security-providers: Security Provider Architecture
141+
/// AR-001-security-providers: Security Provider Architecture
142142
///
143143
/// The feature records at image build time which security providers the JDK may construct, which
144144
/// provider services reflection may instantiate, and which application-created providers JCE may
@@ -152,14 +152,18 @@
152152
/// instantiated Provider subtype -----> application-provider verification only
153153
/// ```
154154
///
155-
/// The registration planner interprets reflection and instantiation signals. The catalog registrar
156-
/// then records provider construction, retained services, and verification results in the layered
157-
/// run-time manifest. Legacy service-driven inclusion bypasses the planner and retains only the
158-
/// reached service type and its provider.
155+
/// At image build time, {@link SecurityServicesFeature#providerRegistrationPlan} interprets
156+
/// reflection metadata, and {@link SecurityProviderRegistrationPlanner#processNewProviders}
157+
/// combines it with instantiation signals. Complete plans go to
158+
/// {@link SecurityProviderCatalogRegistrar#includeProviderClass}; verification-only plans go to
159+
/// {@link SecurityProviderCatalogRegistrar#registerApplicationSuppliedProviderClass}. Legacy
160+
/// {@link SecurityServicesFeature#registerService} inclusion bypasses the planner and goes directly
161+
/// to {@link SecurityProviderCatalogRegistrar#includeProviderForLegacyService}.
159162
///
160-
/// At run time, JDK-managed provider construction consults the manifest through the acquisition
161-
/// filter. An application-supplied provider object consults the same manifest only for JCE
162-
/// verification; supplying an existing instance does not require reflective provider construction.
163+
/// At run time, {@link SecurityProviderRuntimeAccess#isJdkAcquirable} gates JDK-managed provider
164+
/// construction. Application-supplied provider objects instead use
165+
/// {@link com.oracle.svm.core.jdk.JceProviderVerificationSupport#getVerificationResult
166+
/// getVerificationResult} for JCE verification; they do not require reflective construction.
163167
/// This architecture implements §FS-002-security-providers.
164168
///
165169
/// ## 1. Supported Transition Modes

substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/services/SecurityProviderAnalysisArchitectureTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import com.oracle.svm.core.jdk.SecurityProviderRuntimeState;
3737

3838
public class SecurityProviderAnalysisArchitectureTest {
39-
/** Tests §AR-002-security-providers.3 and §AR-002-security-providers.4. */
39+
/** Tests §AR-001-security-providers.3 and §AR-001-security-providers.4. */
4040
@Test
4141
public void typeMetadataCreatesApplicationSuppliedVerificationState() throws Exception {
4242
Assume.assumeTrue("native image runtime only", ImageInfo.inImageRuntimeCode());
@@ -49,7 +49,7 @@ public void typeMetadataCreatesApplicationSuppliedVerificationState() throws Exc
4949
Assert.assertNotNull(Mac.getInstance("type-metadata-mac", provider));
5050
}
5151

52-
/** Tests §AR-002-security-providers.4 manifest merge semantics. */
52+
/** Tests §AR-001-security-providers.4 manifest merge semantics. */
5353
@Test
5454
public void failedBuildTimeVerificationIsNotOverwritten() {
5555
Assume.assumeTrue("native image runtime only", ImageInfo.inImageRuntimeCode());
@@ -62,14 +62,14 @@ public void failedBuildTimeVerificationIsNotOverwritten() {
6262
Assert.assertThrows(SecurityException.class, () -> Mac.getInstance("failed-verification-mac", provider));
6363
}
6464

65-
/** Tests §AR-002-security-providers.3 without granting JDK construction eligibility. */
65+
/** Tests §AR-001-security-providers.3 without granting JDK construction eligibility. */
6666
@Test
6767
public void instantiatedProviderWithoutMetadataIsValidationOnly() {
6868
Assume.assumeTrue("native image runtime only", ImageInfo.inImageRuntimeCode());
6969
assertApplicationSuppliedProviderWasValidated(new SecurityServiceTest.ReachableProviderWithoutMetadata());
7070
}
7171

72-
/** §AR-002-security-providers.3: An image-heap provider instance is validated. */
72+
/** §AR-001-security-providers.3: An image-heap provider instance is validated. */
7373
@Test
7474
public void imageHeapProviderWithoutMetadataIsValidated() {
7575
Assume.assumeTrue("native image runtime only", ImageInfo.inImageRuntimeCode());

substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/services/SecurityProviderExplicitRegistrationArchitectureTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
public class SecurityProviderExplicitRegistrationArchitectureTest {
4242
private static final String REGISTERED_PROVIDER_NAME = "reflection-metadata-provider";
4343

44-
/** Tests §AR-002-security-providers.3 and §AR-002-security-providers.4. */
44+
/** Tests §AR-001-security-providers.3 and §AR-001-security-providers.4. */
4545
@Test
4646
public void instantiatedProvidersHaveClassKeyedAcquisitionKinds() {
4747
Assume.assumeTrue("native image runtime only", ImageInfo.inImageRuntimeCode());

0 commit comments

Comments
 (0)