F-5803: close Ed25519 release split-lock race by freeing under one lock
parent
1466e4f5aa
commit
de7d9136f5
|
|
@ -109,8 +109,8 @@ public class AesCcm extends NativeStruct {
|
|||
(state != WolfCryptState.RELEASED)) {
|
||||
synchronized (pointerLock) {
|
||||
wc_AesFree();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,8 +109,8 @@ public class AesGcm extends NativeStruct {
|
|||
(state != WolfCryptState.RELEASED)) {
|
||||
synchronized (pointerLock) {
|
||||
wc_AesFree();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,11 +100,11 @@ public class Dh extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_FreeDhKey();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
setPrivateKey(new byte[0]);
|
||||
setPublicKey(new byte[0]);
|
||||
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ public class Ecc extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_ecc_free();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
|
||||
synchronized (rngLock) {
|
||||
|
|
@ -100,7 +101,6 @@ public class Ecc extends NativeStruct {
|
|||
}
|
||||
}
|
||||
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ public class Ed25519 extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_ed25519_free();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ public class Lms extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_LmsKey_free();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,8 +144,8 @@ public class MlDsa extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_dilithium_free();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ public class MlKem extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_mlkem_free();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -250,8 +250,8 @@ public class Rsa extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_FreeRsaKey();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,8 +189,8 @@ public class SlhDsa extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_SlhDsaKey_free();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ public class Xmss extends NativeStruct {
|
|||
|
||||
synchronized (pointerLock) {
|
||||
wc_XmssKey_free();
|
||||
super.releaseNativeStruct();
|
||||
}
|
||||
super.releaseNativeStruct();
|
||||
state = WolfCryptState.RELEASED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue