Skip to content

Commit

Permalink
TKSS-1018: Native SM2Signature should not reset NativeSMSignature ins…
Browse files Browse the repository at this point in the history
…tance
  • Loading branch information
johnshajiang committed Dec 27, 2024
1 parent 279ee5c commit 557a837
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ protected byte[] engineSign() throws SignatureException {
} catch (BadPaddingException e) {
throw new SignatureException(e);
} finally {
reset();
buffer.reset();
}
}

Expand All @@ -184,12 +184,15 @@ protected boolean engineVerify(byte[] sigBytes) throws SignatureException {
} catch (BadPaddingException e) {
throw new SignatureException(e);
} finally {
reset();
buffer.reset();
}
}

private void reset() {
sm2 = null;
privateKey = null;
publicKey = null;
id = null;

buffer.reset();
}
}

0 comments on commit 557a837

Please sign in to comment.