-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: [wip] PQC POC 2 #13203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore: [wip] PQC POC 2 #13203
Changes from 1 commit
64be800
7c915c7
f0478ae
408496f
ae47748
a61bd9d
6b8816b
5be6b97
4d9e72c
6bbb7fc
a472a87
2d59672
498bbb2
a50066c
30acb1a
0225fac
5bff2c4
f0e9e46
35606e2
bf1afbe
d536c3d
c38b4c9
99cf802
e290225
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: PQC Connectivity Integration Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| pqc-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
|
|
||
| # 1. Checkout sibling HTTP Client repository (MUST point to your modified fork/branch containing PQC JJSSE fixes) | ||
| - name: Checkout google-http-java-client | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: <your-github-username>/google-http-java-client # UPDATE with your fork | ||
| ref: <your-pqc-branch> # UPDATE with your branch containing PQC JJSSE fixes | ||
| path: google-http-java-client | ||
|
|
||
| # 2. Build and install modified google-http-client SNAPSHOT locally | ||
| - name: Build and Install google-http-java-client | ||
| run: | | ||
| cd google-http-java-client | ||
| mvn clean install -DskipTests=true -Dcheckstyle.skip -Dclirr.skip -Denforcer.skip -Dfmt.skip | ||
|
|
||
| # 3. Checkout this monorepo | ||
| - name: Checkout google-cloud-java-pqc | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| path: google-cloud-java-pqc | ||
|
|
||
| # 4. Build the entire monorepo core components required by the tests | ||
| - name: Build and Install Core Dependency Reactor | ||
| run: | | ||
| cd google-cloud-java-pqc | ||
| mvn clean install -pl sdk-platform-java/pqc-test/pqc-test-snapshot,sdk-platform-java/pqc-test/pqc-test-release -am -T 1.5C -Dcheckstyle.skip -Dclirr.skip -Denforcer.skip -Dfmt.skip -DskipTests=true | ||
|
|
||
| # 5. Run Snapshot PQC Tests (EXPECT PASS) | ||
| - name: Run Snapshot PQC Connectivity Tests (Expect PASS) | ||
| run: | | ||
| cd google-cloud-java-pqc/sdk-platform-java/pqc-test/pqc-test-snapshot | ||
| mvn install -Dcheckstyle.skip -Dclirr.skip -Denforcer.skip -Dfmt.skip -Dtest=RunPqcTest | ||
|
|
||
| # 6. Run Release PQC Tests (EXPECT FAIL) | ||
| - name: Run Release PQC Connectivity Tests (Expect FAIL) | ||
| # We expect this step to fail. If it passes, it means release libraries are negotiating PQC (which is incorrect). | ||
| # Thus we run it and assert that the maven command fails (exit code != 0). | ||
| run: | | ||
| cd google-cloud-java-pqc/sdk-platform-java/pqc-test/pqc-test-release | ||
| if mvn install -Dcheckstyle.skip -Dclirr.skip -Denforcer.skip -Dfmt.skip -Dtest=RunPqcTest; then | ||
| echo "Error: Release tests passed but they were expected to fail!" | ||
| exit 1 | ||
| else | ||
| echo "Success: Release tests failed-fast as expected." | ||
| exit 0 | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| </parent> | ||
|
|
||
| <properties> | ||
| <bouncycastle.version>1.80</bouncycastle.version> | ||
| <skipUnitTests>false</skipUnitTests> | ||
| <checkstyle.header.file>java.header</checkstyle.header.file> | ||
| <maven.compiler.release>8</maven.compiler.release> | ||
|
|
@@ -27,7 +28,7 @@ | |
| consistent across modules in this repository --> | ||
| <javax.annotation-api.version>1.3.2</javax.annotation-api.version> | ||
| <grpc.version>1.81.0</grpc.version> | ||
| <google.http-client.version>2.1.0</google.http-client.version> | ||
| <google.http-client.version>2.1.1-SNAPSHOT</google.http-client.version> | ||
|
diegomarquezp marked this conversation as resolved.
Outdated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating |
||
| <gson.version>2.13.2</gson.version> | ||
| <guava.version>33.5.0-jre</guava.version> | ||
| <protobuf.version>4.33.2</protobuf.version> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,8 @@ | |
| import com.google.auth.mtls.DefaultMtlsProviderFactory; | ||
| import com.google.auth.mtls.MtlsProvider; | ||
| import com.google.common.annotations.VisibleForTesting; | ||
| import javax.net.ssl.SSLContext; | ||
| import java.security.NoSuchAlgorithmException; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| import java.io.IOException; | ||
| import java.security.GeneralSecurityException; | ||
| import java.security.KeyStore; | ||
|
|
@@ -185,16 +187,26 @@ public TransportChannelProvider withCredentials(Credentials credentials) { | |
| } | ||
|
|
||
| HttpTransport createHttpTransport() throws IOException, GeneralSecurityException { | ||
| if (mtlsProvider == null) { | ||
| return null; | ||
| } | ||
| if (certificateBasedAccess.useMtlsClientCertificate()) { | ||
| // 1. Get the scope-specific PQC-hardened SSLContext utilizing Bouncy Castle. | ||
| SSLContext sslContext = com.google.api.client.util.SslUtils.getTlsSslContext(); | ||
|
|
||
| // 2. Initialize the NetHttpTransport builder pre-configured with our PQC SSL context. | ||
| NetHttpTransport.Builder builder = new NetHttpTransport.Builder() | ||
| .setSslSocketFactory(sslContext.getSocketFactory()); | ||
|
|
||
| // 3. Verify if mTLS is supported and explicitly requested in the current client session. | ||
| if (mtlsProvider != null && certificateBasedAccess.useMtlsClientCertificate()) { | ||
| // 4. Retrieve the mutual TLS client key store from the session-specific mtlsProvider. | ||
| KeyStore mtlsKeyStore = mtlsProvider.getKeyStore(); | ||
| // 5. Ensure key store is valid before configuring mutual TLS client certificates. | ||
| if (mtlsKeyStore != null) { | ||
| return new NetHttpTransport.Builder().trustCertificates(null, mtlsKeyStore, "").build(); | ||
| // 6. Configure the mutual TLS certificates while preserving the PQC SSL context. | ||
| builder.trustCertificates(null, mtlsKeyStore, ""); | ||
| } | ||
| } | ||
| return null; | ||
|
|
||
| // 7. Return the compiled and PQC-hardened NetHttpTransport instance. | ||
| return builder.build(); | ||
|
diegomarquezp marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| private HttpJsonTransportChannel createChannel() throws IOException, GeneralSecurityException { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>com.google.api</groupId> | ||
| <artifactId>gapic-generator-java-pom-parent</artifactId> | ||
| <version>2.73.0-SNAPSHOT</version> | ||
| <relativePath>../gapic-generator-java-pom-parent</relativePath> | ||
| </parent> | ||
|
|
||
| <groupId>com.google.api</groupId> | ||
| <artifactId>pqc-test-parent</artifactId> | ||
| <packaging>pom</packaging> | ||
| <version>2.81.0-SNAPSHOT</version> | ||
|
|
||
| <modules> | ||
| <module>pqc-test-common</module> | ||
| <module>pqc-test-snapshot</module> | ||
| <module>pqc-test-release</module> | ||
| </modules> | ||
| </project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>com.google.api</groupId> | ||
| <artifactId>pqc-test-parent</artifactId> | ||
| <version>2.81.0-SNAPSHOT</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <artifactId>pqc-test-common</artifactId> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.google.api</groupId> | ||
| <artifactId>gax-httpjson</artifactId> | ||
| <version>2.81.0-SNAPSHOT</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.api</groupId> | ||
| <artifactId>gax-grpc</artifactId> | ||
| <version>2.81.0-SNAPSHOT</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.bouncycastle</groupId> | ||
| <artifactId>bcprov-jdk18on</artifactId> | ||
| <version>${bouncycastle.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.bouncycastle</groupId> | ||
| <artifactId>bctls-jdk18on</artifactId> | ||
| <version>${bouncycastle.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-api</artifactId> | ||
| <version>5.10.2</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-netty</artifactId> | ||
| <version>${grpc.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-stub</artifactId> | ||
| <version>${grpc.version}</version> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> |
Uh oh!
There was an error while loading. Please reload this page.