Skip to content
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

Restore behavior on platforms where CRIU is supported but not in use #7

Merged
merged 1 commit into from
Jan 5, 2024
Merged
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: 5 additions & 5 deletions src/java.base/unix/classes/sun/security/provider/NativePRNG.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2022, 2023 All Rights Reserved
* (c) Copyright IBM Corp. 2022, 2024 All Rights Reserved
* ===========================================================================
*/

Expand Down Expand Up @@ -508,8 +508,9 @@ private static void readFully(InputStream in, byte[] data, Variant variant)
if (in.readNBytes(data, 0, len) < len) {
throw new IOException("Could not read from file(s)");
}
return;
}
/*[ELSE] CRIU_SUPPORT */
/*[ENDIF] CRIU_SUPPORT */
int ofs = 0;
while (len > 0) {
int k = in.read(data, ofs, len);
Expand All @@ -522,7 +523,6 @@ private static void readFully(InputStream in, byte[] data, Variant variant)
if (len > 0) {
throw new IOException("Could not read from file(s)");
}
/*[ENDIF] CRIU_SUPPORT */
}

// get true random bytes, just read from "seed"
Expand Down Expand Up @@ -634,8 +634,9 @@ private void implNextBytes(byte[] data) {
for (int i = 0; i < data.length; i++) {
data[i] ^= rawData[i];
}
return;
}
/*[ELSE] CRIU_SUPPORT */
/*[ENDIF] CRIU_SUPPORT */
int data_len = data.length;
int ofs = 0;
int len;
Expand Down Expand Up @@ -665,7 +666,6 @@ private void implNextBytes(byte[] data) {
}
data_len -= len;
}
/*[ENDIF] CRIU_SUPPORT */
} catch (IOException e){
throw new ProviderException("nextBytes() failed", e);
}
Expand Down