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

JCE: add synchronization to protected methods in WolfCryptSignature #68

Merged
merged 1 commit into from
Mar 30, 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
12 changes: 6 additions & 6 deletions src/main/java/com/wolfssl/provider/jce/WolfCryptSignature.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private void wolfCryptInitPublicKey(PublicKey key, byte[] encodedKey)
}

@Override
protected void engineInitSign(PrivateKey privateKey)
protected synchronized void engineInitSign(PrivateKey privateKey)
throws InvalidKeyException {

int ret;
Expand Down Expand Up @@ -279,7 +279,7 @@ protected void engineInitSign(PrivateKey privateKey)
}

@Override
protected void engineInitVerify(PublicKey publicKey)
protected synchronized void engineInitVerify(PublicKey publicKey)
throws InvalidKeyException {

int ret;
Expand Down Expand Up @@ -353,7 +353,7 @@ protected void engineSetParameter(String param, Object value)
}

@Override
protected byte[] engineSign() throws SignatureException {
protected synchronized byte[] engineSign() throws SignatureException {

int ret = 0;
int encodedSz = 0;
Expand Down Expand Up @@ -442,7 +442,7 @@ protected byte[] engineSign() throws SignatureException {
}

@Override
protected void engineUpdate(byte b) throws SignatureException {
protected synchronized void engineUpdate(byte b) throws SignatureException {

byte[] tmp = new byte[1];
tmp[0] = b;
Expand All @@ -454,7 +454,7 @@ protected void engineUpdate(byte b) throws SignatureException {
}

@Override
protected void engineUpdate(byte[] b, int off, int len)
protected synchronized void engineUpdate(byte[] b, int off, int len)
throws SignatureException {

switch (this.digestType) {
Expand Down Expand Up @@ -484,7 +484,7 @@ protected void engineUpdate(byte[] b, int off, int len)
}

@Override
protected boolean engineVerify(byte[] sigBytes)
protected synchronized boolean engineVerify(byte[] sigBytes)
throws SignatureException {

int ret = 0;
Expand Down