JCE: zero privKeyBytes buffer before leaking wolfCryptInitPrivateKey

pull/212/head
Ruby Martin 2026-04-27 17:20:13 -06:00
parent aef00fa251
commit ae161c7a1c
1 changed files with 5 additions and 1 deletions

View File

@ -345,7 +345,11 @@ public class WolfCryptSignature extends SignatureSpi {
privKeyBytes = ecPriv.getS().toByteArray();
}
this.ecc.importPrivate(privKeyBytes, null);
try {
this.ecc.importPrivate(privKeyBytes, null);
} finally {
zeroArray(privKeyBytes);
}
break;
}