Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/windows-vs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ jobs:
$content = Get-Content $userSettingsPath -Raw
Write-Output "Original file size: $($content.Length) characters"

$newDefines = "#define WOLFSSL_KEY_GEN`n#define HAVE_CRL`n#define OPENSSL_ALL`n`n"
$newDefines = "#define WOLFSSL_KEY_GEN`n#define HAVE_CRL`n#define OPENSSL_ALL`n#define WOLFSSL_SHA224`n`n"

# Try multiple possible insertion points
$insertPoints = @(
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/wolfssl/provider/jce/WolfCryptProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public final class WolfCryptProvider extends Provider {
*/
public WolfCryptProvider() {
super("wolfJCE", 1.8, "wolfCrypt JCE Provider");

/* Refresh debug flags in case system properties were set after
* WolfCryptDebug class was first loaded (e.g., via JAVA_OPTS) */
WolfCryptDebug.refreshDebugFlags();

registerServices();
}

Expand Down
14 changes: 8 additions & 6 deletions src/main/java/com/wolfssl/provider/jce/WolfCryptRandom.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ public WolfCryptRandom() {
}

@Override
protected byte[] engineGenerateSeed(int numBytes) {
protected synchronized byte[] engineGenerateSeed(int numBytes) {

return rng.generateBlock(numBytes);
}

@Override
protected void engineNextBytes(byte[] bytes) {
protected synchronized void engineNextBytes(byte[] bytes) {

rng.generateBlock(bytes);
}

@Override
protected void engineSetSeed(byte[] seed) {
protected synchronized void engineSetSeed(byte[] seed) {
/* wolfCrypt reseeds internally automatically */
log("setSeed() not supported by wolfJCE");
}
Expand All @@ -75,7 +75,7 @@ private void log(String msg) {

@SuppressWarnings("deprecation")
@Override
protected void finalize() throws Throwable {
protected synchronized void finalize() throws Throwable {
try {

if (this.rng != null) {
Expand All @@ -98,7 +98,9 @@ protected void finalize() throws Throwable {
*
* @throws IOException on error writing to ObjectOutputStream
*/
private void writeObject(ObjectOutputStream out) throws IOException {
private synchronized void writeObject(ObjectOutputStream out)
throws IOException {

if (this.rng != null) {
this.rng.free();
this.rng.releaseNativeStruct();
Expand All @@ -118,7 +120,7 @@ private void writeObject(ObjectOutputStream out) throws IOException {
* @throws IOException on error reading from ObjectInputStream
* @throws ClassNotFoundException if object class not found
*/
private void readObject(ObjectInputStream in)
private synchronized void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {

if (rng == null) {
Expand Down
Loading
Loading